Files
computer-playbook/utils/env/handlers/act_platform_image.py
kevinveenbirkenbachandClaude Opus 5 2d283ed39a feat(ci): resolve image refs from services.yml SPOT
moby/buildkit was hardcoded in four places across two workflows and catthehacker/ubuntu in two act scripts, none of them reachable by the image mirror: utils/docker/image/discovery.py only scans roles/**/meta/services.yml. So the one image the CI build cannot proceed without was pulled straight from Docker Hub, unmirrored, which is what broke the fedora build in run 30160077828.

Declare both as mirror-only services on svc-runner, following the test-e2e-playwright precedent, so the existing mirror pipeline picks them up unchanged. New scripts/meta/resolve/image/service_ref.sh reads image+version back out of the declaration and is the single source for consumers outside Ansible; its mode argument is mandatory (upstream never touches the network, mirror prefers the GHCR tag and falls back to upstream). The fallback is why the mirror job can keep running in parallel with the build instead of gating it.

ACT_PLATFORM_IMAGE moves to an env handler so act consumers read the declared value via BASH_ENV, and workflow.sh now demands it instead of defaulting to a literal. Operator overrides still win through eb.setdefault.

Verified: service_ref.sh in all four paths (upstream, mirror hit, missing mode, invalid mode); the mirror path matches GHCRProvider.image_base() character for character and resolves against the live registry anonymously; ACT_PLATFORM_IMAGE resolves through the real BASH_ENV mechanism; make quality green on all four targets.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-27 23:53:33 +02:00

28 lines
748 B
Python

"""ACT_PLATFORM_IMAGE: act runner platform image, resolved from the svc-runner
role's ``act-runner`` service declaration."""
from __future__ import annotations
from typing import TYPE_CHECKING
from utils.env.runtime import run_helper
if TYPE_CHECKING:
from utils.env.builder import BuildContext, EnvBuilder
KEY = "ACT_PLATFORM_IMAGE"
COMMENT = (
"act runner platform image, declared as svc-runner/act-runner in meta/services.yml."
)
RESOLVER = "scripts/meta/resolve/image/service_ref.sh"
def apply(eb: EnvBuilder, ctx: BuildContext) -> None:
image = run_helper(
["bash", RESOLVER, "svc-runner", "act-runner", "upstream"],
cwd=ctx.repo_root,
)
if image:
eb.setdefault(KEY, image, comment=COMMENT)