Skip to content

feat: add Rucio storage plugin integration for benchmark outputs (barrel_ecal PoC) - #278

Open
wdconinc wants to merge 1 commit into
masterfrom
rucio
Open

feat: add Rucio storage plugin integration for benchmark outputs (barrel_ecal PoC)#278
wdconinc wants to merge 1 commit into
masterfrom
rucio

Conversation

@wdconinc

@wdconinc wdconinc commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Briefly, what does this PR introduce? Please link to any relevant presentations or discussions.

  • 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)
  • Add profiles/rucio/config.yaml with storage-rucio-upload-rse setting
  • README: document Rucio upload configuration

What is the urgency of this PR?

  • High (please describe reason below)
  • Medium
  • Low

What kind of change does this PR introduce?

  • Bug fix (issue #__)
  • New feature (issue #__)
  • Optimization (issue #__)
  • Updated documentation
  • other: __

Please check if any of the following apply

  • This PR introduces breaking changes. Please describe changes users need to make below.
  • This PR changes default behavior. Please describe changes below.
  • AI was used in preparing this PR. Please describe usage below.

Developed together with copilot. Wish I didn't have to steer it as mush as I did...

Copilot AI review requested due to automatic review settings April 24, 2026 18:47
…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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: and rucio: config blocks in snakemake.yml plus a profiles/rucio Snakemake profile.
  • Adds Rucio upload helpers (_rucio_upload_enabled, _rucio_output, _RUCIO_DID_PREFIX) and expands remote-path handling for remote_provider: rucio.
  • Updates benchmarks/barrel_ecal/Snakefile producing rules to stage-copy selected outputs into Rucio storage targets, and documents usage in README.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 subsequent cp are 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.

Comment on lines +3 to +6
# 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).
#
Comment thread Snakefile
"""
if _rucio_upload_enabled:
return storage(path)
local = re.sub(r"^rucio://[^/]*/", ".rucio_staging/", path)
Comment on lines +43 to +44
--outputFile {output.local}
exec cp {output.local} {output.rucio}
Comment on lines 100 to +102
cd {wildcards.DETECTOR_CONFIG}
root -l -b -q '{input.script}+("{wildcards.PARTICLE}", true)'
cd - > /dev/null
Comment thread README.md
Comment on lines +39 to +41
Benchmark outputs are uploaded to Rucio as part of each producing rule when
`config.rucio.host` is set (see `snakemake.yml`). Invoke with:

Comment thread snakemake.yml
Comment on lines +14 to +22
# 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
Comment thread Snakefile
Comment on lines +9 to +16
_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")
Comment on lines 139 to +141
cd {wildcards.DETECTOR_CONFIG}
root -l -b -q '{input.script}+("../{input.sim}")'
cd - > /dev/null
Comment thread snakemake.yml
Comment on lines +14 to +16
# 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"),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you considered using something like --default-storage-prefix rucio://user.wdconinck/j0001.?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't think we'd want users to write this; only CI VALIDATION.

@veprbl veprbl Apr 24, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@wdconinc wdconinc mentioned this pull request Apr 27, 2026
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants