@@ -45,16 +45,17 @@ jobs:
45
45
build-images :
46
46
strategy :
47
47
matrix :
48
- docker-platform : ["linux/ arm64", "linux/ amd64"]
48
+ arch : ["arm64", "amd64"]
49
49
runs-on : ubuntu-latest-m
50
50
needs : [setup, set-short-sha]
51
51
env :
52
52
SHORT_SHA : ${{ needs.set-short-sha.outputs.short_sha }}
53
+ DOCKER_PLATFORM : linux/${{ matrix.arch }}
53
54
steps :
54
55
- name : Set up Docker Buildx
55
56
uses : docker/setup-buildx-action@v3
56
57
with :
57
- driver : ${{ matrix.docker-platform == 'linux/ amd64' && 'docker' || 'docker-container' }}
58
+ driver : ${{ matrix.arch == 'amd64' && 'docker' || 'docker-container' }}
58
59
- name : Checkout code
59
60
uses : actions/checkout@v4
60
61
- name : Login to Quay.io
@@ -68,15 +69,15 @@ jobs:
68
69
# Clear some space (https://github.com/actions/runner-images/issues/2840)
69
70
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/share/boost
70
71
71
- ARCH=$(cut -d "/" -f2 <<< ${{ matrix.docker-platform }})
72
- DOCKER_BUILDKIT=1 docker buildx build --platform=$ARCH --load \
72
+ DOCKER_BUILDKIT=1 docker buildx build --load -f Dockerfile- ${{ matrix.arch }} \
73
+ --platform=$DOCKER_PLATFORM \
73
74
--build-arg PIP_VERSION=$PIP_VERSION \
74
75
--build-arg BUILDKIT_INLINE_CACHE=1 \
75
76
--build-arg PIPELINE_PACKAGE=${{ env.PIPELINE_FAMILY }} \
76
77
--provenance=false \
77
78
--progress plain \
78
- --cache-from $DOCKER_BUILD_REPOSITORY:$ARCH \
79
- -t $DOCKER_BUILD_REPOSITORY:$ARCH -$SHORT_SHA .
79
+ --cache-from $DOCKER_BUILD_REPOSITORY:${{ matrix.arch }} \
80
+ -t $DOCKER_BUILD_REPOSITORY:${{ matrix.arch }} -$SHORT_SHA .
80
81
- name : Set virtualenv cache
81
82
uses : actions/cache@v4
82
83
id : virtualenv-cache
@@ -88,20 +89,17 @@ jobs:
88
89
uses : docker/setup-qemu-action@v3
89
90
- name : Test image
90
91
run : |
91
- ARCH=$(cut -d "/" -f2 <<< ${{ matrix.docker-platform }})
92
92
source .venv/bin/activate
93
- if [ "$ {{ matrix.docker-platform }}" == "linux/arm64" ]; then
94
- DOCKER_PLATFORM="${{ matrix.docker-platform }}" DOCKER_IMAGE="$DOCKER_BUILD_REPOSITORY:$ARCH-$SHORT_SHA" \
93
+ DOCKER_IMAGE="$DOCKER_BUILD_REPOSITORY:$ {{ matrix.arch }}-$SHORT_SHA" \
94
+ if [ "$DOCKER_PLATFORM" == "linux/arm64" ]; then
95
95
SKIP_INFERENCE_TESTS=true make docker-test
96
96
else
97
- DOCKER_PLATFORM="${{ matrix.docker-platform }}" DOCKER_IMAGE="$DOCKER_BUILD_REPOSITORY:$ARCH-$SHORT_SHA" \
98
97
make docker-test
99
98
fi
100
99
- name : Push image
101
100
run : |
102
101
# write to the build repository to cache for the publish-images job
103
- ARCH=$(cut -d "/" -f2 <<< ${{ matrix.docker-platform }})
104
- docker push $DOCKER_BUILD_REPOSITORY:$ARCH-$SHORT_SHA
102
+ docker push $DOCKER_BUILD_REPOSITORY:${{ matrix.arch }}-$SHORT_SHA
105
103
publish-images :
106
104
runs-on : ubuntu-latest-m
107
105
needs : [setup, set-short-sha, build-images]
0 commit comments