-
Notifications
You must be signed in to change notification settings - Fork 45
579 lines (555 loc) · 19 KB
/
linux-eic-shell.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
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
name: linux-eic-shell
on:
push:
branches:
- main
tags:
- '*'
pull_request:
workflow_dispatch:
inputs:
github_repository:
description: 'Submitting GitHub repository'
required: false
default: ''
type: string
github_sha:
description: 'Submitting GitHub sha'
required: false
default: ''
type: string
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
xmllint-before-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
sudo apt-get update
sudo apt-get install -y libxml2-utils
find compact/ -name "*.xml" -exec xmllint {} \; > /dev/null
list-detector-configs:
runs-on: ubuntu-latest
outputs:
configs_csv: ${{ steps.list-detector-configs.outputs.configs_csv }}
configs_json: ${{ steps.list-detector-configs.outputs.configs_json }}
steps:
- uses: actions/checkout@v3
- id: list-detector-configs
run: |
CONFIGS_CSV=$(
ls -1 configurations | sed 's/^/epic_/g' | xargs | sed 's/\.yml//g;s/ /,/g'
)
CONFIGS_JSON=$((
echo '{ "detector_config": ['
ls -1 configurations | sed 's/^/epic_/g' | xargs | sed 's/\.yml//g;s/ /, /g' | xargs -n 1 echo | sed -r 's/^([^,]*)(,?)$/"\1"\2/'
echo ' ]}'
) | jq -c .)
echo "configs_csv=${CONFIGS_CSV}" | tee -a $GITHUB_OUTPUT
echo "configs_json=${CONFIGS_JSON}" | tee -a $GITHUB_OUTPUT
build:
runs-on: ubuntu-latest
needs: xmllint-before-build
strategy:
matrix:
include:
- CC: gcc
CXX: g++
- CC: clang
CXX: clang++
env:
PREFIX: ${{ github.workspace }}/install
steps:
- uses: actions/checkout@v3
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
run: |
echo "timestamp=$(date --iso-8601=minutes)" >> $GITHUB_OUTPUT
- name: Retrieve ccache cache files
uses: actions/cache@v3
with:
path: .ccache
key: ccache-${{ matrix.CC }}-${{ github.ref_name }}-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: |
ccache-${{ matrix.CC }}-${{ github.ref_name }}-
ccache-${{ matrix.CC }}-
ccache-
- name: Configure ccache
run: |
mkdir -p ~/.ccache/
echo "cache_dir=${{ github.workspace }}/.ccache" >> ~/.ccache/ccache.conf
echo "max_size=500MB" >> ~/.ccache/ccache.conf
echo "compression=true" >> ~/.ccache/ccache.conf
- uses: cvmfs-contrib/github-action-cvmfs@v3
- name: Setup CVMFS OSG eic-shell environment
uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
run: |
eic-info
- name: Build detector geometry
uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
run: |
CC=${{ matrix.CC }} CXX=${{ matrix.CXX }} cmake -B build -S . -DCMAKE_INSTALL_PREFIX=${PREFIX} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cmake --build build -- -k -j 2 install
- uses: actions/upload-artifact@v3
with:
name: build-${{ matrix.CC }}-full-eic-shell
path: install/
if-no-files-found: error
- run: |
source install/setup.sh
sed -i 's%\(<fiber\|<lens\)%<comment>\1%g; s%\(/fiber>\|/lens>\)%\1</comment>%g' \
${DETECTOR_PATH}/compact/ecal/barrel_interlayers.xml \
${DETECTOR_PATH}/compact/ecal/forward_scfi.xml \
${DETECTOR_PATH}/compact/far_forward/ZDC_Ecal_WSciFi.xml \
${DETECTOR_PATH}/compact/pid/mrich.xml
- uses: actions/upload-artifact@v3
with:
name: build-${{ matrix.CC }}-fast-eic-shell
path: install/
if-no-files-found: error
xmllint-after-build:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v3
with:
name: build-gcc-full-eic-shell
path: install/
- run: |
sudo apt-get update
sudo apt-get install -y libxml2-utils
find install/share -name "*.xml" -exec xmllint {} \; > /dev/null
trigger-geoviewer:
runs-on: ubuntu-latest
needs:
- xmllint-after-build
- list-detector-configs
steps:
- uses: eic/trigger-gitlab-ci@v2
id: trigger
with:
url: https://eicweb.phy.anl.gov
project_id: 539
token: ${{ secrets.EICWEB_GEOVIEWER_TRIGGER }}
ref_name: main
variables: |
DETECTOR_REPOSITORYURL=${{ github.server_url }}/${{ github.repository }}
DETECTOR_REPOSITORYREF=${{ github.ref }}
DETECTOR_CONFIG=${{ needs.list-detector-configs.outputs.configs_csv }}
DETECTOR_VERSION=${{ github.event.pull_request.head.ref || github.ref_name }}
GITHUB_REPOSITORY=${{ github.repository }}
GITHUB_SHA=${{ github.event.pull_request.head.sha || github.sha }}
GITHUB_PR=${{ github.event.pull_request.number }}
check-geometry-configs:
runs-on: ubuntu-latest
needs:
- build
- list-detector-configs
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: build-gcc-fast-eic-shell
path: install/
- uses: cvmfs-contrib/github-action-cvmfs@v3
- uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
network_types: "none"
setup: install/setup.sh
run: |
IFS=, read -a configs <<< "${{ needs.list-detector-configs.outputs.configs_csv }}"
for config in ${configs[@]} ; do
echo "::group::${config}" ;
checkGeometry -c ${DETECTOR_PATH}/${config}.xml ;
echo "::endgroup::" ;
done
check-tracking-geometry:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: build-gcc-fast-eic-shell
path: install/
- uses: cvmfs-contrib/github-action-cvmfs@v3
- uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
network_types: "none"
setup: install/setup.sh
run: |
root -b -q "scripts/test_ACTS.cxx+(\"${DETECTOR_PATH}/${DETECTOR_CONFIG}.xml\")" | tee check_tracking_geometry.out
bin/acts_geo_check check_tracking_geometry.out
convert-to-gdml:
runs-on: ubuntu-latest
needs:
- build
- list-detector-configs
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: build-gcc-full-eic-shell
path: install/
- uses: cvmfs-contrib/github-action-cvmfs@v3
- uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
network_types: "none"
setup: install/setup.sh
run: |
IFS=, read -a configs <<< "${{ needs.list-detector-configs.outputs.configs_csv }}"
for config in ${configs[@]} ; do
echo "::group::${config}" ;
geoConverter -compact2gdml -input ${DETECTOR_PATH}/${config}.xml -output ${config}.gdml ;
echo "::endgroup::" ;
done
- uses: actions/upload-artifact@v3
with:
name: gdml
path: "*.gdml"
if-no-files-found: error
convert-to-tgeo:
runs-on: ubuntu-latest
needs:
- build
- list-detector-configs
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: build-gcc-full-eic-shell
path: install/
- uses: cvmfs-contrib/github-action-cvmfs@v3
- uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
network_types: "none"
setup: install/setup.sh
run: |
IFS=, read -a configs <<< "${{ needs.list-detector-configs.outputs.configs_csv }}"
for config in ${configs[@]} ; do
echo "::group::${config}" ;
geoConverter -compact2tgeo -input ${DETECTOR_PATH}/${config}.xml -output ${config}.root
echo "::endgroup::" ;
done
- uses: actions/upload-artifact@v3
with:
name: tgeo
path: "*.root"
if-no-files-found: error
dump-constants:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
detector_config: [epic_arches, epic_brycecanyon]
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: build-gcc-full-eic-shell
path: install/
- uses: cvmfs-contrib/github-action-cvmfs@v3
- uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
network_types: "none"
setup: install/setup.sh
run: |
mkdir -p doc
npdet_info dump ${DETECTOR_PATH}/${{matrix.detector_config}}.xml | tee doc/${{matrix.detector_config}}_constants.out
- uses: actions/upload-artifact@v3
with:
name: constants
path: doc/${{matrix.detector_config}}_constants.out
if-no-files-found: error
dump-parameter-table:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
detector_config: [epic_arches, epic_brycecanyon]
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: build-gcc-full-eic-shell
path: install/
- uses: cvmfs-contrib/github-action-cvmfs@v3
- uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
network_types: "none"
setup: install/setup.sh
run: |
mkdir -p doc
npdet_info dump ${DETECTOR_PATH}/${{matrix.detector_config}}.xml | grep -v '^\s' | grep '=' | cut -d= -f1-2 | tee doc/${{matrix.detector_config}}_constants.toml
cp doc/${{matrix.detector_config}}_constants.toml doc/constants.toml
python bin/make_detector_parameter_table | tee doc/${{matrix.detector_config}}.csv
- uses: actions/upload-artifact@v3
with:
name: constants
path: doc/${{matrix.detector_config}}_constants.toml
if-no-files-found: error
- uses: actions/upload-artifact@v3
with:
name: DetectorParameterTable
path: doc/${{matrix.detector_config}}.csv
if-no-files-found: error
check-overlap-tgeo:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
option: ['m'] #, 's'] # FIXME
detector_config: [epic_arches, epic_brycecanyon] # FIXME
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: build-gcc-full-eic-shell
path: install/
- uses: cvmfs-contrib/github-action-cvmfs@v3
- uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
network_types: "bridge" # this job must succeed even when new artifacts
setup: install/setup.sh
run: |
mkdir -p doc
checkOverlaps --option ${{ matrix.option }} -c ${DETECTOR_PATH}/${{ matrix.detector_config }}.xml | tee doc/overlap_check_tgeo.out
noverlaps="$(grep -c ovlp doc/overlap_check_tgeo.out || true)"
if [[ "${noverlaps}" -gt "0" ]] ; then echo "${noverlaps} overlaps found!" && false ; fi
check-geometry-full:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: build-gcc-full-eic-shell
path: install/
- uses: cvmfs-contrib/github-action-cvmfs@v3
- uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
setup: install/setup.sh
run: |
mkdir -p doc
checkGeometry -f true -c ${DETECTOR_PATH}/${DETECTOR_CONFIG}.xml | tee geometry_check_full.out
mv statistics.root geometry_check_full.root
- uses: actions/upload-artifact@v3
with:
name: check-geometry-full
path: |
geometry_check_full.out
geometry_check_full.root
if-no-files-found: error
check-overlap-geant4:
runs-on: ubuntu-latest
needs:
- build
strategy:
matrix:
detector_config: [epic_arches, epic_brycecanyon]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: build-gcc-full-eic-shell
path: install/
- uses: cvmfs-contrib/github-action-cvmfs@v3
- uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
network_types: "bridge" # this job must succeed even when new artifacts
setup: install/setup.sh
run: |
mkdir -p doc
python scripts/checkOverlaps.py -c ${DETECTOR_PATH}/${{ matrix.detector_config }}.xml | tee doc/overlap_check_geant4.out
noverlaps="$(grep -c GeomVol1002 doc/overlap_check_geant4.out || true)"
if [[ "${noverlaps}" -gt "0" ]] ; then echo "${noverlaps} overlaps found!" && false ; fi
check-overlap-geant4-fast:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
detector_config: [epic_inner_detector, epic_arches, epic_brycecanyon]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: build-gcc-fast-eic-shell
path: install/
- uses: cvmfs-contrib/github-action-cvmfs@v3
- uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
network_types: "bridge" # this job must succeed even when new artifacts
setup: install/setup.sh
run: |
mkdir -p doc
python scripts/checkOverlaps.py -c ${DETECTOR_PATH}/${{ matrix.detector_config }}.xml | tee doc/overlap_check_geant4.out
noverlaps="$(grep -c GeomVol1002 doc/overlap_check_geant4.out || true)"
if [[ "${noverlaps}" -gt "0" ]] ; then echo "${noverlaps} overlaps found!" && false ; fi
trigger-detector-benchmarks:
runs-on: ubuntu-latest
needs: [check-overlap-tgeo, check-overlap-geant4-fast]
strategy:
matrix:
detector_config: [epic_arches, epic_brycecanyon]
steps:
- uses: eic/trigger-gitlab-ci@v2
id: trigger
with:
url: https://eicweb.phy.anl.gov
project_id: 399
token: ${{ secrets.EICWEB_DETECTOR_BENCHMARK_TRIGGER }}
ref_name: master
variables: |
DETECTOR_REPOSITORYURL=${{ github.server_url }}/${{ github.repository }}
DETECTOR_VERSION=${{ github.event.pull_request.head.ref || github.ref_name }}
DETECTOR_CONFIG=${{ matrix.detector_config }}
GITHUB_REPOSITORY=${{ inputs.github_repository || github.repository }}
GITHUB_SHA=${{ inputs.github_sha || github.event.pull_request.head.sha || github.sha }}
- run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
/repos/${{ github.repository }}/statuses/${{ github.event.pull_request.head.sha || github.sha }} \
-f state="pending" \
-f target_url="${{ steps.trigger.outputs.web_url }}" \
-f description="Triggered... $(TZ=America/New_York date)" \
-f context="eicweb/detector_benchmarks (${{ matrix.detector_config }})"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
generate-prim-file:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
detector_config: [epic_arches, epic_brycecanyon]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: build-gcc-fast-eic-shell
path: install/
- uses: cvmfs-contrib/github-action-cvmfs@v3
- uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
network_types: "none"
setup: install/setup.sh
run: |
bin/generate_prim_file -c $DETECTOR_PATH/${{ matrix.detector_config }}.xml -o prim -D -t ${{ matrix.detector_config }}
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.detector_config }}.prim
path: prim/${{ matrix.detector_config }}.prim
if-no-files-found: error
retention-days: 1
dawn-view:
runs-on: ubuntu-latest
needs: generate-prim-file
strategy:
matrix:
view: [view1, view2, view3, view6, view7, view11, view13, view50]
detector_config: [epic_arches, epic_brycecanyon]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: ${{ matrix.detector_config }}.prim
path: prim/
- uses: cvmfs-contrib/github-action-cvmfs@v3
- uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
network_types: "none"
run: |
mkdir -p images
bin/make_dawn_views -i prim/${{ matrix.detector_config }}.prim -t ${{ matrix.view }} -d scripts/${{ matrix.view }} -D
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.detector_config }}_views
path: images/
if-no-files-found: error
dawn-view-slices:
runs-on: ubuntu-latest
needs: generate-prim-file
if: github.ref == 'refs/heads/main'
strategy:
matrix:
view: [view12, view14, view15]
slice: [100, 300, 500, 700, 900, 1100, 1300, 1500, 1700, 1900]
detector_config: [epic_arches, epic_brycecanyon]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: ${{ matrix.detector_config }}.prim
path: prim/
- uses: cvmfs-contrib/github-action-cvmfs@v3
- uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
network_types: "none"
run: |
mkdir -p images
bin/make_dawn_views -i prim/${{ matrix.detector_config }}.prim -t ${{ matrix.view }} -d scripts/${{ matrix.view }} -D -- ${{ matrix.slice }}
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.detector_config }}_views
path: images/
if-no-files-found: error
#TODO view20
build-artifacts-page:
runs-on: ubuntu-latest
needs:
- dawn-view
- dawn-view-slices
- convert-to-gdml
- convert-to-tgeo
- dump-constants
- dump-parameter-table
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
path: artifacts/
- uses: actions/jekyll-build-pages@v1
- uses: actions/upload-pages-artifact@v1
with:
retention-days: 7
deploy-artifacts-page:
needs:
- build-artifacts-page
if: github.ref == 'refs/heads/main'
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1