Conversation
…al PoC)
- Add rucio: and xrootd: config blocks to snakemake.yml with JLab
defaults and commented BNL alternatives
- Root Snakefile: add _rucio_upload_enabled flag, _rucio_output() helper,
and shared _RUCIO_DID_PREFIX = rucio://{scope}/VALIDATION/benchmarks/detector/{job_id}
- Root Snakefile: add configurable _xrootd_base_url; fix get_remote_path()
to support Rucio reads
- barrel_ecal Snakefile: integrate Rucio storage outputs directly into the
four producing rules (sim, particles_analysis, pi0_analysis,
pion_rejection_analysis); no separate publish step
- Add profiles/rucio/config.yaml with storage-rucio-upload-rse setting
- Document required upstream snakemake-storage-plugin-rucio fixes in
snakemake-storage-plugin-rucio-required-changes.md
- README: document Rucio upload configuration
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds an initial (“PoC”) integration of Snakemake’s Rucio storage plugin to upload benchmark outputs (focused on barrel_ecal), and makes XRootD base URL configurable to support both XRootD and Rucio “read” modes.
Changes:
- Introduces
xrootd:andrucio:config blocks insnakemake.ymlplus aprofiles/rucioSnakemake profile. - Adds Rucio upload helpers (
_rucio_upload_enabled,_rucio_output,_RUCIO_DID_PREFIX) and expands remote-path handling forremote_provider: rucio. - Updates
benchmarks/barrel_ecal/Snakefileproducing rules to stage-copy selected outputs into Rucio storage targets, and documents usage inREADME.md.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
snakemake.yml |
Adds XRootD and Rucio configuration blocks (currently enabling Rucio host by default). |
profiles/rucio/config.yaml |
Adds a Snakemake profile intended to configure Rucio upload RSE. |
Snakefile |
Adds Rucio upload toggle/helper and makes XRootD base URL configurable; supports remote_provider: rucio. |
benchmarks/barrel_ecal/Snakefile |
Adds Rucio storage outputs and post-step cp staging for upload in 4 producing rules. |
README.md |
Documents how to run uploads via the Rucio profile. |
Comments suppressed due to low confidence (1)
benchmarks/barrel_ecal/Snakefile:214
- Same pattern here:
root ...and the subsequentcpare separate commands without explicit error chaining. Chaining with&&(or setting-e) will ensure the upload-staging copy only happens if the analysis step succeeds.
cd {wildcards.DETECTOR_CONFIG}
root -l -b -q '{input.script}+g("../{input.electron}", "../{input.piminus}")'
cd - > /dev/null
exec cp {output.pion_rej_json} {output.rucio}
"""
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Uses snakemake-storage-plugin-rucio. Rucio connection details (host, auth) | ||
| # are read from the standard Rucio client configuration (~/.rucio/rucio.cfg or | ||
| # environment variables such as RUCIO_HOST, RUCIO_ACCOUNT, RUCIO_AUTH_TYPE). | ||
| # |
| """ | ||
| if _rucio_upload_enabled: | ||
| return storage(path) | ||
| local = re.sub(r"^rucio://[^/]*/", ".rucio_staging/", path) |
| --outputFile {output.local} | ||
| exec cp {output.local} {output.rucio} |
| cd {wildcards.DETECTOR_CONFIG} | ||
| root -l -b -q '{input.script}+("{wildcards.PARTICLE}", true)' | ||
| cd - > /dev/null |
| Benchmark outputs are uploaded to Rucio as part of each producing rule when | ||
| `config.rucio.host` is set (see `snakemake.yml`). Invoke with: | ||
|
|
| # Uncomment the BNL block to upload to BNL instead of JLab. | ||
| rucio: | ||
| host: https://rucio-server.jlab.org:443 | ||
| rse: EIC-XRD | ||
| scope: epic | ||
| # BNL alternative: | ||
| # rucio: | ||
| # host: https://nprucio01.sdcc.bnl.gov:443 | ||
| # rse: BNL-XRD |
| _rucio_upload_enabled = bool(config.get("rucio", {}).get("host")) | ||
| if not _rucio_upload_enabled: | ||
| logger.warning( | ||
| "Rucio host not configured (config.rucio.host); " | ||
| "benchmark outputs will not be uploaded to Rucio." | ||
| ) | ||
|
|
||
| _rucio_scope = config.get("rucio", {}).get("scope", "epic") |
| cd {wildcards.DETECTOR_CONFIG} | ||
| root -l -b -q '{input.script}+("../{input.sim}")' | ||
| cd - > /dev/null |
| # Uncomment the BNL block to upload to BNL instead of JLab. | ||
| rucio: | ||
| host: https://rucio-server.jlab.org:443 |
| output: | ||
| "{DETECTOR_CONFIG}/sim_output/sim_emcal_barrel_{PARTICLE}_energies{E_MIN}_{E_MAX}.edm4hep.root" | ||
| local="{DETECTOR_CONFIG}/sim_output/sim_emcal_barrel_{PARTICLE}_energies{E_MIN}_{E_MAX}.edm4hep.root", | ||
| rucio=_rucio_output(f"{_RUCIO_BASE}/sim_output/sim_emcal_barrel_{{PARTICLE}}_energies{{E_MIN}}_{{E_MAX}}.edm4hep.root"), |
There was a problem hiding this comment.
Have you considered using something like --default-storage-prefix rucio://user.wdconinck/j0001.?
There was a problem hiding this comment.
I didn't think we'd want users to write this; only CI VALIDATION.
There was a problem hiding this comment.
And you can put this in the rucio profile Which is not what you should do because one can't remove/overwrite things from Rucio
Briefly, what does this PR introduce? Please link to any relevant presentations or discussions.
rucio:andxrootd:config blocks tosnakemake.ymlwith JLab defaults and commented BNL alternativesSnakefile: add_rucio_upload_enabledflag,_rucio_output()helper, and shared_RUCIO_DID_PREFIX = rucio://{scope}/VALIDATION/benchmarks/detector/{job_id}Snakefile: add configurable_xrootd_base_url; fixget_remote_path()to support Rucio readsSnakefile: integrate Rucio storage outputs directly into the four producing rules (sim, particles_analysis, pi0_analysis, pion_rejection_analysis)profiles/rucio/config.yamlwithstorage-rucio-upload-rsesettingREADME: document Rucio upload configurationWhat is the urgency of this PR?
What kind of change does this PR introduce?
Please check if any of the following apply
Developed together with copilot. Wish I didn't have to steer it as mush as I did...