Skip to content

Commit

Permalink
Build containers with platform-specific package images.
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
maleadt authored and THargreaves committed Jan 7, 2025
1 parent 953c796 commit 319514a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/Container.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Docker image
name: Publish Docker container

on:
workflow_dispatch:
Expand All @@ -20,7 +20,7 @@ on:

jobs:
push_to_registry:
name: Build container - Julia ${{ matrix.julia }} - CUDA ${{ matrix.cuda }}
name: Container for ${{ matrix.platform }} - Julia ${{ matrix.julia }} - CUDA ${{ matrix.cuda }}
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -30,9 +30,15 @@ jobs:
matrix:
julia: ["1.10", "1.11"]
cuda: ["11.8", "12.6"]
platform: ["linux/amd64", "linux/arm64"]
include:
- julia: "1.11"
cuda: "12.6"
platform: "linux/amd64"
default: true
- julia: "1.11"
cuda: "12.6"
platform: "linux/arm64"
default: true

steps:
Expand Down Expand Up @@ -68,6 +74,15 @@ jobs:
CUDA_MAJOR=$(echo ${{ matrix.cuda }} | cut -d'.' -f1)
echo "major=${CUDA_MAJOR}" >> $GITHUB_OUTPUT
- name: Set CPU target
id: cpu_target
run: |
if [[ "${{ matrix.platform }}" == "linux/amd64" ]]; then
echo "target=generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)" >> $GITHUB_OUTPUT
elif [[ "${{ matrix.platform }}" == "linux/arm64" ]]; then
echo "target=generic;cortex-a57;thunderx2t99;carmel,clone_all;apple-m1,base(3);neoverse-512tvb,base(3)" >> $GITHUB_OUTPUT
fi
- name: Log in to registry
uses: docker/login-action@v3
with:
Expand Down Expand Up @@ -97,9 +112,11 @@ jobs:
context: .
push: true
provenance: false # the build fetches the repo again, so provenance tracking is not useful
platforms: ${{ matrix.platform }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
JULIA_VERSION=${{ matrix.julia }}
CUDA_VERSION=${{ matrix.cuda }}
PACKAGE_SPEC=CUDA#${{ steps.pkg.outputs.ref }}
JULIA_CPU_TARGET=${{ steps.cpu_target.outputs.target }}
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
ARG JULIA_VERSION=1
FROM julia:${JULIA_VERSION}

ARG JULIA_CPU_TARGET=native
ENV JULIA_CPU_TARGET=${JULIA_CPU_TARGET}

ARG CUDA_VERSION=12.6

ARG PACKAGE_SPEC=CUDA
Expand Down

0 comments on commit 319514a

Please sign in to comment.