-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitlab-ci.yml
223 lines (209 loc) · 6.6 KB
/
.gitlab-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
image: ${BENCHMARKS_REGISTRY}/${BENCHMARKS_CONTAINER}:${BENCHMARKS_TAG}
variables:
DETECTOR: epic
DETECTOR_CONFIG: epic_craterlake
GITHUB_SHA: ''
GITHUB_REPOSITORY: ''
SNAKEMAKE_FLAGS: '--cache'
workflow:
name: '$PIPELINE_NAME'
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_PIPELINE_SOURCE == "web"'
- if: '$CI_PIPELINE_SOURCE == "webide"'
- if: '$CI_PIPELINE_SOURCE == "trigger"'
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$CI_COMMIT_TAG'
default:
tags:
- phy-scratch
artifacts:
expire_in: 72 hours
paths:
- .local/detector
- .local/lib
- .local/bin
- .local/include
- .local/share
- .snakemake/log
- results
- config
- .env
- summary.txt
reports:
dotenv: .env
stages:
- status-pending
- config
- initialize
- data_init
- simulate
- calibrate
- benchmarks
- collect
- deploy
- status-report
.status:
image: curlimages/curl:latest
script:
- |
if [ -n "${GITHUB_SHA}" ] ; then
curl \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token ${GITHUB_REPO_STATUS_TOKEN}" \
"https://api.github.com/repos/${GITHUB_REPOSITORY}/statuses/${GITHUB_SHA}" \
-d '{"state":"'"${STATE}"'",
"target_url":"'"${CI_PIPELINE_URL}"'",
"description":"'"${DESCRIPTION} $(TZ=America/New_York date)"'",
"context":"eicweb/detector_benchmarks ('"$DETECTOR_CONFIG"')"
}' ;
fi
benchmarks:detector:pending:
stage: status-pending
extends: .status
variables:
STATE: "pending"
DESCRIPTION: "Started..."
when: always
common:setup:
stage: config
before_script:
script:
- |
if [[ "${COMMON_BENCH_VERSION}" == "" ]] ; then
export COMMON_BENCH_VERSION="master"
fi
echo "COMMON_BENCH_VERSION = ${COMMON_BENCH_VERSION}"
echo "COMMON_BENCH_VERSION=${COMMON_BENCH_VERSION}" >> .env
git clone -b "${COMMON_BENCH_VERSION}" https://eicweb.phy.anl.gov/EIC/benchmarks/common_bench.git setup
echo "BENCHMARKS_TAG: ${BENCHMARKS_TAG}"
echo "BENCHMARKS_CONTAINER: ${BENCHMARKS_CONTAINER}"
echo "BENCHMARKS_REGISTRY: ${BENCHMARKS_REGISTRY}"
- source setup/bin/env.sh && ./setup/bin/install_common.sh
- mkdir_local_data_link sim_output
- mkdir -p results
- mkdir -p config
- print_env.sh
get_data:
stage: data_init
needs: ["common:setup"]
script:
- source .local/bin/env.sh
- ln -s "${LOCAL_DATA_PATH}/sim_output" sim_output
- ln -s "${LOCAL_DATA_PATH}/datasets/data" data
- cd ${LOCAL_DATA_PATH} && git clone --depth=1 https://eicweb.phy.anl.gov/EIC/datasets.git datasets
.det_benchmark:
needs:
- ["get_data","common:setup"]
before_script:
- mc config host add S3 https://eics3.sdcc.bnl.gov:9000 ${S3_ACCESS_KEY} ${S3_SECRET_KEY} || echo "Failed to configure S3."
- source .local/bin/env.sh
- source /opt/detector/epic-main/setup.sh
- ls -lrtha
- ln -s "${LOCAL_DATA_PATH}/sim_output" sim_output
- ln -s "${LOCAL_DATA_PATH}/datasets/data" data
# snakemake support
- mkdir "${DETECTOR_CONFIG}"
- ln -s "${LOCAL_DATA_PATH}/sim_output" "${DETECTOR_CONFIG}/sim_output"
- ln -s "../results" "${DETECTOR_CONFIG}/results"
- mkdir -p "$SNAKEMAKE_OUTPUT_CACHE"
- ls -lrtha
retry:
max: 2
when:
- runner_system_failure
include:
- local: 'benchmarks/backgrounds/config.yml'
- local: 'benchmarks/backwards_ecal/config.yml'
- local: 'benchmarks/calo_pid/config.yml'
- local: 'benchmarks/ecal_gaps/config.yml'
- local: 'benchmarks/tracking_detectors/config.yml'
- local: 'benchmarks/tracking_performances/config.yml'
- local: 'benchmarks/tracking_performances_dis/config.yml'
- local: 'benchmarks/barrel_ecal/config.yml'
- local: 'benchmarks/barrel_hcal/config.yml'
- local: 'benchmarks/lfhcal/config.yml'
- local: 'benchmarks/zdc/config.yml'
- local: 'benchmarks/zdc_lyso/config.yml'
- local: 'benchmarks/zdc_neutron/config.yml'
- local: 'benchmarks/zdc_photon/config.yml'
- local: 'benchmarks/zdc_pi0/config.yml'
- local: 'benchmarks/material_scan/config.yml'
- local: 'benchmarks/pid/config.yml'
- local: 'benchmarks/timing/config.yml'
- local: 'benchmarks/b0_tracker/config.yml'
- local: 'benchmarks/insert_muon/config.yml'
- local: 'benchmarks/insert_tau/config.yml'
- local: 'benchmarks/zdc_sigma/config.yml'
- local: 'benchmarks/zdc_lambda/config.yml'
- local: 'benchmarks/insert_neutron/config.yml'
- local: 'benchmarks/femc_electron/config.yml'
- local: 'benchmarks/femc_photon/config.yml'
- local: 'benchmarks/femc_pi0/config.yml'
deploy_results:
allow_failure: true
stage: deploy
needs:
- "collect_results:backgrounds"
- "collect_results:backwards_ecal"
- "collect_results:barrel_ecal"
- "collect_results:barrel_hcal"
- "collect_results:calo_pid"
- "collect_results:ecal_gaps"
- "collect_results:lfhcal"
- "collect_results:material_scan"
- "collect_results:pid"
- "collect_results:tracking_performance"
- "collect_results:tracking_performance_campaigns"
- "collect_results:zdc_sigma"
- "collect_results:zdc_lambda"
- "collect_results:insert_neutron"
- "collect_results:tracking_performances_dis"
- "collect_results:zdc"
- "collect_results:zdc_lyso"
- "collect_results:zdc_neutron"
- "collect_results:insert_muon"
- "collect_results:insert_tau"
- "collect_results:zdc_photon"
- "collect_results:zdc_pi0"
- "collect_results:femc_electron"
- "collect_results:femc_photon"
- "collect_results:femc_pi0"
script:
- snakemake $SNAKEMAKE_FLAGS --cores 1 results/metadata.json
- find results -print | sort | tee summary.txt
- xrdfs $XROOTD_RW_ENDPOINT mkdir $XROOTD_OUTPUT_PREFIX/pipeline-$CI_PIPELINE_ID
- xrdcp -r results $XROOTD_RW_ENDPOINT/$XROOTD_OUTPUT_PREFIX/pipeline-$CI_PIPELINE_ID
benchmarks:detector:success:
stage: status-report
dependencies: []
extends: .status
variables:
STATE: "success"
DESCRIPTION: "Succeeded!"
after_script:
# Cleanup scratch space
- rm -rfv $LOCAL_DATA_PATH
when: on_success
benchmarks:detector:failure:
stage: status-report
dependencies: []
extends: .status
variables:
STATE: "failure"
DESCRIPTION: "Failed!"
when: on_failure
pages:
stage: deploy
rules:
- if: '$CI_COMMIT_BRANCH == "master" && $CI_SERVER_HOST != "eicweb.phy.anl.gov"'
cache:
paths:
- node_modules/
image: node:latest
script:
- mkdir public && cp doc/main.html public/index.html
artifacts:
paths:
- public