ci: arm64 policy - serialise legs, one retry, never drop an existing arm64, ELF check before publish
- max-parallel: 2 on the cac / cac-fpm matrices (8 concurrent QEMU legs failed on 2026-11-19) - ONE retry of a failed arm64 leg (90 s pause) in cac, cac-fpm, shared-httpd - assemble-multiarch-index.sh: --guard-existing-arm64 (fail instead of replacing a multi-arch tag by amd64-only; dispatch input allow_amd64_only overrides) and --verify-bin (ELF machine type of amd64 and arm64 before any tag is written) - tests: assemble-guard.test.sh, wiring tests; docs/arm64-publish-policy.md Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
This commit is contained in:
1 parent
655c88f10b
commit
e1ea28e6a8
5 files changed
+274
-11
No files matched your search
@@ -17,6 +17,11 @@ on:
|
||||
required: false
|
||||
default: ''
|
||||
type: string
|
||||
allow_amd64_only:
|
||||
description: 'true = let a build whose arm64 leg failed replace a tag that already has arm64 with an amd64-only one (default: fail instead; restore arm64 afterwards with the arm64-attach workflow).'
|
||||
required: false
|
||||
default: 'false'
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
# Shell gate. Runs FIRST and costs seconds; the images below do not depend on
|
||||
@@ -79,6 +84,7 @@ jobs:
|
||||
scripts/index-platforms.sh \
|
||||
scripts/assemble-multiarch-index.sh \
|
||||
scripts/attach-arm64-index.sh \
|
||||
scripts/tests/assemble-guard.test.sh \
|
||||
scripts/tests/attach-arm64-index.test.sh \
|
||||
scripts/tests/verify-image-arch.test.sh \
|
||||
scripts/tests/image-label-amd64.test.sh \
|
||||
@@ -105,6 +111,7 @@ jobs:
|
||||
run: |
|
||||
./scripts/tests/attach-arm64-index.test.sh
|
||||
./scripts/tests/verify-image-arch.test.sh
|
||||
./scripts/tests/assemble-guard.test.sh
|
||||
|
||||
# Static wiring of the multi-arch publish jobs (cac, cac-fpm, shared-httpd):
|
||||
# by-digest pushes, non-fatal arm64 leg, timeouts, exact tag scheme.
|
||||
@@ -162,6 +169,11 @@ jobs:
|
||||
# One PHP version failing (e.g. an EOL stream) must not cancel the
|
||||
# security builds of the others.
|
||||
fail-fast: false
|
||||
# 2026-11-19: 4+4 QEMU arm64 legs ran at once and 6 of 8 failed on network steps
|
||||
# (Remi / pkg-cache timeouts, truncated repomd.xml.asc); legs run alone succeeded.
|
||||
# Caps concurrent legs of this family (max-parallel 1 = safest, slowest; whether
|
||||
# the runner honours it is unverified).
|
||||
max-parallel: 2
|
||||
matrix:
|
||||
phpver: ${{ fromJSON(needs.plan.outputs.cac) }}
|
||||
steps:
|
||||
@@ -301,13 +313,35 @@ jobs:
|
||||
EXPECT_PHP_MIN=${{ steps.phpmin.outputs.min }}
|
||||
outputs: type=image,name=repo.anhonesthost.net/cloud-hosting-platform/cac,push-by-digest=true,name-canonical=true,push=true
|
||||
|
||||
# ONE retry of a failed arm64 leg after a pause (network-step flakes). Same inputs.
|
||||
- name: Wait before arm64 retry
|
||||
if: steps.arm64.outcome == 'failure'
|
||||
run: sleep 90
|
||||
|
||||
- name: Retry arm64 (push by digest)
|
||||
id: arm64_retry
|
||||
if: steps.arm64.outcome == 'failure'
|
||||
continue-on-error: true
|
||||
timeout-minutes: 45
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
platforms: linux/arm64
|
||||
build-args: |
|
||||
PHPVER=${{ matrix.phpver }}
|
||||
CACHE_BUST=${{ steps.bust.outputs.value }}
|
||||
BASE_IMAGE=${{ steps.base.outputs.image }}
|
||||
PKG_CACHE=${{ steps.pkgcache.outputs.url }}
|
||||
EXPECT_PHP_MIN=${{ steps.phpmin.outputs.min }}
|
||||
outputs: type=image,name=repo.anhonesthost.net/cloud-hosting-platform/cac,push-by-digest=true,name-canonical=true,push=true
|
||||
|
||||
# Creates the index tag(s) from THIS run's digests only (a previous run's
|
||||
# arm64 is never re-attached). scripts/assemble-multiarch-index.sh.
|
||||
- name: Assemble index tag(s)
|
||||
env:
|
||||
AMD64_DIGEST: ${{ steps.amd64.outputs.digest }}
|
||||
ARM64_DIGEST: ${{ steps.arm64.outputs.digest }}
|
||||
ARM64_OUTCOME: ${{ steps.arm64.outcome }}
|
||||
ARM64_DIGEST: ${{ steps.arm64.outputs.digest || steps.arm64_retry.outputs.digest }}
|
||||
ARM64_OUTCOME: ${{ (steps.arm64.outcome == 'success' || steps.arm64_retry.outcome == 'success') && 'success' || steps.arm64.outcome }}
|
||||
ALLOW_AMD64_ONLY: ${{ github.event.inputs.allow_amd64_only }}
|
||||
PHPVER: ${{ matrix.phpver }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
@@ -317,6 +351,7 @@ jobs:
|
||||
scripts/assemble-multiarch-index.sh \
|
||||
--amd64 "$AMD64_DIGEST" \
|
||||
--arm64 "$ARM64_DIGEST" --arm64-outcome "$ARM64_OUTCOME" \
|
||||
--guard-existing-arm64 --verify-bin /usr/sbin/httpd --verify-bin /usr/bin/php \
|
||||
--repo repo.anhonesthost.net/cloud-hosting-platform/cac \
|
||||
"${tags[@]}"
|
||||
|
||||
@@ -329,6 +364,11 @@ jobs:
|
||||
# One PHP version failing (e.g. an EOL stream) must not cancel the
|
||||
# security builds of the others.
|
||||
fail-fast: false
|
||||
# 2026-11-19: 4+4 QEMU arm64 legs ran at once and 6 of 8 failed on network steps
|
||||
# (Remi / pkg-cache timeouts, truncated repomd.xml.asc); legs run alone succeeded.
|
||||
# Caps concurrent legs of this family (max-parallel 1 = safest, slowest; whether
|
||||
# the runner honours it is unverified).
|
||||
max-parallel: 2
|
||||
matrix:
|
||||
phpver: ${{ fromJSON(needs.plan.outputs.cac_fpm) }}
|
||||
steps:
|
||||
@@ -470,13 +510,36 @@ jobs:
|
||||
EXPECT_PHP_MIN=${{ steps.phpmin.outputs.min }}
|
||||
outputs: type=image,name=repo.anhonesthost.net/cloud-hosting-platform/cac-fpm,push-by-digest=true,name-canonical=true,push=true
|
||||
|
||||
# ONE retry of a failed arm64 leg after a pause (network-step flakes). Same inputs.
|
||||
- name: Wait before arm64 retry
|
||||
if: steps.arm64.outcome == 'failure'
|
||||
run: sleep 90
|
||||
|
||||
- name: Retry arm64 (push by digest)
|
||||
id: arm64_retry
|
||||
if: steps.arm64.outcome == 'failure'
|
||||
continue-on-error: true
|
||||
timeout-minutes: 45
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
file: ./Dockerfile.fpm
|
||||
platforms: linux/arm64
|
||||
build-args: |
|
||||
PHPVER=${{ matrix.phpver }}
|
||||
CACHE_BUST=${{ steps.bust.outputs.value }}
|
||||
BASE_IMAGE=${{ steps.base.outputs.image }}
|
||||
PKG_CACHE=${{ steps.pkgcache.outputs.url }}
|
||||
EXPECT_PHP_MIN=${{ steps.phpmin.outputs.min }}
|
||||
outputs: type=image,name=repo.anhonesthost.net/cloud-hosting-platform/cac-fpm,push-by-digest=true,name-canonical=true,push=true
|
||||
|
||||
# Creates the index tag(s) from THIS run's digests only (a previous run's
|
||||
# arm64 is never re-attached). scripts/assemble-multiarch-index.sh.
|
||||
- name: Assemble index tag(s)
|
||||
env:
|
||||
AMD64_DIGEST: ${{ steps.amd64.outputs.digest }}
|
||||
ARM64_DIGEST: ${{ steps.arm64.outputs.digest }}
|
||||
ARM64_OUTCOME: ${{ steps.arm64.outcome }}
|
||||
ARM64_DIGEST: ${{ steps.arm64.outputs.digest || steps.arm64_retry.outputs.digest }}
|
||||
ARM64_OUTCOME: ${{ (steps.arm64.outcome == 'success' || steps.arm64_retry.outcome == 'success') && 'success' || steps.arm64.outcome }}
|
||||
ALLOW_AMD64_ONLY: ${{ github.event.inputs.allow_amd64_only }}
|
||||
PHPVER: ${{ matrix.phpver }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
@@ -486,6 +549,7 @@ jobs:
|
||||
scripts/assemble-multiarch-index.sh \
|
||||
--amd64 "$AMD64_DIGEST" \
|
||||
--arm64 "$ARM64_DIGEST" --arm64-outcome "$ARM64_OUTCOME" \
|
||||
--guard-existing-arm64 --verify-bin /usr/sbin/php-fpm --verify-bin /usr/bin/php \
|
||||
--repo repo.anhonesthost.net/cloud-hosting-platform/cac-fpm \
|
||||
"${tags[@]}"
|
||||
|
||||
@@ -912,18 +976,39 @@ jobs:
|
||||
PKG_CACHE=${{ steps.pkgcache.outputs.url }}
|
||||
outputs: type=image,name=repo.anhonesthost.net/cloud-hosting-platform/shared-httpd,push-by-digest=true,name-canonical=true,push=true
|
||||
|
||||
# ONE retry of a failed arm64 leg after a pause (network-step flakes). Same inputs.
|
||||
- name: Wait before arm64 retry
|
||||
if: steps.arm64.outcome == 'failure'
|
||||
run: sleep 90
|
||||
|
||||
- name: Retry arm64 (push by digest)
|
||||
id: arm64_retry
|
||||
if: steps.arm64.outcome == 'failure'
|
||||
continue-on-error: true
|
||||
timeout-minutes: 25
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
file: ./Dockerfile.shared-httpd
|
||||
platforms: linux/arm64
|
||||
build-args: |
|
||||
BASE_IMAGE=${{ steps.base.outputs.image }}
|
||||
PKG_CACHE=${{ steps.pkgcache.outputs.url }}
|
||||
outputs: type=image,name=repo.anhonesthost.net/cloud-hosting-platform/shared-httpd,push-by-digest=true,name-canonical=true,push=true
|
||||
|
||||
# Creates the index tag(s) from THIS run's digests only (a previous run's
|
||||
# arm64 is never re-attached). scripts/assemble-multiarch-index.sh.
|
||||
- name: Assemble index tag(s)
|
||||
env:
|
||||
AMD64_DIGEST: ${{ steps.amd64.outputs.digest }}
|
||||
ARM64_DIGEST: ${{ steps.arm64.outputs.digest }}
|
||||
ARM64_OUTCOME: ${{ steps.arm64.outcome }}
|
||||
ARM64_DIGEST: ${{ steps.arm64.outputs.digest || steps.arm64_retry.outputs.digest }}
|
||||
ARM64_OUTCOME: ${{ (steps.arm64.outcome == 'success' || steps.arm64_retry.outcome == 'success') && 'success' || steps.arm64.outcome }}
|
||||
ALLOW_AMD64_ONLY: ${{ github.event.inputs.allow_amd64_only }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
scripts/assemble-multiarch-index.sh \
|
||||
--amd64 "$AMD64_DIGEST" \
|
||||
--arm64 "$ARM64_DIGEST" --arm64-outcome "$ARM64_OUTCOME" \
|
||||
--guard-existing-arm64 --verify-bin /usr/sbin/httpd \
|
||||
--repo repo.anhonesthost.net/cloud-hosting-platform/shared-httpd \
|
||||
--tag latest
|
||||
|
||||
|
||||
Reference in new issue
Block a user