|
1 | | -# This file is a template, and might need editing before it works on your project. |
2 | | -# To contribute improvements to CI/CD templates, please follow the Development guide at: |
3 | | -# https://docs.gitlab.com/ee/development/cicd/templates.html |
4 | | -# This specific template is located at: |
5 | | -# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml |
6 | | - |
7 | | -# Official language image. Look for the different tagged releases at: |
8 | | -# https://hub.docker.com/r/library/python/tags/ |
9 | | -image: python:latest |
10 | | - |
11 | | -# Change pip's cache directory to be inside the project directory since we can |
12 | | -# only cache local items. |
13 | 1 | variables: |
14 | | - PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" |
15 | | - |
16 | | -# https://pip.pypa.io/en/stable/topics/caching/ |
17 | | -cache: |
18 | | - paths: |
19 | | - - .cache/pip |
20 | | - |
21 | | -before_script: |
22 | | - - python --version ; pip --version # For debugging |
23 | | - - pip install virtualenv |
24 | | - - virtualenv venv |
25 | | - - source venv/bin/activate |
26 | | - |
27 | | -test: |
| 2 | + # Use the specialized MPCDF HPC image |
| 3 | + CUDA_IMAGE: "gitlab-registry.mpcdf.mpg.de/mpcdf/ci-module-image/nvhpcsdk_26:2026" |
| 4 | + PIP_DISABLE_PIP_VERSION_CHECK: "1" |
| 5 | + |
| 6 | +stages: |
| 7 | + - test |
| 8 | + |
| 9 | +gpu_tests: |
| 10 | + stage: test |
| 11 | + image: ${CUDA_IMAGE} |
| 12 | + tags: |
| 13 | + - gpu-nvidia |
| 14 | + - gpu-nvidia-cc80 |
| 15 | + before_script: |
| 16 | + - module load python-waterboa/2025.06 |
| 17 | + - module load nvhpcsdk/26 |
28 | 18 | script: |
29 | | - - pip install ruff tox # you can also use tox |
30 | | - - pip install --editable ".[test]" |
31 | | - - tox -e py,ruff |
32 | | - |
33 | | -run: |
34 | | - script: |
35 | | - - pip install . |
36 | | - # run the command here |
37 | | - artifacts: |
38 | | - paths: |
39 | | - - build/* |
40 | | - |
41 | | -pages: |
42 | | - script: |
43 | | - - pip install sphinx sphinx-rtd-theme |
44 | | - - cd doc |
45 | | - - make html |
46 | | - - mv build/html/ ../public/ |
47 | | - artifacts: |
48 | | - paths: |
49 | | - - public |
50 | | - rules: |
51 | | - - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH |
52 | | - |
53 | | -deploy: |
54 | | - stage: deploy |
55 | | - script: echo "Define your deployment script!" |
56 | | - environment: production |
57 | | - |
| 19 | + - echo "--- CUDA Sanity Check ---" |
| 20 | + - nvidia-smi |
| 21 | + |
| 22 | + - echo "--- Detect Compute Capability ---" |
| 23 | + - nvidia-smi --query-gpu=compute_cap --format=csv,noheader |
| 24 | + |
| 25 | + - echo "--- Tool Versions ---" |
| 26 | + - cmake --version |
| 27 | + - python3 --version |
| 28 | + - git --version |
| 29 | + |
| 30 | + - echo "--- Pytest Execution ---" |
| 31 | + # The MPCDF image likely has a specific python environment. |
| 32 | + # We install our dependencies into the user directory or a virtualenv. |
| 33 | + - python3 -m pip install --user cupy-cuda12x |
| 34 | + - python3 -m pip install --user -e . |
| 35 | + |
| 36 | + # Add the user bin to PATH for pytest |
| 37 | + - export PATH="$HOME/.local/bin:$PATH" |
| 38 | + - export ARRAY_BACKEND=cupy |
| 39 | + |
| 40 | + - python3 -m pytest tests/unit/ |
0 commit comments