forked from rest-for-physics/framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
343 lines (298 loc) · 10.8 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
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
image: ghcr.io/lobis/root-geant4-garfield:rest-for-physics
# variables:
# GIT_SUBMODULE_STRATEGY: recursive
stages:
# Basic checks to verify correctness of code
- pre-build
# Build and run tests
- test
# Project compilation validation
- build
# REST libraries installed as submodules
- libraries
# Basic validation tests of installation
- install
# Basic core validation tests
- core
# Stage dedicated to validate metadata classes. gas, readout, g4Metadata, etc
- metadata
# Stage to validate restG4 package examples
- restG4
# Stage to validate framework examples
- examples
# Stage to validate data chain processing constructions (TREX-DM data, PandaX-III topology, etc).
- restManager process
# Stage to validate tasks or executions over preprocessed data files
- postProcessing
# Stage to validate other restManager tasks (metadata generation, script loading, etc).
- restManager generate
# Scripts to launch more complete tests. TRestGas file generation, Geant4 physics validation, etc.
- deploy
before_script:
- pwd
- export USER="test"
- echo $CI_SERVER_HOST
- echo $CRONJOB
# We redefine the HOME
- export HOME=${CI_PROJECT_DIR}/install/
- rm -rf $HOME/.rest
# Check versions
- root-config --version
- geant4-config --version
- echo $GARFIELD_INSTALL
- python3 --version
clang-format:
stage: pre-build
script:
- if [ $CI_SERVER_HOST != "lfna.unizar.es" ]; then exit 0; fi
- cd ${CI_PROJECT_DIR}/
- if [ -n "$CRONJOB" ]; then ./pipeline/clangformattest.sh; else echo "Skipping clang-format"; fi
- ./pipeline/clangformattest.sh
- clang-format --version
only:
variables:
- $CI_SERVER_HOST == "lfna.unizar.es"
- $CRONJOB
- $CRONJOB == "YES"
Validate Code:
stage: pre-build
script:
- cd ${CI_PROJECT_DIR}/
- python3 pull-submodules.py --force --dontask --latest:${CI_COMMIT_BRANCH} --exclude:iaxo,detector-template
- python3 pipeline/validateProcesses.py source/libraries/
#Build and Test:
# stage: test
# script:
# - cd ${CI_PROJECT_DIR}
# - python3 pull-submodules.py --force --dontask --latest:${CI_COMMIT_BRANCH} --exclude:iaxo,detector-template
# - mkdir ${CI_PROJECT_DIR}/build && cd ${CI_PROJECT_DIR}/build
# - cmake ${CI_PROJECT_DIR} -DTEST=ON -DREST_ALL_LIBS=ON
# -DREST_GARFIELD=OFF -DREST_G4=ON -DREST_WELCOME=OFF -DCMAKE_INSTALL_PREFIX=${CI_PROJECT_DIR}/install-test
# - make -j2 install
# - source ${CI_PROJECT_DIR}/install-test/thisREST.sh
# - ctest --output-on-failure -O ${CI_PROJECT_DIR}/build/Testing/summary.txt
artifacts:
name: "Testing"
paths:
- ${CI_PROJECT_DIR}/build/Testing
expire_in: 1 day
Build and Install:
stage: build
script:
- cd ${CI_PROJECT_DIR}
- python3 pull-submodules.py --force --dontask --latest:${CI_COMMIT_BRANCH} --exclude:iaxo,detector-template
- rm -rf ${CI_PROJECT_DIR}/build && mkdir ${CI_PROJECT_DIR}/build && cd ${CI_PROJECT_DIR}/build
- rm -rf ${CI_PROJECT_DIR}/install
- cmake ${CI_PROJECT_DIR} -DCMAKE_INSTALL_PREFIX=${CI_PROJECT_DIR}/install
-DREST_ALL_LIBS=ON -DREST_GARFIELD=ON -DREST_G4=ON -DREST_WELCOME=OFF -DREST_MPFR=ON
- make install -j2
artifacts:
name: "Install"
paths:
- ${CI_PROJECT_DIR}/install
expire_in: 1 day
Load REST Libraries:
stage: install
script:
- echo ${CI_PROJECT_DIR}/install/thisREST.sh
- cat ${CI_PROJECT_DIR}/install/thisREST.sh
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- restRoot -b -q
List REST Macros:
stage: install
script:
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- restManager ListMacros
01.NLDBD:
stage: restG4
script:
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- cd ${CI_PROJECT_DIR}/install/examples/restG4/01.NLDBD/
- restG4 NLDBD.rml
- geant4-config --version
- restRoot -b -q Validate.C'("Run00001_NLDBD_Test.root")'
artifacts:
paths:
- ${CI_PROJECT_DIR}/install/examples/restG4/01.NLDBD/Run00001_NLDBD_Test.root
expire_in: 1 day
PandaX-III MC:
stage: restG4
script:
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- cd ${CI_PROJECT_DIR}/pipeline/pandaxiii_MC
- restG4 ${CI_PROJECT_DIR}/install/examples/restG4/05.PandaXIII/Xe136bb0n.rml -o Xe136bb0n.root
- restRoot -b -q ${CI_PROJECT_DIR}/install/examples/restG4/05.PandaXIII/Validate.C'("Xe136bb0n.root")'
artifacts:
paths:
- ${CI_PROJECT_DIR}/pipeline/pandaxiii_MC/Xe136bb0n.root
expire_in: 1 day
08.alphas:
stage: restG4
script:
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- cd ${CI_PROJECT_DIR}/install/examples/restG4/08.Alphas/
- mkdir data
- export REST_ENERGY=5
- export REST_FOIL=1
- restG4 alphas.rml
artifacts:
paths:
- ${CI_PROJECT_DIR}/install/examples/restG4/08.Alphas/data/Run_5MeV_1um.root
expire_in: 1 day
01.alphaTrack:
stage: examples
script:
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- cd ${CI_PROJECT_DIR}/install/examples/01.alphaTrack/
- mkdir data
- export RAW_PROCESSING=ON
- export HIT_PROCESSING=ON
- export TRACK_PROCESSING=ON
- restManager --c processing.rml --f ${CI_PROJECT_DIR}/install/examples/restG4/08.Alphas/data/Run_5MeV_1um.root
- restRoot -b -q Validate.C'("data/Response_5MeV_1um.root")'
Load Gas:
stage: metadata
script:
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- cd ${CI_PROJECT_DIR}/pipeline/metadata/gas/
- restRoot -b -q LoadGasFromServerAndValidate.C
only:
variables:
- $CI_SERVER_HOST == "lfna.unizar.es"
Generate Gas:
stage: metadata
script:
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- cd ${CI_PROJECT_DIR}/pipeline/metadata/gas/
- restRoot -b -q GenerateDummyGas.C
only:
variables:
- $CI_SERVER_HOST == "lfna.unizar.es"
AnalysisTree:
stage: core
script:
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- cd ${CI_PROJECT_DIR}/pipeline/analysistree/
- restRoot -b -q simpleTree.cpp
Generate Readout:
stage: metadata
script:
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- cd ${CI_PROJECT_DIR}/pipeline/metadata/readout/
- restManager --c generateReadout.rml --o readout.root
- restRoot -b -q PrintReadout.C'("readout.root")' > /dev/null
# We need to introduce basic validation here
# - diff validation.txt print.txt
Basic Readout:
stage: metadata
script:
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- cd ${CI_PROJECT_DIR}/projects/basic-examples/
- git submodule update --init .
- cd basic-readouts
- git submodule update --init .
- restRoot -b -q GenerateReadouts.C'("basic.root")'
- restRoot -b -q BasicValidation.C'("basic.root", "pixelDecoding")'
Test Metadata:
stage: restManager generate
script:
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- cd ${CI_PROJECT_DIR}/install/examples
- restManager --c saveMetadataFile.rml --o meta.root
artifacts:
paths:
- ${CI_PROJECT_DIR}/install/examples/meta.root
expire_in: 1 day
TREX-DM Latest Data:
stage: restManager process
script:
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- cd ${CI_PROJECT_DIR}/pipeline/trex
- wget --no-check-certificate https://sultan.unizar.es/trexdm-readouts/readouts_v2.3.root
- restManager --c 01_raw.rml --f R01928_tagTest_Vm_250_Vd_160_Pr_6_Gain_0x0_Shape_0xF_Clock_0x4-068.aqs
- restManager --c 02_signal.rml --f RawData_01928.root
- restManager --c 03_hits.rml --f Signals_01928.root
- restRoot -b -q ../MakeBasicTree.C'("Hits_01928.root")'
- rm RawData_01928.root
- rm Signals_01928.root
- root -b -q ../ValidateTrees.C'("validation.root")'
- restRoot -b -q ValidateDetectorParams.C'("Hits_01928.root")'
artifacts:
paths:
- ${CI_PROJECT_DIR}/pipeline/trex/Hits_01928.root
expire_in: 1 day
PandaX-III Topological from reference file:
stage: restManager process
script:
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- cd ${CI_PROJECT_DIR}/pipeline/pandaxiii_MC
- restManager --c AllProcesses.rml --i Xe136bb0n_small_reference.root --o Xe136bb0n_small_reference_processed.root --j 1 --e 5
- restRoot -b -q ../MakeBasicTree.C'("Xe136bb0n_small_reference_processed.root")'
- restRoot -b -q ../ValidateTrees.C'("Xe136bb0n_validation.root")'
- restManager --c plots.rml --i Xe136bb0n_small_reference_processed.root
artifacts:
paths:
- ${CI_PROJECT_DIR}/pipeline/pandaxiii_MC/trackParameter.png
expire_in: 1 week
PandaX-III Topological from Geant4:
stage: restManager process
script:
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- cd ${CI_PROJECT_DIR}/pipeline/pandaxiii_MC
- echo "using just-generated g4 file"
- restManager --c AllProcesses.rml --i Xe136bb0n.root --o Xe136bb0n_processed.root --j 1 --e 5
- restRoot -b -q ../MakeBasicTree.C'("Xe136bb0n_processed.root")'
- restRoot -b -q ../ValidateTrees.C'("Xe136bb0n_validation.root")'
artifacts:
paths:
- ${CI_PROJECT_DIR}/pipeline/pandaxiii_MC/Xe136bb0n_processed.root
expire_in: 1 week
PandaX-III Data:
stage: restManager process
script:
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- cd ${CI_PROJECT_DIR}/pipeline/pandaxiii_data
- restManager --c P3AutoChain.rml --i CoBo_AsAd0_2019-03-15.graw --o testOutput.root --j 1
- restRoot -b -q ../MakeBasicTree.C'("testOutput.root")'
- restRoot -b -q ../ValidateTrees.C'("validation.root")'
artifacts:
paths:
- ${CI_PROJECT_DIR}/pipeline/pandaxiii_data/TriggerRate.png
expire_in: 1 week
Event Selection:
stage: restManager process
script:
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- cd ${CI_PROJECT_DIR}/pipeline/selection
- restManager --c g4Analysis.rml --f "${CI_PROJECT_DIR}/install/examples/restG4/01.NLDBD/Run00001_NLDBD_Test.root"
- restManager --c g4OnSelection.rml --f Run00001_NLDBD_Test_g4Analysis.root
- restRoot -b -q Validate.C'("Run00001_NLDBD_Test_EvSelection.root")'
- restManager --c g4EvSelectionIDsFromFile.rml --f Run00001_NLDBD_Test_g4Analysis.root
- restRoot -b -q ValidateIDsFromFile.C'("Run00001_NLDBD_Test_EvSelectionIDsFromFile.root")'
artifacts:
paths:
- ${CI_PROJECT_DIR}/pipeline/selection/IDs.txt
expire_in: 1 week
AnalysisPlot:
stage: postProcessing
script:
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- cd ${CI_PROJECT_DIR}/pipeline/analysisPlot/
- restManager --c summary.rml --f ${CI_PROJECT_DIR}/pipeline/trex/Hits_01928.root
AnalysisPlot2:
stage: postProcessing
script:
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- cd ${CI_PROJECT_DIR}/pipeline/analysisPlot/
- restManager --batch --c classify.rml
- restRoot -b -q ValidateClassify.C
Deploy:
stage: deploy
only:
- tags
script:
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- rest-config --welcome
artifacts:
paths:
- ${CI_PROJECT_DIR}/install