-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
327 lines (302 loc) · 12.4 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
# Prevent duplicated pipeline by removing MR pipelines
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
- when: always
variables:
GIT_STRATEGY: none # don't do anything by default
#Common to all stages
default:
tags:
- juno-shell
id_tokens:
CI_JOB_JWT:
aud: https://gitlab.onera.net
stages:
- init
- build
- test
- deploy
job:init:
stage: init
script: # explicitly load modules one by one, so that if one fails, it will be easy to identify
- INIT_ORIGINAL_FOLDER=$(pwd)
- cd ~/.jacamar-ci/builds
- mkdir -p ${CI_PROJECT_NAME}
- cd ${CI_PROJECT_NAME}
#- git clone --depth 10 ${CI_REPOSITORY_URL} ${CI_PIPELINE_ID}
- git clone ${CI_REPOSITORY_URL} ${CI_PIPELINE_ID}
- cd ${CI_PIPELINE_ID}
- git checkout ${CI_COMMIT_SHA}
- echo "CUSTOM_CI_DIR=$PWD" >> ${INIT_ORIGINAL_FOLDER}/build.env
- git submodule update --init external/project_utils
- git submodule update --init external/cpp_cgns
- git submodule update --init external/std_e
- git submodule update --init external/pytest_parallel
- git submodule update --init external/paradigm
- (cd external/paradigm && git submodule update --init extensions/paradigma)
artifacts:
reports:
dotenv: build.env
job:build:
stage: build
script:
- cd $CUSTOM_CI_DIR
- mkdir -p build && cd build
- module purge || true # sometimes, some system-related modules can't be unloaded -- proceed anyways
- module load socle-cfd/6.0-intel2220-impi gcc/10.2.0
- cmake -DCMAKE_BUILD_TYPE=Debug -Dmaia_ENABLE_TESTS=ON -Dmaia_ENABLE_COVERAGE=ON -DPDM_ENABLE_LONG_G_NUM=OFF -DPDM_ENABLE_EXTENSION_PDMA=ON ../
- make -j 24
# This build documentation after main build, only if branch is dev or for MR events
job:doc:
stage: build
needs: ["job:init", "job:build"] #job:init is needed to get dotenv artifacts
rules:
- if: $CI_OPEN_MERGE_REQUESTS || $CI_COMMIT_BRANCH == "dev"
script:
- cd $CUSTOM_CI_DIR/build
- module purge || true # sometimes, some system-related modules can't be unloaded -- proceed anyways
- module load socle-cfd/6.0-intel2220-impi gcc/10.2.0
- source source.sh
- export PYTHONPATH=/tmp_user/juno/sonics/dist/socle_cfd6/python_packages/lib/python3.8/site-packages:$PYTHONPATH
- cmake -Dmaia_ENABLE_DOCUMENTATION=ON .
- make maia_sphinx
#todo : display reports on browser eg with gitlab pages
job:ctest:
stage: test
before_script:
- |
cat > $CUSTOM_CI_DIR/build/.coveragerc << EOF
[coverage:run]
parallel = true
source = maia
EOF
script:
- INIT_ORIGINAL_FOLDER=$(pwd)
- rm -rf $INIT_ORIGINAL_FOLDER/reports # Cleanup old builds reports if existing
- cd $CUSTOM_CI_DIR/build
- module purge || true # sometimes, some system-related modules can't be unloaded -- proceed anyways
- module load socle-cfd/6.0-intel2220-impi gcc/10.2.0
- export PATH=$FEFLOPATH:$PATH
- source source.sh
- mpirun -np 4 test/maia_doctest_unit_tests
- mpirun -np 4 coverage run -m pytest ../maia
- mpirun -np 8 python3 -m pytest ../test --scheduler=dynamic
- coverage combine
- coverage report
- coverage xml -o coverage_unit_tests.xml
- sed 's@'"$CI_PROJECT_DIR"'/@@' -i coverage_unit_tests.xml
# GitLab needs artifacts to be in the folder of the job so move it
- mv ./coverage_unit_tests.xml $INIT_ORIGINAL_FOLDER && mv ./reports $INIT_ORIGINAL_FOLDER
when: on_success # s'exécutera uniquement si le job `job:build` passe
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
paths:
- ./reports/*
when: always
# Next allows to display a test tab in the pipeline with report but requires a feature flag to be enabled,
# see https://docs.gitlab.com/ee/ci/unit_test_reports.html#viewing-unit-test-reports-on-gitlab
# Use it in combination with --junitxml=reports/pytest-junit.xml in the pytest launcher (TestCreate.cmake)
reports:
junit: ./reports/*_test.xml
coverage_report:
coverage_format: cobertura
path: ./coverage_unit_tests.xml
job:doc_snippets:
stage: test
script:
- cd $CUSTOM_CI_DIR/build
- module purge || true # sometimes, some system-related modules can't be unloaded -- proceed anyways
- module load socle-cfd/6.0-intel2220-impi gcc/10.2.0
- source source.sh; unset PYTEST_PLUGINS
- mpirun -np 1 python3 -m pytest ../doc
job:portability_gnum:
stage: test
rules:
- if: $CI_OPEN_MERGE_REQUESTS || $CI_COMMIT_BRANCH == "dev"
script:
- cd $CUSTOM_CI_DIR
- module purge || true # sometimes, some system-related modules can't be unloaded -- proceed anyways
- module load socle-cfd/6.0-intel2220-impi gcc/10.2.0
- mkdir -p build_int64 && cd build_int64
- cmake -DCMAKE_BUILD_TYPE=Debug -DPDM_ENABLE_LONG_G_NUM=ON -DPDM_ENABLE_EXTENSION_PDMA=ON ../
- make -j 24
- source source.sh
- mpirun -np 4 test/maia_doctest_unit_tests
- mpirun -np 4 python3 -m pytest ../maia/
- mpirun -np 8 python3 -m pytest ../test --scheduler=dynamic
job:portability_cfd6:
stage: test
rules:
- if: $CI_OPEN_MERGE_REQUESTS || $CI_COMMIT_BRANCH == "dev"
script:
- cd $CUSTOM_CI_DIR
- module purge || true # sometimes, some system-related modules can't be unloaded -- proceed anyways
- module load socle-cfd/6.0-intel2220-impi
- mkdir -p build_cfd6 && cd build_cfd6
- cmake ../ -DCMAKE_BUILD_TYPE=Debug
-DCMAKE_CXX_COMPILER=/usr/bin/g++ -DCMAKE_CXX_STANDARD=17
-DCMAKE_EXE_LINKER_FLAGS='-lz -lbz2' -DCMAKE_SHARED_LINKER_FLAGS='-lz -lbz2'
-DPDM_ENABLE_LONG_G_NUM=OFF -DPDM_ENABLE_EXTENSION_PDMA=ON
- make -j 24
- source $ELSASPIRO/.env_elsA
- source source.sh
- mpirun -np 4 python3 -m pytest ../maia/
job:portability_openmpi:
stage: test
rules:
- if: $CI_OPEN_MERGE_REQUESTS || $CI_COMMIT_BRANCH == "dev"
script:
- cd $CUSTOM_CI_DIR
- source /tmp_user/juno/sonics/dist/socle_cfd7/source.sh
- mkdir -p build_cfd7 && cd build_cfd7
- cmake -DCMAKE_BUILD_TYPE=Debug -DPDM_ENABLE_LONG_G_NUM=OFF -DPDM_ENABLE_EXTENSION_PDMA=ON ../
- make -j 24
- source source.sh
- mpiexec -np 4 test/maia_doctest_unit_tests
- mpiexec -np 4 pytest ../maia/
- mpiexec -np 4 pytest ../test/
job:portability_llvm:
stage: test
rules:
- if: $CI_OPEN_MERGE_REQUESTS || $CI_COMMIT_BRANCH == "dev"
script:
- cd $CUSTOM_CI_DIR
- module purge || true # sometimes, some system-related modules can't be unloaded -- proceed anyways
- module load socle-cfd/6.0-intel2220-impi
- export CC=icx; export CXX=icpx
- mkdir -p build_llvm && cd build_llvm
- cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_STANDARD=17 -DPDM_ENABLE_LONG_G_NUM=OFF -DPDM_ENABLE_EXTENSION_PDMA=ON ../
- make -j 24
- source source.sh
- mpirun -np 4 test/maia_doctest_unit_tests
- mpirun -np 4 python3 -m pytest ../maia/
- mpirun -np 8 python3 -m pytest ../test --scheduler=dynamic
job:portability_optim:
stage: test
rules:
- if: $CI_OPEN_MERGE_REQUESTS || $CI_COMMIT_BRANCH == "dev"
script:
- cd $CUSTOM_CI_DIR
- module purge || true # sometimes, some system-related modules can't be unloaded -- proceed anyways
- module load socle-cfd/6.0-intel2220-impi gcc/10.2.0
- mkdir -p build_cfd6_optim && cd build_cfd6_optim
- export CFLAGS="-O3 -g -DNDEBUG -ftree-vectorize -ftree-loop-vectorize -fvect-cost-model=unlimited -ftree-loop-optimize -march=native -fopenmp-simd -mtune=intel -mprefer-vector-width=512"
- export CXXFLAGS=$CFLAGS
- cmake -DCMAKE_BUILD_TYPE=Release -Dmaia_ENABLE_TESTS=ON -DPDM_ENABLE_LONG_G_NUM=OFF -DPDM_ENABLE_EXTENSION_PDMA=ON ../
- make -j 24
- source source.sh
- mpirun -np 4 test/maia_doctest_unit_tests
- mpirun -np 4 python3 -m pytest ../maia/
- mpirun -np 8 python3 -m pytest ../test --scheduler=dynamic -k "not test_wall_distance_U"
# Deploy the documentation sphinx documentation to the site and pages, only if branch is dev
pages:
stage: deploy
rules:
- if: $CI_COMMIT_BRANCH == "dev"
script:
- rm -rf public
- mkdir public
- cp -r /tmp_user/juno/sonics/usr/maia/doc/html/* public/
- cp -r $CUSTOM_CI_DIR/build/doc/sphinx/html public/dev
- |
cat > public/index.html << EOF
<head>
<meta http-equiv='refresh' content='0; URL=dev/index.html'>
</head>
EOF
artifacts:
paths:
- public
init_deploy:
stage: deploy
rules:
- if: $CI_COMMIT_BRANCH == "dev"
variables:
GIT_STRATEGY: clone
before_script:
- git submodule update --init
- (cd external/paradigm && git submodule update --init)
script:
- rsync -a . sonics@spiro02:/scratchm/sonics/tmp/maia-ci-${CI_PIPELINE_ID}
- rsync -a . sonics@sator:/tmp_user/sator/sonics/tmp/maia-ci-${CI_PIPELINE_ID}
- rsync -a . sonics@juno1:/tmp_user/juno/sonics/tmp/maia-ci-${CI_PIPELINE_ID}
- rsync -a --delete . sonics@spiro02:/stck/sonics/tmp/maia-ci-dev #This one is for LD8
deploy_spiro_socle6:
stage: deploy
needs: ["init_deploy"]
rules:
- if: $CI_COMMIT_BRANCH == "dev"
before_script:
- |
cat > build_spiro6.sh << EOF
module purge || true # sometimes, some system-related modules can't be unloaded -- proceed anyways
module load socle-cfd/6.0-intel2220-impi cmake/3.23.2
export https_proxy=http://proxy.onera:80
cmake ../ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/scratchm/sonics/usr/maia/dev/dsi-cfd6 \
-DCMAKE_CXX_COMPILER=/usr/bin/g++ -DCMAKE_CXX_STANDARD=17 \
-DCMAKE_EXE_LINKER_FLAGS='-lz -lbz2' -DCMAKE_SHARED_LINKER_FLAGS='-lz -lbz2' \
-DPDM_ENABLE_LONG_G_NUM=OFF -DPDM_ENABLE_EXTENSION_PDMA=ON
make -j install > dsi-cfd6.log
EOF
script:
- export JOB_BUILD_DIR=/scratchm/sonics/tmp/maia-ci-${CI_PIPELINE_ID}/build-${CI_JOB_ID}/
- echo "Build directory is ${JOB_BUILD_DIR}"
- rsync build_spiro6.sh sonics@spiro02:${JOB_BUILD_DIR}
- ssh sonics@spiro01 "cd $JOB_BUILD_DIR; source /etc/profile; sh ./build_spiro6.sh"
deploy_sator_socle6:
stage: deploy
needs: ["init_deploy"]
rules:
- if: $CI_COMMIT_BRANCH == "dev"
before_script:
- |
cat > build_sator6.sh << EOF
module purge || true # sometimes, some system-related modules can't be unloaded -- proceed anyways
module load socle-cfd/6.0-intel2220-impi cmake/3.23.2
export https_proxy=http://proxy.onera:80
cmake ../ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/tmp_user/sator/sonics/usr/maia/dev/dsi-cfd6 \
-DCMAKE_CXX_COMPILER=/usr/bin/g++ -DCMAKE_CXX_STANDARD=17 \
-DPDM_ENABLE_LONG_G_NUM=ON -DPDM_ENABLE_EXTENSION_PDMA=ON
make -j install > dsi-cfd6.log
EOF
script:
- export JOB_BUILD_DIR=/tmp_user/sator/sonics/tmp/maia-ci-${CI_PIPELINE_ID}/build-${CI_JOB_ID}/
- echo "Build directory is ${JOB_BUILD_DIR}"
- rsync build_sator6.sh sonics@sator:${JOB_BUILD_DIR}
- ssh sonics@sator "cd $JOB_BUILD_DIR; source /etc/profile; sh ./build_sator6.sh"
deploy_juno_socle6:
stage: deploy
needs: ["init_deploy"]
rules:
- if: $CI_COMMIT_BRANCH == "dev"
before_script:
- |
cat > build_juno6.sh << EOF
module purge || true # sometimes, some system-related modules can't be unloaded -- proceed anyways
module load socle-cfd/6.0-intel2220-impi cmake/3.23.2
export https_proxy=http://proxy.onera:80
cmake ../ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/tmp_user/juno/sonics/usr/maia/dev/dsi-cfd6 \
-DCMAKE_CXX_COMPILER=/usr/bin/g++ -DCMAKE_CXX_STANDARD=17 \
-DPDM_ENABLE_LONG_G_NUM=OFF -DPDM_ENABLE_EXTENSION_PDMA=ON
make -j install > dsi-cfd6.log
EOF
script:
- export JOB_BUILD_DIR=/tmp_user/juno/sonics/tmp/maia-ci-${CI_PIPELINE_ID}/build-${CI_JOB_ID}/
- echo "Build directory is ${JOB_BUILD_DIR}"
- rsync build_juno6.sh sonics@juno1:${JOB_BUILD_DIR}
- ssh sonics@juno1 "cd $JOB_BUILD_DIR; source /etc/profile; sh ./build_juno6.sh"
post_deploy:
stage: deploy
needs: ["deploy_spiro_socle6", "deploy_sator_socle6", "deploy_juno_socle6"]
rules:
- if: $CI_COMMIT_BRANCH == "dev"
before_script:
script:
- ssh sonics@spiro02 "rm -rf /scratchm/sonics/tmp/maia-ci-${CI_PIPELINE_ID}"
- ssh sonics@sator "rm -rf /tmp_user/sator/sonics/tmp/maia-ci-${CI_PIPELINE_ID}"
- ssh sonics@juno1 "rm -rf /tmp_user/juno/sonics/tmp/maia-ci-${CI_PIPELINE_ID}"