forked from NOAA-GFDL/MOM6
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
359 lines (317 loc) · 10.3 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
stages:
- setup
- builds
- run
- tests
- cleanup
# JOB_DIR points to a persistent working space used for most stages in this pipeline but
# that is unique to this pipeline.
# We use the "fetch" strategy to speed up the startup of stages
variables:
JOB_DIR: "/gpfs/f5/gfdl_o/scratch/oar.gfdl.mom6-account/runner/builds/$CI_PIPELINE_ID"
GIT_STRATEGY: fetch
# Always eport value of $JOB_DIR
before_script:
- echo Job directory set to $JOB_DIR
# Test that merge with dev/gfdl works.
p:merge:
stage: setup
tags:
- mom6-ci-c5
script:
- git pull --no-edit https://github.com/NOAA-GFDL/MOM6.git dev/gfdl
# Setup the persistent JOB_DIR for all subsequent stages
#
# This basically setups up a complete tree much as a user would in their workflow
p:clone:
stage: setup
tags:
- mom6-ci-c5
script:
# NOTE: We could sweep any builds older than 3 days here if needed
#- find $HOME/ci/[0-9]* -mtime +3 -delete 2> /dev/null || true
- .gitlab/pipeline-ci-tool.sh create-job-dir
#.gitlab/pipeline-ci-tool.sh clean-job-dir
# Make work spaces for running simultaneously in parallel jobs
#
# Each work space is a clone of MOM6-examples with symbolic links for the build and data directories
# so they can share executables which can run simultaneously without interfering with each other
s:work-space:pgi:
stage: setup
tags:
- mom6-ci-c5
needs: ["p:clone"]
script:
- .gitlab/pipeline-ci-tool.sh copy-test-space pgi
s:work-space:intel:
stage: setup
tags:
- mom6-ci-c5
needs: ["p:clone"]
script:
- .gitlab/pipeline-ci-tool.sh copy-test-space intel
s:work-space:gnu:
stage: setup
tags:
- mom6-ci-c5
needs: ["p:clone"]
script:
- .gitlab/pipeline-ci-tool.sh copy-test-space gnu
s:work-space:gnu-restarts:
stage: setup
tags:
- mom6-ci-c5
needs: ["p:clone"]
script:
- .gitlab/pipeline-ci-tool.sh copy-test-space gnu-rst
# Compile executables
#
# gnu:repro, gnu:debug, intel:repro and pgi:repro are used by their respective run:* jobs
# gnu:ice-only-nolib and gnu:ocean-only-nolibs are not used but simply test that the model compiles without libraries
compile:pgi:repro:
stage: builds
needs: ["p:clone"]
tags:
- mom6-ci-c5
script:
- .gitlab/pipeline-ci-tool.sh mrs-compile repro_pgi
compile:intel:repro:
stage: builds
needs: ["p:clone"]
tags:
- mom6-ci-c5
script:
- .gitlab/pipeline-ci-tool.sh mrs-compile repro_intel
compile:gnu:repro:
stage: builds
needs: ["p:clone"]
tags:
- mom6-ci-c5
script:
- .gitlab/pipeline-ci-tool.sh mrs-compile repro_gnu mrs-compile static_gnu
compile:gnu:debug:
stage: builds
needs: ["p:clone"]
tags:
- mom6-ci-c5
script:
- .gitlab/pipeline-ci-tool.sh mrs-compile debug_gnu
compile:gnu:ocean-only-nolibs:
stage: builds
needs: ["p:clone"]
tags:
- mom6-ci-c5
script:
- .gitlab/pipeline-ci-tool.sh nolibs-ocean-only-compile gnu
compile:gnu:ice-ocean-nolibs:
stage: builds
needs: ["p:clone"]
tags:
- mom6-ci-c5
script:
- .gitlab/pipeline-ci-tool.sh nolibs-ocean-ice-compile gnu
# Runs
run:pgi:
stage: run
needs: ["s:work-space:pgi","compile:pgi:repro"]
tags:
- mom6-ci-c5
script:
- sbatch --clusters=c5 --nodes=12 --time=${MOM6_RUN_JOB_DURATION:=15:00} --account=gfdl_o --qos=debug --job-name=mom6_pgi_tests --output=log.$CI_JOB_ID --wait .gitlab/pipeline-ci-tool.sh run-suite pgi SNL && ( egrep -v 'pagefaults|HiWaterMark=' log.$CI_JOB_ID ; echo Job returned normally ) || ( cat log.$CI_JOB_ID ; echo Job failed ; exit 911 )
- test -f $JOB_DIR/CI-BATCH-SUCCESS-pgi-SNL || ( echo Batch job did not complete ; exit 911 )
run:intel:
stage: run
needs: ["s:work-space:intel","compile:intel:repro"]
tags:
- mom6-ci-c5
script:
- sbatch --clusters=c5 --nodes=12 --time=${MOM6_RUN_JOB_DURATION:=15:00} --account=gfdl_o --qos=debug --job-name=mom6_intel_tests --output=log.$CI_JOB_ID --wait .gitlab/pipeline-ci-tool.sh run-suite intel SNL && ( egrep -v 'pagefaults|HiWaterMark=' log.$CI_JOB_ID ; echo Job returned normally ) || ( cat log.$CI_JOB_ID ; echo Job failed ; exit 911 )
- test -f $JOB_DIR/CI-BATCH-SUCCESS-intel-SNL || ( echo Batch job did not complete ; exit 911 )
run:gnu:
stage: run
needs: ["s:work-space:gnu","compile:gnu:repro","compile:gnu:debug"]
tags:
- mom6-ci-c5
script:
- sbatch --clusters=c5 --nodes=12 --time=${MOM6_RUN_JOB_DURATION:=15:00} --account=gfdl_o --qos=debug --job-name=mom6_gnu_tests --output=log.$CI_JOB_ID --wait .gitlab/pipeline-ci-tool.sh run-suite gnu SNLDT && ( egrep -v 'pagefaults|HiWaterMark=' log.$CI_JOB_ID ; echo Job returned normally ) || ( cat log.$CI_JOB_ID ; echo Job failed ; exit 911 )
- test -f $JOB_DIR/CI-BATCH-SUCCESS-gnu-SNLDT || ( echo Batch job did not complete ; exit 911 )
run:gnu-restarts:
stage: run
needs: ["s:work-space:gnu-restarts","compile:gnu:repro"]
tags:
- mom6-ci-c5
script:
- sbatch --clusters=c5 --nodes=12 --time=${MOM6_RUN_JOB_DURATION:=15:00} --account=gfdl_o --qos=debug --job-name=mom6_gnu_restarts --output=log.$CI_JOB_ID --wait .gitlab/pipeline-ci-tool.sh run-suite gnu R && ( egrep -v 'pagefaults|HiWaterMark=' log.$CI_JOB_ID ; echo Job returned normally ) || ( cat log.$CI_JOB_ID ; echo Job failed ; exit 911 )
- test -f $JOB_DIR/CI-BATCH-SUCCESS-gnu-R || ( echo Batch job did not complete ; exit 911 )
# GH/autoconf tests (duplicates the GH actions tests)
#
# These stages replace the "before_script" and so start in the transient work-space provided by gitlab.
# We work here to avoid collisions with parallel jobs
actions:gnu:
stage: tests
needs: []
tags:
- mom6-ci-c5
before_script:
- echo -e "\e[0Ksection_start:`date +%s`:submodules[collapsed=true]\r\e[0KCloning submodules"
- git submodule init ; git submodule update
- echo -e "\e[0Ksection_end:`date +%s`:submodules\r\e[0K"
script:
- echo -e "\e[0Ksection_start:`date +%s`:compile[collapsed=true]\r\e[0KCompiling executables"
- cd .testing
- module unload darshan-runtime intel PrgEnv-intel ; module load PrgEnv-gnu/8.5.0 cray-hdf5 cray-netcdf ; module switch gcc-native/12.3
- FC=ftn MPIFC=ftn CC=cc make -s -j
- MPIRUN= FC=ftn MPIFC=ftn CC=cc make preproc -s -j
- echo -e "\e[0Ksection_end:`date +%s`:compile\r\e[0K"
- (echo '#!/bin/bash';echo 'make MPIRUN="srun -mblock --exclusive" test -s -j') > job.sh
- sbatch --clusters=c5 --nodes=2 --time=0:10:00 --account=gfdl_o --qos=debug --job-name=MOM6.gnu.testing --output=log.$CI_JOB_ID --wait job.sh || ( cat log.$CI_JOB_ID ; exit 911 ) && make test -s
- make test.summary
actions:intel:
stage: tests
needs: []
tags:
- mom6-ci-c5
before_script:
- echo -e "\e[0Ksection_start:`date +%s`:submodules[collapsed=true]\r\e[0KCloning submodules"
- git submodule init ; git submodule update
- echo -e "\e[0Ksection_end:`date +%s`:submodules\r\e[0K"
script:
- echo -e "\e[0Ksection_start:`date +%s`:compile[collapsed=true]\r\e[0KCompiling executables"
- cd .testing
- module unload darshan-runtime ; module unload intel cray-libsci cray-mpich PrgEnv-intel ; module load PrgEnv-intel intel/2023.2.0 cray-hdf5 cray-netcdf cray-mpich
- FC=ftn MPIFC=ftn CC=cc make -s -j
- MPIRUN= FC=ftn MPIFC=ftn CC=cc make preproc -s -j
- echo -e "\e[0Ksection_end:`date +%s`:compile\r\e[0K"
- (echo '#!/bin/bash';echo 'make MPIRUN="srun -mblock --exclusive" test -s -j') > job.sh
- sbatch --clusters=c5 --nodes=2 --time=0:10:00 --account=gfdl_o --qos=debug --job-name=MOM6.intel.testing --output=log.$CI_JOB_ID --wait job.sh || ( cat log.$CI_JOB_ID ; exit 911 ) && make test -s
- make test.summary
# Tests
#
# stats file tests involve comparing the check sums of the generated files against the check sums in the stats-repo
# log file tests involve comparing the check sums of the generated files against the check sums in MOM6-examples
t:pgi:symmetric:
stage: tests
needs: ["run:pgi"]
tags:
- mom6-ci-c5
script:
- .gitlab/pipeline-ci-tool.sh check-stats pgi S
t:pgi:non-symmetric:
stage: tests
needs: ["run:pgi"]
tags:
- mom6-ci-c5
script:
- .gitlab/pipeline-ci-tool.sh check-stats pgi N
t:pgi:layout:
stage: tests
needs: ["run:pgi"]
tags:
- mom6-ci-c5
script:
- .gitlab/pipeline-ci-tool.sh check-stats pgi L
t:pgi:params:
stage: tests
needs: ["run:pgi"]
tags:
- mom6-ci-c5
script:
- .gitlab/pipeline-ci-tool.sh check-params pgi
allow_failure: true
t:intel:symmetric:
stage: tests
needs: ["run:intel"]
tags:
- mom6-ci-c5
script:
- .gitlab/pipeline-ci-tool.sh check-stats intel S
t:intel:non-symmetric:
stage: tests
needs: ["run:intel"]
tags:
- mom6-ci-c5
script:
- .gitlab/pipeline-ci-tool.sh check-stats intel N
t:intel:layout:
stage: tests
needs: ["run:intel"]
tags:
- mom6-ci-c5
script:
- .gitlab/pipeline-ci-tool.sh check-stats intel L
t:intel:params:
stage: tests
needs: ["run:intel"]
tags:
- mom6-ci-c5
script:
- .gitlab/pipeline-ci-tool.sh check-params intel
allow_failure: true
t:gnu:symmetric:
stage: tests
needs: ["run:gnu"]
tags:
- mom6-ci-c5
script:
- .gitlab/pipeline-ci-tool.sh check-stats gnu S
t:gnu:non-symmetric:
stage: tests
needs: ["run:gnu"]
tags:
- mom6-ci-c5
script:
- .gitlab/pipeline-ci-tool.sh check-stats gnu N
t:gnu:layout:
stage: tests
needs: ["run:gnu"]
tags:
- mom6-ci-c5
script:
- .gitlab/pipeline-ci-tool.sh check-stats gnu L
t:gnu:static:
stage: tests
needs: ["run:gnu"]
tags:
- mom6-ci-c5
script:
- .gitlab/pipeline-ci-tool.sh check-stats gnu T
t:gnu:symmetric-debug:
stage: tests
needs: ["run:gnu"]
tags:
- mom6-ci-c5
script:
- .gitlab/pipeline-ci-tool.sh check-stats gnu D
t:gnu:restart:
stage: tests
needs: ["run:gnu-restarts"]
tags:
- mom6-ci-c5
script:
- .gitlab/pipeline-ci-tool.sh check-stats gnu R
t:gnu:params:
stage: tests
needs: ["run:gnu"]
tags:
- mom6-ci-c5
script:
- .gitlab/pipeline-ci-tool.sh check-params gnu
allow_failure: true
t:gnu:diags:
stage: tests
needs: ["run:gnu"]
tags:
- mom6-ci-c5
script:
- .gitlab/pipeline-ci-tool.sh check-diags gnu
allow_failure: true
# We cleanup ONLY if the preceding stages were completed successfully
cleanup:
stage: cleanup
tags:
- mom6-ci-c5
before_script:
- echo Skipping usual preamble
script:
- rm -rf $HOME/ci/$CI_PIPELINE_ID
- rm -rf $JOB_DIR