Skip to content

Commit 71d095b

Browse files
committed
CI: Pull/push container images from/to GitHub registry
Thus far we've assumed that the CI Docker images were available locally on the runner's machine, which effectively limited us to running each build matrix entry on a specific machine (i.e., the one where the respective image was built). Switching to a public registry allows us to have more than one machine for running jobs on NVIDIA hardware, for example.
1 parent 404e325 commit 71d095b

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

.github/workflows/celerity_ci.yml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,12 @@ jobs:
5858
container:
5959
# We could run this for more than one implementation,
6060
# but would likely end up with mostly duplicate diagnostics.
61-
image: celerity-build/hipsycl:ubuntu22.04-latest
61+
image: ghcr.io/celerity/celerity-build/hipsycl:ubuntu22.04-latest
6262
volumes:
6363
- ccache:/ccache
64+
credentials:
65+
username: ${{ github.actor }}
66+
password: ${{ secrets.GITHUB_TOKEN }}
6467
steps:
6568
# Here and in jobs below: We need to manually set the container workspace
6669
# path as an environment variable, as (curiously) the `github.workspace` context
@@ -141,9 +144,12 @@ jobs:
141144
build-dir: /root/build
142145
examples-build-dir: /root/build-examples
143146
container:
144-
image: celerity-build/${{ matrix.sycl }}:ubuntu${{ matrix.ubuntu-version }}-${{ matrix.sycl-version }}
147+
image: ghcr.io/celerity/celerity-build/${{ matrix.sycl }}:ubuntu${{ matrix.ubuntu-version }}-${{ matrix.sycl-version }}
145148
volumes:
146149
- ccache:/ccache
150+
credentials:
151+
username: ${{ github.actor }}
152+
password: ${{ secrets.GITHUB_TOKEN }}
147153
steps:
148154
- name: Set container workspace environment variable
149155
run: echo "container-workspace=$GITHUB_WORKSPACE" > $GITHUB_ENV
@@ -220,20 +226,30 @@ jobs:
220226
- sycl: "hipsycl"
221227
platform: "nvidia"
222228
env:
223-
image-basename-dpcpp: celerity-build/dpcpp:ubuntu${{ needs.build-and-test.outputs.dpcpp-HEAD-ubuntu-version }}
224-
image-basename-hipsycl: celerity-build/hipsycl:ubuntu${{ needs.build-and-test.outputs.hipsycl-HEAD-ubuntu-version }}
229+
image-basename-dpcpp: ghcr.io/celerity/celerity-build/dpcpp:ubuntu${{ needs.build-and-test.outputs.dpcpp-HEAD-ubuntu-version }}
230+
image-basename-hipsycl: ghcr.io/celerity/celerity-build/hipsycl:ubuntu${{ needs.build-and-test.outputs.hipsycl-HEAD-ubuntu-version }}
231+
permissions:
232+
packages: write
225233
steps:
234+
- name: Log into Container registry
235+
uses: docker/login-action@v3
236+
with:
237+
registry: ghcr.io
238+
username: ${{ github.actor }}
239+
password: ${{ secrets.GITHUB_TOKEN }}
226240
- if: matrix.sycl == 'dpcpp'
227241
run: |
228242
if [[ "${{ needs.build-and-test.outputs.dpcpp-HEAD-Debug-works }}" -eq 1 ]] && [[ "${{ needs.build-and-test.outputs.dpcpp-HEAD-Release-works }}" -eq 1 ]]; then
229243
docker tag ${{ env.image-basename-dpcpp }}-HEAD ${{ env.image-basename-dpcpp }}-latest
244+
docker push ${{ env.image-basename-dpcpp }}-latest
230245
else
231246
exit 1
232247
fi
233248
- if: matrix.sycl == 'hipsycl'
234249
run: |
235250
if [[ "${{ needs.build-and-test.outputs.hipsycl-HEAD-Debug-works }}" -eq 1 ]] && [[ "${{ needs.build-and-test.outputs.hipsycl-HEAD-Release-works }}" -eq 1 ]]; then
236251
docker tag ${{ env.image-basename-hipsycl }}-HEAD ${{ env.image-basename-hipsycl }}-latest
252+
docker push ${{ env.image-basename-hipsycl }}-latest
237253
else
238254
exit 1
239255
fi
@@ -245,7 +261,10 @@ jobs:
245261
env:
246262
container-workspace: <placeholder>
247263
container:
248-
image: celerity-lint
264+
image: ghcr.io/celerity/celerity-lint
265+
credentials:
266+
username: ${{ github.actor }}
267+
password: ${{ secrets.GITHUB_TOKEN }}
249268
steps:
250269
- name: Set container workspace environment variable
251270
run: echo "container-workspace=$GITHUB_WORKSPACE" > $GITHUB_ENV

0 commit comments

Comments
 (0)