-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
477 lines (398 loc) · 14.4 KB
/
.gitlab-ci.yml
File metadata and controls
477 lines (398 loc) · 14.4 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
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
---
stages:
- check_source
- processing
- core
- update_repositories
- documentation
####################################################################################################
variables:
# GitLab Settings
GIT_SUBMODULE_STRATEGY: normal
# Shortcut names
MARC_VERSION: '2025.1'
PETSC_GCC_LATEST: '2026.04.03'
PETSC_ONEAPI_LATEST: '2026.04.03'
PETSC_LLVM_LATEST: '2026.04.04'
PYTHON_LATEST: '2026.02.24'
####################################################################################################
# https://docs.gitlab.com/ci/yaml/workflow
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_BRANCH
auto_cancel:
on_job_failure: all
####################################################################################################
# reusable building blocks for common tasks
.on_merge:
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
.on_merge_without_squash:
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_SQUASH_ON_MERGE != 'true'
.registry:
image: git.damask-multiphysics.org:5050/damask/damask/${IMAGE}
####################################################################################################
# images
.petsc_gcc_default:
extends: .registry
variables:
IMAGE: gcc_petsc-default:${PETSC_GCC_LATEST}
.petsc_gcc_debug:
extends: .registry
variables:
IMAGE: gcc_petsc-debug:${PETSC_GCC_LATEST}
.petsc_gcc_debug_previous:
extends: .registry
parallel:
matrix:
- IMAGE:
- gcc_petsc-debug:2025.11.13
- gcc_petsc-debug:2025.05.27a
- gcc_petsc-debug:2025.03.10a
.petsc_oneapi_default:
extends: .registry
variables:
IMAGE: oneapi_petsc-default:${PETSC_ONEAPI_LATEST}
.petsc_oneapi_debug:
extends: .registry
variables:
IMAGE: oneapi_petsc-debug:${PETSC_ONEAPI_LATEST}
.petsc_oneapi_performance:
extends: .registry
variables:
IMAGE: oneapi_petsc-default:2025.09.30
.petsc_oneapi_debug_previous:
extends: .registry
parallel:
matrix:
- IMAGE:
- oneapi_petsc-debug:2025.11.13
- oneapi_petsc-debug:2025.06.12a
- oneapi_petsc-debug:2025.03.27a
.petsc_llvm_debug:
extends: .registry
variables:
IMAGE: llvm_petsc-default:${PETSC_LLVM_LATEST} # only one image at the moment
.petsc:
extends: .registry
parallel:
matrix:
- IMAGE:
- gcc_petsc-default:${PETSC_GCC_LATEST}
- gcc_petsc-i64:${PETSC_GCC_LATEST}
- oneapi_petsc-default:${PETSC_ONEAPI_LATEST}
.petsc_previous:
extends: .registry
parallel:
matrix:
- IMAGE:
- gcc_petsc-default:2025.11.13
- gcc_petsc-i64:2025.11.13
- oneapi_petsc-default:2025.11.13
- gcc_petsc-default:2025.05.27a
- gcc_petsc-i64:2025.05.27a
- oneapi_petsc-default:2025.06.12a
- gcc_petsc-default:2025.03.10a
- gcc_petsc-i64:2025.03.10a
- oneapi_petsc-default:2025.03.27a
.python:
extends: .registry
variables:
IMAGE: python:${PYTHON_LATEST}
.python_previous:
extends: .registry
parallel:
matrix:
- IMAGE:
- python:2025.06.05
- python:2025.01.05
- python:310_2412
####################################################################################################
# Check Source: compile (core) or import (processing) of each commit in a merge request w/o squash
####################################################################################################
.check_source:
extends: .on_merge_without_squash
stage: check_source
variables:
GIT_DEPTH: 0
allow_failure: true
core:
extends: [.check_source, .petsc]
script:
- |
COMMITS=$(git log --reverse --format=format:%H origin/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}..${CI_COMMIT_SHA}~)
for COMMIT in ${COMMITS};do
printf "%b" "\e[1;32m::\nchecking commit ${COMMIT}\n::\e[0m\n"
git checkout ${COMMIT}
git submodule update --init
rm -rf build
cmake -DGRID=ON -DMESH=ON -B build && cmake --build build --parallel 4 --target install
done
processing:
extends: [.check_source, .petsc_gcc_default]
script:
- |
source env/DAMASK.sh
COMMITS=$(git log --reverse --format=format:%H origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME..$CI_COMMIT_SHA)
for COMMIT in ${COMMITS};do
printf "%b" "\e[1;32m::\nchecking commit ${COMMIT}\n::.\e[0m\n"
git checkout ${COMMIT}
python -c 'import damask;print(damask.__version__)'
done
####################################################################################################
# Processing: pre- and post-processing tools written in Python
####################################################################################################
.processing:
stage: processing
before_script:
- python --version
- pip list
mypy:
extends: [.processing, .python]
script:
- cd python
- mypy damask
.create_package:
extends: .processing
script:
- sed -i 's/-[[:digit:]]*-.*//' VERSION
- cd python
- python3 -m build --wheel --no-isolation
create_package:
extends: [.create_package, .python]
create_package_previous:
extends: [.create_package, .python_previous, .on_merge]
.pytest:
extends: .processing
script:
- export DAMASK_ROOT=$(pwd)
- PYTHONPATH=${DAMASK_ROOT}/python:$PYTHONPATH
- cd python
- python3 -m pytest -v --cov=damask --cov-report=xml --damask-root=${DAMASK_ROOT}
- coverage report --fail-under=90 --show-missing
pytest:
extends: [.pytest, .python]
pytest_previous:
extends: [.pytest, .python_previous, .on_merge]
doctest:
extends: [.processing, .python]
script:
- cd python
- cp tests/resources/doctest/*.* .
# pretend neper to be present such that call to /bin/neper does not fail
- echo '#!/usr/bin/env bash' > /bin/neper
- chmod +x /bin/neper
- PYTHONPATH=${PWD}:${PYTHONPATH} NO_COLOR=1 python3 -m pytest -v --doctest-modules damask
####################################################################################################
# Core: DAMASK core written in Fortran, C++, and C
####################################################################################################
open-source:
stage: core
extends: .petsc_gcc_default
tags:
- long_running
needs: []
before_script:
- cmake -DGRID=ON -DMESH=ON -B build -G Ninja && cmake --build build --parallel 4 --target install
- source env/DAMASK.sh
script:
- cd tests/integration
- export OMP_NUM_THREADS=2
- pytest -v -x -n 3 --dist=loadscope --durations=20 -k 'not compile and not Marc'
c++-linter:
stage: core
extends: .petsc_gcc_default
script:
# for now only capture non-solver and test modules
- BOOST_MAPPINGS=/usr/share/include-what-you-use/boost-all.imp
- cmake -B build -DTEST=ON
-DCMAKE_CXX_INCLUDE_WHAT_YOU_USE="include-what-you-use;-Xiwyu;--error;-Xiwyu;--mapping_file=${BOOST_MAPPINGS}"
-DCMAKE_CXX_CLANG_TIDY='clang-tidy;--checks=cppcoreguidelines*,bugprone*;--warnings-as-errors=cppcoreguidelines*,bugprone*'
- cmake --build build --parallel --target install
.unittest:
stage: core
script:
- source env/DAMASK.sh
- ./bin/DAMASK_test
- find build -name '*.gcda' -exec gcov {} \; | grep src/.*\.f90 -A+1 || true
- ctest --test-dir build/tests/unit_cpp/ --output-on-failure -j"$(nproc)" --no-tests=ignore
parallel:
matrix:
- BUILD_TYPE: [DEBUG, RELEASE, PERFORMANCE]
.unittest_base:
extends: .unittest
before_script:
- cmake -B build -DTEST=ON -DCMAKE_INSTALL_PREFIX=${PWD} -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
- cmake --build build --target install
unittest_gcc:
extends: [.unittest, .petsc_gcc_debug]
before_script:
- cmake -B build -DTEST=ON -DCMAKE_INSTALL_PREFIX=${PWD} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILDCMD_POST=-coverage
- cmake --build build --target install
unittest_oneapi:
extends: [.unittest_base, .petsc_oneapi_debug]
unittest_llvm:
extends: [.unittest, .petsc_llvm_debug]
before_script:
- sed -i 's/Fortran_COMPILER_VERSION_MIN .*)/Fortran_COMPILER_VERSION_MIN 20)/' cmake/Compiler-LLVMFlang.cmake
- cmake -B build -DTEST=ON -DCMAKE_INSTALL_PREFIX=${PWD} -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
- cmake --build build --target install
unittest_gcc_previous:
extends: [.unittest_base, .petsc_gcc_debug_previous, .on_merge]
unittest_oneapi_previous:
extends: [.unittest_base, .petsc_oneapi_debug_previous, .on_merge]
.compile:
stage: core
before_script:
- ${PETSC_DIR}/lib/petsc/bin/petscversion
- tail +$(grep -n 'Configure Actions.*' /petsc/configure.log | cut -f 1 -d:) /petsc/configure.log
- source env/DAMASK.sh
- cd tests/integration
.compile_macos:
extends: .compile
tags:
- mac-os-arm
.compile_grid:
extends: .compile
script:
- pytest -v -k 'compile and grid'
.compile_mesh:
extends: .compile
script:
- pytest -v -k 'compile and mesh'
compile_grid:
extends: [.compile_grid, .petsc]
compile_mesh:
extends: [.compile_mesh, .petsc]
compile_grid_macos:
extends: [.compile_macos]
script:
- pytest -v -k 'compile and grid and not AGGRESSIVE' --build-type=RELEASE --buildcmd-post="--include-directory-after=$(gfortran -print-file-name=include)"
compile_mesh_macos:
extends: [.compile_macos]
script:
- pytest -v -k 'compile and mesh and not AGGRESSIVE' --build-type=RELEASE --buildcmd-post="--include-directory-after=$(gfortran -print-file-name=include)"
compile_grid_previous:
extends: [.compile_grid, .petsc_previous, .on_merge]
compile_mesh_previous:
extends: [.compile_mesh, .petsc_previous, .on_merge]
# compiles but does not run
compile_llvm:
stage: core
extends: .petsc_llvm_debug
before_script:
- sed -i 's/Fortran_COMPILER_VERSION_MIN .*)/Fortran_COMPILER_VERSION_MIN 20)/' cmake/Compiler-LLVMFlang.cmake
script:
- cmake -DGRID=ON -DMESH=ON -B build -G Ninja && cmake --build build --parallel 4 --target install
Marc_patch:
stage: core
image: git.damask-multiphysics.org:5050/damask/damask/marc_base:${MARC_VERSION}
script:
- source env/DAMASK.sh
- export TMPDIR=/tmp
- python3 install/MarcMentat/MSC_modifications.py --editor=gted --marc-version=${MARC_VERSION} --damask-root=${CI_PROJECT_DIR} --marc-root=/opt/msc
- test -f /opt/msc/mentat${MARC_VERSION}/bin/kill6
- cd examples/Marc && python3 -c "import damask;damask.solver.Marc(version=${MARC_VERSION}).submit_job('r-value','texture',True,'h')"
- test -f ${CI_PROJECT_DIR}/src/Marc/DAMASK_Marc.marc || { echo 'Marc simulation failed, DAMASK_Marc.marc not generated'; exit 1; }
Marc_compile:
stage: core
image: git.damask-multiphysics.org:5050/damask/damask/marc_patched:${MARC_VERSION}
script:
- source env/DAMASK.sh
- cd tests/integration
- pytest -k 'compile and Marc'
.configexamples_debug:
stage: core
before_script:
- ${PETSC_DIR}/lib/petsc/bin/petscversion
- tail +$(grep -n 'Configure Actions.*' /petsc/configure.log | cut -f 1 -d:) /petsc/configure.log
- source env/DAMASK.sh
- cmake -B build -DGRID=ON -DCMAKE_BUILD_TYPE=DEBUG
- cmake --build build --target install
- cd tests/integration
script:
- python3 -X faulthandler -m pytest -p no:faulthandler -v -k configexamples # https://blog.xmatthias.com/post/pytest-debug-segfault/
configexamples_debug_gcc:
extends: [.configexamples_debug, .petsc_gcc_default]
configexamples_debug_oneapi:
extends: [.configexamples_debug, .petsc_oneapi_default]
Marc_run:
stage: core
image: git.damask-multiphysics.org:5050/damask/damask/marc_patched:${MARC_VERSION}
before_script:
- source env/DAMASK.sh
- cd examples/Marc && python3 -c "import damask;damask.solver.Marc(version=${MARC_VERSION}).submit_job('r-value','texture',True,'h')"
script:
- cd ${CI_PROJECT_DIR}/tests/integration
- pytest -k 'not compile and Marc'
# Needs closer look
# Phenopowerlaw_singleSlip:
# stage: core
# script: Phenopowerlaw_singleSlip/test.py
grid_performance:
stage: core
extends: .petsc_oneapi_performance
tags:
- matesting
before_script:
- cmake -DGRID=ON -DOPTIMIZATION=AGGRESSIVE -B build
- cmake --build build --parallel 4 --target install
- source env/DAMASK.sh
script:
- git clone -q https://damask_user:${TOKEN_STATISTICS}@git.damask-multiphysics.org/damask/statistics.git
- ./statistics/measure_performance.py --input_dir examples/grid --tag ${CI_COMMIT_SHA} --output_dir statistics
- cp statistics/performance.txt .
artifacts:
paths: [performance.txt]
####################################################################################################
# Update Repositories
####################################################################################################
.update:
stage: update_repositories
image:
name: alpine/git
entrypoint: [""]
before_script:
- git config --global user.name "testbot"
- git config --global user.email "testbot@damask-multiphysics.org"
rules: [if: $CI_COMMIT_BRANCH == 'development']
update_statistics:
extends: .update
dependencies:
- grid_performance
script:
- git clone -q https://damask_user:${TOKEN_STATISTICS}@git.damask-multiphysics.org/damask/statistics.git
- cp performance.txt statistics/
- cd statistics
- git commit -m ${CI_PIPELINE_ID}_${CI_COMMIT_SHA} performance.txt
- git push
update_revision:
extends: .update
script:
- cd $(mktemp -d)
- git clone -b development -q https://damask_user:${TOKEN_DAMASK}@git.damask-multiphysics.org/damask/DAMASK.git .
- export VERSION=$(git describe ${CI_COMMIT_SHA})
- echo ${VERSION:1} > VERSION
- >
git diff-index --quiet HEAD ||
git commit VERSION -m "[skip ci] updated version information after successful test of $VERSION"
- if [ ${CI_COMMIT_SHA} == $(git rev-parse HEAD^) ]; then git push --atomic --no-verify origin HEAD:development HEAD:master; fi
####################################################################################################
# Documentation
####################################################################################################
publish_website_master:
stage: documentation
trigger:
project: damask/website
branch: master
rules: [if: $CI_COMMIT_BRANCH == 'development']
publish_website_3.0:
stage: documentation
trigger:
project: damask/website
branch: '3.0'
rules: [if: $CI_COMMIT_BRANCH == '3.0']