Skip to content

ci: one image-registry setting and a quay-capable registry library (Quay migration phase 1, no behaviour change) - #998

Merged
bpalermo merged 2 commits into
mainfrom
ci/registry-abstraction
Sep 27, 2026
Merged

bpalermo merged 2 commits into
mainfrom
ci/registry-abstraction

Conversation

@bpalermo

Copy link
Copy Markdown
Owner

Phase 1 of proposal 040 (Quay migration). No behaviour change: everything still publishes to and verifies against ghcr.io/bpalermo/aether. Every rendered coordinate is unchanged; I queried the image_push, image_load, oci_push/oci_load and helm push targets before and after the change.

One setting

bazel/img/registry.bzl holds the four values below, plus the helpers image_repository(), image_reference(), chart_repository(), chart_registry_url() and registry_token_url():

IMAGE_REGISTRY = "ghcr.io"                        # phase 2: "quay.io"
IMAGE_NAMESPACE = "bpalermo/aether"               # phase 2: "aethermesh"
IMAGE_NAME_OVERRIDES = {"proxy": "aether-proxy"}  # phase 2: {}
CHART_REPOSITORY_PREFIX = "charts/"               # phase 2: "chart-"
reader how
9 go_multi_arch_image call sites, go_multi_arch_image.bzl default image_repository("<c>"), IMAGE_REGISTRY
4 charts (login_url/registry_url), aether_proxy_supervisor_image_test IMAGE_REGISTRY, chart_registry_url(), image_reference("proxy-supervisor")
//proxy oci_push/oci_load proxy/bazel/registry.bzl, a byte-identical copy (that workspace cannot load from the root module)
//bazel/proxy_pin matches the pin by image_reference("proxy") (was: last segment == aether-proxy), token via registry_token_url()
//test/e2e:e2e_test x_defs default image refs (AETHER_*_IMAGE still override)
workflows scripts/image-registry.sh >> "$GITHUB_ENV" after checkout → IMAGE_REGISTRY_HOST, IMAGE_NAMESPACE, IMAGE_REGISTRY, PROXY_IMAGE; docker/login-action registry: derived; proxy-release's IMAGE → PROXY_IMAGE; bump-chart's sed address derived
e2e scripts (6) IMAGE_REGISTRY="$(scripts/image-registry.sh prefix)"
verifiers scripts/registry-lib.sh resolves its repo lists through image-registry.sh

Guards. scripts/check-registry-config.sh runs in ci's shell job, and in proxy's shell job because a proxy-only PR skips ci. It asserts four things:

  • the setting parses (exit 2 otherwise);
  • the proxy copy is identical;
  • the aether-proxy pin in values.yaml names image_reference("proxy");
  • no tracked file outside the allow-list spells <host>/<namespace>, or the bare namespace path. Allow-list: the setting and its copy, the pin, docs/, website/, charts/README.md, proxy/README.md, .devcontainer/, and the check itself.

Separately, //bazel/img:registry_test pins image-registry.sh against the Starlark helpers (26 answers).

Registry library

scripts/ghcr-lib.sh becomes scripts/registry-lib.sh. The old file is now a one-line shim, and every ghcr_* / GHCR_* name is still an alias.

  • The target registry is REGISTRY_HOST, read at call time. It defaults to the host in the setting.
  • Tokens come from the right endpoint for each host: ghcr /token, quay /v2/auth. REGISTRY_USERNAME/REGISTRY_PASSWORD are supported for a Quay robot. GHCR_TOKEN is sent only to ghcr.io.
  • New registry_referrers <repo> <digest> <token> [artifactType]. It follows Link pagination and returns 0/200 with a merged index, 1/404 meaning "no referrers API", or 2 for anything else, including a 200 that is not an index.
  • registry_signature_layout[_direct] can now return referrer: a referrer whose artifactType is application/vnd.dev.sigstore.bundle.v0.3+json and whose dev.sigstore.bundle.predicateType is https://sigstore.dev/cosign/sign/v1, or one of cosign 2's application/vnd.dev.cosign.artifact.sig.v1+json. An attestation bundle or a buildx attestation does not count. More than one layout present is reported as both.
  • verify-image-signatures.sh takes the host from each ref. Its header notes that cosign v3 finds a referrer on quay by itself.

Harnesses (all offline)

  • check-ghcr-lookup.sh becomes check-registry-lookup.sh, now 30 cases. It adds a fake quay covering:
    • the /v2/auth token shape;
    • a referrers index with a sign bundle plus an attestation → referrer;
    • referrers 404 → falls back to the tag layouts;
    • referrers 5xx → inconclusive;
    • a 200 whose body is not an index → inconclusive;
    • a sign bundle on referrers page 2 → found;
    • a sign referrer plus a .sig tag → both;
    • the shim still working;
    • the real verifier end to end against the phase-2 setting (a temp registry.bzl flipped to quay.io/aethermesh) with signatures only as referrers → PASS 36/36, 24 of them via referrers.
  • check-signature-layout.sh now has 13 cases, adding the referrer layouts.
  • Unchanged and still green: check-publish-verify-control.sh (14/14), check-proxy-pin.sh (18/18), check-push-head-selection.sh (6/6), check-index-children.sh (7/7), check-shell-lint.sh (37 scripts covered).

For each new case I made a scratch mutation, watched it go red, then reverted. Details are in the session report.

Real read-only proofs

  • ghcr.io, bpalermo/aether/agent:dev:
    • /token returns 200; tag lookup returns rc 0, and a missing tag rc 1;
    • registry_referrers returns rc 1 (404, no API), so the tag layouts decide: the index and both children are bundle.
  • quay.io, prometheus/prometheus:latest:
    • /v2/auth returns 200; HEAD returns rc 0, and a missing tag rc 1;
    • referrers returns 200 with an empty index; layout none.
  • quay.io images that do carry cosign referrers:
    • argoproj/argocd:latest has 1 sign-bundle referrer (referrer).
    • cilium/cilium:stable has 2 (referrer).
    • jetstack/cert-manager-controller:v1.18.0 has only a .sig tag (legacy).
    • keycloak/keycloak:latest children have buildx attestation referrers and read as none, which is correct.

Validation

  • bazel build of //bazel/... //charts/... //tools/... //test/... //agent/cmd/... //cni/cmd/... //registrar/cmd/... //controller/cmd/... //prober/cmd/... //e2e/...
  • bazel test of the same set: 33 pass, including every image_test, the chart template tests and registry_test.
  • The e2e_test binary carries the x_defs refs.
  • In proxy/: bazel build --nobuild //:push //:load
  • bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //scripts/... //bazel/... //e2e/... //tools/... //charts/... //test/...
  • make gazelle and bazel run //:format leave no diff.
  • Every workflow parses as YAML.
  • Chart patch bumps: aether 0.95.5, crds 0.8.1, prober 0.4.3, udsecho 0.2.3.

Not run: kind/e2e, any push or signing, actionlint.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

…uay migration phase 1, no behaviour change)

Proposal 040 moves every image and chart from ghcr.io/bpalermo/aether to the
quay.io org `aethermesh`. This is phase 1: nothing moves yet, but the move
becomes a one-file flip and the verification library already works against
both registries.

One setting: bazel/img/registry.bzl (IMAGE_REGISTRY, IMAGE_NAMESPACE,
IMAGE_NAME_OVERRIDES, CHART_REPOSITORY_PREFIX + image_repository(),
image_reference(), chart_repository(), chart_registry_url(),
registry_token_url()). Every go_multi_arch_image call site, the chart pushes
and the proxy-supervisor template test, the e2e go_test (x_defs) and
//bazel/proxy_pin read it; the //proxy workspace carries a byte-identical copy
(proxy/bazel/registry.bzl). Workflows, verifiers and e2e scripts read it through
scripts/image-registry.sh (strict parse, no defaults); IMAGE_REGISTRY /
PROXY_IMAGE in the workflows are now derived into $GITHUB_ENV.
scripts/check-registry-config.sh (ci + proxy shell jobs) asserts the setting
parses, the proxy copy matches, the aether-proxy pin agrees, and no literal
survives outside a written-down allow-list; //bazel/img:registry_test pins the
shell reader against the Starlark helpers.

scripts/ghcr-lib.sh -> scripts/registry-lib.sh (ghcr-lib.sh is a shim; every
ghcr_* name is an alias): REGISTRY_HOST-parameterised, per-host token endpoint
(ghcr /token, quay /v2/auth), and registry_referrers (OCI 1.1; a 404 means "no
API", never "no signatures"). registry_signature_layout[_direct] now also
reports `referrer` for a cosign sign-bundle referrer (an attestation bundle or a
buildx attestation does not count). check-ghcr-lookup.sh ->
check-registry-lookup.sh with a fake quay; check-signature-layout.sh gains the
referrer cases.

Every rendered coordinate is unchanged (image_push/image_load/oci_push/helm
push targets queried before and after). Chart patch versions bumped because
their BUILD files changed.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
@bpalermo
bpalermo force-pushed the ci/registry-abstraction branch from e669567 to 58aca21 Compare September 27, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant