11name : Publish devito docker images from compiler bases
22
3+ permissions :
4+ contents : read
5+
36on :
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 \
0 commit comments