Skip to content

Separate the source-built native image - #1539

Open
ChristianPavilonis wants to merge 52 commits into
baseline/ec-storage-20261110from
baseline/native-image-20261110
Open

ChristianPavilonis wants to merge 52 commits into
baseline/ec-storage-20261110from
baseline/native-image-20261110

Conversation

@ChristianPavilonis

@ChristianPavilonis ChristianPavilonis commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Original digest-pinned native producer, build-context allowlist and local image smoke workflow.
  • Reorganize the existing working demo using EdgeZero83d7a629, not current-main forwarding compatibility.

Draft baseline review unit. Not a current-main merge candidate, deployment approval or completed current-head CI claim.

Baseline and sequence

Head: b9e1ff2cf4ecbc752f9843379d034268d7965689. Base: baseline/ec-storage-20261110.

Historical main anchor: 2dd968aeebeb2cc0d5110115f64e0ad58e2e1d13. Original demo: TS2423a2ed plus separately preserved dirty inputs. Matching EdgeZero: draft431, exact revision 83d7a6296d285e135c4ea70021b19e6c8dca7e9f.

The user selected compatible-baseline cleanup. Current-main integration with EdgeZero462 and the authenticated-forwarder incompatibility are deferred. Preserve current-main PR1525/1526 ready and1527/1528 draft, with their existing bases. No excluded1499 or independent1506 implementation, relay/privacy experiment, new transport fallback, group/codec/phase design or operational deployment is included.

Changes

Area Change
This unit Original digest-pinned native producer, build-context allowlist and local image smoke workflow.
Unchanged work Original checkouts, dirty Prebid inputs, recovery references and existing PRs remain preserved.

Closes

Refs #1530. This unit completes one part of the baseline extraction and does not close the overall tracker on its own.

Spec

Not a new feature. This is extraction of existing demo behavior and bounded build/caller corrections. Original native and EC storage design/review records remain in the baseline where applicable; they are not presented as approval of later combined source. No new forwarding, consent, timer or provider policy is designed here.

Test plan

A fresh exact-final b67ffc6 linux/amd64 producer build and real runtime smoke pass. Image50e07713a542a03689b76833b2ac78daeea789e494156e6c4db72d3624a7069e runs as UID/GID10001. Producer files match this unit; final integration also carries the separately reviewed wrapper/examples. Earlier f45 image proof remains retained separately. Default/local providers only; no image publication, AWS access or separate wrapper acceptance is claimed.

  • Required current-head hosted checks complete before ready-state transition.
  • Final baseline combined-check results recorded with exact input revisions and limitations.
  • Focused failures and corrections retained rather than assertions relaxed.

The b67ffc6 baseline checkpoint has passing documented local gates: Fastly/default/reuse/native/Cloudflare/Spin suites, all adapter strict lint lanes, 17 cross-adapter parity cases, 1252 JS cases, CLI suites, formatting, clock/digest/proposal checks and changed-lines domain lint. Passing checks at121ebcc36 are reused only for unchanged relevant inputs; the final follow-up covers the CLI test-import and documentation-only corrections. These results are not a substitute for this PR's current-head hosted checks.

Checklist

  • Existing behavior extracted into a scoped review unit.
  • Public examples use fictional inputs and no licensed Geo data.
  • No deployment, main merge, old-RC closure or recovery deletion.
  • No new worker launched or paused experiment resumed.
  • Review readiness confirmed independently from later units.

Operational Terraform remains in trusted-server-deployer. Local checks and prototype tests do not qualify cloud access, fleet durability or a live publisher.

Hosted docs-build correction

The first hosted format-docs job caught an additional site-build gate that the original local formatter checkpoint had not run: a relative link from the native EC guide to a Terraform example outside the site. Native EC correction8b11dbad3 replaces it with the plain repository path; no dead-link check is disabled. That docs-only correction is carried through the existing upper PR identities. Native EC and final integration8985b111 both pass docs ESLint and VitePress build; the final docs formatter also passes. Runtime, dependency, image-build-context and test inputs are unchanged from b67ffc6, so their prior exact-input proofs are reused. Hosted current-head checks still control readiness.

Startup negative-probe correction

A hosted native EC case failed the no-listener probe while its child logged the expected startup validation failure. The old log has no socket endpoints, so the failure's exact subtype is not claimed confirmed. A separate controlled Linux reproduction demonstrates a successful TCP self-connection with no listening server. Native correction8490c691d distinguishes equal local/peer endpoints from a real listener; actual socket controls prove the self-connection is excluded and a real listener is still detected. Nonzero exit, expected diagnostic, secret-redaction and the original startup deadline remain required. This changes only the acceptance fixture, not production admission, transport or trust.

The earliest native unit and final9356c557 default/all-feature acceptance checks and strict lint pass, including both controls and the original failure case. Ignores remain explicit; earlier separately executed celld proof is not relabeled as a new ignored-case run. Correction is merged upward through existing PR identities without force-pushing or retargeting. Current-head hosted checks must pass; the old failure is retained rather than rerun-only waived. Runtime/API/dependency inputs remain unchanged. A fresh exact9356 producer build and real runtime smoke now pass: image sha256:65a735d38e9dbc0573d0f6068a8b261bd202c43aea05085c2b2d6bccc91ebdbd, linux/amd64 UID/GID10001, including startup rejection and in-flight SIGTERM drain. Prior b67 image receipts remain separate; no image was pushed. All local parent runners are complete.

Browser CI host compatibility

Preserved older browser failures show Playwright1.58.2 rejecting ubuntu-latest's new Ubuntu26.04 image before browser installation; later missing-executable failures are consequences, not passing browser tests. Nativeb1216763a pins only the browser job to ubuntu-24.04, leaving dependency versions, tests and assertions unchanged. Direct Actionlint1.7.12 passes at the owning native and final integration points; the first shim-only attempt could not run because no global version was configured, and is not counted as lint proof. No global tooling was changed. The only9356 ->ee7 delta is this workflow host/comment; runtime, Cargo, docs, tests and Docker-context inputs are unchanged. Actual browser execution on the supported hosted runner remains pending and must pass before readiness. No waiver or browser skip.

Reconciliation refresh above the new PR 1506 head

Merge-forward head f8d757ec94794102c7e2151e4e282901dfc7bccb retains original public 8d41cb06c2a95618d5564d57118ce77cddbcc115, previous local candidate 2eacf2d7875fca7c75ce63fb1c0ba0a086bc6754 and updated parent 99016b97f6631cfaa972506b9249a0b5f90fc18d. The original feature patch is unchanged. Aram's #1516 code/tests/spec are preserved upstream rather than duplicated as another owned production port. The existing PR identity, feature boundary and readiness remain intact.

Fresh shared-root and combined RC qualification passes on the refreshed source. Reused JS/Chrome/storage/wrapper/Terraform evidence is explicitly fingerprinted, not claimed as a new execution. Source-image proof is bound to refreshed #1539, not a new RC release. Fresh hosted/macOS, digest-backed wrapper/RC images, other external browser/framework lanes and live AWS/publisher/CMP acceptance remain unverified. Ignored/unexecuted cases and original failed receipts are not counted as passes. Historical claims above remain bound to their named old inputs. No tag, registry publication or deployment is included.

Published snapshot; newer upstream integration pending

Published deliberately for review from the qualified #1506 checkpoint 57d7c6ad8db43601ef31c1e1d1615e6dd2aa6a6a. At publication the moving author branch was at 628474ec4a8cee8361a6927ae6b79b68fdd33a55. Newer upstream bounded-response handling, per-profile RTB caps and Sourcepoint changes are not incorporated or qualified in this snapshot. Further merge-forward reconciliation and conflict resolution may be needed before merge. Local results above describe this exact qualified source, not a merge with the newer base or a release.

@prk-Jr prk-Jr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

No blocking issues. The build-context allowlist, the digest-pinned multi-stage build and the smoke test are careful work. The test covers startup rejection of an invalid config envelope and of a missing secret, non-root execution, a read-only root filesystem with explicit writable mounts, and SIGTERM draining with a request in flight. All checks pass at b9e1ff2c, including local-provider-image.

Non-blocking

  • ♻️ Builds download unused wasm targets because of rust-toolchain.toml (inline suggestion on Dockerfile).
  • 📝 The new docs page isn't linked from the sidebar.
  • 🤔 The TRUSTED_SERVER__EC__PASSPHRASE poison value isn't asserted.
  • 🤔 apt-get upgrade makes the runtime layer unrepeatable despite the digest pins.

Verification notes

I relied on the head-matched CI run and did not build the image locally. Non-default NATIVE_FEATURES sets are compiled only by the clippy-axum --all-features CI step, not built or smoke-tested as images.

Comment thread Dockerfile
# Optional existing build metadata input; .git never enters the build context.
ARG TRUSTED_SERVER__GIT_VERSION=""
RUN <<'SH'
set -eu

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ refactor — Each image build downloads three unused wasm standard libraries.

rust-toolchain.toml is in the build context and lists wasm32-wasip1, wasm32-wasip2 and wasm32-unknown-unknown. The first rustc --version below makes rustup install all three before this native-only build starts. The local-provider-image run at this head shows downloading 3 components and about 98 spurious network error retry warnings. It passed only because the retries succeeded. That adds roughly 20s and a network step that can fail the image build for no product reason.

Setting RUSTUP_TOOLCHAIN before the first rustc call selects the installed 1.98.1 toolchain without applying the file's target list. The rust-toolchain.toml channel assertion below still keeps the two in sync.

Suggested change
set -eu
set -eu
# Native-only build: skip the toolchain file's wasm targets.
export RUSTUP_TOOLCHAIN=1.98.1

@@ -0,0 +1,46 @@
# Native container

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 note — Nothing links to this page. It isn't in the docs/.vitepress/config.mts sidebar, and no other doc links to it, so readers can only reach it by URL or search. Consider adding a sidebar entry next to the other guide pages (outside this diff, so no suggestion).

'--env',
'EDGEZERO__ADAPTER__SHUTDOWN_GRACE_SECONDS=3',
'--env',
'TRUSTED_SERVER__EC__PASSPHRASE=poison',

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 thinking — This poison value is never checked. The origin URL poison on the next line is covered indirectly, because the page request would fail if it were used. Nothing distinguishes whether the EC passphrase came from poison or from the envelope's secret reference, so a change that started honoring this variable would still pass. Either add an assertion that tells the two passphrases apart, or drop the line so it doesn't read as coverage.

Comment thread Dockerfile

FROM debian:bookworm-slim@sha256:7c7b2c966bc9ee8cedfeef67e0e279108992c77681fa595db4a9d65c06ccc587 AS runtime
RUN apt-get update \
&& apt-get upgrade -y --no-install-recommends \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 thinking — The base images are digest-pinned and the image records a hash of its build inputs. But apt-get upgrade pulls whatever Debian packages are current, so two builds of the same commit can produce different runtime images. Getting security patches this way is a reasonable trade-off. A short comment saying it's deliberate would keep readers from assuming the runtime layer is reproducible.

@ChristianPavilonis
ChristianPavilonis marked this pull request as ready for review November 11, 2026 13:50
Keep the existing PR's isolated source build, non-root runtime, minimal build context and local-provider lifecycle smoke. Resolve and pin Node 24.20.0 to its registry index digest, check it against .tool-versions and retain Rust 1.98.1 with two build jobs.

The local Linux image passes actual startup rejection, listener, page/TSJS, runtime permissions and in-flight SIGTERM checks. No image publication, cloud access or production-feature image qualification is implied.
@aram356

aram356 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed c59897d4f, a merge of #1537's new head 9be8425a3, which brings #1506's repin of EdgeZero to rc/identity at 459bd27d (42e0c46c7): EdgeZero #275 at 0e2a58ae, the EdgeZero stack's test fixes and EdgeZero #536's bounded record update, RecordHandle::update. The merge had no conflicts.

Invalid application inputs no longer stop the native process. Since the
#1142 health contract reached this stack's base, the Axum adapter keeps
listening with the failure router: liveness answers 200, while readiness
and every other route answer the fixed unavailable response. The container
test still expected startup rejection, so invalid-envelope failed with
"must not listen".

The test now expects the failure router for both invalid inputs, checks
that each case logs its own cause before the listener is ready, and reads
the envelope's configured response header from the finalized page, since
operational probes skip finalization. This is the same expectation #1646
adopted, so the change merges up the stack without conflicts.
aram356 added a commit that referenced this pull request Nov 26, 2026
#1646's new head 4f1c155 brings #1539's cf4e815, "Expect the failure router in the native container test", and #1646's a18abf4, "Compare undeclared Axum KV stores with assert_eq". The merge is clean.
aram356 added a commit that referenced this pull request Nov 26, 2026
#1661's new head 2e0bbb0 brings #1539's cf4e815, "Expect the failure router in the native container test", and #1646's a18abf4, "Compare undeclared Axum KV stores with assert_eq". The merge is clean.
aram356 added a commit that referenced this pull request Nov 26, 2026
…dentity

#1622 (7621b11) carries #1539's cf4e815, "Expect the failure router in the native container test", and #1646's a18abf4, "Compare undeclared Axum KV stores with assert_eq". The merge is clean.
aram356 added a commit that referenced this pull request Nov 26, 2026
…dentity

#1653 (a0ee47b) carries #1539's cf4e815, "Expect the failure router in the native container test", and #1646's a18abf4, "Compare undeclared Axum KV stores with assert_eq". The merge is clean.
aram356 added a commit that referenced this pull request Nov 26, 2026
…dentity

#1654 (ca143b7) carries #1539's cf4e815, "Expect the failure router in the native container test", and #1646's a18abf4, "Compare undeclared Axum KV stores with assert_eq" and #1654's own 8d8892b, "Let the missing-secret container case keep its listener". The merge is clean.
aram356 added a commit that referenced this pull request Nov 26, 2026
…dentity

#1655 (a93595c) carries #1539's cf4e815, "Expect the failure router in the native container test", and #1646's a18abf4, "Compare undeclared Axum KV stores with assert_eq". The merge is clean.
aram356 added a commit that referenced this pull request Nov 26, 2026
…dentity

#1659 (b72b5e8) carries #1539's cf4e815, "Expect the failure router in the native container test", and #1646's a18abf4, "Compare undeclared Axum KV stores with assert_eq" and #1659's own 0c887ac, "Name the accepting geo consent fixture by its role". The merge is clean.
aram356 added a commit that referenced this pull request Nov 26, 2026
…dentity

#1660 (39cfe15) carries #1539's cf4e815, "Expect the failure router in the native container test", and #1646's a18abf4, "Compare undeclared Axum KV stores with assert_eq". The merge is clean.
@aram356

aram356 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed cf4e815d4, "Expect the failure router in the native container test". local-provider-image has failed here since 3f0ff5f82 merged #1537's line: the Axum adapter keeps listening with the failure router when application inputs are invalid, under the #1142 health contract, but the container test still expected startup to be rejected, so invalid-envelope failed with "must not listen". The test now carries the expectation #1646 adopted. Locally, the full container test passes on this head, including both invalid-input cases, the published port, the page rewrite and the drain.

Takes #1537's new head b53f26a, which carries #1506's repin of EdgeZero to
rc/identity at 1619078a (8edc50e), a revert that removes EdgeZero 522
(portable Fastly record providers) and 524 (outbound mTLS client
identities).

The merge is clean.
@aram356

aram356 commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed 0e94ff26e.

Takes #1537's new head b53f26a, which carries #1506's repin of EdgeZero to rc/identity at 1619078a (8edc50e), a revert that removes IABTechLab/edgezero#522 (portable Fastly record providers) and IABTechLab/edgezero#524 (outbound mTLS client identities).

The merge is clean.

PR #1537's new head brings its native EC acquire formatting and legacy store rule, plus the cascaded owner review fixes from #1525, #1526, #1488, #1489, #1639, #1531, #1532, #1615, #1637, #1533, #1536 and #1535. The merge is clean.
PR #1537's new head brings wave B: #1506's merge of main ab5c24f (#1501, js_asset_proxy rewriter ordering) and its repin of EdgeZero to rc/identity 8a73c0978806, carried up through the chain. The merge is clean. Cargo.lock changes only the 10 EdgeZero package sources, now at 8a73c097; the codegen crate's nested Cargo.lock is unchanged.
@aram356

aram356 commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Round 12 identity realignment: rc/identity is now at db7dce634, and EdgeZero is pinned to its rc/identity at 8a73c097. This branch fast-forwarded from 0e94ff26e to 8df27b282:

Each merge message says what it carries and how any conflict was resolved.

PR #1537's new head brings #1535's owner fix that keeps mirrored GPP consent through transient CMP not-ready states (#1678) and #1535's move of the consent-update test host to publisher.example.com for the URL-host lint. The merge is clean.
PR #1537's new head brings #1506's move of the five auction endpoint test requests from test-publisher.com to publisher.example.com, for the URL-host lint. The merge is clean.
PR #1537's new head brings #1506's repin of EdgeZero to rc/identity ef5cbf30, which renames Fastly backends to ez_b31v2_* and moves the yanked pin-project-lite, chacha20 and spin, #1625's shared Wrangler installer for CI, #1639's pull reserve boundary check and wording, #1613's conformance doc alignment, #1616's certificate policy and pull-sync fixture corrections, #1617's preserved startup diagnostics and hardened runtime checks, #1635's complete startup evidence in native fixtures, #1637's shared readable non-Unicode Geo fixture, #1627's Spin store reads and retained runtime coverage and #1535's Sourcepoint consent mirror deduplication and consent update coverage. The merge is clean. Cargo.lock changes only the EdgeZero package sources (now ef5cbf30) and the yanked pin-project-lite, chacha20 and spin; the codegen crate's nested Cargo.lock is unchanged.
@aram356

aram356 commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Round 15 identity realignment: rc/identity is now at 391a08578, and EdgeZero is pinned to its rc/identity at ef5cbf308. This branch fast-forwarded from 565c2fdfd to 572fbe802:

Each merge message says what it carries and how any conflict was resolved.

aram356 added a commit that referenced this pull request Dec 3, 2026
free_loopback_port bound port 0, read the port and released it, then the
spawned binary bound it. On Linux, another test's port-0 bind can take
that released port in between: in a probe holding 200 port-0 binds after
each release, the released port was reassigned in 106 of 3000 rounds
(none on macOS, which allocates port-0 binds in sequence). The child
then failed to bind, the startup probe connected to the other test's
server, and the test failed with a connection reset when that server
closed (seen on #1539's CI).

Reserve the port from 20000..30000 instead, below the Linux (32768 and
up) and macOS (49152 and up) ephemeral ranges, so no port-0 bind or
outbound connection can take it. A new test holds 64 port-0 binds and
checks that none falls in the range, so a host with a different
ephemeral range fails loudly instead of racing.
Carries #1533's Axum startup-test port fix (779e446) and nothing
else. Owner commits pushed to other chain PRs since round 15 come in
with the next round.
@aram356

aram356 commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Cascade of #1533's Axum startup-test port fix (779e44673): 22730248d merges it into this PR. There were no conflicts and nothing else changed. The fix moves free_loopback_port in crates/trusted-server-adapter-axum/tests/routes.rs below the ephemeral port range, and #1533's note has the details. Owner commits pushed to other chain PRs since round 15 come in with the next round. rc/identity is now 62f8e41e2.

@aram356

aram356 commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Merged #1627's runtime KV removal (7c2b84f45) into this branch as ce080cd4b, on top of 22730248d.

At the maintainer's request, that commit removes the generic runtime KV store trusted_server_runtime_kv. Nothing reads or writes it, and the managed Fastly deploy made every service provision and pay for it. edgezero.toml and the Fastly Hooks::stores() now declare only trusted_server_kv, and RuntimeServices::kv_store() is unavailable on every adapter.

Only that commit was merged, not the base branch's new head. Conflicts were resolved in edgezero.toml, the Fastly Hooks::stores() in app.rs, fastly.toml, the Viceroy template, the integration tests' config.rs, trusted-server.example.toml, docs/guide/architecture.md and docs/guide/edgezero.md. Only trusted_server_kv stays declared, this branch's record-store comment and local seeds are kept, and the runtime-KV lines are dropped.

Checks on this head: no reference to the removed store remains and cargo fmt --check passes; clippy-fastly, clippy-axum, clippy-cloudflare and clippy-spin-native pass. rc/identity (b9dc3153e) passed the full CI gate list with the removal.

PR #1537's new head brings #1487's change that strips `ts-eids` from publisher-origin requests unless the operator opts in. The merge is clean.
@aram356

aram356 commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Round 17 identity realignment: rc/identity is now at 0ed862633, and EdgeZero stays pinned to its rc/identity at ef5cbf308. This branch fast-forwarded from ce080cd4b to 2142e38d2:

Each merge message says what it carries and how any conflict was resolved.

@aram356

aram356 commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator

Merged #1614's /_ts/ local answers (48930c270) into this branch as fbccaf773, on top of 2142e38d2.

Trusted Server owns the /_ts/ namespace (#1740). A request for /_ts or any /_ts/ path that no route handles now gets a local 404 on Fastly, Axum, Cloudflare and Spin, and never reaches the publisher origin. The path is matched after percent-decoding. Paths outside the namespace, such as /_tsx or /articles/_ts/x, still go to the publisher origin, and every routed /_ts/ path answers as before.

This merge takes #1537's new head (2b8587e4c), which carries 48930c270 and nothing else new to this branch. It was clean.

Checks on this head: no conflict markers; cargo fmt --all -- --check passes; the merge adds exactly #1614's change to this branch's files; it merges cleanly with every lower head in its stack. rc/identity (e72407155) passed the full CI gate list with the change.

This branch has not been deployed

No deployments
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.

4 participants