Skip to content

feat(040): publish to quay.io/aethermesh — registry flip, chart-<name> repositories via oras, release-environment pushes, split sweep (Quay cut-over, phase 2) - #1017

Merged
bpalermo merged 8 commits into
mainfrom
feat/040-quay-cutover
Sep 27, 2026

Conversation

@bpalermo

@bpalermo bpalermo commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

Proposal 040, phase 2: every image and chart now publishes to the Quay org quay.io/aethermesh. Gate: quay-smoke run 36345331611 was green. It showed that the robot can push to pre-created repositories but cannot create them, that cosign v3.1.2 keyless sign --recursive writes a referrer only on the index and every child, and that verify_image_signatures passes on quay.

What moves

artifact before (ghcr.io) now (quay.io)
agent / mesh-dns / proxy-supervisor / cni-install / registrar / controller / prober / udsecho images ghcr.io/bpalermo/aether/<component> quay.io/aethermesh/<component>
proxy image (proxy-release.yml) ghcr.io/bpalermo/aether/aether-proxy quay.io/aethermesh/proxy
aether / crds / prober / udsecho charts ghcr.io/bpalermo/aether/charts/<name> quay.io/aethermesh/chart-<name>
signatures cosign tag (sha256-<hex> / .sig) OCI 1.1 referrer, no tag

The flip itself is in bazel/img/registry.bzl (byte-equal proxy/bazel/registry.bzl): quay.io / aethermesh / {} / chart-. The file also gets two new lines:

  • SIGNATURE_LAYOUT = "referrer": the layout the sweep now asserts for every commit published under this setting.
  • PROXY_PIN_LEGACY_REFERENCES = ["ghcr.io/bpalermo/aether/aether-proxy"]: see "The proxy pin" below.

image-registry.sh gains chart-ref, signature-layout and proxy-pin-refs. //bazel/img:registry_test checks all 32 answers against the Starlark helpers.

Breaking: every chart is major-bumped

The charts go to aether 0.95.7 → 1.0.0, crds 0.8.1 → 1.0.0, prober 0.4.3 → 1.0.0 and udsecho 0.2.3 → 1.0.0. The default image repositories moved, which breaks anyone who overrides repository by prefix. The chart-version-bump check passes against current main.

To migrate a chart consumer:

  1. Point helm at oci://quay.io/aethermesh/chart-<name>.
  2. Upgrade with the values you run today: helm get values <release> -n <ns> -o yaml > values.yaml, then -f values.yaml. Never --reuse-values.
  3. If you mirror images, mirror from quay.io/aethermesh/<component> and override each image's repository individually.

Releases from before the move stay on ghcr.io, untouched. This is written up in docs/getting-started.md, charts/README.md, README.md and the runbook.

How charts are pushed: chart_push (oras)

helm push can't do this job, for three reasons:

  • It appends Chart.yaml's name: to its base, so it can't name the repository.
  • Quay has no nested repositories to hold charts/<name>.
  • Bare prober / udsecho would collide with the images of the same name.

Instead, chart_push in //bazel/helm:defs.bzl writes exactly what helm push writes, and names the repository:

  • The command is oras push <chart_registry_url(chart)>:<packaged version> --config Chart.json:application/vnd.cncf.helm.config.v1+json <name>-<version>.tgz:application/vnd.cncf.helm.chart.content.v1.tar+gzip.
  • The Chart.yaml → JSON config comes from a build action, //tools/chartconfig, a small Go tool run on the stamped package.
  • oras is 1.3.4, from per-platform http_archives in MODULE.bazel with sha256 from the release checksums. There's no BCR module. It's wrapped by //tools/oras, with //tools/oras:version_test.
  • chart_registry_url(chart) now returns the per-chart repository, e.g. quay.io/aethermesh/chart-aether.
  • Both tag shapes are kept: aether.chart_push pushes <version> and aether_commit.chart_push pushes <version>-<full sha>. crds, prober and udsecho push their X.Y.Z-<sha> version.
  • The charts no longer set registry_url, so rules_helm no longer defines .push or .push_registry targets that would push to the wrong names. publish.yaml runs <chart>.push_images first, then <chart>.chart_push.
  • //bazel/helm:chart_push_test checks the argv, the media types, the byte-identical layer and the config. It also checks that SemVer's + becomes _ in the tag, and that a target for the wrong chart refuses to push. No network is needed.

Local proof: I pushed crds and aether_commit into a throwaway local registry:2, not quay.

  • helm pull oci://…/chart-crds --version … worked.
  • The layer digest was identical to a real helm push of the same .tgz: sha256:b06e00ee….
  • The config was the same JSON document (716 bytes, same keys and values).
  • helm template oci://…/chart-aether rendered.

Workflows

  • Robot login in release jobs. publish.yaml (publish) and proxy-release.yml (build-push, manifest, sign) run with environment: release. They use docker/login-action@v4 to ${{ env.IMAGE_REGISTRY_HOST }} with secrets.QUAY_USERNAME / secrets.QUAY_TOKEN. image_push, oras and cosign all use that Docker login.
  • Dropped:
    • packages: write, HELM_REGISTRY_*, and GHCR_TOKEN/GITHUB_TOKEN as registry credentials in those jobs. GITHUB_TOKEN stays for GitHub API calls.
    • The old main environment on publish. BUILDBUDDY_ORG_API_KEY is also a repository secret, so dropping main loses nothing.
  • Robot reads. The sign and verify steps read from the registry with the robot (REGISTRY_USERNAME/REGISTRY_PASSWORD), not anonymously.
  • Signing is unchanged: image_push plus the separate //tools/cosign sign --recursive step, not the rules_img signer plugin.
  • bump-chart now uses proxy_pin_rewrite (scripts/proxy-pin-lib.sh) instead of the sed that matched repository: $PROXY_IMAGE. After the flip, that sed would have matched nothing and quietly reported "nothing to do", so the first quay proxy release would never have been pinned. The new rewrite finds the block by any accepted reference and moves repository: together with tag:, digest: and the provenance comment. It fails if it can't do that.

The split sweep, and how it finds the cut-over

verify-published-artifacts.sh reads git show <sha>:bazel/img/registry.bzl for each push head it checks. That's the same way it already reads chart versions and the release-tag prefix. From that file it gets the host, namespace, overrides, chart prefix, and SIGNATURE_LAYOUT. A file without that line means tag, which is every ghcr.io publish.

  • No cut-over sha or date is written down anywhere. The cut-over commit is simply this PR's merge commit: the first one whose registry.bzl says quay.io.
  • Heads before it are checked on ghcr.io: charts/<name>, the aether-proxy override, signature tags.
  • Heads at or after it are checked on quay.io: chart-<name>, flat names, signature referrers.
  • On quay, a fallback tag instead of a referrer is MISSING (the wrong layout). So is a referrer plus a tag: that's both, the double-write.
  • A post-flip head whose artifacts exist only on ghcr.io is MISSING. The sweep never falls back to the old registry.
  • Commits older than the file itself (before ci: one image-registry setting and a quay-capable registry library (Quay migration phase 1, no behaviour change) #998) use its first version, which phase 1 introduced with no behaviour change.
  • Each commit block in the output now starts with a line naming the setting it used: registry <host>/<ns>, signatures as <layout>.
  • The expected-red control now also asserts that every MISSING line names the registry its tree names.

Quay is read anonymously through /v2/auth. GHCR_TOKEN stays in publish-verify only for ghcr.io reads of older heads, and registry-lib.sh only ever sends it to ghcr.io.

The proxy pin stays on ghcr.io until the next proxy release

The pin is data that only bump-chart writes, so the flip can't move it. charts/aether/values.yaml keeps ghcr.io/bpalermo/aether/aether-proxy@sha256:0722f675…, and a new values comment says it moves with the next proxy release.

Every pin reader accepts proxy_pin_references(), which is image_reference("proxy") plus PROXY_PIN_LEGACY_REFERENCES:

  • //bazel/proxy_pin: //test/envoy_validate passes and pulls from ghcr.
  • proxy-pin-lib.sh
  • ci.yaml's proxy-pin job, which I ran locally and it passed.
  • check-registry-config.sh, which reports a legacy pin as a ::notice::.

The sweep looks the pin up on the registry the pin names. It uses the signature layout of the newest registry.bzl under which that reference was image_reference("proxy").

This PR's own merge triggers a proxy release, because it touches proxy-release.yml and proxy/bazel/registry.bzl. That release's bump-chart PR re-pins to quay.io/aethermesh/proxy.

quay-smoke: reading the certificate SAN

cosign v3's verify JSON is [{"critical": …}] only, with no optional.Subject, so that row always printed ?. The SAN is now read from the sigstore bundle that cosign download signature returns (verificationMaterial.certificate.rawBytes, or the leaf of the chain), then openssl x509 -ext subjectAltName.

I checked this against a real quay referrer-only signature, quay.io/argoproj/argocd → https://github.com/argoproj/argo-cd/.github/workflows/image-reuse.yaml@refs/heads/master, and against our ghcr bundle → …/publish.yaml@refs/heads/main. The summary now fails if the SAN can't be read or doesn't match the verify identity.

check-registry-config: two allow-lists

  • Current registry (unchanged rule): no quay.io/aethermesh literal outside the setting. README.md is added to that allow-list as user-facing install docs.

  • New legacy hunt: the pre-cut-over registry may appear only inside the legacy allow-list. That covers the coordinate ghcr.io/bpalermo/aether, the bare host ghcr.io, and the bare namespace. Other projects' images such as ghcr.io/open-telemetry/… and the devcontainer features are excluded by a negative control. Each path in the list has a reason:

    • the setting's history note and legacy refs
    • the pin
    • proposals, runbook records and observability notes
    • the consumer migration notes
    • the split-sweep scripts and workflow comments
    • the offline harnesses
    • quay-smoke's history note

    This list is exactly the footprint phase 4 removes. git grep -n ghcr.io output is entirely inside it.

Harness cases, and which I saw fail

harness new cases
check-registry-lookup (35) runs on a throwaway two-commit history: PRE (pre-flip setting) and POST (this setting). PRE passes on the fake ghcr (tags); POST passes on the fake quay (referrers only); both pass in one run. RED: POST published only to ghcr is 20/20 MISSING on quay. RED: a fallback tag on quay (SIGNATURE_LAYOUT referrer) gives 24 wrong-layout MISSING. RED: the double-write gives 24 both. The #1015 proxy-pin token case, adapted to the pin's own registry.
check-publish-verify-control (20) control on a PRE tree is red on ghcr.io/bpalermo/aether/; on a POST tree, red on quay.io/aethermesh/. A perfect red printed against the other registry is rejected. A POST tree where only ghcr is readable is inconclusive (exit 2), never a borrowed red.
check-signature-layout (28) the layout each setting promises: current = referrer, pre-flip file with no line = tag, a malformed line or a missing file is refused. Then every (found, promised) pair through registry_layout_satisfies.
check-index-children (10) the child walk asks ghcr for a PRE head and quay for a POST head. A POST head whose index exists only on ghcr yields no children and fails.
check-proxy-pin (27) the legacy ghcr pin parses and reports its own reference; a pin on an unknown registry and a legacy+current double block are refused. proxy_pin_rewrite moves legacy→quay and re-pins in place, leaving the supervisor digest untouched. It refuses (file unchanged) when there's no block, no digest, or a bad digest.
check-registry-config the legacy hunt with its positive and negative controls.

Seen RED. For each of these I broke the implementation, ran the harness, then restored the file:

  • A. The verifier ignores the per-head setting and uses the checkout's file. check-registry-lookup fails 5 cases (PRE on ghcr, unsigned child, 503, witnessed absence, cross-cut-over run). check-publish-verify-control fails the PRE-tree cases ("0 of 20 MISSING lines on ghcr.io/bpalermo/aether/").
  • B. A fallback tag is accepted as referrer. check-signature-layout fails found bundle promised referrer -> rc 0, want 1, and the check-registry-lookup wrong-layout case fails.
  • C. The verifier falls back to ghcr when quay misses. The "POST published only to ghcr" case fails.
  • D. A ghcr.io mention is appended to Makefile. check-registry-config exits 1 naming Makefile:188.
  • E. bump-chart's rewrite only knows image_reference("proxy"), which is the old sed's behaviour. check-proxy-pin fails "legacy (ghcr) pin moves to image_reference("proxy"): the rewrite failed".
  • F. The control's registry check is removed. "a perfect red on the OTHER registry: control rejects: want exit 1, got 0".
  • G. A quay-smoke state with no SAN makes summary exit 1 (san=unread), and exit 0 once the SAN is read.

Verification

  • bazel test //... --test_output=errors: 119/119 pass. These include //bazel/img:registry_test, //bazel/helm:chart_push_test, //tools/oras:version_test, //tools/chartconfig:chartconfig_test, //test/envoy_validate on the legacy pin, and every //charts/aether helm_template_test.
  • bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //... is clean, //:format is committed, and format.check is clean.
  • make deps-audit is OK.
  • All 8 shell-job harnesses are green: check-shell-lint, check-signature-layout, check-index-children, check-push-head-selection, check-publish-verify-control, check-proxy-pin, check-registry-lookup, check-registry-config.
  • helm template of the packaged aether-1.0.0 renders quay.io/aethermesh/{agent,mesh-dns,cni-install,registrar,controller,proxy-supervisor}@sha256:… and the unchanged ghcr.io/bpalermo/aether/aether-proxy@sha256:0722f675….
  • Read-only real sweeps with the new verifier: 98a84a8 and e93671b, which predates registry.bzl and so uses the first-version fallback, both PASS 40/40 on ghcr.io.

Credential binding (follow-up commit 599bdb7)

registry-lib.sh sends REGISTRY_USERNAME/REGISTRY_PASSWORD only to the token endpoint of REGISTRY_CREDENTIAL_HOST. That defaults to the IMAGE_REGISTRY_HOST the workflows export, or the setting's host if nothing is exported. A token request to any other host goes anonymous, with one stderr line: registry-lib: credentials are for quay.io; reading ghcr.io anonymously.

New check-registry-lookup cases (now 40 in total), using a fake registry that records every -u it receives:

  • the credential reaches the setting's host
  • no credential reaches another host
  • an exported IMAGE_REGISTRY_HOST is honoured
  • a REGISTRY_CREDENTIAL_HOST override works in both directions

Seen red: with the guard removed, both "another host" cases fail, because the fake records ghcr.io aethermesh+robot and quay.io aethermesh+robot.

After merge

  • 1. The publish run on the merge commit goes green, pushing images and charts to quay.io with the robot.
  • 2. On that first quay publish, confirm the signatures are referrer-only by hand. Take one index digest and one child digest. registry_referrers should list the sigstore sign bundle, and both tag lookups (sha256-<hex>, sha256-<hex>.sig) should 404. That is the double-write check. publish-verify for the merge commit should pass with signatures as referrer.
  • 3. Phase 3, talos: helm upgrade from oci://quay.io/aethermesh/chart-aether using helm get values <release> -n <ns> -o yaml → -f, never --reuse-values. Then the 8h soak. The proxy-release bump PR triggered by this merge should land first, so the proxy comes from quay too.
  • 4. Phase 4, decommission ghcr, once nothing supported references it:
    • drop the sweep's ghcr branch (the first-version fallback and the tag default)
    • empty PROXY_PIN_LEGACY_REFERENCES
    • drop GHCR_TOKEN
    • shrink the legacy allow-list
    • leave the ghcr packages in place, read-only

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

bpalermo and others added 8 commits September 27, 2026 17:58
Flip the one registry setting (bazel/img/registry.bzl + its byte-identical
//proxy copy) to quay.io / aethermesh / no name overrides / chart- prefix, and
make everything around it follow:

- SIGNATURE_LAYOUT = "referrer" (what the sweep now asserts per commit) and
  PROXY_PIN_LEGACY_REFERENCES (the ghcr.io pin the chart keeps until the next
  proxy release re-pins it); image-registry.sh gains chart-ref,
  signature-layout and proxy-pin-refs, pinned by //bazel/img:registry_test.
- Charts pushed with oras to chart_registry_url(<chart>) =
  quay.io/aethermesh/chart-<name>: chart_push (//bazel/helm:defs.bzl) writes
  exactly what `helm push` writes (the .tgz as the chart-content layer,
  Chart.yaml as the helm config via //tools/chartconfig), because helm push
  cannot name a flat repository and quay has no nested ones. oras 1.3.4 pinned
  in MODULE.bazel, wrapped by //tools/oras with a version_test.
- publish.yaml / proxy-release.yml: every pushing or signing job runs in the
  `release` environment and logs in with the Quay robot; image_push + the
  separate keyless cosign sign step stay.
- publish-verify split: verify-published-artifacts.sh reads registry.bzl AS OF
  EACH PUSH HEAD (host, names, chart prefix, signature layout), so pre-cut-over
  heads are checked on ghcr.io and post-cut-over heads on quay.io; the proxy pin
  is looked up where the pin says. Harnesses extended with the split and its
  reds.
- Every pin reader (//bazel/proxy_pin, proxy-pin-lib, ci proxy-pin job,
  check-registry-config) accepts proxy_pin_references(); bump-chart rewrites the
  pin, repository line included, via proxy_pin_rewrite.
- quay-smoke reads the certificate SAN from the signature bundle (cosign v3's
  verify JSON has no optional.Subject) and fails when it cannot.
- Charts major-bumped to 1.0.0; docs, README, runbook and proposal 040 moved to
  the quay coordinates, with a consumer migration note and a phase-4 TODO.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
Renaming the step re-fingerprinted CodeQL's already-dismissed
actions/untrusted-checkout alert (#8: the job checks out ref: main and passes
the triggering head sha as data) and surfaced it as new on this PR. The step
name and its env comment go back to main's text; the split is described in
the workflow header.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
REGISTRY_USERNAME/REGISTRY_PASSWORD are now sent only to the token endpoint
of REGISTRY_CREDENTIAL_HOST (default: the IMAGE_REGISTRY_HOST the workflows
export from scripts/image-registry.sh, else the setting's host). A token
request to any other host goes anonymous, with one stderr line
("registry-lib: credentials are for quay.io; reading ghcr.io anonymously").
The split sweep reads pre-cut-over heads on ghcr.io in runs that may hold the
quay robot, and nothing that points the library at a third registry may hand
it the password.

check-registry-lookup.sh (40 cases): the fake records every `-u` it is handed;
new cases pin the credential reaching its own host, NO credential reaching
another host, the exported IMAGE_REGISTRY_HOST, and a REGISTRY_CREDENTIAL_HOST
override both ways. Seen red with the guard removed.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
Brings in #1016 (repository-cache keys, cache-save: false, ci-bazel-warmup
first steps), #1019 and #1012. publish.yaml keeps both sides: the #1016
setup-bazel cache settings and warm-up step, then the release-environment
Quay robot login.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
…t lookups

Under the verifier's pipefail, an early-exiting `grep -q` can SIGPIPE the
writer and turn a hit into a miss. One check-registry-lookup run right after
the main merge reported "no commit reachable from <HEAD> introduced <pinned
digest>" (not reproduced in the next 200 direct runs and 6 harness runs);
proxy_pin_introduced_by and registry_signature_layout now read their whole
input with `grep -c`.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
Keeps chart 1.0.0 (main: 0.95.8) and takes main's new ghcr.io proxy pin
(a43a20b), a PROXY_PIN_LEGACY_REFERENCES reference.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
@bpalermo
bpalermo merged commit 516d79e into main Sep 27, 2026
25 checks passed
@bpalermo
bpalermo deleted the feat/040-quay-cutover branch September 27, 2026 22:14
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