Skip to content

Commit 67e171d

Browse files
Swap to Spack and matrix-based GHA for more reliability
1 parent d010777 commit 67e171d

File tree

4 files changed

+134
-120
lines changed

4 files changed

+134
-120
lines changed

.github/Dockerfile

-29
This file was deleted.

.github/docker-compose.yml

+43-75
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,49 @@
1-
version: "3.9"
2-
3-
x-fenix: &fenix
4-
build: &fenix-build
5-
context: ./
6-
dockerfile: .github/Dockerfile
7-
args:
8-
OPENMPI_REPO: open-mpi/ompi
9-
OPENMPI_VERS_PREFIX: tags
10-
OPENMPI_VERS: v5.0.0rc10
11-
#Caches should be manually scoped, or they'll conflict.
12-
x-bake:
13-
cache-from:
14-
- type=gha,scope=default
15-
cache-to:
16-
- type=gha,scope=default,mode=max
17-
181
services:
19-
#fenix_ompi_5rc10:
20-
# <<: *fenix
21-
# image: "fenix:ompi_5rc10"
22-
# build:
23-
# <<: *fenix-build
24-
# x-bake:
25-
# cache-from:
26-
# - type=gha,scope=ompi_5rc10
27-
# cache-to:
28-
# - type=gha,scope=ompi_5rc10,mode=max
29-
30-
fenix_ompi_5:
31-
<<: *fenix
32-
image: "fenix:ompi_5"
2+
bootstrap:
3+
image: "bootstrap"
334
build:
34-
<<: *fenix-build
5+
dockerfile_inline: |
6+
FROM spack/ubuntu-jammy:0.22.2
7+
VOLUME /configs
8+
ARG OMPI_VERSION
9+
ENV OMPI_VERSION=$${OMPI_VERSION}
10+
CMD cp /configs/spack.yaml . && \
11+
spack -e . add openmpi@$${OMPI_VERSION} && \
12+
spack -e . containerize >/configs/spack.Dockerfile
3513
args:
36-
- OPENMPI_VERS_PREFIX=heads
37-
- OPENMPI_VERS=v5.0.x
38-
x-bake:
39-
cache-from:
40-
- type=gha,scope=ompi_5
41-
cache-to:
42-
- type=gha,scope=ompi_5,mode=max
43-
44-
fenix_ompi_main:
45-
<<: *fenix
46-
image: "fenix:ompi_main"
14+
OMPI_VERSION: main
15+
no_cache: true
16+
pull_policy: build
17+
volumes:
18+
- .github/:/configs
19+
20+
env:
21+
image: "ghcr.io/sandialabs/fenix/env:main"
4722
build:
48-
<<: *fenix-build
49-
args:
50-
- OPENMPI_VERS_PREFIX=heads
51-
- OPENMPI_VERS=main
52-
x-bake:
53-
cache-from:
54-
- type=gha,scope=ompi_main
55-
cache-to:
56-
- type=gha,scope=ompi_main,mode=max
57-
58-
fenix_icldisco_latest:
59-
<<: *fenix
60-
image: "fenix:icldisco_latest"
23+
# Generated by running the bootstrap image
24+
dockerfile: .github/spack.Dockerfile
25+
26+
fenix:
27+
image: "fenix"
6128
build:
62-
<<: *fenix-build
29+
dockerfile_inline: |
30+
ARG OMPI_VERSION main
31+
FROM ghcr.io/sandialabs/fenix/env:$${OMPI_VERSION}
32+
COPY . /fenix
33+
RUN . /opt/spack-environment/activate.sh && \
34+
mkdir -p /fenix/build && \
35+
cd /fenix/build && \
36+
cmake /fenix \
37+
-DCMAKE_BUILD_TYPE=Release \
38+
-DCMAKE_C_COMPILER=mpicc \
39+
-DFENIX_EXAMPLES=ON \
40+
-DFENIX_TESTS=ON \
41+
-DMPIEXEC_PREFLAGS="--allow-run-as-root;--map-by;:oversubscribe" && \
42+
make -j
43+
44+
WORKDIR /fenix/build
45+
ENTRYPOINT ["/entrypoint.sh"]
46+
CMD ["ctest", "--output-on-failure", "--timeout", "60"]
6347
args:
64-
- OPENMPI_REPO=icldisco/ompi
65-
- OPENMPI_VERS_PREFIX=heads
66-
- OPENMPI_VERS=ulfm/latest
67-
x-bake:
68-
cache-from:
69-
- type=gha,scope=icldisco_latest
70-
cache-to:
71-
- type=gha,scope=icldisco_latest,mode=max
72-
73-
#fenix_icldisco_experimental:
74-
# <<: *fenix
75-
# image: fenix/icldisco
76-
# build:
77-
# <<: *fenix-build
78-
# args:
79-
# - OPENMPI_REPO=icldisco/ompi
80-
# - OPENMPI_VERS_PREFIX=heads
81-
# - OPENMPI_VERS=ulfm/experimental
48+
OMPI_VERSION: main
49+
pull_policy: build

.github/spack.yaml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
spack:
2+
packages:
3+
openmpi:
4+
variants: +internal-hwloc +internal-libevent +internal-pmix
5+
concretizer:
6+
unify: true
7+
reuse: true
8+
9+
container:
10+
format: docker
11+
strip: false
12+
images:
13+
os: ubuntu:22.04
14+
spack: 0.22.2
15+
os_packages:
16+
build:
17+
- build-essential
18+
- autotools-dev
19+
- pkg-config
20+
- python3
21+
- m4
22+
- autoconf
23+
- automake
24+
- flex
25+
- git
26+
- zlib1g-dev
27+
- libperl-dev
28+
- numactl
29+
final:
30+
- build-essential
31+
- cmake

.github/workflows/ci_checks.yaml

+60-16
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,65 @@ on:
1111
jobs:
1212
test:
1313
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
ompi_version:
18+
- main
19+
- 5.0.3
20+
1421
steps:
15-
- uses: actions/checkout@v3
16-
- uses: docker/setup-buildx-action@v2
17-
- name: Build
18-
uses: docker/bake-action@master
22+
- name: Checkout repository
23+
uses: actions/checkout@v3
24+
25+
- name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@v2
27+
28+
- name: Log in to GHCR container registry
29+
uses: docker/login-action@v3
30+
with:
31+
registry: ghcr.io
32+
username: ${{ github.actor }}
33+
password: ${{ secrets.GITHUB_TOKEN }}
34+
35+
- name: Bake the bootstrap docker image
36+
uses: docker/bake-action@v5
1937
with:
20-
files: |
21-
.github/docker-compose.yml
22-
load: true
23-
- name: Test open-mpi v5.0.x
24-
if: success() || failure()
25-
run: docker run fenix:ompi_5
26-
- name: Test open-mpi main
27-
if: success() || failure()
28-
run: docker run fenix:ompi_main
29-
- name: Test icldisco latest
30-
if: success() || failure()
31-
run: docker run fenix:icldisco_latest
38+
files: .github/docker-compose.yml
39+
targets: bootstrap
40+
workdir: .
41+
set: |
42+
*.output=type=docker,name=bootstrap
43+
*.cache-from=type=gha,scope=bootstrap/${{ matrix.ompi_version }}
44+
*.cache-to=type=gha,mode=max,scope=bootstrap/${{ matrix.ompi_version }}
45+
*.args.OMPI_VERSION=${{ matrix.ompi_version }}
46+
47+
- name: Bootstrap the environment Dockerfile
48+
run: docker run -v ${GITHUB_WORKSPACE}/.github:/configs bootstrap
49+
50+
- name: Build the environment
51+
uses: docker/bake-action@v5
52+
with:
53+
files: .github/docker-compose.yml
54+
targets: env
55+
workdir: .
56+
pull: true
57+
set: |
58+
*.cache-from=type=gha,scope=env/${{ matrix.ompi_version }}
59+
*.cache-to=type=gha,mode=max,scope=env/${{ matrix.ompi_version }}
60+
env.tags=ghcr.io/sandialabs/fenix/env:${{ matrix.ompi_version }}
61+
env.output=type=registry,name=ghcr.io/sandialabs/fenix/env:${{ matrix.ompi_version }}
62+
63+
- name: Build Fenix
64+
uses: docker/bake-action@v5
65+
with:
66+
source: .
67+
files: .github/docker-compose.yml
68+
targets: fenix
69+
workdir: .
70+
set: |
71+
*.output=type=docker,name=fenix
72+
*.args.OMPI_VERSION=${{ matrix.ompi_version }}
73+
74+
- name: Test Fenix
75+
run: docker run fenix

0 commit comments

Comments
 (0)