Skip to content

Commit

Permalink
drop use of Snakemake 7.x-specific remote functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
veprbl committed Jul 3, 2024
1 parent 0b6ddfe commit fccefc4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 21 deletions.
27 changes: 8 additions & 19 deletions Snakefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,17 @@
configfile: "config.yaml"

if config["remote"] == "S3":
from snakemake.remote.S3 import RemoteProvider as S3RemoteProvider
provider = S3RemoteProvider(
endpoint_url="https://eics3.sdcc.bnl.gov:9000",
access_key_id=os.environ["S3_ACCESS_KEY"],
secret_access_key=os.environ["S3_SECRET_KEY"],
)
remote_path = lambda path: f"eictest/{path}"
elif config["remote"] == "XRootD":
from snakemake.remote.XRootD import RemoteProvider as XRootDRemoteProvider
provider = XRootDRemoteProvider(
stay_on_remote=False,
)
remote_path = lambda path: f"root://dtn-eic.jlab.org//work/eic2/{path}"
else:
raise ValueError(f"Unexpected config[\"remote\"] = {config['remote']}")

include: "benchmarks/backgrounds/Snakefile"
include: "benchmarks/barrel_ecal/Snakefile"
include: "benchmarks/ecal_gaps/Snakefile"
include: "benchmarks/material_scan/Snakefile"


rule fetch_epic:
output:
filepath="EPIC/{PATH}"
shell: """
xrdcp root://dtn-eic.jlab.org//work/eic2/{output.filepath} {output.filepath}
"""


rule warmup_run:
output:
"warmup/{DETECTOR_CONFIG}.edm4hep.root",
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/ecal_gaps/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import os

rule ecal_gaps_sim:
input:
steering_file=provider.remote(remote_path("EPIC/EVGEN/SINGLE/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.steer")),
"EPIC/EVGEN/SINGLE/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.steer",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
output:
"sim_output/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.{INDEX}.edm4hep.root",
Expand Down
1 change: 0 additions & 1 deletion config.yaml

This file was deleted.

0 comments on commit fccefc4

Please sign in to comment.