-
Notifications
You must be signed in to change notification settings - Fork 85
/
.gitlab-ci.yml
209 lines (188 loc) · 7.23 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
variables:
PROJECT_ALLOC_NAME: ${CI_PROJECT_NAME}_ci_${CI_PIPELINE_ID}
BUILD_ROOT: ${CI_PROJECT_DIR}
# Should make it so we aren't doing fresh clones of GEOS all the time
GIT_STRATEGY: fetch
# Manually update submodules
GIT_SUBMODULE_STRATEGY: none
stages:
- build
- nightly
####
# Template
.build_script:
script:
# Change submodule paths to absolute github paths (default is relative to GEOS gitlab path)
- git submodule set-url src/coreComponents/LvArray https://github.com/GEOS-DEV/LvArray.git
- git submodule set-url src/cmake/blt https://github.com/LLNL/blt.git
- git submodule set-url src/coreComponents/constitutive/PVTPackage https://github.com/GEOS-DEV/PVTPackage.git
- git submodule set-url integratedTests git@github.com:GEOS-DEV/integratedTests.git
- git submodule set-url src/coreComponents/fileIO/coupling/hdf5_interface https://github.com/GEOS-DEV/hdf5_interface.git
# Clean up directory and submodules when pre-initialized from previous CI run
- git clean -x -f -d
- git submodule foreach --recursive git clean -x -f -d
# Update submodules
- git submodule update --init --recursive src/cmake/blt
- git submodule update --init --recursive src/coreComponents/LvArray
- git submodule update --init --recursive src/coreComponents/constitutive/PVTPackage
- git submodule update --init --recursive integratedTests
- git submodule update --init --recursive src/coreComponents/fileIO/coupling/hdf5_interface
- mkdir ${SYSTEM_COMPILER}
# newer geosxats needs python3 to run
- module load python/3
# GEOS requires CMake >=3.23
- module load cmake/3.23.1
# CONFIGURE
- echo "~~~~~~~~~~ START - configure ~~~~~~~~~~~"
- config_code=0
- python scripts/config-build.py -hc host-configs/LLNL/${HOST_CONFIG} -bt Release -bp build -DENABLE_DOXYGEN=OFF 2>&1 | tee ${SYSTEM_COMPILER}/${SYSTEM_COMPILER}_configure.log || config_code=$?
- mv ${SYSTEM_COMPILER}/${SYSTEM_COMPILER}_configure.log ${SYSTEM_COMPILER}/${SYSTEM_COMPILER}_configure_$([ $config_code == 0 ] && echo "SUCCESS" || echo "FAILURE").log
- echo "~~~~~~~~~~ END - configure ~~~~~~~~~~~~~"
# BUILD
- echo "~~~~~~~~~~ START - build ~~~~~~~~~~~"
- build_code=0
- ${ALLOC_COMMAND} make VERBOSE=1 -C build -j ${NPROC:-16} 2>&1 | tee ${SYSTEM_COMPILER}/${SYSTEM_COMPILER}_build.log || build_code=$?
- mv ${SYSTEM_COMPILER}/${SYSTEM_COMPILER}_build.log ${SYSTEM_COMPILER}/${SYSTEM_COMPILER}_build_$([ $build_code == 0 ] && echo "SUCCESS" || echo "FAILURE").log
- echo "~~~~~~~~~~ END - build ~~~~~~~~~~~~~"
# UNIT TEST
- echo "~~~~~~~~~~ START - unit tests ~~~~~~~~~~~"
- unit_code=0
- cd build
- ${ALLOC_COMMAND} ctest --output-on-failure 2>&1 | tee ../${SYSTEM_COMPILER}/${SYSTEM_COMPILER}_unit_test.log || unit_code=$?
- cd ..
- mv ${SYSTEM_COMPILER}/${SYSTEM_COMPILER}_unit_test.log ${SYSTEM_COMPILER}/${SYSTEM_COMPILER}_unit_test_$([ $unit_code == 0 ] && echo "SUCCESS" || echo "FAILURE").log
- echo "~~~~~~~~~~ END - unit tests ~~~~~~~~~~~~~"
# INTEGRATED TEST
- echo "~~~~~~~~~~ START - integrated tests ~~~~~~~~~~~"
- cd build
- make ats_clean
- make ats_environment
# Hard code integrated test failure status until optional fail flag fixed
- integrated_code=1
- ${INTEGRATED_ALLOC_COMMAND} ./integratedTests/geos_ats.sh --failIfTestsFail 2>&1 | tee ../${SYSTEM_COMPILER}/${SYSTEM_COMPILER}_integrated_test.log || integrated_code=1
#- ${INTEGRATED_ALLOC_COMMAND} ./integratedTests/geos_ats.sh --failIfTestsFail 2>&1 | tee ../${SYSTEM_COMPILER}/${SYSTEM_COMPILER}_integrated_test.log || integrated_code=$?
- cd ..
- mv ${SYSTEM_COMPILER}/${SYSTEM_COMPILER}_integrated_test.log ${SYSTEM_COMPILER}/${SYSTEM_COMPILER}_integrated_test_$([ $integrated_code == 0 ] && echo "SUCCESS" || echo "FAILURE").log
- cp -rL build/integratedTests/TestResults ${SYSTEM_COMPILER}/
- echo "~~~~~~~~~~ END - integrated tests ~~~~~~~~~~~~~"
# CLEANUP + PRINT SUCCESS/FAILURES
- echo "~~~~~~~~~~ START - cleanup ~~~~~~~~~~~"
- cd build
- make ats_clean
- cd ..
- rm -rf build
- if [[ $config_code -ne 0 ]]; then echo "Configuration failed"; else echo "Configuration succeeded"; fi
- if [[ $build_code -ne 0 ]]; then echo "Build failed"; else echo "Build succeeded"; fi
- if [[ $unit_code -ne 0 ]]; then echo "Unit tests failed"; else echo "Unit tests succeeded"; fi
- if [[ $integrated_code -ne 0 ]]; then echo "Integrated tests failed"; else echo "Integrated tests succeeded"; fi
- exit_val=$(( 0 | $config_code | $build_code | $unit_code | $integrated_code ))
- exit $exit_val
- echo "~~~~~~~~~~ END - cleanup ~~~~~~~~~~~~~"
# Job only triggers for scheduled pipelines and through web interface
only:
refs:
- schedules
- web
# Output a folder of logs files; these are automatically inherited by nightly-job
artifacts:
when: always
paths:
- quartz*/
- lassen*/
- tioga*/
# Allow job to always fail, so nightly-job in next stage will run
allow_failure: true
####
# quartz template
.build_on_quartz:
stage: build
variables:
ALLOC_COMMAND: "salloc -N1 -ppdebug"
INTEGRATED_ALLOC_COMMAND: "salloc -N1 -n 36 -ppdebug"
tags:
- shell
- quartz
extends: [.build_script]
####
# tioga template
.build_on_tioga:
stage: build
variables:
ALLOC_COMMAND: "salloc -N1 -ppdebug"
INTEGRATED_ALLOC_COMMAND: "salloc -N 10 -p pbatch"
before_script:
- module load rocm/5.4.3
- module load cce/15.0.0
- module load cmake/3.23.1
tags:
- shell
- tioga
extends: [.build_script]
####
# lassen template
.build_on_lassen:
stage: build
variables:
ALLOC_COMMAND: "lalloc 1"
INTEGRATED_ALLOC_COMMAND: "lalloc 10"
tags:
- shell
- lassen
extends: [.build_script]
####
# quartz jobs
quartz_clang_14_build:
variables:
HOST_CONFIG: "quartz-clang-14.cmake"
SYSTEM_COMPILER: "quartz-clang-14"
extends: [.build_on_quartz]
quartz_gcc_12_build:
variables:
HOST_CONFIG: "quartz-gcc-12.cmake"
SYSTEM_COMPILER: "quartz-gcc-12"
extends: [.build_on_quartz]
####
# tioga job
tioga_cce_15_build:
variables:
HOST_CONFIG: "tioga-cce-15.cmake"
SYSTEM_COMPILER: "tioga-cce-15"
extends: [.build_on_tioga]
####
# lassen jobs
lassen_clang_10_cuda_11_build:
variables:
HOST_CONFIG: "lassen-clang-10-cuda-11.cmake"
SYSTEM_COMPILER: "lassen-clang-10-cuda-11"
extends: [.build_on_lassen]
lassen_gcc_8_cuda_11_build:
variables:
HOST_CONFIG: "lassen-gcc-8-cuda-11.cmake"
SYSTEM_COMPILER: "lassen-gcc-8-cuda-11"
extends: [.build_on_lassen]
####
# Pull nightlyTests repo and update files
# Note: Arguments to update.sh need to be kept updated with build jobs
nightly-job:
stage: nightly
script:
- |
echo "~~~~~~~~~~ START - write to nightlyTests Repo ~~~~~~~~~~~~~"
git clone git@github.com:GEOS-DEV/nightlyTests.git
cd nightlyTests
./update.sh \
quartz-clang-14 \
quartz-gcc-12 \
lassen-clang-10-cuda-11 \
lassen-gcc-8-cuda-11 \
tioga-cce-15
echo "~~~~~~~~~~ END - write to nightlyTests Repo ~~~~~~~~~~~~~"
only:
refs:
- schedules
- web
variables:
- $NIGHTLY_TEST_ENABLED
tags:
- shell
- quartz