Skip to content

Commit aa28279

Browse files
committed
Build containers with platform-specific package images.
[ci skip]
1 parent 8c4705b commit aa28279

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

.github/workflows/Container.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish Docker image
1+
name: Publish Docker container
22

33
on:
44
workflow_dispatch:
@@ -20,7 +20,7 @@ on:
2020

2121
jobs:
2222
push_to_registry:
23-
name: Build container - Julia ${{ matrix.julia }} - CUDA ${{ matrix.cuda }}
23+
name: Container for ${{ matrix.platform }} - Julia ${{ matrix.julia }} - CUDA ${{ matrix.cuda }}
2424
runs-on: ubuntu-latest
2525
permissions:
2626
contents: read
@@ -30,9 +30,15 @@ jobs:
3030
matrix:
3131
julia: ["1.10", "1.11"]
3232
cuda: ["11.8", "12.6"]
33+
platform: ["linux/amd64", "linux/arm64"]
3334
include:
3435
- julia: "1.11"
3536
cuda: "12.6"
37+
platform: "linux/amd64"
38+
default: true
39+
- julia: "1.11"
40+
cuda: "12.6"
41+
platform: "linux/arm64"
3642
default: true
3743

3844
steps:
@@ -68,6 +74,15 @@ jobs:
6874
CUDA_MAJOR=$(echo ${{ matrix.cuda }} | cut -d'.' -f1)
6975
echo "major=${CUDA_MAJOR}" >> $GITHUB_OUTPUT
7076
77+
- name: Set CPU target
78+
id: cpu_target
79+
run: |
80+
if [[ "${{ matrix.platform }}" == "linux/amd64" ]]; then
81+
echo "target=generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)" >> $GITHUB_OUTPUT
82+
elif [[ "${{ matrix.platform }}" == "linux/arm64" ]]; then
83+
echo "target=generic;cortex-a57;thunderx2t99;carmel,clone_all;apple-m1,base(3);neoverse-512tvb,base(3)" >> $GITHUB_OUTPUT
84+
fi
85+
7186
- name: Log in to registry
7287
uses: docker/login-action@v3
7388
with:
@@ -97,9 +112,11 @@ jobs:
97112
context: .
98113
push: true
99114
provenance: false # the build fetches the repo again, so provenance tracking is not useful
115+
platforms: ${{ matrix.platform }}
100116
tags: ${{ steps.meta.outputs.tags }}
101117
labels: ${{ steps.meta.outputs.labels }}
102118
build-args: |
103119
JULIA_VERSION=${{ matrix.julia }}
104120
CUDA_VERSION=${{ matrix.cuda }}
105121
PACKAGE_SPEC=CUDA#${{ steps.pkg.outputs.ref }}
122+
JULIA_CPU_TARGET=${{ steps.cpu_target.outputs.target }}

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
ARG JULIA_VERSION=1
1111
FROM julia:${JULIA_VERSION}
1212

13+
ARG JULIA_CPU_TARGET=native
14+
ENV JULIA_CPU_TARGET=${JULIA_CPU_TARGET}
15+
1316
ARG CUDA_VERSION=12.6
1417

1518
ARG PACKAGE_SPEC=CUDA

0 commit comments

Comments
 (0)