-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.gitlab-ci.yml
215 lines (194 loc) · 5.83 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
image: ${BENCHMARKS_REGISTRY}/${BENCHMARKS_CONTAINER}:${BENCHMARKS_TAG}
variables:
DETECTOR: epic
DETECTOR_CONFIG: epic_craterlake
DETECTOR_REPOSITORYURL: 'https://github.com/eic/epic.git'
GITHUB_SHA: ''
GITHUB_REPOSITORY: ''
workflow:
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
- results
- config
- .env
- summary.txt
reports:
dotenv: .env
stages:
- status-pending
- config
- initialize
- data_init
- simulate
- calibrate
- benchmarks
- collect
- deploy
- trigger
- 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
common:detector:
stage: initialize
needs: ["common:setup"]
script:
- source .local/bin/env.sh && build_detector.sh
- mkdir_local_data_link sim_output
- mkdir -p results
- mkdir -p config
- print_env.sh
get_data:
stage: data_init
needs: ["common:detector"]
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:detector"]
before_script:
- source .local/bin/env.sh
- ls -lrtha
- ln -s "${LOCAL_DATA_PATH}/sim_output" sim_output
- ln -s "${LOCAL_DATA_PATH}/datasets/data" data
- ls -lrtha
retry:
max: 2
when:
- runner_system_failure
include:
- local: 'benchmarks/tracking_detectors/config.yml'
- local: 'benchmarks/barrel_ecal/config.yml'
- local: 'benchmarks/barrel_hcal/config.yml'
- local: 'benchmarks/zdc/config.yml'
- local: 'benchmarks/material_maps/config.yml'
- local: 'benchmarks/pid/config.yml'
- local: 'benchmarks/timing/config.yml'
- local: 'benchmarks/b0_tracker/config.yml'
- local: 'benchmarks/others/config.yml'
deploy_results:
stage: deploy
needs:
- ["collect_results:zdc","collect_results:barrel_ecal","collect_results:barrel_hcal","collect_results:materialscan"]
script:
- echo "deploy results!"
- find results -print | sort | tee summary.txt
benchmarks:detector:success:
stage: status-report
extends: .status
variables:
STATE: "success"
DESCRIPTION: "Succeeded!"
when: on_success
benchmarks:detector:failure:
stage: status-report
extends: .status
variables:
STATE: "failure"
DESCRIPTION: "Failed!"
when: on_failure
benchmarks:reconstruction:
stage: trigger
variables:
GITHUB_SHA: "${GITHUB_SHA}"
GITHUB_REPOSITORY: "${GITHUB_REPOSITORY}"
DETECTOR: "$DETECTOR"
DETECTOR_CONFIG: "$DETECTOR_CONFIG"
DETECTOR_VERSION: "$DETECTOR_VERSION"
DETECTOR_REPOSITORYURL: "$DETECTOR_REPOSITORYURL"
DETECTOR_DEPLOY_TOKEN_USERNAME: "${DETECTOR_DEPLOY_TOKEN_USERNAME}"
DETECTOR_DEPLOY_TOKEN_PASSWORD: "${DETECTOR_DEPLOY_TOKEN_PASSWORD}"
COMMON_BENCH_VERSION: "$COMMON_BENCH_VERSION"
BENCHMARKS_TAG: "${BENCHMARKS_TAG}"
BENCHMARKS_CONTAINER: "${BENCHMARKS_CONTAINER}"
BENCHMARKS_REGISTRY: "${BENCHMARKS_REGISTRY}"
trigger:
project: EIC/benchmarks/reconstruction_benchmarks
strategy: depend
needs: ["deploy_results"]
benchmarks:physics:
stage: trigger
variables:
GITHUB_SHA: "${GITHUB_SHA}"
GITHUB_REPOSITORY: "${GITHUB_REPOSITORY}"
DETECTOR: "$DETECTOR"
DETECTOR_CONFIG: "$DETECTOR_CONFIG"
DETECTOR_VERSION: "$DETECTOR_VERSION"
DETECTOR_REPOSITORYURL: "$DETECTOR_REPOSITORYURL"
DETECTOR_DEPLOY_TOKEN_USERNAME: "${DETECTOR_DEPLOY_TOKEN_USERNAME}"
DETECTOR_DEPLOY_TOKEN_PASSWORD: "${DETECTOR_DEPLOY_TOKEN_PASSWORD}"
COMMON_BENCH_VERSION: "$COMMON_BENCH_VERSION"
BENCHMARKS_TAG: "${BENCHMARKS_TAG}"
BENCHMARKS_CONTAINER: "${BENCHMARKS_CONTAINER}"
BENCHMARKS_REGISTRY: "${BENCHMARKS_REGISTRY}"
trigger:
project: EIC/benchmarks/physics_benchmarks
strategy: depend
needs: ["deploy_results"]
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