-
Notifications
You must be signed in to change notification settings - Fork 9
519 lines (497 loc) · 21.1 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
# SPDX-License-Identifier: LGPL-3.0-or-later
# Copyright (C) 2023 Christopher Dilks
name: ci
on:
pull_request:
push:
branches:
- main
defaults:
run:
shell: bash
env:
ebeam_en: 18
pbeam_en: 275
root: root -b -q
root_no_delphes: root -b -q macro/ci/define_exclude_delphes.C
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
# BUILD ---------------------------------------------------------------------------
build_all:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
recipe:
- release
# - debug ### disabled, since was only used for `valgrind` CI tests
steps:
- uses: actions/checkout@v3
- uses: cvmfs-contrib/github-action-cvmfs@v3
- uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
run: |
echo "[CI] install delphes"
deps/install_delphes.sh
echo "[CI] build epic-analysis"
source environ.sh
make ${{matrix.recipe}}
- uses: actions/upload-artifact@v3
with:
name: x_build_${{matrix.recipe}}
retention-days: 1
path: |
# epic-analysis
lib
src/*Dict.cxx
# delphes
deps/delphes
external
# mstwpdf
deps/mstwpdf/*.o
deps/mstwpdf/*.so
# adage
deps/adage/lib
deps/adage/src/*Dict.cxx
build_no_delphes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cvmfs-contrib/github-action-cvmfs@v3
- uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
run: |
echo "[CI] build epic-analysis"
source environ.sh
EXCLUDE_DELPHES=1 make release
- uses: actions/upload-artifact@v3
with:
name: x_build_no_delphes
retention-days: 1
path: |
# epic-analysis
lib
src/*Dict.cxx
# mstwpdf
deps/mstwpdf/*.o
deps/mstwpdf/*.so
# adage
deps/adage/lib
deps/adage/src/*Dict.cxx
# DELPHES ---------------------------------------------------------------------------
# run delphes on a hepmc file
delphes_fastsim:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- { id: 1, options: --version hepmc.pythia6 --no-radcor --limit 5 --num-hepmc-events 15000 --minQ2 1 } # max limit=30
- { id: 10, options: --version hepmc.pythia6 --no-radcor --limit 5 --num-hepmc-events 15000 --minQ2 10 } # max limit=40
- { id: 100, options: --version hepmc.pythia6 --no-radcor --limit 5 --num-hepmc-events 15000 --minQ2 100 } # max limit=50
- { id: 1000, options: --version hepmc.pythia6 --no-radcor --limit 5 --num-hepmc-events 15000 --minQ2 1000 } # max limit=60
steps:
- uses: actions/checkout@v3
- uses: cvmfs-contrib/github-action-cvmfs@v3
- uses: eic/run-cvmfs-osg-eic-shell@main
env:
S3_ACCESS_KEY: ${{secrets.S3_ACCESS_KEY}}
S3_SECRET_KEY: ${{secrets.S3_SECRET_KEY}}
with:
platform-release: "jug_xl:nightly"
setup: environ.sh
run: |
echo "[CI] install delphes"
deps/install_delphes.sh
echo "[CI] download HEPMC files and run Delphes"
s3tools/add-host.sh
s3tools/s3tool.rb \
--energy ${{env.ebeam_en}}x${{env.pbeam_en}} \
--output ci \
--config datarec/ci/delphes_${{matrix.id}}.config \
${{matrix.options}}
- uses: actions/upload-artifact@v3
with:
name: x_fastsim_delphes
retention-days: 1
path: datarec
# DOWNLOAD FULLSIM ---------------------------------------------------------------------------
# download full simulation files and make config
download_fullsim:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
include:
- { id: epic_latest, options: --version epic.latest --limit 20 --detector craterlake --no-radcor }
- { id: epic_previous, options: --version epic.previous --limit 20 --detector craterlake --no-radcor }
- { id: ecce, options: --version ecce.22.1 --limit 40 }
- { id: athena, options: --version athena.deathvalley-v1.0 --limit 20 }
steps:
- uses: actions/checkout@v3
- uses: cvmfs-contrib/github-action-cvmfs@v3
- uses: eic/run-cvmfs-osg-eic-shell@main
env:
S3_ACCESS_KEY: ${{secrets.S3_ACCESS_KEY}}
S3_SECRET_KEY: ${{secrets.S3_SECRET_KEY}}
with:
platform-release: "jug_xl:nightly"
setup: environ.sh
run: |
echo "[CI] download files from S3"
s3tools/add-host.sh
s3tools/s3tool.rb \
--energy ${{env.ebeam_en}}x${{env.pbeam_en}} \
--output ${{matrix.id}} \
--mode s \
--config s3files.config \
${{matrix.options}}
echo "[CI] cat config file"
cat s3files.config
- uses: actions/upload-artifact@v3
with:
name: x_fullsim_${{matrix.id}}
retention-days: 1
path: |
s3files.config
datarec
# ANALYSIS ---------------------------------------------------------------------------
# run analysis macros matrix for fastsim
analysis_fastsim:
needs:
- build_all
- delphes_fastsim
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
aname: [x_q2, p_eta, yRatio, single_bin]
recon: [Ele]
include:
- { aname: x_q2, recon: Mixed }
- { aname: x_q2, recon: JB }
- { aname: x_q2, recon: DA }
- { aname: x_q2, recon: Sigma }
- { aname: x_q2, recon: eSigma }
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: x_build_release
- uses: actions/download-artifact@v3
with:
name: x_fastsim_delphes
path: x_fastsim_delphes
- uses: cvmfs-contrib/github-action-cvmfs@v3
- uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
setup: environ.sh
run: |
echo "[CI] job matrix params:"
echo "aname = ${{matrix.aname}}"
echo "recon = ${{matrix.recon}}"
echo "[CI] Delphes artifacts"
ls -R x_fastsim_delphes
echo "[CI] unpack Delphes artifacts"
mv -v x_fastsim_delphes/ci datarec/
echo "[CI] generate combined config file"
s3tools/src/generate-config-file.rb delphes.config ${{env.ebeam_en}}x${{env.pbeam_en}} datarec/ci/delphes*.config.list
echo "[CI] cat delphes.config"
cat delphes.config
echo "[CI] ANALYSIS MACRO"
${{env.root}} 'macro/ci/analysis_${{matrix.aname}}.C("delphes.config","fastsim.${{matrix.aname}}.${{matrix.recon}}","${{matrix.recon}}")'
- uses: actions/upload-artifact@v3
with:
name: analysis
retention-days: 7
path: out
# run analysis macros matrix for full simulation
analysis_fullsim:
needs:
- build_no_delphes
- download_fullsim
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
detector:
- epic_latest
- epic_previous
- athena
- ecce
aname: [x_q2, p_eta, yRatio, single_bin]
recon: [Ele]
include: # enable other recon methods for `aname==x_q2` only
- { aname: x_q2, recon: Mixed, detector: epic_latest } # FIXME: not sure how to avoid being repetitive...
- { aname: x_q2, recon: JB, detector: epic_latest }
- { aname: x_q2, recon: DA, detector: epic_latest }
- { aname: x_q2, recon: Sigma, detector: epic_latest }
- { aname: x_q2, recon: eSigma, detector: epic_latest }
- { aname: x_q2, recon: Mixed, detector: epic_previous }
- { aname: x_q2, recon: JB, detector: epic_previous }
- { aname: x_q2, recon: DA, detector: epic_previous }
- { aname: x_q2, recon: Sigma, detector: epic_previous }
- { aname: x_q2, recon: eSigma, detector: epic_previous }
- { aname: x_q2, recon: Mixed, detector: athena }
- { aname: x_q2, recon: JB, detector: athena }
- { aname: x_q2, recon: DA, detector: athena }
- { aname: x_q2, recon: Sigma, detector: athena }
- { aname: x_q2, recon: eSigma, detector: athena }
- { aname: x_q2, recon: Mixed, detector: ecce }
- { aname: x_q2, recon: JB, detector: ecce }
- { aname: x_q2, recon: DA, detector: ecce }
- { aname: x_q2, recon: Sigma, detector: ecce }
- { aname: x_q2, recon: eSigma, detector: ecce }
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: x_build_no_delphes
- uses: actions/download-artifact@v3
with:
name: x_fullsim_${{matrix.detector}}
- uses: cvmfs-contrib/github-action-cvmfs@v3
- uses: eic/run-cvmfs-osg-eic-shell@main
env:
S3_ACCESS_KEY: ${{secrets.S3_ACCESS_KEY}}
S3_SECRET_KEY: ${{secrets.S3_SECRET_KEY}}
with:
platform-release: "jug_xl:nightly"
setup: environ.sh
run: |
echo "[CI] job matrix params:"
echo "aname = ${{matrix.aname}}"
echo "recon = ${{matrix.recon}}"
echo "[CI] cat s3files.config"
cat s3files.config
echo "[CI] ANALYSIS MACRO"
${{env.root_no_delphes}} 'macro/ci/analysis_${{matrix.aname}}.C("s3files.config","${{matrix.detector}}.${{matrix.aname}}.${{matrix.recon}}","${{matrix.recon}}")'
- uses: actions/upload-artifact@v3
with:
name: analysis
retention-days: 7
path: out
# POSTPROCESS ---------------------------------------------------------------------------
# run postprocess macros matrix for fastsim and fullsim
postprocess:
needs:
- analysis_fastsim
- analysis_fullsim
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
mode:
- fastsim
- epic_latest
- epic_previous
- athena
- ecce
pname: # list only jobs which will only use one (primary) recon method
- bin_test
- coverage2D_p_eta
- y_minima
- q2_weights_test
- eta_vs_p_forPID
recon: [Ele] # primary recon method(s)
include:
# use only primary recon method
- { pname: bin_test, aname: x_q2, pmacro: postprocess_bin_test.C }
- { pname: coverage2D_p_eta, aname: p_eta, pmacro: postprocess_p_eta.C }
- { pname: y_minima, aname: yRatio, pmacro: postprocess_yRatio.C }
- { pname: q2_weights_test, aname: single_bin, pmacro: postprocess_q2_weights.C }
- { pname: eta_vs_p_forPID, aname: single_bin, pmacro: postprocess_eta_vs_p_forPID.C }
# use all reconstruction methods: # FIXME: not sure how to avoid being repetitive...
- { mode: fastsim, pname: coverage2D_x_q2, recon: Ele, aname: x_q2, pmacro: postprocess_x_q2.C }
- { mode: fastsim, pname: coverage2D_x_q2, recon: DA, aname: x_q2, pmacro: postprocess_x_q2.C }
- { mode: fastsim, pname: coverage2D_x_q2, recon: eSigma, aname: x_q2, pmacro: postprocess_x_q2.C }
- { mode: fastsim, pname: coverage2D_x_q2, recon: JB, aname: x_q2, pmacro: postprocess_x_q2.C }
- { mode: fastsim, pname: coverage2D_x_q2, recon: Mixed, aname: x_q2, pmacro: postprocess_x_q2.C }
- { mode: fastsim, pname: coverage2D_x_q2, recon: Sigma, aname: x_q2, pmacro: postprocess_x_q2.C }
- { mode: epic_latest, pname: coverage2D_x_q2, recon: Ele, aname: x_q2, pmacro: postprocess_x_q2.C }
- { mode: epic_latest, pname: coverage2D_x_q2, recon: DA, aname: x_q2, pmacro: postprocess_x_q2.C }
- { mode: epic_latest, pname: coverage2D_x_q2, recon: eSigma, aname: x_q2, pmacro: postprocess_x_q2.C }
- { mode: epic_latest, pname: coverage2D_x_q2, recon: JB, aname: x_q2, pmacro: postprocess_x_q2.C }
- { mode: epic_latest, pname: coverage2D_x_q2, recon: Mixed, aname: x_q2, pmacro: postprocess_x_q2.C }
- { mode: epic_latest, pname: coverage2D_x_q2, recon: Sigma, aname: x_q2, pmacro: postprocess_x_q2.C }
- { mode: epic_previous, pname: coverage2D_x_q2, recon: Ele, aname: x_q2, pmacro: postprocess_x_q2.C }
- { mode: epic_previous, pname: coverage2D_x_q2, recon: DA, aname: x_q2, pmacro: postprocess_x_q2.C }
- { mode: epic_previous, pname: coverage2D_x_q2, recon: eSigma, aname: x_q2, pmacro: postprocess_x_q2.C }
- { mode: epic_previous, pname: coverage2D_x_q2, recon: JB, aname: x_q2, pmacro: postprocess_x_q2.C }
- { mode: epic_previous, pname: coverage2D_x_q2, recon: Mixed, aname: x_q2, pmacro: postprocess_x_q2.C }
- { mode: epic_previous, pname: coverage2D_x_q2, recon: Sigma, aname: x_q2, pmacro: postprocess_x_q2.C }
- { mode: athena, pname: coverage2D_x_q2, recon: Ele, aname: x_q2, pmacro: postprocess_x_q2.C }
- { mode: athena, pname: coverage2D_x_q2, recon: DA, aname: x_q2, pmacro: postprocess_x_q2.C }
- { mode: athena, pname: coverage2D_x_q2, recon: eSigma, aname: x_q2, pmacro: postprocess_x_q2.C }
- { mode: athena, pname: coverage2D_x_q2, recon: JB, aname: x_q2, pmacro: postprocess_x_q2.C }
- { mode: athena, pname: coverage2D_x_q2, recon: Mixed, aname: x_q2, pmacro: postprocess_x_q2.C }
- { mode: athena, pname: coverage2D_x_q2, recon: Sigma, aname: x_q2, pmacro: postprocess_x_q2.C }
- { mode: ecce, pname: coverage2D_x_q2, recon: Ele, aname: x_q2, pmacro: postprocess_x_q2.C }
- { mode: ecce, pname: coverage2D_x_q2, recon: DA, aname: x_q2, pmacro: postprocess_x_q2.C }
- { mode: ecce, pname: coverage2D_x_q2, recon: eSigma, aname: x_q2, pmacro: postprocess_x_q2.C }
- { mode: ecce, pname: coverage2D_x_q2, recon: JB, aname: x_q2, pmacro: postprocess_x_q2.C }
- { mode: ecce, pname: coverage2D_x_q2, recon: Mixed, aname: x_q2, pmacro: postprocess_x_q2.C }
- { mode: ecce, pname: coverage2D_x_q2, recon: Sigma, aname: x_q2, pmacro: postprocess_x_q2.C }
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: x_build_no_delphes
- uses: actions/download-artifact@v3
with:
name: analysis
path: out
- uses: cvmfs-contrib/github-action-cvmfs@v3
- uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
setup: environ.sh
run: |
echo "[CI] job matrix params:"
echo "aname = ${{matrix.aname}}"
echo "pname = ${{matrix.pname}}"
echo "mode = ${{matrix.mode}}"
echo "recon = ${{matrix.recon}}"
echo "pmacro = ${{matrix.pmacro}}"
echo "[CI] POSTPROCESS MACRO"
ls out
mv -v out/${{matrix.mode}}.{${{matrix.aname}},${{matrix.pname}}}.${{matrix.recon}}.root # rename aname -> pname
${{env.root_no_delphes}} 'macro/ci/${{matrix.pmacro}}("out/${{matrix.mode}}.${{matrix.pname}}.${{matrix.recon}}.root")'
rm -v out/${{matrix.mode}}.${{matrix.pname}}.${{matrix.recon}}.root # rm analysis_root artifact
- uses: actions/upload-artifact@v3
with:
name: postprocess
retention-days: 30
path: |
out/*.images/*.png
out/*.root
# COMPARATORS ---------------------------------------------------------------------------
# run compare macros matrix for fastsim vs. fullsim
comparison:
needs:
- analysis_fastsim
- analysis_fullsim
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
pname: # list only jobs which will only use one (primary) recon method
- coverage_p_eta
- resolution_p_eta
recon: [Ele] # primary recon method(s)
include:
# use only primary recon method
- { pname: coverage_p_eta, aname: p_eta, xvar: p, yvar: eta }
- { pname: resolution_p_eta, aname: p_eta, xvar: p, yvar: eta }
# use all reconstruction methods:
## resolution
- { pname: resolution_x_q2, recon: Ele, aname: x_q2, xvar: x, yvar: q2 }
- { pname: resolution_x_q2, recon: Mixed, aname: x_q2, xvar: x, yvar: q2 }
- { pname: resolution_x_q2, recon: DA, aname: x_q2, xvar: x, yvar: q2 }
- { pname: resolution_x_q2, recon: JB, aname: x_q2, xvar: x, yvar: q2 }
- { pname: resolution_x_q2, recon: Sigma, aname: x_q2, xvar: x, yvar: q2 }
- { pname: resolution_x_q2, recon: eSigma, aname: x_q2, xvar: x, yvar: q2 }
## coverage
- { pname: coverage_x_q2, recon: Ele, aname: x_q2, xvar: x, yvar: q2 }
- { pname: coverage_x_q2, recon: Mixed, aname: x_q2, xvar: x, yvar: q2 }
- { pname: coverage_x_q2, recon: DA, aname: x_q2, xvar: x, yvar: q2 }
- { pname: coverage_x_q2, recon: JB, aname: x_q2, xvar: x, yvar: q2 }
- { pname: coverage_x_q2, recon: Sigma, aname: x_q2, xvar: x, yvar: q2 }
- { pname: coverage_x_q2, recon: eSigma, aname: x_q2, xvar: x, yvar: q2 }
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: x_build_no_delphes
- uses: actions/download-artifact@v3
with:
name: analysis
path: out
- uses: cvmfs-contrib/github-action-cvmfs@v3
- uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
setup: environ.sh
run: |
echo "[CI] job matrix params:"
echo "aname = ${{matrix.aname}}"
echo "pname = ${{matrix.pname}}"
echo "recon = ${{matrix.recon}}"
echo "xvar = ${{matrix.xvar}}"
echo "yvar = ${{matrix.yvar}}"
echo "[CI] COMPARATOR MACRO: ePIC"
macro/ci/comparator_run.sh ${{matrix.aname}} ${{matrix.pname}} ${{matrix.recon}} ${{matrix.xvar}} ${{matrix.yvar}} \
"ePIC Latest" "epic_latest" \
"ePIC Previous" "epic_previous" \
"ECCE" "ecce" \
"Delphes" "fastsim" \
"epic_productions"
# echo "[CI] COMPARATOR MACRO: LEGACY"
# macro/ci/comparator_run.sh ${{matrix.aname}} ${{matrix.pname}} ${{matrix.recon}} ${{matrix.xvar}} ${{matrix.yvar}} \
# "Delphes Pythia6 (no radcor)" "fastsim" \
# "ePIC Arches (no radcor)" "epic_latest" \
# "ATHENA" "athena" \
# "ECCE" "ecce" \
# "LEGACY"
- uses: actions/upload-artifact@v3
with:
name: comparison
retention-days: 30
path: |
out/comparison*.images/*.png
out/comparison*.root
# ARTIFACTS ---------------------------------------------------------------------------
# collect artifacts into one directory
collect:
needs:
- postprocess
- comparison
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: postprocess
path: results
- uses: actions/download-artifact@v3
with:
name: comparison
path: results
- name: tree_artifacts
run: tree results
- name: cull
run: |
find results -name "*.root" -print | xargs rm -v
rm -v results/*y_minima*/canv*.png
tree results
- name: rename-dirs
run: |
for d in $(ls -d results/*.images); do \
d=$(echo $d | sed 's;/$;;'); \
mv -v $d $(echo $d | sed 's;\.images$;;'); \
done
tree results
- name: merge_recon
run: |
macro/ci/merge-recon.sh results resolution_x_q2
macro/ci/merge-recon.sh results coverage_x_q2
macro/ci/merge-recon.sh results coverage2D_x_q2
tree results
- name: merge_fastfull
run: |
macro/ci/merge-fastfull.sh results \
epic_latest \
epic_previous \
ecce \
athena
tree results
- uses: actions/upload-artifact@v3
with:
retention-days: 90
name: _FULL_RESULTS
path: results