-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy path.gitlab-ci.yml
413 lines (349 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
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
---
stages:
- prepare
- python
- compile
- fortran
- statistics
- finalize
###################################################################################################
default:
before_script:
- ${LOCAL_HOME}/bin/queue ${CI_JOB_ID} ${TOKEN}
- source env/DAMASK.sh
- export PATH=${TESTROOT}/bin:${PATH}
- echo Job start:" $(date)"
after_script:
- echo Job end:" $(date)"
###################################################################################################
variables:
# ===============================================================================================
# GitLab Settings
# ===============================================================================================
GIT_SUBMODULE_STRATEGY: normal
# ===============================================================================================
# Shortcut names
# ===============================================================================================
TESTROOT: "$LOCAL_HOME/GitLabCI_Pipeline_$CI_PIPELINE_ID"
# ===============================================================================================
# Names of module files to load
# ===============================================================================================
# ++++++++++++ Compiler/MPI/PETSc +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
COMPILER_INTEL: "oneapi/2025.0.0"
PETSC_INTEL: "Libraries/PETSc/3.22.4/OneAPI-2025.0"
# ++++++++++++ MSC Marc +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MSC: "FEM/MSC/2024.1"
IntelMarc: "Compiler/Intel/2022.0.1 Libraries/IMKL/2022.0.1"
HDF5Marc: "HDF5/1.12.1/Intel-2022.0.1"
###################################################################################################
# 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
create_testroot:
stage: prepare
before_script:
- ${LOCAL_HOME}/bin/queue ${CI_JOB_ID} ${TOKEN}
- echo Job start:" $(date)"
script:
- mkdir -p ${TESTROOT}
.on_merge:
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
###################################################################################################
.python_base:
stage: python
image: git.damask-multiphysics.org:5050/damask/damask/python:$PYTHON_IMAGE
tags:
- matesting2-container-runner
before_script:
- python --version
- pip list
.python_default:
extends: .python_base
variables: {PYTHON_IMAGE: 2025.02.25}
.python_min:
extends: .python_base
variables: {PYTHON_IMAGE: '310_2412'}
.create_package:
script:
- sed -i 's/-[[:digit:]]*-.*//' VERSION
- cd python
- python3 -m build --wheel --no-isolation
create_package:
extends:
- .create_package
- .python_default
create_package_min:
extends:
- .create_package
- .python_min
- .on_merge
.pytest:
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_default
pytest_min:
extends:
- .pytest
- .python_min
- .on_merge
doctest:
extends: .python_default
script:
- export DAMASK_ROOT=$(pwd)
- PYTHONPATH=${DAMASK_ROOT}/python:$PYTHONPATH
- cd python
- python3 -m pytest -v --doctest-modules -k 'not result and not configmaterial and not orientation and not geomgrid' damask
mypy:
extends: .python_default
script:
- cd python
- mypy damask
###################################################################################################
.unittest:
stage: compile
tags:
- matesting2-container-runner
script:
- source env/DAMASK.sh
- export OPENBLAS_NUM_THREADS=1
- ./bin/DAMASK_test
- find . -name '*.gcda' -not -path "**/test/*" -exec gcov {} \;
.unittest_GCC:
extends: .unittest
image: git.damask-multiphysics.org:5050/damask/damask/gcc_petsc-debug:2025.03.10
.unittest_oneAPI:
extends: .unittest
image: git.damask-multiphysics.org:5050/damask/damask/oneapi_petsc-debug:2025.03.27
# -------------------------------------------------------------------------------------------------
unittest_GCC_DEBUG:
extends: .unittest_GCC
before_script:
- cmake -B builddir -DDAMASK_SOLVER=test -DCMAKE_INSTALL_PREFIX=${PWD} -DCMAKE_BUILD_TYPE=DEBUG -DBUILDCMD_POST=-coverage
- cmake --build builddir --target install
unittest_GCC_RELEASE:
extends: .unittest_GCC
before_script:
- cmake -B builddir -DDAMASK_SOLVER=test -DCMAKE_INSTALL_PREFIX=${PWD} -DCMAKE_BUILD_TYPE=RELEASE -DBUILDCMD_POST=-coverage
- cmake --build builddir --target install
unittest_GCC_PERFORMANCE:
extends: .unittest_GCC
before_script:
- cmake -B builddir -DDAMASK_SOLVER=test -DCMAKE_INSTALL_PREFIX=${PWD} -DCMAKE_BUILD_TYPE=PERFORMANCE -DBUILDCMD_POST=-coverage
- cmake --build builddir --target install
# -------------------------------------------------------------------------------------------------
unittest_oneAPI_DEBUG:
extends: .unittest_oneAPI
before_script:
- cmake -B builddir -DDAMASK_SOLVER=test -DCMAKE_INSTALL_PREFIX=${PWD} -DCMAKE_BUILD_TYPE=DEBUG
- cmake --build builddir --target install
unittest_oneAPI_RELEASE:
extends: .unittest_oneAPI
before_script:
- cmake -B builddir -DDAMASK_SOLVER=test -DCMAKE_INSTALL_PREFIX=${PWD} -DCMAKE_BUILD_TYPE=RELEASE
- cmake --build builddir --target install
unittest_oneAPI_PERFORMANCE:
extends: .unittest_oneAPI
before_script:
- cmake -B builddir -DDAMASK_SOLVER=test -DCMAKE_INSTALL_PREFIX=${PWD} -DCMAKE_BUILD_TYPE=PERFORMANCE
- cmake --build builddir --target install
###################################################################################################
.compile:
stage: compile
tags:
- matesting2-container-runner
before_script:
- tail +$(grep -n 'Configure Actions.*' /petsc/configure.log | cut -f 1 -d:) /petsc/configure.log
- source env/DAMASK.sh
- export OPENBLAS_NUM_THREADS=1
- cd PRIVATE/testing
.compile_grid:
extends: .compile
script:
- pytest -v -k 'compile and grid'
.compile_mesh:
extends: .compile
script:
- pytest -v -k 'compile and mesh'
grid_GCC:
extends: .compile_grid
image: git.damask-multiphysics.org:5050/damask/damask/gcc_petsc-default:2025.03.10
mesh_GCC:
extends: .compile_mesh
image: git.damask-multiphysics.org:5050/damask/damask/gcc_petsc-default:2025.03.10
grid_GCC-i64:
extends: .compile_grid
image: git.damask-multiphysics.org:5050/damask/damask/gcc_petsc-i64:2025.03.10
mesh_GCC-i64:
extends: .compile_mesh
image: git.damask-multiphysics.org:5050/damask/damask/gcc_petsc-i64:2025.03.10
grid_oneAPI:
extends: .compile_grid
image: git.damask-multiphysics.org:5050/damask/damask/oneapi_petsc-default:2025.03.27
mesh_oneAPI:
extends: .compile_mesh
image: git.damask-multiphysics.org:5050/damask/damask/oneapi_petsc-default:2025.03.27
Marc_Intel:
stage: compile
tags:
- bare-metal
script:
- source /opt/venv/bin/activate
- module load $IntelMarc $HDF5Marc $MSC
- cd PRIVATE/testing
- pytest -k 'compile and Marc' --basetemp ${TESTROOT}/compile_Marc
setup_Marc:
stage: compile
tags:
- bare-metal
script:
- source /opt/venv/bin/activate
- module load $IntelMarc $HDF5Marc $MSC
- cd $(mktemp -d)
- cp ${CI_PROJECT_DIR}/examples/Marc/* .
- python3 -c "import damask;damask.solver.Marc().submit_job('r-value','texture',True,'h')"
- mkdir -p ${TESTROOT}/src/Marc
- mv ${CI_PROJECT_DIR}/src/Marc/DAMASK_Marc.marc ${TESTROOT}/src/Marc
###################################################################################################
.configexamples_debug:
stage: compile
tags:
- matesting2-container-runner
before_script:
- tail +$(grep -n 'Configure Actions.*' /petsc/configure.log | cut -f 1 -d:) /petsc/configure.log
- source env/DAMASK.sh
- export OPENBLAS_NUM_THREADS=1
- cmake -B builddir -DDAMASK_SOLVER=grid -DCMAKE_BUILD_TYPE=DEBUG
- cmake --build builddir --target install
- cd PRIVATE/testing
script:
- pytest -v -k configexamples
configexamples_debug_GCC:
extends: .configexamples_debug
image: git.damask-multiphysics.org:5050/damask/damask/gcc_petsc-default:2025.03.10
before_script:
- tail +$(grep -n 'Configure Actions.*' /petsc/configure.log | cut -f 1 -d:) /petsc/configure.log
- source env/DAMASK.sh
- export OPENBLAS_NUM_THREADS=1
- cmake -B builddir -DDAMASK_SOLVER=grid -DCMAKE_BUILD_TYPE=DEBUG
- cmake --build builddir --target install
- cd PRIVATE/testing
configexamples_debug_oneAPI:
extends: .configexamples_debug
image: git.damask-multiphysics.org:5050/damask/damask/oneapi_petsc-default:2025.03.27
###################################################################################################
open-source_GCC:
stage: fortran
tags:
- matesting2-container-runner
image: git.damask-multiphysics.org:5050/damask/damask/gcc_petsc-default:2025.03.10
before_script:
- cmake -DDAMASK_SOLVER=grid -B build/grid && cmake --build build/grid --parallel 2 --target install
- cmake -DDAMASK_SOLVER=mesh -B build/grid && cmake --build build/grid --parallel 2 --target install
- source env/DAMASK.sh
- export OPENBLAS_NUM_THREADS=1
script:
- cd PRIVATE/testing
- pytest -v -k 'not compile and not (signal or restart) and not Marc'
open-source_signal_restart_GCC:
stage: fortran
tags:
- bare-metal
before_script:
- source /opt/venv/bin/activate
- module load ${COMPILER_INTEL} ${PETSC_INTEL}
- cd $(mktemp -d)
- cmake -DDAMASK_SOLVER=grid -DCMAKE_INSTALL_PREFIX=${TESTROOT} ${CI_PROJECT_DIR}
- make -j2 all install
- export PATH=${TESTROOT}/bin:${PATH}
- cd ${CI_PROJECT_DIR}
- source env/DAMASK.sh
- echo Job start:" $(date)"
script:
- cd PRIVATE/testing
- pytest -v -k 'signal or restart' -m 'not cifail' --basetemp ${TESTROOT}/open-source -v
after_script:
- echo Job end:" $(date)"
Marc:
stage: fortran
tags:
- bare-metal
script:
- source /opt/venv/bin/activate
- cd PRIVATE/testing
- pytest -k 'not compile and Marc' -m 'not cifail' --damask-root=${TESTROOT} --basetemp ${TESTROOT}/Marc -v
# Needs closer look
# Phenopowerlaw_singleSlip:
# stage: fortran
# script: Phenopowerlaw_singleSlip/test.py
###################################################################################################
grid_performance:
stage: statistics
tags:
- bare-metal
before_script:
- ${LOCAL_HOME}/bin/queue ${CI_JOB_ID} ${TOKEN} --blocking
- source /opt/venv/bin/activate
- source env/DAMASK.sh
- echo Job start:" $(date)"
script:
- module load ${COMPILER_INTEL} ${PETSC_INTEL}
- cd $(mktemp -d)
- cmake -DOPTIMIZATION=AGGRESSIVE -DDAMASK_SOLVER=grid -DCMAKE_INSTALL_PREFIX=./ ${CI_PROJECT_DIR}
- make -j2 all install
- export PATH=${PWD}/bin:${PATH}
- cd $(mktemp -d)
- git clone -q git@git.damask-multiphysics.org:damask/statistics.git .
- ./measure_performance.py --input_dir ${CI_PROJECT_DIR}/examples/grid --tag ${CI_COMMIT_SHA}
- >
if [ ${CI_COMMIT_BRANCH} == development ]; then
git add performance.txt
git commit -m ${CI_PIPELINE_ID}_${CI_COMMIT_SHA}
git push
fi
###################################################################################################
update_website_master:
stage: finalize
trigger:
project: damask/website
branch: master
only:
- development
update_website_3.0:
stage: finalize
trigger:
project: damask/website
branch: "3.0"
only:
- "3.0"
update_revision:
stage: finalize
tags:
- bare-metal
before_script:
- ${LOCAL_HOME}/bin/queue ${CI_JOB_ID} ${TOKEN}
- source /opt/venv/bin/activate
- echo Job start:" $(date)"
script:
- cd $(mktemp -d)
- git clone -q git@git.damask-multiphysics.org:damask/DAMASK.git .
- git pull
- 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
only:
- development