Skip to content

Commit b125a31

Browse files
committed
Add cicd-ext CI configuration
1 parent 4bbcf40 commit b125a31

File tree

9 files changed

+251
-2
lines changed

9 files changed

+251
-2
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
ARG DEPS_IMAGE
2+
FROM $DEPS_IMAGE
3+
4+
COPY . /oomph
5+
WORKDIR /oomph
6+
7+
RUN spack -e ci build-env oomph -- cmake -B build -DOOMPH_WITH_TESTING=ON -DMPIEXEC_EXECUTABLE="" -DMPIEXEC_NUMPROC_FLAG="" -DMPIEXEC_PREFLAGS="" -DMPIEXEC_POSTFLAGS="" && \
8+
spack -e ci build-env oomph -- cmake --build build -j$(nproc)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM ghcr.io/eth-cscs/alps-images:py26.01-alps3-base
2+
3+
ARG SPACK_SHA=develop
4+
ARG SPACK_PACKAGES_SHA=main
5+
ARG SPACK_ENV_FILE
6+
7+
ENV DEBIAN_FRONTEND=noninteractive
8+
9+
RUN mkdir -p /opt/spack && \
10+
curl -Ls "https://api.github.com/repos/spack/spack/tarball/$SPACK_SHA" | tar --strip-components=1 -xz -C /opt/spack
11+
12+
ENV PATH="/opt/spack/bin:$PATH"
13+
14+
RUN mkdir -p /opt/spack-packages && \
15+
curl -Ls "https://api.github.com/repos/spack/spack-packages/tarball/$SPACK_PACKAGES_SHA" | tar --strip-components=1 -xz -C /opt/spack-packages
16+
17+
RUN spack repo remove --scope defaults:base builtin && \
18+
spack repo add --scope site /opt/spack-packages/repos/spack_repo/builtin
19+
20+
COPY $SPACK_ENV_FILE /spack_environment/spack.yaml
21+
22+
RUN spack env create ci /spack_environment/spack.yaml && \
23+
spack -e ci concretize -f && \
24+
spack -e ci install --jobs $(nproc) --fail-fast --only=dependencies

.cscs-ci/default.yaml

Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
include:
2+
- remote: 'https://gitlab.com/cscs-ci/recipes/-/raw/master/templates/v2/.ci-ext.yml'
3+
4+
stages:
5+
- build_deps
6+
- build
7+
- test
8+
9+
variables:
10+
# The base image is the py26.01 alps3 image from docs.cscs.ch
11+
BASE_IMAGE: ghcr.io/eth-cscs/alps-images:py26.01-alps3-base
12+
SPACK_SHA: develop
13+
SPACK_PACKAGES_SHA: main
14+
FF_TIMESTAMPS: true
15+
16+
.build_deps_template:
17+
stage: build_deps
18+
timeout: 1 hours
19+
before_script:
20+
- echo $DOCKERHUB_TOKEN | podman login docker.io -u $DOCKERHUB_USERNAME --password-stdin || true
21+
- export DOCKERFILE_SHA=`sha256sum .cscs-ci/container/deps.Containerfile | head -c 16`
22+
- export ENV_FILE_SHA=`sha256sum ${SPACK_ENV_FILE} | head -c 16`
23+
- export CONFIG_TAG=`echo $DOCKERFILE_SHA-$BASE_IMAGE-$SPACK_SHA-$SPACK_PACKAGES_SHA-$ENV_FILE_SHA | sha256sum - | head -c 16`
24+
- export PERSIST_IMAGE_NAME=$CSCS_REGISTRY_PATH/oomph-spack-deps-$BACKEND:$CONFIG_TAG
25+
- echo -e "CONFIG_TAG=$CONFIG_TAG" >> base-${BACKEND}.env
26+
- echo -e "DEPS_IMAGE=$PERSIST_IMAGE_NAME" >> base-${BACKEND}.env
27+
variables:
28+
DOCKERFILE: .cscs-ci/container/deps.Containerfile
29+
DOCKER_BUILD_ARGS: '["SPACK_SHA", "SPACK_PACKAGES_SHA", "SPACK_ENV_FILE"]'
30+
artifacts:
31+
reports:
32+
dotenv: base-${BACKEND}.env
33+
34+
build_deps_nccl:
35+
extends:
36+
- .container-builder-cscs-gh200
37+
- .build_deps_template
38+
variables:
39+
BACKEND: nccl
40+
SPACK_ENV_FILE: .cscs-ci/spack/nccl.yaml
41+
42+
build_deps_mpi:
43+
extends:
44+
- .container-builder-cscs-gh200
45+
- .build_deps_template
46+
variables:
47+
BACKEND: mpi
48+
SPACK_ENV_FILE: .cscs-ci/spack/mpi.yaml
49+
50+
build_deps_ucx:
51+
extends:
52+
- .container-builder-cscs-gh200
53+
- .build_deps_template
54+
variables:
55+
BACKEND: ucx
56+
SPACK_ENV_FILE: .cscs-ci/spack/ucx.yaml
57+
58+
build_deps_libfabric:
59+
extends:
60+
- .container-builder-cscs-gh200
61+
- .build_deps_template
62+
variables:
63+
BACKEND: libfabric
64+
SPACK_ENV_FILE: .cscs-ci/spack/libfabric.yaml
65+
66+
.build_template:
67+
stage: build
68+
extends: .container-builder-cscs-gh200
69+
timeout: 1 hours
70+
before_script:
71+
- echo $DOCKERHUB_TOKEN | podman login docker.io -u $DOCKERHUB_USERNAME --password-stdin || true
72+
- export PERSIST_IMAGE_NAME=$CSCS_REGISTRY_PATH/oomph-build-$BACKEND:$CI_COMMIT_SHA
73+
- echo -e "BUILD_IMAGE=$PERSIST_IMAGE_NAME" >> build-${BACKEND}.env
74+
variables:
75+
DOCKERFILE: .cscs-ci/container/build.Containerfile
76+
DOCKER_BUILD_ARGS: '["DEPS_IMAGE"]'
77+
artifacts:
78+
reports:
79+
dotenv: build-${BACKEND}.env
80+
81+
build_nccl:
82+
extends: .build_template
83+
needs:
84+
- job: build_deps_nccl
85+
artifacts: true
86+
variables:
87+
BACKEND: nccl
88+
89+
build_mpi:
90+
extends: .build_template
91+
needs:
92+
- job: build_deps_mpi
93+
artifacts: true
94+
variables:
95+
BACKEND: mpi
96+
97+
build_ucx:
98+
extends: .build_template
99+
needs:
100+
- job: build_deps_ucx
101+
artifacts: true
102+
variables:
103+
BACKEND: ucx
104+
105+
build_libfabric:
106+
extends: .build_template
107+
needs:
108+
- job: build_deps_libfabric
109+
artifacts: true
110+
variables:
111+
BACKEND: libfabric
112+
113+
.test_serial_template:
114+
stage: test
115+
extends: .container-runner-clariden-gh200
116+
variables:
117+
SLURM_JOB_NUM_NODES: 1
118+
SLURM_NTASKS: 1
119+
SLURM_TIMELIMIT: '00:15:00'
120+
SLURM_PARTITION: normal
121+
script:
122+
- ctest --test-dir build -L "serial" --output-on-failure
123+
124+
.test_parallel_template:
125+
stage: test
126+
extends: .container-runner-clariden-gh200
127+
variables:
128+
SLURM_JOB_NUM_NODES: 1
129+
SLURM_NTASKS: 4
130+
SLURM_TIMELIMIT: '00:15:00'
131+
SLURM_PARTITION: normal
132+
SLURM_MPI: pmix
133+
MPICH_GPU_SUPPORT_ENABLED: 1
134+
script:
135+
- srun -n 4 ctest --test-dir build -L "parallel-ranks-4" --output-on-failure
136+
137+
test_serial_nccl:
138+
extends: .test_serial_template
139+
needs:
140+
- job: build_nccl
141+
artifacts: true
142+
image: $BUILD_IMAGE
143+
144+
test_parallel_nccl:
145+
extends: .test_parallel_template
146+
needs:
147+
- job: build_nccl
148+
artifacts: true
149+
image: $BUILD_IMAGE
150+
151+
test_serial_mpi:
152+
extends: .test_serial_template
153+
needs:
154+
- job: build_mpi
155+
artifacts: true
156+
image: $BUILD_IMAGE
157+
158+
test_parallel_mpi:
159+
extends: .test_parallel_template
160+
needs:
161+
- job: build_mpi
162+
artifacts: true
163+
image: $BUILD_IMAGE
164+
165+
test_serial_ucx:
166+
extends: .test_serial_template
167+
needs:
168+
- job: build_ucx
169+
artifacts: true
170+
image: $BUILD_IMAGE
171+
172+
test_parallel_ucx:
173+
extends: .test_parallel_template
174+
needs:
175+
- job: build_ucx
176+
artifacts: true
177+
image: $BUILD_IMAGE
178+
179+
test_serial_libfabric:
180+
extends: .test_serial_template
181+
needs:
182+
- job: build_libfabric
183+
artifacts: true
184+
image: $BUILD_IMAGE
185+
186+
test_parallel_libfabric:
187+
extends: .test_parallel_template
188+
needs:
189+
- job: build_libfabric
190+
artifacts: true
191+
image: $BUILD_IMAGE

.cscs-ci/spack/libfabric.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
spack:
2+
specs:
3+
- oomph backend=libfabric +cuda +python
4+
view: false
5+
concretizer:
6+
unify: true

.cscs-ci/spack/mpi.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
spack:
2+
specs:
3+
- oomph backend=mpi +cuda +python
4+
view: false
5+
concretizer:
6+
unify: true

.cscs-ci/spack/nccl.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
spack:
2+
specs:
3+
- oomph backend=nccl +cuda +python
4+
view: false
5+
concretizer:
6+
unify: true

.cscs-ci/spack/ucx.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
spack:
2+
specs:
3+
- oomph backend=ucx +cuda +python
4+
view: false
5+
concretizer:
6+
unify: true

test/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ function(reg_serial_test t)
4848
add_test(
4949
NAME ${t}
5050
COMMAND $<TARGET_FILE:${t}>)
51+
set_tests_properties(${t} PROPERTIES LABELS "serial")
5152
endfunction()
5253

5354
foreach(t ${serial_tests})
@@ -65,7 +66,7 @@ function(reg_parallel_test t_ lib n)
6566
NAME ${t}
6667
COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${n} ${MPIEXEC_PREFLAGS}
6768
$<TARGET_FILE:${t}> ${MPIEXEC_POSTFLAGS})
68-
set_tests_properties(${t} PROPERTIES RUN_SERIAL TRUE)
69+
set_tests_properties(${t} PROPERTIES RUN_SERIAL TRUE LABELS "parallel-ranks-${n}")
6970
endfunction()
7071

7172
if (OOMPH_WITH_MPI)

test/bindings/fortran/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ function(reg_parallel_test_f t_ lib n nthr)
3030
COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${n} ${MPIEXEC_PREFLAGS}
3131
$<TARGET_FILE:${t}> ${MPIEXEC_POSTFLAGS})
3232
set_tests_properties(${t} PROPERTIES
33-
ENVIRONMENT OMP_NUM_THREADS=${nthr})
33+
ENVIRONMENT OMP_NUM_THREADS=${nthr}
34+
LABELS "parallel-ranks-${n}")
3435
endfunction()
3536

3637
if (OOMPH_WITH_MPI)

0 commit comments

Comments
 (0)