forked from LLNL/scr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
424 lines (404 loc) · 12.5 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
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
stages:
- build
- test
default:
before_script:
- echo "before_script" `pwd`
- export SRC_DIR=$(pwd)
- echo "SRC_DIR=$SRC_DIR"
- export WORK_DIR_BASE=${CI_BUILDS_DIR}/${CI_PIPELINE_ID}
- mkdir -p ${WORK_DIR_BASE}
# Since /dev/shm is local to whichever particular runner is selected, it is hard to get to the
# files in case of problems. If there are problems with the CI build, put TMP_DIR in the work directory, so that
# log files are available after the run.
# - export TMP_DIR_ROOT=${WORK_DIR_BASE}/shm/${USER}/gitlab-ci/${CI_PIPELINE_ID}
- export TMP_DIR_ROOT=/dev/shm/${USER}/gitlab-ci/${CI_PIPELINE_ID}
- export TMP_DIR_BASE=${TMP_DIR_ROOT}/${CI_JOB_ID}
- mkdir -p ${TMP_DIR_BASE}
# I want to clean up /dev/shm, but the after_script runs with a separate environment
# from before_script and script. So we need to store important variables so they
# can be re-initialized in after_script
- echo "WORK_DIR_BASE=${WORK_DIR_BASE}" > buildvars
- echo "TMP_DIR_ROOT=${TMP_DIR_ROOT}" >> buildvars
- echo "TMP_DIR_BASE=${TMP_DIR_BASE}" >> buildvars
- cd ${WORK_DIR_BASE}
- echo "before_script end" `pwd`
after_script:
- pwd
- source buildvars
# - echo "Copying $TMP_DIR_BASE to $WORK_DIR_BASE"
# - cp -r $TMP_DIR_BASE $WORK_DIR_BASE/tmp/$TMP_DIR_BASE
- echo "Cleaning up ${TMP_DIR_ROOT}"
- rm -rf ${TMP_DIR_ROOT}
buildjob-catalyst:
stage: build
when: manual
tags:
- catalyst
script:
- export WORK_DIR=${WORK_DIR_BASE}/catalyst
- mkdir -p ${WORK_DIR}
- cd ${WORK_DIR}
- mkdir install
- uname -a
- pwd
- echo "CI_BUILDS_DIR is $CI_BUILDS_DIR"
- echo "CI_PIPELINE_ID is $CI_PIPELINE_ID"
- echo "CI_PIPELINE_IID is $CI_PIPELINE_IID"
- echo "TMP_DIR_BASE is $TMP_DIR_BASE"
- echo "WORK_DIR_BASE is $WORK_DIR_BASE"
- echo "Working dir " `pwd`
# The build directory needs to be called build because the testing scripts pick up the name,
# so make sure the build directory is called "build" even though its in /dev/shm
- mkdir ${TMP_DIR_BASE}/build
- ln -s ${TMP_DIR_BASE}/build build-tmp
- mkdir ${TMP_DIR_BASE}/deps
- ln -s ${TMP_DIR_BASE}/deps deps
- ${SRC_DIR}/bootstrap.sh
- cd build
- cmake -DCMAKE_INSTALL_PREFIX=${WORK_DIR}/install -DCMAKE_PREFIX_PATH=${WORK_DIR}/install ${SRC_DIR}
- make
- make install
# Move build from /dev/shm to work directory.
- cd ${WORK_DIR}
- mv build build-shm
- mkdir build && cd build
- (cd ../build-shm; tar cf - .) | tar xvf -
#artifacts:
# paths:
# - build/
testserial-catalyst:
stage: test
when: manual
tags:
- catalyst
- batch
- slurm
variables:
LLNL_SLURM_SCHEDULER_PARAMETERS: '--nodes=1 -p pbatch'
dependencies:
- buildjob-catalyst
script:
- echo "Running in" `pwd`
- uname -a
- echo "CI_BUILDS_DIR is $CI_BUILDS_DIR"
- echo "CI_PIPELINE_ID is $CI_PIPELINE_ID"
- echo "CI_PIPELINE_IID is $CI_PIPELINE_IID"
- echo "WORK_DIR_BASE is $WORK_DIR_BASE"
- cd ${WORK_DIR_BASE}/catalyst
- export SCR_CONF_FILE=$(pwd)/build/examples/test.conf
- pwd
- cd build
- ctest --verbose -T Test -R serial*
- pwd
testparallel-catalyst:
stage: test
when: manual
tags:
- catalyst
- batch
- slurm
variables:
LLNL_SLURM_SCHEDULER_PARAMETERS: '--nodes=4 -p pbatch'
dependencies:
- buildjob-catalyst
script:
- echo "Running in" `pwd`
- uname -a
- echo "CI_BUILDS_DIR is $CI_BUILDS_DIR"
- echo "CI_PIPELINE_ID is $CI_PIPELINE_ID"
- echo "CI_PIPELINE_IID is $CI_PIPELINE_IID"
- echo "WORK_DIR_BASE is $WORK_DIR_BASE"
- cd ${WORK_DIR_BASE}/catalyst
- export SCR_CONF_FILE=$(pwd)/build/examples/test.conf
- pwd
- cd build
- ctest --verbose -T Test -R parallel*
- pwd
- mkdir -p Testing/Tests
- cp `grep -rl '.xml$' Testing/*` Testing/*/* Testing/Tests/
spack-scr-catalyst:
stage: build
when: manual
tags:
- catalyst
- shell
script:
- mkdir -p catalyst
- cd catalyst
- uname -a
- pwd
- echo "CI_BUILDS_DIR is $CI_BUILDS_DIR"
- echo "CI_PIPELINE_ID is $CI_PIPELINE_ID"
- echo "CI_PIPELINE_IID is $CI_PIPELINE_IID"
- echo "WORK_DIR_BASE is $WORK_DIR_BASE"
- echo "Working dir " `pwd`
- rm -rf spack
- git clone --depth 1 https://github.com/spack/spack.git
- cd spack
- . share/spack/setup-env.sh
- spack compiler find --scope site
- spack install --keep-stage scr@develop resource_manager=SLURM
- spack cd -i scr
- cd share/scr/examples
- export MPICC=/usr/tce/packages/mvapich2/mvapich2-2.2-gcc-4.9.3/bin/mpicc
- export MPICXX=/usr/tce/packages/mvapich2/mvapich2-2.2-gcc-4.9.3/bin/mpicxx
- export MPIF90=/usr/tce/packages/mvapich2/mvapich2-2.2-gcc-4.9.3/bin/mpif90
- make
buildjob-quartz:
stage: build
when: manual
tags:
- quartz
script:
- export WORK_DIR=${WORK_DIR_BASE}/quartz
- mkdir -p ${WORK_DIR}
- cd ${WORK_DIR}
- mkdir install
- uname -a
- pwd
- echo "CI_BUILDS_DIR is $CI_BUILDS_DIR"
- echo "CI_PIPELINE_ID is $CI_PIPELINE_ID"
- echo "CI_PIPELINE_IID is $CI_PIPELINE_IID"
- echo "TMP_DIR_BASE is $TMP_DIR_BASE"
- echo "WORK_DIR_BASE is $WORK_DIR_BASE"
- echo "Working dir " `pwd`
# The build directory needs to be called build because the testing scripts pick up the name,
# so make sure the build directory is called "build" even though its in /dev/shm
- mkdir ${TMP_DIR_BASE}/build
- ln -s ${TMP_DIR_BASE}/build build-tmp
- mkdir ${TMP_DIR_BASE}/deps
- ln -s ${TMP_DIR_BASE}/deps deps
- ${SRC_DIR}/bootstrap.sh
- cd build
- cmake -DCMAKE_INSTALL_PREFIX=${WORK_DIR}/install -DCMAKE_PREFIX_PATH=${WORK_DIR}/install ${SRC_DIR}
- make
- make install
# Move build from /dev/shm to work directory.
- cd ${WORK_DIR}
- mv build build-shm
- mkdir build && cd build
- (cd ../build-shm; tar cf - .) | tar xvf -
#artifacts:
# paths:
# - build/ stage: build
testserial-quartz:
stage: test
when: manual
tags:
- quartz
- batch
- slurm
variables:
LLNL_SLURM_SCHEDULER_PARAMETERS: '--nodes=1 -p pbatch'
dependencies:
- buildjob-quartz
script:
- echo "Running in" `pwd`
- uname -a
- echo "CI_BUILDS_DIR is $CI_BUILDS_DIR"
- echo "CI_PIPELINE_ID is $CI_PIPELINE_ID"
- echo "CI_PIPELINE_IID is $CI_PIPELINE_IID"
- echo "WORK_DIR_BASE is $WORK_DIR_BASE"
- cd ${WORK_DIR_BASE}/quartz
- export SCR_CONF_FILE=$(pwd)/build/examples/test.conf
- pwd
- cd build
- ctest --verbose -T Test -R serial*
- pwd
testparallel-quartz:
stage: test
when: manual
tags:
- quartz
- batch
- slurm
variables:
LLNL_SLURM_SCHEDULER_PARAMETERS: '--nodes=4 -p pbatch'
dependencies:
- buildjob-quartz
script:
- echo "Running in" `pwd`
- uname -a
- echo "CI_BUILDS_DIR is $CI_BUILDS_DIR"
- echo "CI_PIPELINE_ID is $CI_PIPELINE_ID"
- echo "CI_PIPELINE_IID is $CI_PIPELINE_IID"
- echo "WORK_DIR_BASE is $WORK_DIR_BASE"
- cd ${WORK_DIR_BASE}/quartz
- export SCR_CONF_FILE=$(pwd)/build/examples/test.conf
- echo "SCR_CONF_FILE is $SCR_CONF_FILE"
- pwd
- cd build
- ctest --verbose -T Test -R parallel*
- pwd
- mkdir -p Testing/Tests
- cp `grep -rl '.xml$' Testing/*` Testing/*/* Testing/Tests/
spack-scr-quartz:
stage: build
when: manual
tags:
- quartz
- shell
script:
- mkdir -p quartz
- cd quartz
- uname -a
- pwd
- echo "CI_BUILDS_DIR is $CI_BUILDS_DIR"
- echo "CI_PIPELINE_ID is $CI_PIPELINE_ID"
- echo "CI_PIPELINE_IID is $CI_PIPELINE_IID"
- echo "WORK_DIR_BASE is $WORK_DIR_BASE"
- echo "Working dir " `pwd`
- rm -rf spack
- git clone --depth 1 https://github.com/spack/spack.git
- cd spack
- . share/spack/setup-env.sh
- spack compiler find --scope site
- spack install --keep-stage scr@develop resource_manager=NONE
- spack cd -i scr
- cd share/scr/examples
- export MPICC=/usr/tce/packages/mvapich2/mvapich2-2.2-gcc-4.9.3/bin/mpicc
- export MPICXX=/usr/tce/packages/mvapich2/mvapich2-2.2-gcc-4.9.3/bin/mpicxx
- export MPIF90=/usr/tce/packages/mvapich2/mvapich2-2.2-gcc-4.9.3/bin/mpif90
- make
buildjob-lassen:
stage: build
when: manual
tags:
- lassen
script:
- export WORK_DIR=${WORK_DIR_BASE}/lassen
- mkdir -p ${WORK_DIR}
- cd ${WORK_DIR}
- mkdir install
- uname -a
- pwd
- echo "CI_BUILDS_DIR is $CI_BUILDS_DIR"
- echo "CI_PIPELINE_ID is $CI_PIPELINE_ID"
- echo "CI_PIPELINE_IID is $CI_PIPELINE_IID"
- echo "TMP_DIR_BASE is $TMP_DIR_BASE"
- echo "WORK_DIR_BASE is $WORK_DIR_BASE"
- echo "Working dir " `pwd`
# The build directory needs to be called build because the testing scripts pick up the name,
# so make sure the build directory is called "build" even though its in /dev/shm
- mkdir ${TMP_DIR_BASE}/build
- ln -s ${TMP_DIR_BASE}/build build-tmp
- mkdir ${TMP_DIR_BASE}/deps
- ln -s ${TMP_DIR_BASE}/deps deps
- export CC=xlc_r
- export CXX=xlc++_r
- export F90=xlf90_r
- export FFLAGS=-qextname
- ${SRC_DIR}/bootstrap.sh
- cd build
- cmake -DCMAKE_INSTALL_PREFIX=${WORK_DIR}/install -DCMAKE_PREFIX_PATH=${WORK_DIR}/install -DSCR_RESOURCE_MANAGER=LSF ${SRC_DIR}
- make
- make install
# Move build from /dev/shm to work directory.
- cd ${WORK_DIR}
- mv build build-shm
- mkdir build && cd build
- (cd ../build-shm; tar cf - .) | tar xvf -
#artifacts:
# paths:
# - build/
testserial-lassen:
stage: test
when: manual
tags:
- lassen
- batch
- lsf
variables:
LLNL_LSF_SCHEDULER_PARAMETERS: '-nnodes 1 -W 10 /bin/bash'
dependencies:
- buildjob-lassen
script:
- echo "Running in" `pwd`
- uname -a
- echo "CI_BUILDS_DIR is $CI_BUILDS_DIR"
- echo "CI_PIPELINE_ID is $CI_PIPELINE_ID"
- echo "CI_PIPELINE_IID is $CI_PIPELINE_IID"
- echo "WORK_DIR_BASE is $WORK_DIR_BASE"
- cd ${WORK_DIR_BASE}/lassen
- export SCR_CONF_FILE=$(pwd)/build/examples/test.conf
- pwd
- cd build
- ctest --verbose -T Test -R serial*
- pwd
testparallel-lassen:
stage: test
when: manual
tags:
- lassen
- batch
- lsf
variables:
LLNL_LSF_SCHEDULER_PARAMETERS: '-nnodes 4 -W 10 /bin/bash'
dependencies:
- buildjob-lassen
script:
- echo "Running in" `pwd`
- uname -a
- echo "CI_BUILDS_DIR is $CI_BUILDS_DIR"
- echo "CI_PIPELINE_ID is $CI_PIPELINE_ID"
- echo "CI_PIPELINE_IID is $CI_PIPELINE_IID"
- echo "WORK_DIR_BASE is $WORK_DIR_BASE"
- cd ${WORK_DIR_BASE}/lassen
- export SCR_CONF_FILE=$(pwd)/build/examples/test.conf
- pwd
- cd build
- ctest --verbose -T Test -R parallel*
- pwd
- mkdir -p Testing/Tests
- cp `grep -rl '.xml$' Testing/*` Testing/*/* Testing/Tests/
spack-scr-lassen:
stage: build
when: manual
tags:
- lassen
- shell
before_script:
- pwd
- |+
cat > fixcompiler.py <<EOF
import os, sys, yaml
xlf = os.popen('which xlf').read().strip()
xlfr = os.popen('which xlf_r').read().strip()
cfile = sys.argv[1]
with open(cfile, 'r') as f:
compilers = yaml.safe_load(f)
for elem in compilers['compilers']:
for k, v in elem.items():
if ('xl@' in v['spec']):
v['paths']['fc'] = 'xlf'
elif ('xl_r@' in v['spec']):
v['paths']['fc'] = 'xlf_r'
with open(cfile, 'w') as f:
f.write(yaml.dump(compilers))
EOF
- cat fixcompiler.py
script:
- mkdir -p lassen
- cd lassen
- uname -a
- pwd
- echo "CI_BUILDS_DIR is $CI_BUILDS_DIR"
- echo "CI_PIPELINE_ID is $CI_PIPELINE_ID"
- echo "CI_PIPELINE_IID is $CI_PIPELINE_IID"
- echo "WORK_DIR_BASE is $WORK_DIR_BASE"
- echo "Working dir " `pwd`
- rm -rf spack
- git clone --depth 1 https://github.com/spack/spack.git
- cd spack
- . share/spack/setup-env.sh
- spack compiler find --scope site
- mv ../../fixcompiler.py .
- cat fixcompiler.py
- EDITOR="python fixcompiler.py" spack config --scope site edit compilers
- spack install --keep-stage scr@develop%xl_r resource_manager=LSF fflags="-qextname" ^spectrum-mpi
- spack cd -i scr
- cd share/scr/examples
- export MPIF90=`which mpifort`
- export F90FLAGS="-qzerosize -qextname"
- make