Skip to content

Commit 3967db3

Browse files
committed
feat: add support for REANA (#231)
Add REANA as an alternative way to run Dask workflows. REANA brings up a dedicated Dask cluster for workflow and shuts it down after the workflow is finished.
1 parent c37bf59 commit 3967db3

File tree

3 files changed

+46
-1
lines changed

3 files changed

+46
-1
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
inputs:
2+
files:
3+
- ttbar_analysis_pipeline.ipynb
4+
- ttbar_analysis_pipeline.py
5+
- nanoaod_inputs.json
6+
- nanoad_branch_ratios.json
7+
- cabinetry_config.yml
8+
- cabinetry_config_ml.yml
9+
- coffea.ipynb
10+
- corrections.json
11+
- GetIOBranches.py
12+
- jetassignment_training.ipynb
13+
- jetassignment_training.py
14+
- make_corrections_json.py
15+
directories:
16+
- histograms
17+
- utils
18+
- models
19+
- reference
20+
workflow:
21+
type: serial
22+
resources:
23+
kerberos: true
24+
dask:
25+
image: registry.cern.ch/docker.io/alputer/agc-dask:1.0.0
26+
number_of_workers: 200
27+
single_worker_memory: 1Gi
28+
single_worker_threads: 1
29+
specification:
30+
steps:
31+
- name: agc
32+
kubernetes_memory_limit: 5Gi
33+
environment: registry.cern.ch/docker.io/alputer/agc-dask:1.0.0
34+
commands:
35+
- python3 ttbar_analysis_pipeline.py
36+
outputs:
37+
files:
38+
- histograms.root

analyses/cms-open-data-ttbar/utils/clients.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ def get_client(af="coffea_casa"):
3939
cluster.scale(10)
4040
client = cluster.get_client()
4141

42+
elif af == "reana":
43+
import os
44+
from dask.distributed import Client
45+
46+
DASK_SCHEDULER_URI = os.getenv("DASK_SCHEDULER_URI")
47+
client = Client(DASK_SCHEDULER_URI)
48+
4249
elif af == "local":
4350
from dask.distributed import Client
4451

analyses/cms-open-data-ttbar/utils/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# ServiceX: set False to use remote data access
66
"USE_SERVICEX_DOWNLOAD": False,
77
# analysis facility: set to "coffea_casa" for coffea-casa environments,
8-
# "EAF" for FNAL, "purdue-af" for Purdue Analysis Facility, "local" for local setups
8+
# "EAF" for FNAL, "purdue-af" for Purdue Analysis Facility, "reana" for REANA, "local" for local setups
99
"AF": "coffea_casa",
1010
# number of bins for standard histograms in processor
1111
"NUM_BINS": 25,

0 commit comments

Comments
 (0)