xref: /honee/.gitlab-ci.yml (revision 04c6cceae41dd6aaf3b67e98032d41ec99e52a61)
1# ----------------------------------------------------------------------------------------
2# HONEE GitLab CI
3# ----------------------------------------------------------------------------------------
4stages:
5  - test:stage-lint
6  - test:stage-full
7  - test:docs
8  - deploy
9
10.test-basic:
11  interruptible: true
12  only:
13    refs:
14      - web
15      - merge_requests
16
17.test:
18  extends: .test-basic
19  only:
20    refs:
21      - web
22      - merge_requests
23      - main
24      - release
25  except:
26    variables:
27      # Skip if the No-Code label is attached to a merge request (i.e., documentation only)
28      - $CI_MERGE_REQUEST_LABELS =~ /(^|,)No-Code($|,)/
29  needs:
30    - job: docker-build
31      optional: true
32
33.docs:
34  image: python:3.10
35  before_script:
36    - pip install -r doc/requirements.txt
37    - apt-get update
38    - apt-get install -y doxygen librsvg2-bin
39
40
41# ----------------------------------------------------------------------------------------
42# Test formatting and static analysis
43# ----------------------------------------------------------------------------------------
44noether-lint:
45  stage: test:stage-lint
46  extends: .test
47  tags:
48    - noether
49    - shell
50  needs: []
51  script:
52    - rm -f .SUCCESS
53    # Environment
54    - export COVERAGE=1 CC=gcc HIPCC=hipcc
55    - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
56    - echo "-------------- CC ------------------" && $CC --version
57    - echo "-------------- GCOV ----------------" && gcov --version
58    - echo "-------------- HIPCC ---------------" && $HIPCC --version && export HIP_DIR=/opt/rocm
59    # Libraries
60    # -- libCEED
61    - echo "-------------- libCEED -------------"
62    - export CEED_DIR=/projects/honee/libCEED && git -C $CEED_DIR -c safe.directory=$CEED_DIR describe && make -C $CEED_DIR info
63    # -- PETSc
64    - echo "-------------- PETSc ---------------"
65    - export PETSC_DIR=/projects/honee/petsc
66    - export PETSC_ARCH=arch-serial-gpu && git -C $PETSC_DIR -c safe.directory=$PETSC_DIR describe && make -C $PETSC_DIR info
67    - export PETSC_OPTIONS='-malloc_debug no' # faster tests
68    - export LD_LIBRARY_PATH=$PETSC_DIR/lib PATH="$PATH:$PETSC_DIR/bin" # cgnsdiff
69    # make with Werror, Wall, supress loop vectorization warnings
70    - echo "-------------- make Werror ---------"
71    - PEDANTIC=1 PEDANTICFLAGS="-Werror -Wall -Wno-pass-failed" make -j$NPROC_CPU
72    # make format
73    - echo "-------------- make format ---------" && export CLANG_FORMAT=clang-format-15 && $CLANG_FORMAT --version
74    - make -j$NPROC_CPU format && git diff --color=always --exit-code
75    # Clang-tidy
76    - echo "-------------- clang-tidy ----------" && export CLANG_TIDY=clang-tidy-15 && $CLANG_TIDY --version
77    - PETSC_ARCH=arch-serial-gpu make -j$NPROC_CPU tidy
78    # Report status
79    - touch .SUCCESS
80
81
82# ----------------------------------------------------------------------------------------
83# Test memory access assumptions
84# ----------------------------------------------------------------------------------------
85noether-memcheck:
86  stage: test:stage-lint
87  extends: .test
88  tags:
89    - noether
90    - shell
91  needs: []
92  script:
93    - rm -f .SUCCESS
94    # Environment
95    # -- NOTE: Coverage disabled because it doesn't play nice with the ASAN options
96    - export CC=clang-15
97    - export NPROC_POOL=8
98    - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
99    - echo "-------------- CC ------------------" && $CC --version
100    # Libraries
101    # -- libCEED
102    - echo "-------------- libCEED -------------"
103    - export CEED_DIR=/projects/honee/libCEED-cpu && git -C $CEED_DIR -c safe.directory=$CEED_DIR describe && make -C $CEED_DIR info
104    # -- PETSc
105    - echo "-------------- PETSc ---------------"
106    - export PETSC_DIR=/projects/honee/petsc
107    - export PETSC_ARCH=arch-serial-cpu-clang && git -C $PETSC_DIR -c safe.directory=$PETSC_DIR describe && make -C $PETSC_DIR info
108    - export PETSC_OPTIONS='-malloc_debug no' # faster tests
109    - export LD_LIBRARY_PATH=$PETSC_DIR/lib PATH="$PATH:$PETSC_DIR/bin" # cgnsdiff
110    # ASAN
111    - echo "-------------- ASAN ----------------"
112    - echo "ASAN intentionlly skipped, known leaks"
113    # - export ASAN=1 AFLAGS="-fsanitize=address -fsanitize=leak"
114    - echo $AFLAGS
115    # HONEE
116    - echo "-------------- HONEE ---------------" && make info
117    - make clean
118    - make -j$NPROC_CPU
119    # Test suite
120    - echo "-------------- HONEE tests ---------"
121    - echo '[{"subject":"/","metrics":[{"name":"Transfer Size (KB)","value":"19.5","desiredSize":"smaller"},{"name":"Speed Index","value":0,"desiredSize":"smaller"},{"name":"Total Score","value":92,"desiredSize":"larger"},{"name":"Requests","value":4,"desiredSize":"smaller"}]}]' > performance.json
122    # -- Memcheck libCEED CPU backend, serial
123    - NPROC_TEST=1 make -k -j$((NPROC_CPU / NPROC_POOL)) CEED_BACKENDS="/cpu/self/memcheck" JUNIT_BATCH="cpu-serial-memcheck" junit search=navierstokes
124    # Report status
125    - touch .SUCCESS
126  artifacts:
127    paths:
128      - build/*.junit
129    reports:
130      junit: build/*.junit
131      performance: performance.json
132    expire_in: 28 days
133
134
135# ----------------------------------------------------------------------------------------
136# CPU testing on Noether
137# ----------------------------------------------------------------------------------------
138noether-cpu:
139  stage: test:stage-full
140  extends: .test
141  tags:
142    - noether
143    - shell
144  script:
145    - rm -f .SUCCESS
146    # Environment
147    - export COVERAGE=1 CC=gcc HIPCC=hipcc
148    - export NPROC_POOL=4
149    - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
150    - echo "-------------- CC ------------------" && $CC --version
151    - echo "-------------- GCOV ----------------" && gcov --version
152    - echo "-------------- HIPCC ---------------" && $HIPCC --version && export HIP_DIR=/opt/rocm
153    # Libraries
154    # -- libCEED
155    - echo "-------------- libCEED -------------"
156    - export CEED_DIR=/projects/honee/libCEED && git -C $CEED_DIR -c safe.directory=$CEED_DIR describe && make -C $CEED_DIR info
157    # -- PETSc
158    - echo "-------------- PETSc ---------------"
159    - export PETSC_DIR=/projects/honee/petsc
160    - export PETSC_ARCH=arch-parallel-gpu && git -C $PETSC_DIR -c safe.directory=$PETSC_DIR describe && make -C $PETSC_DIR info
161    - export PETSC_OPTIONS='-malloc_debug no' # faster tests
162    - export LD_LIBRARY_PATH=$PETSC_DIR/$PETSC_ARCH/lib PATH="$PATH:$PETSC_DIR/$PETSC_ARCH/bin" # cgnsdiff
163    # HONEE
164    - echo "-------------- HONEE ---------------" && make info
165    - make clean
166    - make -j$NPROC_CPU
167    # Test suite
168    - echo "-------------- HONEE tests ---------"
169    - echo '[{"subject":"/","metrics":[{"name":"Transfer Size (KB)","value":"19.5","desiredSize":"smaller"},{"name":"Speed Index","value":0,"desiredSize":"smaller"},{"name":"Total Score","value":92,"desiredSize":"larger"},{"name":"Requests","value":4,"desiredSize":"smaller"}]}]' > performance.json
170    # -- Fastest libCEED CPU backend, parallel
171    - echo "Parallel tests skipped for now"
172    - NPROC_TEST=1 make -k -j$((NPROC_CPU / NPROC_POOL / 1)) CEED_BACKENDS="/cpu/self" JUNIT_BATCH="cpu-serial" junit search=navierstokes
173    # Report status
174    - touch .SUCCESS
175  after_script:
176    - |
177      if [ -f .SUCCESS ]; then
178        gcovr --xml-pretty --exclude-unreachable-branches --print-summary -o coverage.xml;
179      fi
180  coverage: '/^lines:\s+(\d+.\d\%)/'
181  artifacts:
182    paths:
183      - coverage.xml
184      - build/*.junit
185    reports:
186      coverage_report:
187        coverage_format: cobertura
188        path: coverage.xml
189      junit: build/*.junit
190      performance: performance.json
191    expire_in: 28 days
192
193
194# ----------------------------------------------------------------------------------------
195# CPU Int64 testing on Noether
196# ----------------------------------------------------------------------------------------
197noether-cpu-int64:
198  stage: test:stage-full
199  extends: .test
200  tags:
201    - noether
202    - shell
203  script:
204    - rm -f .SUCCESS
205    # Environment
206    - export COVERAGE=1 CC=gcc HIPCC=hipcc
207    - export NPROC_POOL=4
208    - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
209    - echo "-------------- CC ------------------" && $CC --version
210    - echo "-------------- GCOV ----------------" && gcov --version
211    - echo "-------------- HIPCC ---------------" && $HIPCC --version && export HIP_DIR=/opt/rocm
212    # Libraries
213    # -- libCEED
214    - echo "-------------- libCEED -------------"
215    - export CEED_DIR=/projects/honee/libCEED && git -C $CEED_DIR -c safe.directory=$CEED_DIR describe && make -C $CEED_DIR info
216    # -- PETSc
217    - echo "-------------- PETSc ---------------"
218    - export PETSC_DIR=/projects/honee/petsc
219    - export PETSC_ARCH=arch-serial-cpu-int64 && git -C $PETSC_DIR -c safe.directory=$PETSC_DIR describe && make -C $PETSC_DIR info
220    - export PETSC_OPTIONS='-malloc_debug no' # faster tests
221    - export LD_LIBRARY_PATH=$PETSC_DIR/$PETSC_ARCH/lib PATH="$PATH:$PETSC_DIR/$PETSC_ARCH/bin" # cgnsdiff
222    # HONEE
223    - echo "-------------- HONEE ---------------" && make info
224    - make clean
225    - make -j$NPROC_CPU
226    # Test suite
227    - echo "-------------- HONEE tests ---------"
228    - echo '[{"subject":"/","metrics":[{"name":"Transfer Size (KB)","value":"19.5","desiredSize":"smaller"},{"name":"Speed Index","value":0,"desiredSize":"smaller"},{"name":"Total Score","value":92,"desiredSize":"larger"},{"name":"Requests","value":4,"desiredSize":"smaller"}]}]' > performance.json
229    # -- Fastest libCEED CPU backend, serial
230    - NPROC_TEST=1 make -k -j$((NPROC_CPU / NPROC_POOL / 1)) CEED_BACKENDS="/cpu/self" JUNIT_BATCH="cpu-serial-int64" junit search=navierstokes
231    # Report status
232    - touch .SUCCESS
233  after_script:
234    - |
235      if [ -f .SUCCESS ]; then
236        gcovr --xml-pretty --exclude-unreachable-branches --print-summary -o coverage.xml;
237      fi
238  coverage: '/^lines:\s+(\d+.\d\%)/'
239  artifacts:
240    paths:
241      - coverage.xml
242      - build/*.junit
243    reports:
244      coverage_report:
245        coverage_format: cobertura
246        path: coverage.xml
247      junit: build/*.junit
248      performance: performance.json
249    expire_in: 28 days
250
251
252# ----------------------------------------------------------------------------------------
253# GPU testing on Noether
254# ----------------------------------------------------------------------------------------
255noether-gpu:
256  stage: test:stage-full
257  extends: .test
258  tags:
259    - noether
260    - shell
261  script:
262    - rm -f .SUCCESS
263    # Environment
264    - export COVERAGE=1 CC=gcc HIPCC=hipcc
265    - export NPROC_POOL=4
266    - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
267    - echo "-------------- CC ------------------" && $CC --version
268    - echo "-------------- GCOV ----------------" && gcov --version
269    - echo "-------------- HIPCC ---------------" && $HIPCC --version && export HIP_DIR=/opt/rocm
270    # Libraries
271    # -- libCEED
272    - echo "-------------- libCEED -------------"
273    - export CEED_DIR=/projects/honee/libCEED && git -C $CEED_DIR -c safe.directory=$CEED_DIR describe && make -C $CEED_DIR info
274    # -- PETSc
275    - echo "-------------- PETSc ---------------"
276    - export PETSC_DIR=/projects/honee/petsc
277    - export PETSC_ARCH=arch-parallel-gpu && git -C $PETSC_DIR -c safe.directory=$PETSC_DIR describe && make -C $PETSC_DIR info
278    - export PETSC_OPTIONS='-malloc_debug no' # faster tests
279    - export LD_LIBRARY_PATH=$PETSC_DIR/$PETSC_ARCH/lib PATH="$PATH:$PETSC_DIR/$PETSC_ARCH/bin" # cgnsdiff
280    # HONEE
281    - echo "-------------- HONEE ---------------" && make info
282    - make clean
283    - make -j$NPROC_CPU
284    # Test suite
285    - echo "-------------- HONEE tests ---------"
286    - echo '[{"subject":"/","metrics":[{"name":"Transfer Size (KB)","value":"19.5","desiredSize":"smaller"},{"name":"Speed Index","value":0,"desiredSize":"smaller"},{"name":"Total Score","value":92,"desiredSize":"larger"},{"name":"Requests","value":4,"desiredSize":"smaller"}]}]' > performance.json
287    # -- Fastest libCEED HIP backend, serial
288    # Note: /shared is faster due to /gen JiT time for CeedOperators overwhelming runtime improvements at these problem sizes
289    - NPROC_TEST=1 make -k -j$((NPROC_GPU / NPROC_POOL / 1)) CEED_BACKENDS="/gpu/hip/shared" JUNIT_BATCH="hip-serial" junit search=navierstokes
290    # Report status
291    - touch .SUCCESS
292  after_script:
293    - |
294      if [ -f .SUCCESS ]; then
295        gcovr --xml-pretty --exclude-unreachable-branches --print-summary -o coverage.xml;
296      fi
297  coverage: '/^lines:\s+(\d+.\d\%)/'
298  artifacts:
299    paths:
300      - coverage.xml
301      - build/*.junit
302    reports:
303      coverage_report:
304        coverage_format: cobertura
305        path: coverage.xml
306      junit: build/*.junit
307      performance: performance.json
308    expire_in: 28 days
309
310
311# ----------------------------------------------------------------------------------------
312# Build documentation
313# ----------------------------------------------------------------------------------------
314docs-review:
315  stage: test:docs
316  tags:
317    - noether
318    - docker
319  extends:
320    - .docs
321    - .test-basic
322  interruptible: true
323  script:
324    - export PETSC_DIR=/projects/honee/petsc PETSC_ARCH=arch-parallel-gpu CEED_DIR=/projects/honee/libCEED
325    - git submodule update --init
326    - make doc-html pkgconf=true DOXYGENOPTS= SPHINXOPTS=-W
327    - mv doc/build/html public
328  artifacts:
329    paths:
330      - public
331    expire_in: 28 days
332  environment:
333    name: review/$CI_COMMIT_REF_NAME
334    url: https://$CI_PROJECT_NAMESPACE.gitlab.io/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/public/index.html
335
336
337# ----------------------------------------------------------------------------------------
338# Deploy documentation using GitLab pages
339# ----------------------------------------------------------------------------------------
340pages:  # this job name has special meaning to GitLab
341  stage: deploy
342  tags:
343    - noether
344    - docker
345  extends: .docs
346  interruptible: false
347  script:
348    - git submodule update --init
349    - make doc-dirhtml pkgconf=true DOXYGENOPTS=
350    - mv doc/build/dirhtml public
351  only:
352    - main
353  artifacts:
354    paths:
355      - public
356