Repository navigation
Conversation
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…c without a gcpolicy buildkitd now also reads /etc/buildkit/operator.toml, independent of --config. Only the gc and gcpolicy keys of each worker are taken from it, and only for a worker whose own config sets gc = false and declares no gcpolicy; a config that enables gc or carries its own policy is never changed. This lets the environment that ships buildkitd impose a garbage collection floor on clients that start the daemon with gc disabled. A size-based operator rule is refused unless the worker config sets pruneInUse = false, since a size-bounded prune with pruneInUse may remove records that still have live refs; time-based rules are always accepted. Problems with the operator file are logged and the daemon starts with the client config unchanged. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration
Bot
force-pushed
the
operator-gc-policy
branch
from
October 6, 2026 13:28
a6f3e72 to
01f20c6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
buildkitdnow also reads/etc/buildkit/operator.toml(appdefaults.ConfigDir), independent of whatever--configthe client passes. It is a normal buildkitd config file, but only thegc/gcpolicykeys of each worker are taken from it, and they are applied only to a worker whose own config isgc = falseand has nogcpolicy. Everything else is left alone:Purpose: let the environment that ships
buildkitdimpose a garbage-collection floor on clients that start the daemon withgc = falseand rely on an external prune (or none), without changing those clients.Rules in
config.ApplyOperatorGC(dst *GCConfig, op GCConfig, pruneInUse bool) (applied bool, err error):gc = false, orgc = truewithout agcpolicy→ error, nothing appliedreservedSpace/maxUsedSpace/minFreeSpace/keepBytes) is refused whilepruneInUseis in effect (cache: make in-use pruning opt-out and guard DiskUsage against pruned parents #34 made in-use pruning the default; with a size bound it can remove records that still have refs). Time-only rules (keepDuration) never prune in-use records (keepBytes == 0short-circuits the candidate check inpruneOnce), so they are always accepted.bklogwarn) and the daemon starts with the client's config unchanged — a bad floor can never block startup.applyOperatorConfigruns aftersetDefaultConfig/applyMainFlagsand the log setup, for both the OCI and containerd worker sections (containerd hasPruneInUsehard-coded to true).Verified with the built binary: v1-shaped config (
gc=false, no policy) + operator file →buildctl debug workers -vshowsGC Policy rule#0: All: true, Keep duration: 192h; a config with its owngcpolicy keepDuration=24hkeeps 24h and logs nothing about the operator; no operator file → no GC policy, as before.Link to Devin session: https://app.devin.ai/sessions/e59c0c1861c64b12abae47b044b215d2
Open in Devin Desktop: https://app.devin.ai/desktop/session/e59c0c1861c64b12abae47b044b215d2?variant=devin
Requested by: @piob-io
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled. (Staging)