Skip to content

Commit 46f30d1

Browse files
Swap to Spack and matrix-based GHA for more reliability
1 parent 5975281 commit 46f30d1

File tree

4 files changed

+111
-120
lines changed

4 files changed

+111
-120
lines changed

.github/Dockerfile

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/docker-compose.yml

Lines changed: 48 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,53 @@
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: "local/bootstrap"
334
build:
34-
<<: *fenix-build
5+
dockerfile_inline: |
6+
FROM spack/ubuntu-focal:0.21.3
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: "local/env"
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 spack in a previous workflow step
24+
dockerfile: .github/spack.Dockerfile
25+
depends_on:
26+
bootstrap:
27+
condition: service_completed_successfully
28+
required: true
29+
pull_policy: build
30+
31+
32+
fenix:
33+
image: "local/fenix"
6134
build:
62-
<<: *fenix-build
63-
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
35+
dockerfile_inline: |
36+
FROM local/env
37+
COPY . /fenix
38+
RUN . /opt/spack-environment/activate.sh && \
39+
mkdir -p /fenix/build && \
40+
rm -r /fenix/build/* && \
41+
cd /fenix/build && \
42+
cmake /fenix \
43+
-DCMAKE_BUILD_TYPE=Release \
44+
-DCMAKE_C_COMPILER=mpicc \
45+
-DFENIX_EXAMPLES=ON \
46+
-DFENIX_TESTS=ON \
47+
-DMPIEXEC_PREFLAGS="--allow-run-as-root;--map-by;:oversubscribe" && \
48+
make -j
49+
50+
WORKDIR /fenix/build
51+
ENTRYPOINT ["/entrypoint.sh"]
52+
CMD ["ctest", "--output-on-failure"]
53+
pull_policy: build

.github/spack.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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: latest
15+
os_packages:
16+
build:
17+
- build-essential
18+
- autotools-dev
19+
- libevent-dev
20+
- pkg-config
21+
- python3
22+
- m4
23+
- autoconf
24+
- automake
25+
- libtool
26+
- flex
27+
- git
28+
- zlib1g-dev
29+
- openssh-server
30+
- libperl-dev
31+
- pkg-config
32+
- numactl
33+
final:
34+
- build-essential
35+
- cmake

.github/workflows/ci_checks.yaml

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,33 @@ jobs:
1212
test:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v3
16-
- uses: docker/setup-buildx-action@v2
17-
- name: Build
18-
uses: docker/bake-action@master
15+
- name: Checkout repository
16+
uses: actions/checkout@v3
17+
18+
- name: Set up Docker Buildx
19+
uses: docker/setup-buildx-action@v2
20+
21+
- name: Bootstrap the environment Dockerfile
22+
uses: docker/bake-action@v5
23+
with:
24+
files: .github/docker-compose.yml
25+
load: true
26+
target: bootstrap
27+
28+
- name: Build the environment
29+
uses: docker/bake-action@v5
1930
with:
20-
files: |
21-
.github/docker-compose.yml
31+
files: .github/docker-compose.yml
2232
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
33+
target: env
34+
35+
- name: Build Fenix
36+
uses: docker/bake-action@v5
37+
with:
38+
source: .
39+
files: .github/docker-compose.yml
40+
load: true
41+
target: fenix
42+
43+
- name: Test Fenix
44+
run: docker run local/fenix

0 commit comments

Comments
 (0)