-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
215 lines (203 loc) · 5.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
stages:
- build
variables:
GIT_SUBMODULE_STRATEGY: recursive
PLOTS:
value: "none"
options:
- "none"
- "all"
- "upper_limits"
- "multiple_upper_limits"
- "multiple_upper_limits_by_model"
- "upper_limits_at_point"
- "likelihood_scan"
- "likelihood_scan_2d"
- "multiple_likelihood_scans"
- "multiple_likelihood_scans_2d"
- "multiple_likelihood_scans_by_model"
- "multiple_likelihood_scans_by_model_2d"
- "significance_scan"
- "multiple_significance_scans"
- "pulls_and_impacts"
- "exclusion_and_bestfit"
- "exclusion_and_bestfit_2d"
- "postfit_s_over_b"
- "nuisance_likelihood_scans"
- "goodness_of_fit"
- "multiple_goodness_of_fits"
- "eft_benchmark_limits"
- "multiple_eft_benchmark_limits"
- "upper_limits_c2"
- "likelihood_scan_c2_2d"
- "resonant_limits"
- "multiple_resonant_limits"
- "morphing_scales"
- "morphed_discriminant"
- "stat_error_scan"
- "all_limits"
- "all_likelihoods"
- "all_significances"
- "all_pulls"
- "all_exclusions"
- "all_postfit"
- "all_gof"
- "all_eft_bm"
- "all_eft_c2"
- "all_resonant"
- "all_studies"
description: "A specific plot to produce (see test.TestPlots for more info)."
PARAMETERS:
value: ""
description: "Additional parameters to be passed to the command."
.setup:
stage: build
tags:
- cvmfs
image: gitlab-registry.cern.ch/ci-tools/ci-worker:cc7
before_script:
- >
if [ ! -d data/examplecards ]; then
yum install -y sshpass && \
mkdir -p data/examplecards && \
cd data/examplecards && \
sshpass -v -p ${KRB_PASS} scp -o "StrictHostKeyChecking=no" ${KRB_USER}@lxplus.cern.ch:/afs/cern.ch/user/m/mrieger/public/hh/inference/examplecards/v2.tgz cards.tgz && \
tar -xzf cards.tgz && \
cd ../..
fi
- export DHI_EXAMPLE_CARDS_BASE="${PWD}/data/examplecards"
cache:
key: "${CI_COMMIT_REF_SLUG}"
policy: pull-push
paths:
- data/
compile:
extends: .setup
when: manual
script:
- export DHI_LCG_DIR="/NOTEXISTING"
- source setup.sh
cache:
key: "${CI_COMMIT_REF_SLUG}"
policy: push
paths:
- data/
lint:
extends: .setup
script:
- export DHI_LCG_DIR="/NOTEXISTING"
- source setup.sh
- ./lint.sh
cache:
key: "${CI_COMMIT_REF_SLUG}"
policy: pull-push
paths:
- data/
.test:
stage: build
timeout: 2h
tags:
- cvmfs
image: gitlab-registry.cern.ch/ci-tools/ci-worker:cc7
script:
- export DHI_EXAMPLE_CARDS_BASE="${PWD}/data/examplecards"
- export DHI_LCG_DIR="/NOTEXISTING"
- source setup.sh
- export TEST_CMD="law run dhi.tasks.test.TestPlots --version "ci_${CI_COMMIT_SHORT_SHA}" --plots ${TEST_PLOTS} --campaign \"CI ${CI_COMMIT_SHORT_SHA}\" --file-types png,pdf ${PARAMETERS}"
- echo "running command '${TEST_CMD}'"
- eval "${TEST_CMD}"
- eval "${TEST_CMD} --fetch-output 0,a,plots"
- mkdir png
- mv plots/*.png png
- mkdir pdf
- mv plots/*.pdf pdf
cache:
key: "${CI_COMMIT_REF_SLUG}"
policy: pull
paths:
- data/
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
paths:
- png/*.png
- pdf/*.pdf
expire_in: 1 month
test_all:
extends: .test
when: manual
rules:
- if: $PLOTS == "all"
when: always
parallel:
matrix:
- TEST_PLOTS:
- "all_limits"
- "all_likelihoods"
- "all_significances"
- "all_pulls"
- "all_exclusions"
- "all_postfit"
- "all_gof"
- "all_eft_bm"
- "all_eft_c2"
- "all_resonant"
- "all_studies"
test_specific:
extends: .test
when: manual
rules:
- if: $PLOTS != "none" && $PLOTS != "all"
when: always
variables:
TEST_PLOTS: $PLOTS
build_docs_image:
stage: build
when: manual
tags:
- docker-privileged
image: docker:19.03.1
services:
- docker:19.03.1-dind
variables:
DOCKER_TLS_CERTDIR: "/certs"
script:
- docker info
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- cd docs/docker
- docker build --pull -t "$CI_REGISTRY_IMAGE" .
- docker push "$CI_REGISTRY_IMAGE"
deploy_docs:
stage: build
when: manual
tags:
- docker
image: ${CI_REGISTRY_IMAGE}:latest
environment:
name: inference-${CI_COMMIT_REF_SLUG}
url: ${PAGE_URL}${CI_ENVIRONMENT_SLUG}
on_stop: delete_docs
script:
- test ! -z "${PAGE_ROOT}"
- export FULL_PAGE_ROOT="${PAGE_ROOT}${CI_ENVIRONMENT_SLUG}"
- echo "FULL_PAGE_ROOT is ${FULL_PAGE_ROOT}"
- cd docs
- mkdocs build
- cd site
- tar -czf site.tgz *
- sshpass -v -p ${KRB_PASS} ssh -o "StrictHostKeyChecking=no" ${KRB_USER}@lxplus.cern.ch "[ ! -d ${FULL_PAGE_ROOT} ] && mkdir ${FULL_PAGE_ROOT} || rm -rf ${FULL_PAGE_ROOT}/*"
- sshpass -v -p ${KRB_PASS} scp -o "StrictHostKeyChecking=no" site.tgz ${KRB_USER}@lxplus.cern.ch:${FULL_PAGE_ROOT}/site.tgz
- sshpass -v -p ${KRB_PASS} ssh -o "StrictHostKeyChecking=no" ${KRB_USER}@lxplus.cern.ch "cd ${FULL_PAGE_ROOT}; tar -xzf site.tgz; rm site.tgz"
delete_docs:
stage: build
when: manual
tags:
- docker
image: ${CI_REGISTRY_IMAGE}:latest
environment:
name: inference-${CI_COMMIT_REF_SLUG}
action: stop
script:
- test ! -z "${PAGE_ROOT}"
- export FULL_PAGE_ROOT="${PAGE_ROOT}${CI_ENVIRONMENT_SLUG}"
- echo "FULL_PAGE_ROOT is ${FULL_PAGE_ROOT}"
- sshpass -v -p ${KRB_PASS} ssh -o "StrictHostKeyChecking=no" ${KRB_USER}@lxplus.cern.ch "rm -rf ${FULL_PAGE_ROOT}"