Repository navigation
feat(deploy,preempt)!: K1-unblock wave 1 — resource arbiter reads via resolved-project envelope - #94
Conversation
… resolved-project envelope
Adds #ResolvedProject.resources (a straight one-field projection, mirroring
the existing `deploy` field) and sdk/deploykit/preempt_resolve.go — portable,
LoadUnified-free helpers (MergedDeployTree/FilterPreemptibleHolders/
HolderAddrFor/FindVMClaimant/GpuVendorTokens) extracted from charly core's
former preempt.go. These let the resource arbiter (candy/plugin-preempt, the
superproject-side companion of this change) read its last 2 genuinely
LoadUnified-coupled host dependencies (gather + resources) off the SAME
generic HostBuild("resolved-project") envelope every other consumer already
uses, instead of a bespoke per-capability reverse RPC.
Retires the ExecutorService.HostArbiter reverse RPC entirely (proto +
Executor.HostArbiter client method + #ArbiterGatherReply/#ArbiterResourcesReply
+ ArbiterSeamGather/ArbiterSeamResources) — not merely unused, deleted, per R5.
#HolderAddr/#HolderDescriptor/#PreemptLease/#PreemptLedger/#ArbiterInvokeInput/
#ArbiterInvokeReply are unchanged (still used by the 6 InvokeProvider-dispatched
seams + the in-core proxy).
Verified: go build/vet/test clean (incl. TestGenReproducible +
TestProtocolDocsComplete), golangci-lint 0 issues. R10 (disposable bed
check-preempt-arbiter-pod, box/fedora, testing this LOCAL sdk tree via
CHARLY_REPO_OVERRIDE) — full 12-step PASS incl. the fresh-rebuild gate; see
the superproject companion PR for the paste-proof and the consumer-side diff.
Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)
Pre-submit self-check (retroactive — posted after request, per operator directive)Body-vs-final-diff (via Every evidence line re-executed at the pushed head:
CHANGELOG present: All claims in the PR body reconfirmed against the live pushed head, not merely asserted at authoring time. |
pr-validator — APPROVED ✅Change class: Head verified: Checklist
Comments considered: one comment (author, Cross-PR interactions considered: DecisionPASS. Every applicable R0–R10 + pillar item is independently re-verified — not taken on the author's word. The sdk-repo leg's own gate (build/vet/test/lint/gofmt/reproducibility) was re-run from scratch in a fresh checkout of the exact PR head and is 100% clean; the R5 grep self-test and the "gofmt nit is pre-existing" claim were both independently re-derived, not trusted; the SDD CUE-source mandate was positively re-confirmed (regeneration no-op, Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated) |
pr-validator: rename the CHANGELOG placeholder to the merge-time CalVer. Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)
pr-validator — landing complete ✅
This unblocks the LEG 2 (superproject) consumer PR: bump the Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated) |
…er reads via resolved-project envelope Lands the charly-side consumer adaptation for opencharly/sdk#94's already-merged breaking retirement of ExecutorService.HostArbiter / spec.ArbiterSeamGather / ArbiterSeamResources / ArbiterGatherReply / ArbiterResourcesReply. arbiter.go's hostGather/hostResources now read the generic Executor.HostBuild("resolved-project") envelope + the portable sdk/deploykit helpers (MergedDeployTree, FilterPreemptibleHolders, HolderAddrFor, GpuVendorTokens) instead of the retired Executor.HostArbiter RPC. charly/arbiter_host.go deleted; charly/preempt.go's superseded gather* helpers deleted (gatherResources kept for its remaining core-internal GPU-allocation callers); host_build_config_resolve.go's VM-claimant lookup repoints to the same portable deploykit.FindVMClaimant; the HostArbiter reverse-channel methods + F11 allowlist entry + the plugin-kube fake-client stub removed. sdk gitlink at the merged bbb6aca9 (v0.2026205.742); box/fedora gitlink at the merged afb9237b (distro-fedora#8, its own R5 doc-sweep completion). Landed this standalone, ahead of the volume-persistence PR (#183) that originally surfaced the hazard: any charly cutover bumping its sdk gitlink past sdk main's already-merged #94 retirement broke go build ./charly/... outright, independent of that cutover's own scope. This clears the hazard for every concurrent and future sdk-pin bump. Verified independently across three validation rounds: fresh binary rebuilds, go build/vet/test/gofmt/golangci-lint (0 issues) clean on every round; a live, independent re-run of check-preempt-arbiter-pod (12/12 PASS, both changed-path assertions exit=0); the R5 claim-keyed HostArbiter doc sweep confirmed complete (git grep empty tree-wide, superproject + box/fedora); the box/fedora gitlink confirmed to reference a commit genuinely on distro-fedora's protected main (no half-assembled-base hazard). Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)
…ne + retry) (#208) The bump pulls in spec PR #94: every network git subprocess in the @github ref resolution (refs.GitResolveRef / GitLatestTag / GitDefaultBranch / GitClone / gitCloneByCommit / populateSubmodules) now runs through a bounded runner — a context deadline (30s ref metadata / 60s transfer) plus 2 bounded retries with backoff — so a connection killed in a GitHub HTTP/2 reset window (curl error 92 CANCEL / "RPC failed; HTTP/2 stream 5 reset") re-resolves instead of hanging the pre-deploy phase forever (r9 wave forensics: 3 eval lanes froze on a dead socket — 20x futex_wait + 1x do_epoll_wait). Permanent failures (repo not found / 404) fail fast without retry. No sdk code change: the refs API surface is unchanged (the runner is internal to spec/refs); loaderkit's collection + EnsureRepoDownloaded and kit's DefaultDownloader pick up the bounded resolution through the pinned spec version.
…ordination The BLOCK was body-only: the consumer leg was named in prose instead of filed, and the thread carried no WAITING/HOLDING. Both are addressed (opencharly/plugin-deploy-pod#94 filed and cited; RCA + WAITING posted on this thread, HOLDING on #93 and #94). This commit exists to give the required validator a new head to judge; it changes no file.
* fix(deploy)!: never run a unit as container root A unit with a bind mount now always runs as the IMAGE USER under UserNS=keep-id: the image user is the invoking host user there, so a host-owned volume is writable with no chown and nothing runs as root. The CDI device is emitted only on a unit WITHOUT bind mounts. Measured: keep-id + CDI fails at the spec's first file mount for the nvidia-ctk spec AND for a minimal devices+libs spec (crun mount_setattr EPERM, exit 126), while a devices-only CDI spec applies fine — so a bind unit takes its GPU as device-node injection plus driver-library bind mounts instead. userns=host --user 1000 with an idmapped volume is also denied; the old root branch is gone. Measured end to end in that shape: uid=1000, host bind written 1000:1000, cuInit/device/context/16 MiB alloc ok, nvidia-smi -L lists the GPU, and an ONNX Runtime MatMul executed on CUDAExecutionProvider with the model stored on a gocryptfs volume. gofmt/vet/test/golangci-lint (module toolchain go1.26.8): clean. Agent: `immich-consolidation` · Claude Code session `113f762e-5d70-484a-9ed9-e34c6423c926` Assisted-by: Claude Code deepseek-v4.1-flash:cloud (fully tested and validated) * fix(deploy): the CDI device rides a bind unit; keep-id only rejects its mounts The first commit on this branch dropped the CDI device from every unit with a bind mount. That over-corrected: the measured wall is the CDI spec's `mounts` section, not the device. keep-id + stock /etc/cdi/nvidia.yaml (has mounts) -> crun mount_setattr /usr/bin/nvidia-cuda-mps-control: EPERM, exit 126 keep-id + a DEVICES-ONLY spec (same device name, deviceNodes only) + the driver libs bound to their SONAME paths -> user/uid 1000, device node present, cuInit=0 on the RTX 4080 SUPER So the emitter keeps `AddDevice=nvidia.com/gpu=all` on every GPU unit, bind or not; the caller (plugin-deploy-pod) supplies a devices-only spec and the library binds. The only rule the emitter enforces is the user-namespace one: keep-id as the image user, never UserNS=host with User=0:0. Agent: `immich-consolidation` · Claude Code session `113f762e-5d70-484a-9ed9-e34c6423c926` Assisted-by: Claude Code deepseek-v4.1-flash:cloud (fully tested and validated) * chore: round 1 — cite the consumer leg as filed issue #94 and post coordination The BLOCK was body-only: the consumer leg was named in prose instead of filed, and the thread carried no WAITING/HOLDING. Both are addressed (opencharly/plugin-deploy-pod#94 filed and cited; RCA + WAITING posted on this thread, HOLDING on #93 and #94). This commit exists to give the required validator a new head to judge; it changes no file. * feat(deploy): carry extra podman args and read-only binds for a keep-id GPU unit A keep-id unit needs two things the emitter could not express: the engine flag that points podman at a devices-only CDI spec (`--cdi-spec-dir`), and the driver libraries bound `:ro` to their SONAME paths. QuadletConfig gains PodmanArgs (emitted as ONE PodmanArgs= line, because quadlet splits that line into argv words) and ResolvedBindMount gains ReadOnly. Both are internal library inputs, no wire or schema change. Agent: `immich-consolidation` · Claude Code session `113f762e-5d70-484a-9ed9-e34c6423c926` Assisted-by: Claude Code deepseek-v4.1-flash:cloud (fully tested and validated) * chore: re-sync the pull request head * chore: round 2 — body accounts for every commit, gate re-run on the pushed head Body-only round: the Summary accounts for the second code commit, R11 states the two added internal fields and their disposition, and the module gate was re-run on the exact pushed head with the new test's output pasted. The round RCA is posted on the thread. No file changes. Agent: `immich-consolidation` · Claude Code session `113f762e-5d70-484a-9ed9-e34c6423c926` Assisted-by: Claude Code deepseek-v4.1-flash:cloud (fully tested and validated)
Summary of changes
K1-UNBLOCK program, wave 1 (sdk leg). Adds
#ResolvedProject.resources(aone-field projection mirroring the existing
deployfield) andsdk/deploykit/preempt_resolve.go— portable, LoadUnified-free resource-arbiter helpers (
MergedDeployTree,HolderAddrFor,FilterPreemptibleHolders,FindVMClaimant,GpuVendorTokens) extracted from charly core's formerpreempt.go. These let the resource arbiter's last 2 genuinely LoadUnified-coupled host dependencies (gather of preemptible holders, gpu-vendor resource
map) read the SAME generic
HostBuild("resolved-project")envelope everyother resolved-project consumer already uses, instead of a bespoke
per-capability reverse RPC.
Retires the
ExecutorService.HostArbiterreverse RPC entirely (R5 — not keptunused):
protocol/schema/plugin.cuedrops the RPC + itsHostArbiterRequest/HostArbiterReplymessages (task wire:genregeneratedproto/plugin.proto+ stubs);executor.godrops theExecutor.HostArbiterclient method;
schema/arbiter.cuedrops#ArbiterGatherReply/#ArbiterResourcesReply;spec/arbiter_consts.godropsArbiterSeamGather/ArbiterSeamResources.#HolderAddr/#HolderDescriptor/#PreemptLease/#PreemptLedger/#ArbiterInvokeInput/#ArbiterInvokeReplyare UNCHANGED (still used by the 6 InvokeProvider-dispatched holder seams +
the in-core proxy).
internal/wiregen/main_test.go'sTestProtocolDocsCompletefixed-doc-tableentry for the now-deleted
HostArbiterRequestmessage is removed.Full new-test coverage in
deploykit/preempt_resolve_test.go.Change class
charly-or-sdk Go(sdk leg of a cross-repo cutover). Cross-repo:sdk(this PR, producer — lands first) →
opencharly/charlysuperproject(consumer, bumps the
sdkgitlink +charly/go.modrequire to this PR'smerge tag; opened once this merges, per
/charly-internals:git-workflowB2dependency order).
How R10-tested — exact gate, commands, and pasted output
charly check run check-preempt-arbiter-pod(box/fedora submodule bed) — the R10 witness for the externalized resource
ARBITER dispatch, exactly the code path this change touches
(gather/resources). Run against THIS sdk tree via the superproject's
charly/go.modreplace github.com/opencharly/sdk => ../sdk(in-treedev resolution) from a companion superproject worktree carrying the
matching consumer-side changes (candy/plugin-preempt, charly core) —
see the companion superproject PR for the consumer diff.
check-preempt-arbiter-pod | pod (box/fedora) | ok | 12 steps | ~127s total (image-build 56.7s + check-image 12.3s + deploy-add 18.4s + config 4.2s + start 9.5s + check-live 11.6s + feature-run 11.5s + update 52.1s + feature-run-rebuild 11.7s + cleanup 2.5s). Binary:charly version→2026.203.1350(superproject worktree build, this sdk tree in-tree viareplace). Single bed — not a cross-cutting loader/resolver/IR change, so no concurrent roster required per the R10-gate-by-change-class matrix (a scoped consumer change gets the bed that composes it).[update] PASS after 52.066sischarly update check-preempt-arbiter-pod(destroy + rebuild), followed by[feature-run-rebuild] PASSre-verifying the baked plan against the freshly rebuilt deployment. Zero warnings in the run.check-liveassertions this change enables:arbiter-claim-recorded(charly preempt statussurfaces the bed'stest-locklease — provingAcquireExclusive→ the rewrittenhostGather/hostResources→HostBuild("resolved-project")→deploykit.FilterPreemptibleHolders/GpuVendorTokensall executed correctly) anddriver-switch-dryrun(the GPU driver-switch dispatch, unaffected by this change, confirmed still passing) — bothexit=0in the fresh-rebuild run.Attribution tier
fully tested and validated— every changed code path (the arbiter'sgather/resources reads) executed live against a fresh rebuild, both check-live
assertions that directly exercise them passed, and the R10 fresh-rebuild gate
(
update+feature-run-rebuild) passed clean.Harness rulebook compliance
/charly-internals:go,/charly-internals:plugin,/charly-internals:strict-policy,/charly-internals:git-workflow,/charly-internals:cutover-policy,/charly-internals:install-plan,/charly-core:deploy,/charly-check:checkall loaded before any coderead/edit (SDD schema-change recipe from
/charly-internals:go; theper-plugin CUE-schema + HostBuild-seam pattern from
/charly-internals:plugin).check-preempt-arbiter-podexploratory FAILwas root-caused via direct reproduction (not assumed) to a genuinely
external, pre-existing host condition (the shared
/usr/bin/charlypackagepredating the latest
mainlandings — confirmed against a clean,unmodified main worktree) and fixed at the source (package refresh); the
fresh-rebuild run carries zero warnings.
(
vmshared/cloud_init_iso.go's pre-existing gofmt nit) is explicitly NOTpart of this diff and is flagged for the next lint-sweep thematic batch —
the objective separability test applies (this cutover's own R10 passes and
proves its claim without touching that file).
HolderAddrFor/FilterPreemptibleHolders/FindVMClaimantare ONE shared implementation consumed by BOTH the arbiterplugin (via this sdk change) and the companion superproject PR's
host_build_config_resolve.goVM-claimant lookup — not two copies.cause was fixed by refreshing the actual stale artifact, not bypassed with
CHARLY_SKIP_FRESHNESS_CHECK.git grep 'ArbiterSeamGather\|ArbiterSeamResources\|ArbiterGatherReply\|ArbiterResourcesReply\|HostArbiterRequest\|HostArbiterReply'in this repo returns zero hits outside this PR's own explanatory comments describing the retirement (no CHANGELOG-only carve-out needed — this repo's history lives in the superproject convention, this repo's ownCHANGELOG/entry documents it). No transitional/dual-mode path remains.git statuschecked before every commit.go test) — see above.updatestep rebuilds the fixture image + binary from source andcharly versionwas confirmed (2026.203.1350) on the invoking worktree binary; no new runtime OS deps introduced.check-preempt-arbiter-podisdisposable: true; fresh rebuild ran; zero warnings; the newdeploykit/preempt_resolve_test.gocoverage would FAIL without this change (it directly exercises the new functions).resolved_project_host.go's existingrp.Deployfill, confirmed byte-identical touf.Bundle) before writing any code, not assumed from a skill. ADE — N/A, no candy authored/changed. SDD — the schema change (#ResolvedProject.resources) went through CUE first (task cue:gen,TestGenReproduciblePASS); the proto change went throughtask wire:gen(TestProtocolDocsCompletePASS after updating its fixed doc-table).HostArbiterRPC + its wire types deleted in the SAME commit as the last consumer that used them stopped calling it (companion PR); no Phase-2/deferred scope.updatedestroy+rebuild ran againstcheck-preempt-arbiter-pod,disposable: true.gofmt -l .clean (see note above),golangci-lint run ./...0 issues,go vet ./...clean,go test ./...green.CHANGELOG/2026.204.0001.mdstaged (placeholder CalVer — pr-validator finalizes it at merge).Assisted-by: Claude Code Anthropic Claude Sonnet 5 (fully tested and validated)