mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-08 19:56:53 +00:00
Every check asked `docker manifest inspect` whether a tag resolved. A tag serving only amd64 answers yes, so the arm64 half of the pool could be absent from `latest` while the release, the CI-image wait and the cron picker all reported the images present. `architectures.sh` answers the narrower question instead: given a reference, which architectures must it serve that it does not. It subtracts the manifest index's platforms from `resolve_architectures()`, so the pool stays declared in one place and an absent tag and a single-architecture tag give the same answer to every caller. `highest_release_tag.sh` checks `latest` before it walks the version tags. The published install instructions name the image without a tag, so a reader pulls `latest`, and only a release of the highest version republishes it: an architecture missing from `latest` is therefore reported as that version missing. Older tags stay an existence check, because their source predates the architecture and no rebuild for it is available. The CI-image wait is handed the run's own architecture list, the same expression the build matrix and the manifest step already read, so it cannot demand more than the run produced. The two release workflows pass no list and therefore require the whole pool, which is what drives the rebuild. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
39 lines
1.1 KiB
Bash
Executable File
39 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# Output:
|
|
# The architectures the reference must serve but does not, space-separated;
|
|
# empty when it serves all of them.
|
|
#
|
|
# Env:
|
|
# IMAGE_ARCHITECTURES narrows what the reference must serve; empty asks for
|
|
# the whole pool utils/github/variant/pools.py declares
|
|
set -euo pipefail
|
|
|
|
ref="${1:?Missing image reference}"
|
|
|
|
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
repo_root="$(cd "${script_dir}/../../../.." && pwd)"
|
|
|
|
if ! manifest="$(docker manifest inspect "${ref}" 2>/dev/null)"; then
|
|
manifest=""
|
|
fi
|
|
|
|
cd "${repo_root}"
|
|
|
|
MANIFEST="${manifest}" IMAGE_ARCHITECTURES="${IMAGE_ARCHITECTURES:-}" \
|
|
"${PYTHON:-python3}" -c '
|
|
import json
|
|
import os
|
|
|
|
from utils.github.variant.pools import resolve_architectures
|
|
|
|
raw = os.environ["MANIFEST"].strip()
|
|
index = json.loads(raw) if raw else {}
|
|
served = {
|
|
entry.get("platform", {}).get("architecture")
|
|
for entry in index.get("manifests", [])
|
|
}
|
|
required = resolve_architectures(os.environ["IMAGE_ARCHITECTURES"])
|
|
print(" ".join(name for name in required if name not in served))
|
|
'
|