Container-ready by default: container.enable=true, rev-pinned agent-tools release tags, verified pulls #221
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/coding-lab!221
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "lab/20260723-2144"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #220
Diagnosing the dev-new rollout showed a pin bump alone can never activate the container runner: the enable switch lives in the host-config repo, and nothing tied an agent-tools image (whose baked-in labctl talks to this server) to the server's code rev. This PR makes the defaults carry the whole story, per ADR-0054 (new):
nix/module.nix
services.lab.container.enabledefaults true —services.lab.enablealone makes the host container-ready.enable = falseis the explicit host-only opt-out and renders the byte-identical pre-container unit.container.toolsImageRepo(defaultgit.cloonar.com/cloonar/agent-tools);container.toolsImagesdefaults to<repo>:claude-<self.rev>/<repo>:codex-<self.rev>, falling back to the versions.env CLI-version tags when the source has no rev (dirty tree), so localnix flake check/rebuilds keep working.flake.nix checks
enable = falsedummy (podman leak-check added); new asserts pin default-on provisioning: tools flag with both default refs, no--container-image,Delegate=true,RuntimeDirectory=lab, podman+passt on the unit PATH, default subid range with no container config at all;virtualisation.podmanon by default; explicitly-emptiedtoolsImagesstill fails eval..forgejo/workflows/agent-tools.yml
<provider>-<git sha>tags alongside the CLI-version tags.Go
podmanx.Result.HasPullFailure()+ a retry loop in cmd/lab: deploy and agent-tools publish share a trigger, so a fresh host routinely races the publish of its own sha tag. Preflight re-runs every minute while a pull failure is the blocker, republishing through the existingGate; spawns unblock without a restart. Repeat verdicts log only on change.lab --helpnow documents--container-image/--container-tools-image(gap found in the #220 diagnosis).Docs: ADR-0054, ops.md (option table, agent-tools, container-runner), CONTEXT.md glossary.
Verified:
go test(podmanx/config/cmd-lab; full suite via the package check),go vet,golangci-lint0 issues,gofmtclean;nix build .#checks.x86_64-linux.nixos-moduleand.#checks.x86_64-linux.nixos-container-closureboth pass (dirty tree exercises the CLI-version fallback; CI's clean checkout exercises the rev path). Not driven end-to-end in-session: this host has no podman yet (that's the bug) — first real exercise is the next deploy after merge.Operator notes for dev-new (post-merge):
lab:100000:65536subid range on next deploy;/etc/subuidalready hasdominik:100000:65536, so setservices.lab.container.subIdRange.start = 165536;in Cloonar/nixos (or accept the documented overlap).🤖 Generated with Claude Code
Redesigned per review feedback (commit
dac946b) — the per-merge sha-tag scheme in the PR description is gone; ADR-0054 was rewritten to the settled shape:containers/**again — no image builds on ordinary merges. The per-merge<provider>-<sha>tags are dropped.versions.env:toolsImagesnow defaults to<toolsImageRepo>:claude-<CLAUDE_CODE_VERSION>/:codex-<CODEX_VERSION>read fromcontainers/agent-tools/versions.envat eval. Same file drives the build and the consumer refs, so the defaults move exactly when a publish does. (Also removes the dirty-tree special case the rev design needed.)deploy.ymlgains a wait step — checkout the pushed rev, derive the default refs from itsversions.env, poll the registry anonymously (skopeo via nix) until they resolve, 30-min deadline. On timeout the deploy fails and the Cloonar/nixos pin stays put. Merges that don't touch agent-tools pass this instantly.image exists-first: the version tags are moving refs (a labctl refresh viaworkflow_dispatchre-pushes the same tag), and exists-first would freeze every host on the first digest it ever pulled. Registry unreachable + cached image = degrade to cache with a logged warning; only pull-failure-with-no-cache refuses spawns, and that case keeps the retry loop from the first commit.Verified again: go test/vet/lint/gofmt clean;
nixos-moduleandnixos-container-closurechecks both pass.[autoland] verdict: pass
PASS — validated, awaiting free-text merge confirmation.
Signal relied on: Forgejo CI aggregate
success(labctl pr checks --wait 221) —ci / native,agent-tools / smoke, andci-nix / flake-check(21m, which runs the nixos-module default-on asserts and the container.enable=false zero-diff guard).agent-tools / publishcorrectly skipped (no containers/** diff). Did not re-run any of it.Conventions:
Closes #220present and valid. Commits are Conventional Commits (feat/refactor).Diff reviewed against #220's intent — sound:
CONCERNS (non-blocking): PR title is not Conventional Commits and is stale vs the redesign — it says 'rev-pinned agent-tools release tags', but commit
dac946bdropped the rev/sha-tag scheme for versions.env-pinned tags. If the server squash-merges on the PR title, mainline gets a non-conventional, misleading subject. Suggest retitling in the forge UI before merge (e.g. 'feat(nix,ci): container-ready by default — enable=true, versions.env-pinned agent-tools tags, verified pulls'). Not a blocker.