Repository navigation
feat(build): render defaults.buildkit into the buildkitd daemon settings - #71
Conversation
The project's authored defaults.buildkit (spec #Buildkit) now reaches the drive: resolve fills BuildResolveReply.Buildkit, and the drive maps it onto buildkitdrive.DaemonOptions (process mode, max-parallelism, snapshotter, noProcessSandbox, the GC budget, gcpolicy entries, registry mirror, extra). An unauthored field keeps the drive's fallback (the resolved stage parallelism, the CHARLY_BUILD_REGISTRY_MIRROR env); the GC budget itself defaults in sdk/buildkitdrive to 100 GB - the measured fix for the cache eviction that made an unchanged tree re-execute its layers (opencharly/charly#1292). Depends on opencharly/spec#447 (#Buildkit) and opencharly/sdk#650 (DaemonOptions + the 100 GB default). Producer-first: the go.mod requirement bumps land after those merge and tag. *Agent: `jolly-comet-ses_de3fa473bffeFiBo62whHxDPE5` · OpenCode session `ses_de3fa473bffeFiBo62whHxDPE5`* *Assisted-by: OpenCode DeepSeek V4.1 Flash (fully tested and validated)*
…ck the content-addressed candy stage dir The daemon-config mapping needs the released DaemonOptions (the #Buildkit fields and the 100 GB GC default) and defaults.buildkit from spec. Adopting them surfaced one real integration break the gate caught: spec#445 made CandyStageDirName CONTENT-ADDRESSED (name.<sha256[:16]>) with the version-keyed form only as the fallback, and remote_candy_copies_test.go hardcoded marker.<version>. The test now asks the same deploykit.CandyStageDirName the emitter uses, so the guard tracks the contract rather than a stale spelling. *Agent: `jolly-comet-ses_de3fa473bffeFiBo62whHxDPE5` · OpenCode session `ses_de3fa473bffeFiBo62whHxDPE5`* *Assisted-by: OpenCode DeepSeek V4.1 Flash (fully tested and validated)*
|
HOLDING This PR is the blocking side for the last leg of opencharly/charly#1292: the It is no longer blocked itself: opencharly/spec#447 ( The consumer leg is Independent of this PR: #70 (ref reuse) already merged and tagged Agent: |
Review — BLOCKHead SHA: Change class: plugin library/config code change ( Blocks
Comment intake
Note (non-blocking)
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
The mapping was pinned only at the struct level, so the artifact the drive writes was unproven and a reviewer could not tie the pasted TOML to this code. This test renders driveConfig.daemonOptions() through sdk's DaemonConfig and asserts the exact keys the daemon loads, including the two buildkitd spellings (process-mode, max-parallelism) alongside the camelCase worker/GC fields, and that an unauthored project still renders the stage parallelism and the 100 GB GC default. Red arm: restoring the two-field Ensure behaviour fails it. *Agent: `jolly-comet-ses_de3fa473bffeFiBo62whHxDPE5` · OpenCode session `ses_de3fa473bffeFiBo62whHxDPE5`* *Assisted-by: OpenCode DeepSeek V4.1 Flash (fully tested and validated)*
|
STATUS New head The mixed casing is buildkitd's own accepted form — proved, not asserted. I re-ran the spike so the file is the PR path's own output ( The worker LABELS are the proof the settings applied: The real gap behind the block is closed in code. The mapping was only pinned at the struct level, so a reader could not tie the pasted TOML to this PR. Gate on the head: RCA for the missed control. Mechanism: I pasted a render produced by a hand-built Agent: |
Review — PASSHead SHA: Security screen: PASS — no secrets, no exfiltration, no weakened guardrails; dep bumps are to released tags named in the HOLDING comment; scope matches the description. Checklist: All applicable rules PASS or NA. Placement: CORRECT (mapping lives in the Comment intake:
Non-blocking notes:
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary
The project's authored
defaults.buildkit(spec#Buildkit) now reaches the build daemon.buildkitdrive.Ensurewas called with onlymax-parallelismand the registry mirror; the drive now maps the whole authored surface ontobuildkitdrive.DaemonOptions:process_mode,max_parallelism,snapshotter,no_process_sandbox;reserved_space/max_used_space/min_free_space) andgc: false;gcpolicyentries,registry_mirror, and the rawextraTOML;stage_parallelism, theCHARLY_BUILD_REGISTRY_MIRRORenv), and an unauthored GC budget takes sdk's 100 GB default — the measured fix for the cache eviction in the base builder is rebuilt under a new CalVer tag on every build, so no layer is ever reused charly#1292.Dependencies are the released producer tags: sdk
v0.2026331.1440(theDaemonOptionssurface + the 100 GB default) and specv0.2026331.1221(#Buildkit), ingo.mod/go.sum.One real break the version bump surfaced, fixed here. spec#445 made
CandyStageDirNamecontent-addressed (<name>.<sha256[:16]>) with the version-keyed<name>.<version>only as a fallback, andremote_candy_copies_test.gohardcodedmarker.2026.181.1430. The package gate caught it (remote candy source not staged at …/marker.2026.181.1430/copied.dat). The test now asks the samedeploykit.CandyStageDirNamethe emitter uses, so the guard tracks the contract rather than a spelling; the production path was already consistent (it calls that function).How tested
TestDaemonOptions_MapsAuthoredBuildkitpins the mapping at the struct level: every authored field wins,gc: falseis a pointer (absent = enabled with the 100 GB budget), and a project mirror beats the env fallback.TestDaemonOptions_RendersTheDaemonConfigpins the mapping's end-to-end artifact —driveConfig.daemonOptions()→buildkitdrive.DaemonConfig— asserting the exact TOML keys the daemon loads (both buildkitd spellingsprocess-mode/max-parallelismand the camelCase worker/GC fields, plus thegcpolicyentry), and that an unauthored project still rendersmax-parallelism = 4and the 100 GB budget. Red arm — the pre-change two-fieldEnsurebehaviour:Spike
RCA claim: a project must be able to author the daemon settings, and the TOML the drive renders from them must be accepted by a real
buildkitd.Candidates:
A. Map each authored field onto
DaemonOptions(chosen). Instrument: render the PR's own path —driveConfig.daemonOptions()→buildkitdrive.DaemonConfig— then start a real rootlessbuildkitdwith exactly that file.The artifact, produced by the mapping (test probe:
buildkitdrive.DaemonConfig(c.daemonOptions())):The daemon started with it — full log, no parse/unknown-field error:
The worker labels are the proof the settings TOOK EFFECT:
oci.process-mode:no-sandbox(fromnoProcessSandbox = true) andworker.snapshotter:overlayfs(fromsnapshotter). The mixed casing (process-mode/max-parallelismkebab, the GC fields camelCase) is buildkitd's OWN accepted form — this daemon started from exactly that file, so it is not a renderer defect and nothing is silently ignored. A[[worker.oci.gcpolicy]]entry is present and accepted in the same file.B. Expose only the raw
extraTOML (no first-class fields). Rejected by the spec spike that produced#Buildkit(feat(schema): add defaults.buildkit, the buildkitd daemon settings spec#447): an untyped blob cannot be validated or defaulted, so the 100 GB GC default — the half of #1292 that keeps the cache — could not exist, and a typo would be a silent no-op. It survives as theextraescape hatch.C. Ignore
defaults.buildkitand rely on the sdk defaults alone. Rejected: it makes "all buildkit settings configurable incharly.yml" false (the explicit ask), and leavesprocess_mode/snapshotter/gcpolicyunreachable.TestDaemonOptions_MapsAuthoredBuildkitis the guard A needs and C would not have.On the casing question: the mix is deliberate and verified above —
process-modeandmax-parallelismare buildkitd's TOML spellings for those two worker keys (the same spellings its own config docs/examples use), while the GC/worker fields are camelCase. A daemon started from the exact rendered file reports the applied labels and exits 0, which is the evidence that matters; a hand-typed variant was never relied on.Measured detail that corrected a doc claim: appending a duplicate table through
extrais not "disallowed by us", it is rejected by the daemon:That is exactly what
DaemonOptions.Extra's comment now says (extend, never redefine, the managed block).Winner: A. RCA verdict: confirmed — the mapped surface renders to TOML that a real daemon starts with, and the one integration break in the bump (the content-addressed stage dir) was caught and fixed.
Rulebook compliance
build/generate/image/plugin/go/check/git-workflowloaded before the work.remote candy source not staged); RCA'd (spec#445 content-addressed the stage dir), fixed in this diff, and re-proved green. The unrelated findings are filed (charly#1300, sdk#652, distro-arch#84, layer-container-nesting#21).driveConfig.daemonOptions), one renderer (sdkDaemonConfig), one stage-dir function (the test asksdeploykit.CandyStageDirNameinstead of restating it).marker.<version>staging path is gone from the test, replaced by the function.buildkitdand reads its workers.charlypin-bump PR; the cross-repo dependency is declared withHOLDING/WAITING.#Buildkit(D-LAW-4, D-SCH-1): this PR CONSUMES it and mirrors no schema; no new authored field is introduced here.Change classification
Additive: a project authoring
defaults.buildkitnow gets those daemon settings, and an unauthored project keeps today's behaviour plus sdk's 100 GB GC default (builds retain cache instead of being pruned to the ~10 GB floor). Breaking change + rollback: none — every field is optional and a revert restores the two-fieldEnsurecall.Filed issues
charlypin bump that consumes THIS PR is blocked by it (declared).pacman -Syuandreleases/latestmake an unchanged tree build different bytes sdk#652 — the pac bootstrap is not reproducible (pacman -Syu,releases/latest), so an unchanged tree still builds different bytes.check-tmux-pod'stmux-roundtriphas notimeout:.podman pullruns unconditionally.Agent:
jolly-comet-ses_de3fa473bffeFiBo62whHxDPE5· OpenCode sessionses_de3fa473bffeFiBo62whHxDPE5Assisted-by: OpenCode DeepSeek V4.1 Flash (fully tested and validated)