Repository navigation
fix: OCI provenance labels on every published image (#837), and make kill -TERM stop the soak churn driver (#835) - #845
Merged
Conversation
… what envoy_server_version really is (#837) You could not tell which Envoy a running `aether-proxy` contained, from the process or from the image. Two symptoms, one gap, and the first one is now answered rather than guessed at. ## envoy_server_version reports the AETHER commit, not Envoy's Established outright, not inferred — and not from a running pod. `//test/envoy_validate:envoy_bin` is the Envoy binary extracted from the *published* aether-proxy image at the digest the chart pins, so it can be asked directly: envoy version: cff8beb/1.40.0-dev/Clean/RELEASE/BoringSSL `cff8beb87eb685a44e00cf70c1a534695039da1b` is an **aether** commit — it is that image's own `tag:` in `charts/aether/values.yaml`. The Envoy component of the string is bare `1.40.0-dev`, with no Envoy revision in it at all. The gauge for that image is therefore `0xcff8be`. The `0x2FA24A` = 3121738 in the issue decodes the same way: aether commit `2fa24a8` ("test: drop duplicate integration targets … (#772) (#788)"). It is simply an older image than the chart's current pin. The chain that produces it: * `proxy/.bazelrc` sets `--workspace_status_command="bash bazel/get_workspace_status"`, and that script runs `git rev-parse HEAD`. `proxy/` is a nested workspace inside the aether repo, so BUILD_SCM_REVISION is the aether commit. Envoy is a bzlmod dep; nothing asks its git anything. * `envoy_cc_binary` defaults to `stamp = 1` — cc_binary's "stamp even under `--nostamp`" — so `//source/common/version:version_linkstamp` compiles that real sha in although no build here passes `--stamp`. Verified against a minimal cc_binary + linkstamp: `--nostamp` yields the redacted BUILD_SCM_REVISION `"0"`, and `stamp = 1` yields the workspace-status value. * `server.cc` does `atoull(revision().substr(0, 6), 16)`. So the gauge is 24 bits of the aether commit. Useful, but it will never match `13144f` and was never going to. `proxy/README.md` now says so, with both the derivation and the one-command way to re-confirm it locally, so nobody re-derives this. ## Provenance on the artifact Verified against the published index rather than assumed: every image we publish has `Labels: null`, and the only annotation on `aether-proxy` is `org.opencontainers.image.source` **inherited from distroless/cc**, pointing at GoogleContainerTools/distroless — a confident wrong answer, worse than absent. The rules_img images carry only `org.opencontainers.image.base.*`. Both arches were decoded this time (#837 asked): amd64 and arm64 are identical in every provenance respect — same absent labels, same zero `created`, same single inherited annotation. Only layer digests and `architecture` differ, so the original arm64-only analysis was fully representative. Now, on all nine images (agent, mesh-dns, proxy-supervisor, cni-install, registrar, controller, prober, udsecho, and the proxy): * `org.opencontainers.image.source` — this repo, **overriding** the inherited distroless value (rules_oci merges with `.annotations += {...}`, ours wins); * `org.opencontainers.image.revision` — the aether commit; and on `aether-proxy` alone, the fact recoverable no other way: * `dev.aethermesh.envoy.module-version`, `.revision`, `.bazel-registry`. The registry commit is in there because the envoy bazel-registry keeps one version directory per module and deletes the previous one, so the module version alone does not resolve. ## Determinism did not regress — measured, not assumed Zero timestamps stay: `created` is still unset and history entries are still `bazel bu…`. `revision` is a fixed string, not a clock. * rules_img: `stamp = "force"` on image_manifest/image_index, so the label is correct in *every* configuration — plain `bazel build` included, where "auto" would have baked the literal `{{.STABLE_GIT_COMMIT}}` in. The ExpandTemplate action takes stable-status.txt as an input; volatile-status (BUILD_TIMESTAMP) is constant-metadata to Bazel and invalidates nothing. Proof: `bazel shutdown` then rebuild ⇒ **4556 action-cache hits, 0 actions re-executed, byte-identical index digest** (`sha256:ea16c042…`). The new STABLE_GIT_COMMIT key is stable on purpose: a volatile one would let a cached config blob re-publish the *previous* commit's sha, which is the failure mode this issue is about. * proxy: the metadata genrule is tagged `no-cache` for the same reason — BUILD_SCM_REVISION is volatile there. It is two `sed`s, and its output is byte-identical at a given commit, so `:image`/`:push` still cache-hit. Between commits only the tiny config/manifest actions re-run. No layer, no compile, no link. Prerequisite for #830's next Envoy pin bump, which is exactly the shape of change where "which Envoy is actually running?" must be answerable from the artifact. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
…e next roll (#835) `trap restore_shrink EXIT INT TERM` bundled the safety net with the stop signals, and `restore_shrink` *returns* rather than exiting. So on TERM bash ran the handler, the handler returned, the in-flight `sleep` inside `waituntil` had already been interrupted, and control fell straight through to the next `roll`. The signal sent to stop the driver made it fire early — an unscheduled `ROLLED aether-test/deployment/svc-1` at 23:10:32Z on 2026-09-19, with the driver still running afterwards. That reads in the log as "the tool ignored my signal", which sends you debugging the wrong thing; the tool did the opposite, and the two need different debugging. Split the traps, keeping EXIT as the idempotent safety net: trap restore_shrink EXIT trap 'restore_shrink; exit 130' INT trap 'restore_shrink; exit 143' TERM Reproduced and verified, with `kubectl` stubbed and no cluster involved: * pre-fix, TERM ⇒ driver STILL RUNNING, 1 unscheduled `ROLLED …/svc-1` — exactly the 2026-09-19 observation; * post-fix, TERM ⇒ exit 143, 0 rolls. The idempotency claim was checked rather than taken on trust: a full-schedule dry run (`sleep` stubbed, so all 452 minutes run in seconds) still logs 31 ROLLED and makes exactly **two** `kubectl scale` calls for the SHRINK — down to 0 and back to the replica count it read first. The EXIT trap firing again after `shrink()`'s own `restore_shrink` is a no-op, because `restore_shrink` clears SHRINK_PREV before it scales. `e2e/soak/README.md` gains a "Stopping the churn driver" section for the whole family, since these are cases where the safety action causes the harm: * stop it with `kill -9 <pid>`. Even with the traps fixed, a TERM to the driver's pid alone leaves its `sleep` child running and bash defers the handler until that `sleep` returns — measured: still parked twelve minutes later. Only a TERM that also reaches the child stops it promptly; * never `pkill -f "soak/churn.sh"`: the pattern appears in the command line of the shell issuing it, so it kills your own session too. `pgrep -cf` has the same flaw in the harmless direction — it reads one driver too high. Anchor on the absolute script path; * before launching, check for an existing driver by absolute path and refuse to start a second. Two share `/tmp/soak-churn.log` and interleave into ~62 rolls, which does not fail a run, it silently invalidates it; * at grade time count ROLLED in `/tmp/soak-churn.log` only — older `/tmp/soak-churn-*.log` files match a naive glob and inflate the tally; * never patch `churn.sh` while a soak is running: bash reads scripts incrementally by byte offset, so editing an executing script can corrupt its control flow. Verified no driver was running before this edit. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
proxy/README.md points at //test/envoy_validate:envoy_bin as the one-command way to re-confirm what envoy_server_version reports. #841 factors that target out, so say the label may move rather than leave a reference that silently goes stale. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
This was referenced Sep 20, 2026
bpalermo
added a commit
that referenced
this pull request
Sep 20, 2026
…ace's shell under make lint (#848) (#854) * fix(build): put the proxy workspace's shell under `make lint` (#848) `proxy/bazel/image_metadata.sh` and the two `proxy/integration/check_*.sh` were not linted by anything. `proxy` is in //.bazelignore, so root tooling never descends into it; a hand-run of shellcheck for the PR that added the first one does not survive the next edit. The ignore stays. //proxy is a separate bzlmod workspace pinned to its own Bazel version whose //:image is a multi-hour Envoy compile, and a root build must not analyse any of that. Instead //bazel/lint/proxy_shell reaches the scripts the way //website:staged/proxy-README.md already reaches proxy/README.md: source symlinks in a non-ignored directory. A label under an ignored directory resolves but is never staged into a sandbox; a symlink to it is an ordinary source file of the linting package. sh_library, because that is the rule kind lint_shellcheck_aspect visits. Three things keep it honest: * scripts/check-proxy-shell-lint.sh fails on any difference between the set of //proxy shell scripts and the set of symlinks — a missing one (the script would silently go unlinted again), a stale one, or a symlink replaced by a copy, which would drift; * a `shell` job in proxy.yml runs that check and the lint target on every proxy change. It runs there and not in `ci` because ci's `changes` filter excludes proxy/**, so on a proxy-only PR the whole control-plane workflow skips and a gate living only there would be silent exactly when it matters; * //scripts:check_proxy_shell_lint puts the guard script itself under the same aspect. .gitattributes marks the symlinks `rules-lint-ignored` for the same reason proxy/** already is: formatting one is formatting a proxy file by another name, and shfmt refuses to write through a symlink at all, which failed `make format` outright. It does not weaken the lint — that attribute is read by the format multirun's `git ls-files` discovery, never by the aspect. Proof the gate bites, not just that it runs: SC2045/SC2086 added to proxy/bazel/image_metadata.sh (inside the ignored directory) fails `bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //...` with exit 1, reported against the symlink path. Reverted. The coverage check was proved the same way, in all three directions, and earned its keep on the spot: rebasing onto #845 it failed on image_metadata.sh — a script that had just landed with no symlink — and printed the exact `ln -s` that fixes it. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr * fix(proxy-release): annotate the aether-proxy index, not just its platforms (#847) #845 put OCI provenance on every published image. For the rules_img ones it lands at index level and on each per-platform descriptor, so `crane manifest <index> | jq .annotations` answers directly. aether-proxy's index is assembled outside Bazel by `docker buildx imagetools create`, and carried no annotations at all — verified on the published artifact for the currently pinned tag, whose index JSON has no `annotations` key. The answer existed one hop down and the obvious query returned nothing, which is the same failure shape as #837 itself. The set is DERIVED from the two per-platform manifests rather than restated in the workflow. A literal list here would be a second source of truth for facts //proxy:image_metadata already owns, and would rot the first time that script gained or dropped a key — an index whose provenance disagrees with its platforms is worse than an index with none. Only keys present AND equal on both arches are promoted: an index annotation is a claim about the whole index, so a key that differs per platform stays where it is true. Everything aether sets is identical across arches by construction. The one non-derivation rule is that a foreign `org.opencontainers.image.source` is dropped. distroless/cc's manifest carries one pointing at GoogleContainerTools/distroless and rules_oci merges base annotations; promoting that would take #837's confidently-wrong answer and put it on the descriptor tools read first. Ordering, which is what could actually hurt: annotations CHANGE THE INDEX DIGEST, and bump-chart pins the chart to `index_digest`. They therefore go on the same `imagetools create` that publishes the index, and the read-back is unchanged and still last. There is deliberately no second annotate pass — that would republish a different index under the same tag and pin the chart to a digest nothing serves. Measured on a local registry: the same two sources give c94e979d... unannotated and ac04666f... annotated. The block can only ever ADD `--annotation` arguments. Unreadable manifests, a buildx without `--annotation` on `imagetools create` (caught by a `--dry-run` probe before anything is published), or a dry-run index missing a requested key each warn and fall back to the exact command that ran before this change. All four paths exercised against a real registry; the publish path is byte-identical to today's when the fallback triggers. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr --------- Co-authored-by: Claude Opus 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two independent fixes. They share no files; they are together only because each is small and neither wants its own review cycle.
Closes #837.
Closes #835.
1 — #837: image provenance, and what
envoy_server_versionactually isThe gauge question is closed, not narrowed
The issue's leading hypothesis was "most likely the
proxy/workspace's own SCM revision". That is right, and it is now established directly rather than inferred, without a running pod://test/envoy_validate:envoy_bin(via//bazel/proxy_pin) is the Envoy binary extracted from the publishedaether-proxyimage at the digestcharts/aether/values.yamlpins, so you can just ask it.cff8beb87eb685a44e00cf70c1a534695039da1bis an aether commit — it is that image's owntag:invalues.yaml. The Envoy component of the string is bare1.40.0-dev; there is no Envoy revision in it anywhere. So the gauge for that image is0xcff8be, and the0x2FA24A= 3121738 in the issue is aether commit2fa24a8("test: drop duplicate integration targets … (#772) (#788)") — an older image than the chart's current pin, not a mystery.The mechanism, each step checked against the source rather than recalled:
proxy/.bazelrc:179sets--workspace_status_command="bash bazel/get_workspace_status", and that script runsgit rev-parse HEAD.proxy/is a nested workspace inside the aether git repository, soBUILD_SCM_REVISIONis the aether commit. Envoy is a bzlmod dependency; nothing ever asks its git for a revision.envoy_cc_binarydefaults tostamp = 1(@envoy//bazel/envoy_binary.bzl), i.e.cc_binary's "always stamp, even under--nostamp". That is why the linkstamp carries a real sha although no proxy build passes--stamp. Verified with a minimalcc_binary+linkstamp:--nostampalone yields the redactedBUILD_SCM_REVISIONof"0"; addingstamp = 1yields the workspace-status value.@envoy//source/server/server.cc:606doesatoull(VersionInfo::revision().substr(0, 6), 16)and sets the gauge.proxy/README.mdgains a "Which Envoy is this?" section with all of the above plus the one-command way to re-confirm it, so nobody re-derives it.13144fwas never going to appear in the process.amd64 vs arm64 (issue item 4)
Both config blobs were decoded from the published index this time, anonymously and read-only. They are identical in every provenance respect: no labels,
created=1970-01-01T00:00:00Z, history entriesbazel bu…, and the same single inherited annotationorg.opencontainers.image.source = https://github.com/GoogleContainerTools/distroless. Only per-arch layer digests andarchitecturediffer. The original arm64-only analysis was fully representative.The top-level index has no annotations at all, and the
agentimage (rules_img, published as an index) carries onlyorg.opencontainers.image.base.{name,digest}. Confirmed repo-wide, as the issue said.What this adds
Every published image —
agent,mesh-dns,proxy-supervisor,cni-install,registrar,controller,prober, the e2eudsecho, andaether-proxy— now carries, as both OCI labels (image config) and annotations (manifest, and the index for the rules_img ones):org.opencontainers.image.sourcehttps://github.com/bpalermo/aetherorg.opencontainers.image.revisionsourceis set explicitly so it overrides the value inherited from the base. rules_oci merges with.annotations += {...}and rules_img withcomputed_annotations.update(ctx.attr.annotations)— ours wins in both. That inheritedGoogleContainerTools/distrolessvalue was the actively misleading part of the issue: a confident wrong answer, worse than an absent one.On
aether-proxyalone, the fact recoverable no other way:dev.aethermesh.envoy.module-version1.40.0-dev.20260904.13144fb.envoydev.aethermesh.envoy.revision13144fbdev.aethermesh.envoy.bazel-registrybed06c78cb1ea901164f4d248c3e5167f720e068The registry commit is there on purpose: the envoy bazel-registry keeps one version directory per module and deletes the previous one, so the module version alone does not resolve.
proxy/bazel/image_metadata.shparses both out of the two files that define them (MODULE.bazel,.bazelrc) and hard-fails on a miss, so the labels can never be silently empty or stale relative to the pin.Determinism and caching: measured, not assumed
Zero timestamps stay.
createdis still unset on every image and history entries are stillbazel bu….revisionis a fixed string, not a clock.rules_img (
bazel/img/go_multi_arch_image.bzl):stamp = "force"onimage_manifest/image_index, not the default"auto"."auto"defers to Bazel's--stamp, which onlypublish.yamland the Makefile push targets pass — everywhere else the{{.STABLE_GIT_COMMIT}}placeholder would have been baked in literally, so abazel run …:image_loadimage would claim a revision of{{.STABLE_GIT_COMMIT}}."force"makes it correct in every configuration.The cost is that the tiny
ExpandTemplateaction takesstable-status.txtas an input.volatile-status.txt(BUILD_TIMESTAMP) is also an input but is constant-metadata to Bazel, so it invalidates nothing. Proof —bazel shutdown(new workspace status, newBUILD_TIMESTAMP) then rebuild:Zero actions re-executed, byte-identical index digest.
The new
STABLE_GIT_COMMITworkspace-status key is stable on purpose. A volatile key (the existingGIT_COMMIT) is excluded from the cache key, so a cached config blob would happily re-publish the previous commit's sha — a confidently wrong provenance label, which is precisely the failure mode this issue exists to remove. Being stable costs nothing: the value is identical for every build at a given commit, so remote-cache hits are preserved across machines, and between commits only the config/manifest actions re-run. No layer, no compile, no link.proxy (rules_oci):
BUILD_SCM_REVISIONis volatile there, so//:image_metadatais taggedno-cachefor the same reason. It is twoseds; its output is byte-identical at a given commit, so:imageand:pushstill get action-cache hits.No
--stampis required anywhere, and none was added.Verification
All eight rules_img images were unpacked and checked (plain
bazel build, no--stamp):and the index annotations:
For the proxy,
bazel build //:image_metadataproduces the real file, andbazel build --nobuild //:image //:pushanalyses cleanly (60,674 targets). A full//:imageis a multi-hour C++ build, so the rules_oci application step was proved with a minimal surrogateoci_imageon the same rules_oci 2.3.0, fed the byte-identicalimage_metadata.txt: all five keys land in bothconfig.config.Labelsandmanifest.annotations, withcreatedstill1970-01-01T00:00:00Z.CI has since built the real thing. These changes match
proxy/**minus*.md, so theproxygate ran the full proxy workspace on both arches —//:imagewith the newlabels/annotationsincluded, plus//integration:image_test:Those times are themselves the caching answer for the proxy side: the Envoy compile was a remote-cache hit, because this PR touches no C++ input — only image assembly.
This changes every image digest (the config blob gains labels), so the chart's proxy pin will move on the next
proxy-release.2 — #835:
kill -TERMon the soak churn driver fires the next roll earlye2e/soak/churn.sh:125hadtrap restore_shrink EXIT INT TERM, andrestore_shrinkreturns rather than exiting. On TERM bash ran the handler, the handler returned, the in-flightsleepinsidewaituntilhad already been interrupted, and control fell straight through to the nextroll. The signal sent to stop the driver made it fire early.Reproduced and verified,
kubectlstubbed, no cluster touched:ROLLED aether-test/deployment/svc-1— exactly the 2026-09-19 observationThe idempotency claim was checked rather than taken on trust. A full-schedule dry run with
sleepstubbed (all 452 minutes in seconds) still logs 31 ROLLED and makes exactly twokubectl scalecalls for the SHRINK — down to 0, back to the replica count it read first. The EXIT trap firing again aftershrink()'s ownrestore_shrinkis a no-op, becauserestore_shrinkclearsSHRINK_PREVbefore it scales.e2e/soak/README.mdgains a "Stopping the churn driver" section, because this whole family is cases where the safety action causes the harm:kill -9 <pid>. Even with the traps fixed, a TERM to the driver's pid alone leaves itssleepchild running and bash defers the handler until thatsleepreturns — measured: still parked twelve minutes later. Only a signal that also reaches the child stops it promptly;pkill -f "soak/churn.sh"— the pattern appears in the command line of the shell issuing it, so it kills your own session too.pgrep -cffails the same way in the harmless direction, reading one driver too high. Anchor on the absolute script path;/tmp/soak-churn.logand interleave into ~62 rolls — that does not fail a run, it silently invalidates it;ROLLEDin/tmp/soak-churn.logonly; older/tmp/soak-churn-*.logfiles match a naive glob and inflate the tally.🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
Co-Authored-By: Claude Opus 5 [email protected]
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr