-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
437 lines (400 loc) · 15.5 KB
/
.gitlab-ci.yml
File metadata and controls
437 lines (400 loc) · 15.5 KB
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
425
426
427
428
429
430
431
432
433
434
435
436
437
# -*- coding: utf-8 -*-
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
# This file is part of FLEXI, a high-order accurate framework for numerically solving PDEs with discontinuous Galerkin methods.
# For more information see https://www.flexi-project.org and https://numericsresearchgroup.org
#
# Copyright (c) 2010-2022 Prof. Claus-Dieter Munz
# Copyright (c) 2022-2025 Prof. Andrea Beck
#
# FLEXI is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
#
# FLEXI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License v3.0 for more details.
#
# You should have received a copy of the GNU General Public License along with FLEXI. If not, see <http://www.gnu.org/licenses/>.
# ==================================================================================================================================
# Continuous Integration/Continuous Deployment
# ==================================================================================================================================
spec:
inputs:
nightly:
description: "Run the nightly regression checks"
type: boolean
default: false
weekly:
description: "Run the weekly regression checks"
type: boolean
default: false
deploy:
description: "Deploy the code to GitHub"
type: boolean
default: false
---
# ----------------------------------------------------------------------------------------------------------------------------------------------------
# Settings
# ----------------------------------------------------------------------------------------------------------------------------------------------------
# Check module environment
before_script:
- ulimit -s unlimited
# - module list || true
- python3 --version
# Setup Python virtual environment
- test -f venv/bin/activate && source venv/bin/activate
# Setup CMake generator
- export CMAKE_GENERATOR="Ninja"
- export CMAKE_LINKER_TYPE="MOLD"
# ----------------------------------------------------------------------------------------------------------------------------------------------------
# Stages
# ----------------------------------------------------------------------------------------------------------------------------------------------------
stages:
- lint
- setup
- build
- checkin
- reggie_nightly
- reggie_weekly
- python
- documentation
- deploy
# ----------------------------------------------------------------------------------------------------------------------------------------------------
# Templates ("hidden jobs")
# ----------------------------------------------------------------------------------------------------------------------------------------------------
# Default parameters for the build and testing stage
.default_build_param: &default_build_param
tags: [dockertag]
# Docker image to use for the CI/CD pipeline
# image: ${CI_REGISTRY_IMAGE}/nrg-fedora:42-x86_64
image:
name: registry.iag.uni-stuttgart.de/flexi/flexi/nrg-fedora_42-x86_64
artifacts:
name: "${CI_PIPELINE_ID}-${CI_COMMIT_REF_NAME}-${CI_JOB_NAME}"
expire_in: 1 day
when: on_failure
.default_python_param: &default_python_param
<<: *default_build_param
# Deployment needs to be done on the actual server
.default_deploy_param: &default_deploy_param
tags: [flexitag]
# ----------------------------------------------------------------------------------------------------------------------------------------------------
# Default parameters for the reggie stage
.default_param: &default_param
<<: *default_build_param
allow_failure: false
.default_param_matrix: &default_param_matrix
<<: *default_build_param
allow_failure: false
image:
name: $CI_JOB_IMAGE
parallel:
matrix:
# GNU Compiler Collection (GCC)
- CI_COMPILER: gnu
CI_LINKER: MOLD
CI_JOB_IMAGE: registry.iag.uni-stuttgart.de/flexi/flexi/nrg-fedora_42-x86_64
# Low Level Virtual Machine (LLVM)
# - CI_JOB_IMAGE: registry.iag.uni-stuttgart.de/flexi/flexi/nrg-fedora_42-llvm-x86_64
# CI_COMPILER: llvm
# Intel oneAPI Compiler
- CI_COMPILER: intel
CI_LINKER: DEFAULT
CI_JOB_IMAGE: registry.iag.uni-stuttgart.de/flexi/flexi/nrg-fedora_42-intel-x86_64
.default_python: &default_python
<<: *default_python_param
allow_failure: false
.venv_cache: &venv_cache
key: "${CI_PIPELINE_ID}-venv"
paths:
- venv
policy: pull
# ----------------------------------------------------------------------------------------------------------------------------------------------------
# Defaults for the standard tests (utilizing "extends" to merge the other "artifacts" options with the specific path)
.defaults: &defaults
extends: .default_param
cache:
- *venv_cache
variables:
# The project directory will be cleaned up at the end of the build
FF_ENABLE_JOB_CLEANUP: true
# The trace force send interval for logs is dynamically adjusted based on the trace update interval
FF_USE_DYNAMIC_TRACE_FORCE_SEND_INTERVAL: true
# Fastzip is a performant archiver for cache/artifact archiving and extraction
FF_USE_FASTZIP: true
# Use fast compression for artifacts, resulting in larger archives
ARTIFACT_COMPRESSION_LEVEL: "fast"
# Use no compression for caches
CACHE_COMPRESSION_LEVEL: "fastest"
.defaults_python: &defaults_python
extends: .default_python
variables:
# The project directory will be cleaned up at the end of the build
FF_ENABLE_JOB_CLEANUP: true
# The trace force send interval for logs is dynamically adjusted based on the trace update interval
FF_USE_DYNAMIC_TRACE_FORCE_SEND_INTERVAL: true
# Fastzip is a performant archiver for cache/artifact archiving and extraction
FF_USE_FASTZIP: true
# Use fast compression for artifacts, resulting in larger archives
ARTIFACT_COMPRESSION_LEVEL: "fast"
# Use no compression for caches
CACHE_COMPRESSION_LEVEL: "fastest"
.defaults_nightly: &defaults_nightly
<<: *defaults
rules:
- if: '"$[[ inputs.nightly ]]" == "true"'
# Stage: Requires reggie artifacts
needs:
- reggie_download
script:
- reggie ./regressioncheck/checks/${CI_JOB_NAME} -j 6
.defaults_weekly: &defaults_weekly
<<: *defaults
rules:
- if: '"$[[ inputs.weekly ]]" == "true"'
# Stage: Requires reggie artifacts
needs:
- reggie_download
script:
- reggie ./regressioncheck/checks/${CI_JOB_NAME} -j 6
# ----------------------------------------------------------------------------------------------------------------------------------------------------
# Stage "lint": Run the linters
# policy: allow failure without stopping pipeline only on feature branches
# ----------------------------------------------------------------------------------------------------------------------------------------------------
fortitude:
<<: *defaults_python
stage: lint
dependencies: []
script:
- fortitude --version
- fortitude check --output-format=grouped src
rules:
# Skip running this job for merge requests targeting the default branch
- if: '$CI_MERGE_REQUEST_ID && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH'
when: never
# For feature branches, allow failure without stopping the pipeline
- if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
allow_failure: true
# For master branch, do not allow failure without stopping the pipeline
- when: always
allow_failure: false
ruff:
<<: *defaults_python
stage: lint
dependencies: []
script:
- ruff --version
- ruff check --extend-ignore=E201,E202,E203,E221,E222,E225,E231,E271,E272 --line-length=132 --preview docs tools
# ----------------------------------------------------------------------------------------------------------------------------------------------------
# Stage "setup": Setup the reggie environment
# ----------------------------------------------------------------------------------------------------------------------------------------------------
venv_create:
# Stage: Creates the venv and pushes it as artifact
extends: .default_build_param
stage: setup
# Stage: Does not require any artifacts
dependencies: []
# Stage: Artifacts are not too large yet but will be so in reggie_download
# artifacts:
# paths:
# - venv/
# when: on_success
# expire_in: 1 day
cache:
- key: "${CI_PIPELINE_ID}-venv"
paths:
- venv
policy: push
script:
- deactivate || true
- rm -rf venv
- uv venv venv
- source venv/bin/activate
- uv pip install --upgrade pip setuptools wheel
- uv pip install --upgrade pytest pytest-cov
reggie_download:
# Stage: Pulls the artifacted venv and uploads it as artifact
extends: .default_build_param
stage: setup
# Stage: Requires venv artifacts
needs:
- venv_create
# Stage: Artifacts are too large to upload
# artifacts:
# paths:
# - venv/
# when: on_success
# expire_in: 1 day
cache:
- key: "${CI_PIPELINE_ID}-venv"
paths:
- venv
policy: pull-push
script:
# Install Reggie
- uv pip install git+https://github.com/piclas-framework/reggie2.0.git
# Check Reggie
- reggie --help
# ----------------------------------------------------------------------------------------------------------------------------------------------------
# Stage "reggie_checkin": Run most simple reggie with previous builds on check-in
# ----------------------------------------------------------------------------------------------------------------------------------------------------
build:
extends: .default_param_matrix
stage: build
# artifacts:
# paths:
# - build/
# - build_intel/
# when: on_success
# expire_in: 1 day
cache:
key: "${CI_PIPELINE_ID}-${CI_COMPILER}"
paths:
- build_${CI_COMPILER}
policy: push
script:
- export CMAKE_LINKER_TYPE=${CI_LINKER}
- cmake -B build_${CI_COMPILER} -DLIBS_BUILD_HDF5=OFF
- cmake --build build_${CI_COMPILER} -j6
checkin:
extends: .default_param_matrix
stage: checkin
# Stage: Requires build artifacts
needs:
- reggie_download
- build
cache:
- *venv_cache
- key: "${CI_PIPELINE_ID}-${CI_COMPILER}"
paths:
- build
- build_intel
policy: pull
script:
- cd build_${CI_COMPILER}
- reggie ../regressioncheck/checks/run_basic/freestream_3D -j 6 -e ./bin/flexi
# ----------------------------------------------------------------------------------------------------------------------------------------------------
# Stage "reggie_nightly": Build and run
# - build all specified compile options in "run_basic" with LIBS_BUILD_HDF5=ON
# - h-p-convtests
# - parabolic testcases
# - riemann solver tests
# ----------------------------------------------------------------------------------------------------------------------------------------------------
build_all:
<<: *defaults_nightly
stage: reggie_nightly
script:
- reggie ./regressioncheck/checks/run_basic -j 6
timedisc:
<<: *defaults_nightly
stage: reggie_nightly
convtest:
<<: *defaults_nightly
stage: reggie_nightly
parabolic:
<<: *defaults_nightly
stage: reggie_nightly
riemann:
<<: *defaults_nightly
stage: reggie_nightly
# ----------------------------------------------------------------------------------------------------------------------------------------------------
# Stage "reggie_weekly": Build and run more complex tests, basically complete simulatons
# - Taylor-Green vortex
# - NACA profile
# - Advanced FV simulations
# - RANS channel
# ----------------------------------------------------------------------------------------------------------------------------------------------------
tgv:
<<: *defaults_weekly
stage: reggie_weekly
naca:
<<: *defaults_weekly
stage: reggie_weekly
fv_switch:
<<: *defaults_weekly
stage: reggie_weekly
fv_blend:
<<: *defaults_weekly
stage: reggie_weekly
channelRANS:
<<: *defaults_weekly
stage: reggie_weekly
imperator:
<<: *defaults_weekly
stage: reggie_weekly
script:
- reggie ./regressioncheck/checks/preconditioner -j 6
# ----------------------------------------------------------------------------------------------------------------------------------------------------
# Stage "documentation": Creates doxygen documentation & compiles the documentation creating the *.pdf
# ----------------------------------------------------------------------------------------------------------------------------------------------------
documentation:
extends: .default_build_param
stage: documentation
rules:
- if: '"$[[ inputs.deploy ]]" == "true"'
- if: '"$[[ inputs.weekly ]]" == "true"'
script:
- cd docs/doxygen
- ./builddoxy.sh
artifacts:
paths:
- src
- docs/doxygen
cache:
key: "${CI_COMMIT_REF_SLUG}-DOC"
paths: [docs/doxygen]
policy: push
userguide:
extends: .default_build_param
stage: documentation
image: sphinxdoc/sphinx-latexpdf:latest
rules:
- if: '"$[[ inputs.deploy ]]" == "true"'
- if: '"$[[ inputs.weekly ]]" == "true"'
script:
- cd docs/documentation
- python3 -m pip install --exists-action=w --no-cache-dir -r requirements.txt
- python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html
- ls -l _build/html
- python3 -m sphinx -b latex -D language=en -d _build/doctrees . _build/latex
- ls -l _build/latex
- cd _build/latex
- latexmk -r latexmkrc -pdf -f -dvi- -ps- -jobname=flexi -interaction=nonstopmode || true
- ls -l
- ls -l flexi.pdf
artifacts:
paths:
- docs/documentation
cache:
key: "${CI_COMMIT_REF_SLUG}-USERGUIDE"
paths: [docs/documentation]
policy: push
# ----------------------------------------------------------------------------------------------------------------------------------------------------
# Stage "deploy": Copies the doxygen documentation and userguide *.pdf to the homepage server & copies the repository to github
# ----------------------------------------------------------------------------------------------------------------------------------------------------
homepage:
extends: .default_deploy_param
stage: deploy
rules:
- if: '"$[[ inputs.deploy ]]" == "true" && $CI_SERVER_URL =~ /.*\.iag\.uni-stuttgart\.de$/'
cache:
- key: "${CI_COMMIT_REF_SLUG}-USERGUIDE"
paths: [docs/documentation]
policy: pull
variables:
FF_ENABLE_JOB_CLEANUP: 1
script:
- rsync --recursive --delete docs/documentation/_build/latex/flexi.pdf webserver:nrg.git/nrg_website/NRG/userguide/pdf/userguide.pdf
- rsync --recursive --delete docs/documentation/_build/html/* webserver:nrg.git/nrg_website/NRG/userguide/html/.
github:
extends: .default_deploy_param
stage: deploy
rules:
- if: '"$[[ inputs.deploy ]]" == "true" && $CI_SERVER_URL =~ /.*\.iag\.uni-stuttgart\.de$/'
variables:
FF_ENABLE_JOB_CLEANUP: 1
script:
- git clone --single-branch git@gitlab.iag.uni-stuttgart.de:flexi/flexi.git flexi_github
- cd flexi_github
- git push --mirror git@github.com:flexi-framework/flexi.git
# - git push --mirror git@github.com:flexi-framework/flexi-extensions.git