Skip to content

Commit b8004ad

Browse files
committed
installation: add devito images for arm64
1 parent 4bb3d5c commit b8004ad

14 files changed

Lines changed: 226 additions & 27 deletions

.github/workflows/docker-bases.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Build base compilers docker images
22

3+
permissions:
4+
contents: read
5+
36
concurrency:
47
group: ${{ github.workflow }}-${{ github.ref }}
58
cancel-in-progress: true

.github/workflows/docker-devito.yml

Lines changed: 158 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Publish devito docker images from compiler bases
22

3+
permissions:
4+
contents: read
5+
36
on:
47
release:
58
types: [published]
@@ -21,27 +24,63 @@ jobs:
2124
include:
2225
- base: 'bases:nvidia-nvc'
2326
tag: 'nvidia-nvc'
27+
arch: amd64
28+
platform: linux/amd64
29+
run_tests: false
30+
tag_suffix: '-amd64'
2431
# Respect CUDA_VISIBLE_DEVICES set by the runner and hard-limit docker to that device.
2532
# (--gpus maps only the selected device from CUDA_VISIBLE_DEVICES)
2633
flag: --init --gpus "device=${CUDA_VISIBLE_DEVICES:-all}"
2734
test: 'tests/test_gpu_openacc.py tests/test_gpu_common.py'
2835
runner: ["self-hosted", "nvidiagpu"]
2936

37+
- base: 'bases:nvidia-nvc'
38+
tag: 'nvidia-nvc'
39+
arch: arm64
40+
platform: linux/arm64
41+
run_tests: false
42+
tag_suffix: '-arm64'
43+
flag: --init --gpus "device=${CUDA_VISIBLE_DEVICES:-all}"
44+
test: ''
45+
runner: ubuntu-24.04-arm
46+
3047
# Runtime gpu flags from https://hub.docker.com/r/rocm/tensorflow/
3148
- base: 'bases:amd'
3249
tag: 'amd'
50+
arch: amd64
51+
platform: linux/amd64
52+
run_tests: true
53+
tag_suffix: ''
3354
flag: '--init --network=host --device=/dev/kfd --device=/dev/dri --ipc=host --group-add video --group-add $(getent group render | cut -d: -f3) --cap-add=SYS_PTRACE --security-opt seccomp=unconfined'
3455
test: 'tests/test_gpu_openmp.py'
3556
runner: ["self-hosted", "amdgpu"]
3657

3758
- base: 'bases:cpu-gcc'
3859
tag: "gcc"
60+
arch: amd64
61+
platform: linux/amd64
62+
run_tests: false
63+
tag_suffix: '-amd64'
3964
flag: '--init -t'
4065
test: 'tests/test_operator.py'
4166
runner: ubuntu-latest
4267

68+
- base: 'bases:cpu-gcc'
69+
tag: "gcc"
70+
arch: arm64
71+
platform: linux/arm64
72+
run_tests: false
73+
tag_suffix: '-arm64'
74+
flag: '--init -t'
75+
test: 'tests/test_operator.py'
76+
runner: ubuntu-24.04-arm
77+
4378
- base: 'bases:cpu-icx'
4479
tag: "icx"
80+
arch: amd64
81+
platform: linux/amd64
82+
run_tests: true
83+
tag_suffix: ''
4584
flag: '--init -t'
4685
test: 'tests/test_operator.py'
4786
runner: ubuntu-latest
@@ -83,18 +122,18 @@ jobs:
83122
# `enable` is a "if" filter fir that tag
84123
# `type` is the type of tag
85124
tags: |
86-
type=raw,value=${{ matrix.tag }}-dev
87-
type=raw,value=${{ matrix.tag }}-latest,enable=${{ github.event_name == 'release' }}
88-
type=raw,value=latest,enable=${{ matrix.base == 'bases:cpu-gcc' }}
89-
type=semver,pattern={{raw}},prefix=${{ matrix.tag }}-,enable=${{ github.event_name == 'release' }}
125+
type=raw,value=${{ matrix.tag }}-dev,suffix=${{ matrix.tag_suffix }}
126+
type=raw,value=${{ matrix.tag }}-latest,enable=${{ github.event_name == 'release' }},suffix=${{ matrix.tag_suffix }}
127+
type=raw,value=latest,enable=${{ matrix.base == 'bases:cpu-gcc' }},suffix=${{ matrix.tag_suffix }}
128+
type=semver,pattern={{raw}},prefix=${{ matrix.tag }}-,enable=${{ github.event_name == 'release' }},suffix=${{ matrix.tag_suffix }}
90129
# Legacy "gpu" tag
91-
type=raw,value=gpu-dev,enable=${{ matrix.base == 'bases:nvidia-nvc' }}
92-
type=semver,pattern={{raw}},prefix=gpu-,enable=${{ github.event_name == 'release' && matrix.base == 'bases:nvidia-nvc' }}
93-
type=semver,pattern={{raw}},value=gpu-latest,enable=${{ github.event_name == 'release' && matrix.base == 'bases:nvidia-nvc' }}
130+
type=raw,value=gpu-dev,enable=${{ matrix.base == 'bases:nvidia-nvc' }},suffix=${{ matrix.tag_suffix }}
131+
type=semver,pattern={{raw}},prefix=gpu-,enable=${{ github.event_name == 'release' && matrix.base == 'bases:nvidia-nvc' }},suffix=${{ matrix.tag_suffix }}
132+
type=semver,pattern={{raw}},value=gpu-latest,enable=${{ github.event_name == 'release' && matrix.base == 'bases:nvidia-nvc' }},suffix=${{ matrix.tag_suffix }}
94133
# Legacy "cpu" tag
95-
type=raw,value=cpu-dev,enable=${{ matrix.base == 'bases:cpu-gcc' }}
96-
type=semver,pattern={{raw}},prefix=cpu-,enable=${{ github.event_name == 'release' && matrix.base == 'bases:cpu-gcc' }}
97-
type=semver,pattern={{raw}},value=cpu-latest,enable=${{ github.event_name == 'release' && matrix.base == 'bases:cpu-gcc' }}
134+
type=raw,value=cpu-dev,enable=${{ matrix.base == 'bases:cpu-gcc' }},suffix=${{ matrix.tag_suffix }}
135+
type=semver,pattern={{raw}},prefix=cpu-,enable=${{ github.event_name == 'release' && matrix.base == 'bases:cpu-gcc' }},suffix=${{ matrix.tag_suffix }}
136+
type=semver,pattern={{raw}},value=cpu-latest,enable=${{ github.event_name == 'release' && matrix.base == 'bases:cpu-gcc' }},suffix=${{ matrix.tag_suffix }}
98137
99138
- name: Check tags
100139
run: echo "${{ steps.meta.outputs.tags }}"
@@ -107,11 +146,120 @@ jobs:
107146
push: true
108147
tags: ${{ steps.meta.outputs.tags }}
109148
build-args: base=devitocodes/${{ matrix.base }}
149+
platforms: ${{ matrix.platform }}
110150

111151
- name: Remove dangling layers
112152
run: docker system prune -f
113153

114154
- name: Run tests
155+
if: ${{ matrix.run_tests }}
156+
run: |
157+
docker run ${{ matrix.flag }} --rm -t --name "${CONTAINER_NAME}" \
158+
devitocodes/devito:${{ matrix.tag }}-dev \
159+
pytest ${{ matrix.test }}
160+
161+
deploy-devito-manifest:
162+
needs: deploy-devito
163+
runs-on: ubuntu-latest
164+
env:
165+
DOCKER_BUILDKIT: "1"
166+
167+
strategy:
168+
matrix:
169+
include:
170+
- tag: 'nvidia-nvc'
171+
base: 'bases:nvidia-nvc'
172+
arches: "amd64 arm64"
173+
- tag: 'gcc'
174+
base: 'bases:cpu-gcc'
175+
arches: "amd64 arm64"
176+
177+
steps:
178+
- name: Set up Docker Buildx
179+
uses: docker/setup-buildx-action@v3
180+
181+
- name: Login to DockerHub
182+
uses: docker/login-action@v3
183+
with:
184+
username: ${{ secrets.DOCKER_USERNAME }}
185+
password: ${{ secrets.DOCKER_PASSWORD }}
186+
187+
- name: Docker meta
188+
id: manifest-meta
189+
uses: docker/metadata-action@v5
190+
with:
191+
flavor: |
192+
latest=false
193+
images: |
194+
devitocodes/devito
195+
tags: |
196+
type=raw,value=${{ matrix.tag }}-dev
197+
type=raw,value=${{ matrix.tag }}-latest,enable=${{ github.event_name == 'release' }}
198+
type=raw,value=latest,enable=${{ matrix.base == 'bases:cpu-gcc' }}
199+
type=semver,pattern={{raw}},prefix=${{ matrix.tag }}-,enable=${{ github.event_name == 'release' }}
200+
# Legacy "gpu" tag
201+
type=raw,value=gpu-dev,enable=${{ matrix.base == 'bases:nvidia-nvc' }}
202+
type=semver,pattern={{raw}},prefix=gpu-,enable=${{ github.event_name == 'release' && matrix.base == 'bases:nvidia-nvc' }}
203+
type=semver,pattern={{raw}},value=gpu-latest,enable=${{ github.event_name == 'release' && matrix.base == 'bases:nvidia-nvc' }}
204+
# Legacy "cpu" tag
205+
type=raw,value=cpu-dev,enable=${{ matrix.base == 'bases:cpu-gcc' }}
206+
type=semver,pattern={{raw}},prefix=cpu-,enable=${{ github.event_name == 'release' && matrix.base == 'bases:cpu-gcc' }}
207+
type=semver,pattern={{raw}},value=cpu-latest,enable=${{ github.event_name == 'release' && matrix.base == 'bases:cpu-gcc' }}
208+
209+
- name: Create multi-arch manifests
210+
env:
211+
ARCHES: ${{ matrix.arches }}
212+
TAGS: ${{ steps.manifest-meta.outputs.tags }}
213+
run: |
214+
if [ -z "$TAGS" ]; then
215+
echo "No tags generated, skipping"
216+
exit 0
217+
fi
218+
for tag in $TAGS; do
219+
refs=""
220+
for arch in $ARCHES; do
221+
refs="$refs devitocodes/devito:${tag}-${arch}"
222+
done
223+
echo "Creating manifest for devitocodes/devito:${tag} using:${refs}"
224+
docker buildx imagetools create --tag devitocodes/devito:${tag} $refs
225+
docker buildx imagetools inspect devitocodes/devito:${tag}
226+
done
227+
228+
test-devito:
229+
needs: deploy-devito-manifest
230+
runs-on: ${{ matrix.runner }}
231+
env:
232+
DOCKER_BUILDKIT: "1"
233+
234+
strategy:
235+
fail-fast: false
236+
matrix:
237+
include:
238+
- tag: 'nvidia-nvc'
239+
flag: --init --gpus "device=${CUDA_VISIBLE_DEVICES:-all}"
240+
test: 'tests/test_gpu_openacc.py tests/test_gpu_common.py'
241+
runner: ["self-hosted", "nvidiagpu"]
242+
- tag: 'gcc'
243+
flag: '--init -t'
244+
test: 'tests/test_operator.py'
245+
runner: ubuntu-latest
246+
- tag: 'gcc'
247+
flag: '--init -t'
248+
test: 'tests/test_operator.py'
249+
runner: ubuntu-24.04-arm
250+
251+
steps:
252+
- name: Login to DockerHub
253+
uses: docker/login-action@v3
254+
with:
255+
username: ${{ secrets.DOCKER_USERNAME }}
256+
password: ${{ secrets.DOCKER_PASSWORD }}
257+
258+
- name: Set per‑runner variables
259+
run: |
260+
echo "CONTAINER_NAME=testrun-${{ matrix.tag }}-${RUNNER_NAME// /_}" >> $GITHUB_ENV
261+
262+
- name: Run tests against multi-arch image
115263
run: |
116264
docker run ${{ matrix.flag }} --rm -t --name "${CONTAINER_NAME}" \
117265
devitocodes/devito:${{ matrix.tag }}-dev \

.github/workflows/examples-mpi.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# CPU: Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz (24 cores)
33

44
name: Examples-mpi
5+
permissions:
6+
contents: read
57

68
env:
79
OUTPUT_PATH: ${{ github.workspace }}

.github/workflows/examples.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Examples
22

3+
permissions:
4+
contents: read
5+
36
concurrency:
47
group: ${{ github.workflow }}-${{ github.ref }}
58
cancel-in-progress: true

.github/workflows/flake8.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Flake8
22

3+
permissions:
4+
contents: read
5+
36
concurrency:
47
group: ${{ github.workflow }}-${{ github.ref }}
58
cancel-in-progress: true

.github/workflows/pytest-core-mpi.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: CI-mpi
22

3+
permissions:
4+
contents: read
5+
36
concurrency:
47
group: ${{ github.workflow }}-${{ github.ref }}
58
cancel-in-progress: true

.github/workflows/pytest-core-nompi.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: CI-core
22

3+
permissions:
4+
contents: read
5+
36
concurrency:
47
group: ${{ github.workflow }}-${{ github.ref }}
58
cancel-in-progress: true
@@ -100,7 +103,7 @@ jobs:
100103
language: "openmp"
101104
sympy: "1.13"
102105

103-
- name: pytest-docker-py310-gcc-omp
106+
- name: pytest-docker-py310-gcc-omp-arm64
104107
python-version: '3.10'
105108
os: ubuntu-24.04-arm
106109
arch: "gcc"

.github/workflows/pytest-gpu.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010

1111
name: CI-gpu
1212

13+
permissions:
14+
contents: read
15+
1316
concurrency:
1417
group: ${{ github.workflow }}-${{ github.ref }}
1518
cancel-in-progress: true

.github/workflows/pythonpublish.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Upload to PyPI
22

3+
permissions:
4+
contents: read
5+
36
on:
47
release:
58
types: [published]

.github/workflows/release-notes.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Release Drafter
22

3+
permissions:
4+
contents: read
5+
36
on:
47
push:
58
# branches to consider in the event; optional, defaults to all
@@ -9,6 +12,12 @@ on:
912
jobs:
1013
update_release_draft:
1114
runs-on: ubuntu-latest
15+
permissions:
16+
# write permission is required to create a github release
17+
contents: write
18+
# write permission is required for autolabeler
19+
# otherwise, read permission is required at least
20+
pull-requests: write
1221
steps:
1322
# Drafts your next Release notes as Pull Requests are merged into "main"
1423
- uses: release-drafter/release-drafter@v6

0 commit comments

Comments
 (0)