clan+founding: the rented gateway's deploy builds on the box — it pulls its own closure from the cache #1863

Merged
ben merged 1 commit from session/gateway-builds-own-system into main 2026-09-25 03:36:01 +00:00
Owner

This is part 2 of Ben's ruling to make the gateway pull its own software. It stacks on #1862, so the diff shrinks to one commit once #1862 merges.

Why. WKT-DEMO fire 3's Files deploy spent ~13 min realising the whole 3109 MiB system on bens-mac-04, at ~600 kB/s, before a single path moved. Yet 2771 MiB of it is signed on cache.nixos.org, including Nextcloud's 743 MiB. The rented box is a datacentre droplet with RAM to spare, so it can fetch that itself.

Change.

  • clan.DeployRequest.BuildOnTarget. When set, the apply leaves --build-host localhost off, so clan evaluates and builds on the target. Enrollment's verify already runs that shape green on every rented box.
  • substituteAhead then skips its local build and copy, and keeps only the locked-input prefetch from #1862. It returns whether the node builds on its target.
  • Founding sets the flag through gatewayBuildsOnTarget(draft) for the rented path only. It applies to both the control-plane apply and the services apply.
  • Own-VPS, self-hosted and the private VM keep the local build. Per #1215, a 1 GB guest OOM-kills nix.

Enrollment is unchanged. #713 measured the target compiling the uncached set, mostly Caddy with plugins, at ~11 min on 2 vCPU. That's about what the operator's push of it costs once #1862 stops pushing the nixpkgs source.

Tests. Four new tests failed before the change and pass after it: TestDeploy_BuildOnTargetLetsTheRentedGatewayFetchAndBuildItsOwnSystem, TestDeploy_WithoutBuildOnTargetKeepsTheLocalBuild, TestGatewayBuildsOnTarget_OnlyTheRentedPath and TestApplyControlPlane_CarriesBuildOnTargetToTheSeam. go test ./internal/... is green, and vet and golangci-lint are clean.

Proof. The next Drive A fire. Its activation leg should fall from about 30 min to a few.

Refs #1855

🤖 Generated with Claude Code

https://claude.ai/code/session_013h5C35beyRQMAA1QjxZGk7

This is part 2 of Ben's ruling to make the gateway pull its own software. It stacks on #1862, so the diff shrinks to one commit once #1862 merges. **Why.** WKT-DEMO fire 3's Files deploy spent ~13 min realising the whole 3109 MiB system on bens-mac-04, at ~600 kB/s, before a single path moved. Yet 2771 MiB of it is signed on cache.nixos.org, including Nextcloud's 743 MiB. The rented box is a datacentre droplet with RAM to spare, so it can fetch that itself. **Change.** - `clan.DeployRequest.BuildOnTarget`. When set, the apply leaves `--build-host localhost` off, so clan evaluates and builds on the target. Enrollment's verify already runs that shape green on every rented box. - `substituteAhead` then skips its local build and copy, and keeps only the locked-input prefetch from #1862. It returns whether the node builds on its target. - Founding sets the flag through `gatewayBuildsOnTarget(draft)` for the rented path only. It applies to both the control-plane apply and the services apply. - Own-VPS, self-hosted and the private VM keep the local build. Per #1215, a 1 GB guest OOM-kills nix. **Enrollment is unchanged.** #713 measured the target compiling the uncached set, mostly Caddy with plugins, at ~11 min on 2 vCPU. That's about what the operator's push of it costs once #1862 stops pushing the nixpkgs source. **Tests.** Four new tests failed before the change and pass after it: `TestDeploy_BuildOnTargetLetsTheRentedGatewayFetchAndBuildItsOwnSystem`, `TestDeploy_WithoutBuildOnTargetKeepsTheLocalBuild`, `TestGatewayBuildsOnTarget_OnlyTheRentedPath` and `TestApplyControlPlane_CarriesBuildOnTargetToTheSeam`. `go test ./internal/...` is green, and vet and golangci-lint are clean. **Proof.** The next Drive A fire. Its `activation` leg should fall from about 30 min to a few. Refs #1855 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_013h5C35beyRQMAA1QjxZGk7
clan: the target prefetches tarball-pinned flake inputs too — nixpkgs' 196 MiB source stops pushing from the operator (GOTCHAS #342)
Some checks failed
ci / publish (pull_request) Has been cancelled
ci / publish-broker (pull_request) Has been cancelled
ci / deploy-broker (pull_request) Has been cancelled
ci / seam (pull_request) Has been cancelled
3a5d66348e
clan-core pins nixpkgs as a releases.nixos.org tarball, so #1803's
github-only prefetch skipped it and every rented enroll-copy pushed the
196 MiB nixpkgs `source` over the operator's uplink (WKT-DEMO fire 4, live:
~386 kB/s for ~20 min). prefetchRefsFromLock renders tarball inputs as
`url?narHash=<sri>` beside the github revs; a hand prefetch realised the
identical /nix/store/lr5ld8f0…-source.

Part 1 of Ben's ruling "make the gateway pull its own software".

Refs #1855

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013h5C35beyRQMAA1QjxZGk7
clan: mark the flake.lock decode wireconvention:external — narHash is nix's field name, not our wire
All checks were successful
ci / seam (pull_request) Successful in 20m30s
ci / publish-broker (pull_request) Has been skipped
ci / publish (pull_request) Has been skipped
ci / deploy-broker (pull_request) Has been skipped
e03e94f758
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013h5C35beyRQMAA1QjxZGk7
clan+founding: the rented gateway's deploy builds on the box — it pulls its own closure from the cache
All checks were successful
ci / seam (pull_request) Successful in 21m27s
ci / publish-broker (pull_request) Has been skipped
ci / publish (pull_request) Has been skipped
ci / deploy-broker (pull_request) Has been skipped
52fde07e1c
WKT-DEMO fire 3's Files deploy spent ~13 min realising the whole 3109 MiB
system on the operator's machine at ~600 kB/s (743 MiB of Nextcloud, all
signed on cache.nixos.org) before anything moved, and redded `activation`
on a healthy, idle box.

clan.DeployRequest.BuildOnTarget: the apply leaves `--build-host localhost`
off so clan evaluates and builds on the target (enrollment verify's proven
rented shape), and substituteAhead skips its local build and copy, keeping
the locked-input prefetch. Founding sets it via gatewayBuildsOnTarget(draft)
for the rented path only, on both the control-plane and services applies;
every other path keeps #1215's local build.

Part 2 of Ben's ruling "make the gateway pull its own software".

Refs #1855

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013h5C35beyRQMAA1QjxZGk7
ben merged commit 393e9dcafe into main 2026-09-25 03:36:01 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss!1863
No description provided.