Skip to content

Separate the native AWS runtime wrapper - #1538

Open
ChristianPavilonis wants to merge 51 commits into
baseline/native-image-20261110from
baseline/native-runtime-20261110
Open

ChristianPavilonis wants to merge 51 commits into
baseline/native-image-20261110from
baseline/native-runtime-20261110

Conversation

@ChristianPavilonis

@ChristianPavilonis ChristianPavilonis commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Existing separate binary/runtime digest inputs, literal private file publication and direct exec/signal behavior.
  • 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: 46f621112d5b15ffa48ae8e99c3c0000718032b2. Base: baseline/native-image-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 Existing separate binary/runtime digest inputs, literal private file publication and direct exec/signal behavior.
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

All14 publication/permission/signal cases and ShellCheck pass. The exact binary/runtime wrapper image combination and ECS volume ownership remain unqualified. No credential values or operator config are added.

  • 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 f93091a3d75d9d426523b940a319998e7278fc6e retains original public 3111c2456af73d6bb2b658280460e5dea669ee33, previous local candidate d0a4ce756c77304f098847a77e1cfe09ed7800e2 and updated parent f8d757ec94794102c7e2151e4e282901dfc7bccb. 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.

@ChristianPavilonis
ChristianPavilonis marked this pull request as ready for review November 11, 2026 13:51

@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

Adds a separate native AWS runtime wrapper: two digest-pinned inputs (provider binary image + Debian 13 runtime), an entrypoint that publishes the bindings/Geo TOML literally as 0600 files via temp-file + rename (symlinks replaced, never followed), clears the input env and execs the app so SIGTERM reaches it directly. The shell logic is sound and fails closed; the Geo-off path is correct (native_geo.rs only reads the profile when TS_NATIVE_GEO_PROFILE_FILE is set, so a stale volume file is inert). No blocking findings.

3 of the inline comments below carry a one-click suggestion (comment/docs only).

Non-blocking

🤔 thinking

  • unset comment describes inherited defaults that are not inherited — see inline at deploy/runtime/native-aws/entrypoint.sh:47

⛏ nitpick

  • README test command fails on macOS (mv -T is GNU-only) — see inline at deploy/runtime/native-aws/README.md:37
  • Missing spaces in README — see inline at deploy/runtime/native-aws/README.md:11

Cross-cutting / body-level findings

  • 🤔 Wrapper tests, ShellCheck and image build are not run by any CI job. No workflow references deploy/runtime or test-entrypoint.mjs, and the CI ShellCheck step covers only scripts/docs-proposal/*.sh. A later edit to entrypoint.sh that broke literal publication or symlink replacement would merge green. native-container.yml already has the path-filtered pattern; a similar job on ubuntu-24.04 running shellcheck deploy/runtime/native-aws/entrypoint.sh and node --test deploy/runtime/native-aws/test-entrypoint.mjs (paths: deploy/runtime/native-aws/**) would keep these protections enforced. Fine as a follow-up given this unit's baseline-extraction scope.

Verification

  • shellcheck on entrypoint.sh: pass.
  • node --test deploy/runtime/native-aws/test-entrypoint.mjs on macOS with Node 24.12.0: 7 pass / 7 fail, all mv: illegal option -- T (expected on BSD mv; the Debian target is unaffected). Linux run not reproduced here; the 14/14 result is the author's.
  • Wrapper image build/run, ECS volume ownership and PID-1 SIGTERM handling were not exercised in this review.

CI Status

All 17 reported checks PASS (vitest, integration tests, integration tests (Fastly EC lifecycle), prepare integration artifacts, browser integration tests, format-typescript, format-docs, docs-proposal scripts, cargo fmt, cargo test, cargo test (axum native), cargo test (cross-adapter parity), cargo test (ts CLI, native) ubuntu-latest + macos-latest, spin native + wasm32-wasip2, cloudflare native + wasm32-unknown-unknown, CLAUDE.md symlink guard). None of them exercises the files in this PR.

Comment thread deploy/runtime/native-aws/entrypoint.sh Resolved
Comment thread deploy/runtime/native-aws/README.md Resolved
Comment thread deploy/runtime/native-aws/README.md Resolved
Comment thread deploy/runtime/native-aws/README.md Resolved

@dhruv8sh dhruv8sh 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.

Superseded by a follow-up review with inline comments: #1538 (review)

Takes #1539's new head c59897d, which carries #1506's repin of EdgeZero to
rc/identity at 459bd27d (42e0c46): PR 275 at 0e2a58ae, the stack's test
fixes and EdgeZero 536's bounded record update, RecordHandle::update.

The merge is clean.
@aram356

aram356 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed 4d96cb816, a merge of #1539's new head c59897d4f, 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.

#1539's new head cf4e815 brings #1539's cf4e815, "Expect the failure router in the native container test". The merge is clean.
@aram356

aram356 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#1608), I pushed 321f8bc70, a merge of #1539's new head cf4e815d4, which brings #1539's cf4e815d4, the native container test's failure-router expectation. The merge had no conflicts.

Takes #1539's new head 0e94ff2, 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 a9c7778d0.

Takes #1539's new head 0e94ff2, 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.

The Dockerfile-specific ignore file re-included every file under deploy/
through its parent directory rules, so operator tfvars and state could
enter the wrapper build context. Re-include only the entrypoint.

Fail startup before publishing when EDGEZERO__STORE_BINDINGS_FILE does not
name the published bindings file, rather than letting the app read another
file. Run the wrapper tests and ShellCheck in CI.

Document that the image labels record only the input digests, because the
apt layer follows the Debian mirror at build time, and that BuildKit is
required. Correct the comment about inherited local roots and README
spacing.
@ChristianPavilonis

Copy link
Copy Markdown
Collaborator Author

Pushed 044f6b9 for the review feedback. The inline threads have their own replies. Two points from the review summaries:

  • Wrapper tests in CI (@dhruv8sh, @prk-Jr). format.yml has a new native AWS runtime wrapper job, modeled on release-scripts. It reads Node from .tool-versions, runs ShellCheck on entrypoint.sh and runs node --test deploy/runtime/native-aws/test-entrypoint.mjs. Like the other script jobs it runs on every PR instead of being path-filtered. It doesn't build the image, because the wrapper requires digest-pinned inputs.
  • PR description spacing (@dhruv8sh). Not changed in this push. The description still has the glued numbers, and its test count (14) and head SHA are out of date.

Local checks at 044f6b9: the entrypoint suite passes 20/20 on Linux with Node 24.20.0, ShellCheck 0.11.0 is clean in sh and dash mode, scripts/check-ci-node-pin.mjs passes and actionlint reports nothing new in format.yml. I haven't built or run the real wrapper image.

PR #1539's new head brings the cascaded owner review fixes from #1525, #1526, #1488, #1489, #1639, #1531, #1532, #1615, #1637, #1533, #1536, #1535 and #1537. The merge is clean.

@dhruv8sh dhruv8sh 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

This PR adds a separate native AWS runtime wrapper under deploy/runtime/native-aws/. It has five parts:

  • Dockerfile: a digest-pinned two-stage build. One input image supplies the binary and the other supplies the Debian 13 runtime.
  • Dockerfile.dockerignore: a per-Dockerfile ignore file that lets only entrypoint.sh into the build context.
  • POSIX entrypoint.sh: publishes the bindings TOML and the optional Geo profile TOML as literal 0600 files, then execs the app.
  • Node test suite: checks file publication, signal handling and the image contract.
  • CI job: runs shellcheck and the Node tests.

I found no blocking or non-blocking issues:

  • Entrypoint: treats the TOML input only as data (printf '%s', nothing is sourced or eval'd). It publishes by writing a mktemp file and renaming it into place. It refuses a directory, or a link to one, at the target path. It removes the temp file on failure and on signals. It ignores an inherited Geo pointer when no profile is supplied. It clears the input variables and the local config/data directory variables before the exec, so the app receives SIGTERM directly.
  • Image: removes setuid/setgid bits and runs as the same UID/GID 10001 as the root Dockerfile. It copies the same /usr/local/bin/app and /usr/local/share/ts-build-inputs.sha256 paths that the root Dockerfile produces, so the two image contracts match.
  • Build context: the Dockerfile.dockerignore override is narrower than the root deny-by-default .dockerignore and does not widen it.
  • CI job: follows the conventions of the other jobs in format.yml (same action versions, Node version read from .tool-versions).
  • Tests: cover the edge cases that matter: shell-substitution payloads, a symlink at the target, a symlink to a directory, a missing or overridden bindings pointer, an unwritable mount, an empty Geo profile, and exiting without leaving temp files behind.

PR #1539'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 044f6b9d4 to 355895e0e:

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

PR #1539'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 #1539'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 #1539'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 9fab1eb39 to e5d2b3eea:

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

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): 525e16415 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 b54152f19, on top of 525e16415.

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 #1539'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 b54152f19 to 205139bba:

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 bf22f2678, on top of 205139bba.

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 #1539's new head (fbccaf773), 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