Skip to content

Commit c578f7c

Browse files
derneuereclaude
andcommitted
ci: skip arm64 build for backend-gpu image
The librephotos-base-gpu image is amd64-only, so the arm64 job in the GPU image build fails resolving the base manifest. Add an amd64-only flag to the reusable _build-image workflow that skips the arm64 job and builds the final tag from amd64 alone, and wire it into image-backend-gpu. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 6513f10 commit c578f7c

2 files changed

Lines changed: 26 additions & 10 deletions

File tree

.github/workflows/_build-image.yml

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ on:
2626
required: false
2727
default: ""
2828
type: string
29+
amd64-only:
30+
description: "Build only linux/amd64. Use for images whose base has no arm64 manifest (e.g. GPU)."
31+
required: false
32+
default: false
33+
type: boolean
2934
secrets:
3035
DOCKER_HUB_USERNAME:
3136
required: true
@@ -65,6 +70,7 @@ jobs:
6570
tags: ${{ steps.tag.outputs.tag }}
6671

6772
build-arm64:
73+
if: ${{ !inputs.amd64-only }}
6874
runs-on: ubuntu-24.04-arm
6975
steps:
7076
- uses: actions/checkout@v4
@@ -97,6 +103,10 @@ jobs:
97103

98104
combine-manifest:
99105
needs: [build-amd64, build-arm64]
106+
if: |
107+
always() &&
108+
needs.build-amd64.result == 'success' &&
109+
(inputs.amd64-only || needs.build-arm64.result == 'success')
100110
runs-on: ubuntu-24.04
101111
steps:
102112
- name: Set up Docker Buildx
@@ -106,17 +116,21 @@ jobs:
106116
with:
107117
username: ${{ secrets.DOCKER_HUB_USERNAME }}
108118
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
109-
- name: Combine multi-arch manifest
119+
- name: Combine manifest
110120
run: |
121+
if [ "${{ inputs.amd64-only }}" = "true" ]; then
122+
ARM64_SUFFIX=""
123+
else
124+
ARM64_SUFFIX="-arm64"
125+
fi
111126
if [ -n "${{ inputs.release-tag }}" ]; then
112-
docker buildx imagetools create -t ${{ inputs.image }}:${{ inputs.release-tag }} \
113-
${{ inputs.image }}:${{ inputs.release-tag }}-amd64 \
114-
${{ inputs.image }}:${{ inputs.release-tag }}-arm64
115-
docker buildx imagetools create -t ${{ inputs.image }}:latest \
116-
${{ inputs.image }}:${{ inputs.release-tag }}-amd64 \
117-
${{ inputs.image }}:${{ inputs.release-tag }}-arm64
127+
BASE="${{ inputs.image }}:${{ inputs.release-tag }}"
128+
SOURCES="${BASE}-amd64"
129+
[ -n "$ARM64_SUFFIX" ] && SOURCES="$SOURCES ${BASE}${ARM64_SUFFIX}"
130+
docker buildx imagetools create -t "${BASE}" $SOURCES
131+
docker buildx imagetools create -t ${{ inputs.image }}:latest $SOURCES
118132
else
119-
docker buildx imagetools create -t ${{ inputs.image }}:dev \
120-
${{ inputs.image }}:dev-amd64 \
121-
${{ inputs.image }}:dev-arm64
133+
SOURCES="${{ inputs.image }}:dev-amd64"
134+
[ -n "$ARM64_SUFFIX" ] && SOURCES="$SOURCES ${{ inputs.image }}:dev${ARM64_SUFFIX}"
135+
docker buildx imagetools create -t ${{ inputs.image }}:dev $SOURCES
122136
fi

.github/workflows/image-backend-gpu.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
with:
2020
image: reallibrephotos/librephotos-gpu
2121
dockerfile: deploy/docker/backend-gpu/Dockerfile
22+
amd64-only: true
2223
build-args: |
2324
IMAGE_TAG=dev
2425
secrets: inherit
@@ -29,6 +30,7 @@ jobs:
2930
with:
3031
image: reallibrephotos/librephotos-gpu
3132
dockerfile: deploy/docker/backend-gpu/Dockerfile
33+
amd64-only: true
3234
release-tag: ${{ github.event.release.tag_name }}
3335
build-args: |
3436
IMAGE_TAG=${{ github.event.release.tag_name }}

0 commit comments

Comments
 (0)