Skip to content

setup_builder: take the buildkitd GC keepDuration from the sticky disk response - #131

Open
piob-io wants to merge 1 commit into
release/v2from
devin/1788385046-v2-server-gc-keep-duration
Open

setup_builder: take the buildkitd GC keepDuration from the sticky disk response#131
piob-io wants to merge 1 commit into
release/v2from
devin/1788385046-v2-server-gc-keep-duration

Conversation

@piob-io

@piob-io piob-io commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Lets the backend control buildkitd's GC TTL (today hardcoded keepDuration = "192h" in DEFAULT_BUILDKITD_CONFIG) per organization and fleet-wide, without an action release. No new request: the agent already resolves the sticky disk through the backend on GetStickyDisk, and that response now carries buildkitdConfig { gcKeepDurationHours } (FastActions/fa#5384, sourced from useblacksmith/web#12355).

getStickyDisk()            → buildkitd_config: buildkitdConfigFromServer(response.buildkitdConfig?.gcKeepDurationHours)
setupStickyDisk()          → { device, exposeId, buildkitdConfig }
startAndConfigureBuildkitd(parallelism, buildkitdPath, driverOpts, serverConfig?)
startBuildkitd(..., serverConfig?) → writeBuildkitdTomlFile(..., serverConfig)   // existing plumbing, now fed

buildkitdConfigFromServer(hours) only overrides keepDuration (72 → "72h"); gc = true, all = true, parallelism and everything else stay as before. Missing/0 (old agent or backend, non-dockerfile disks) → default silently; non-integer or outside 1..8760core.warning + default. v1 (main) does not read the field and is unchanged.

Note on types: @buf/blacksmith_vm-agent.bufbuild_es is pinned to a BSR build that predates the new proto field, so the field is read via the same structural cast the function already uses for exposeId etc. Until fa#5384 merges and pnpm update-proto bumps the package, protobuf-es leaves field 5 in $unknown and the action keeps using 192h — i.e. this PR is safe to ship first; the bump is what activates it.

Link to Devin session: https://app.devin.ai/sessions/5c8deaae10f14cf49877e6f03ff873f9
Open in Devin Desktop: https://app.devin.ai/desktop/session/5c8deaae10f14cf49877e6f03ff873f9?variant=devin
Requested by: @piob-io


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled. (Staging)


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

…k response

The backend now attaches buildkitd_config.gc_keep_duration_hours to the
sticky disk it hands out (forwarded by the agent on GetStickyDisk), so
the GC TTL can be set fleet-wide and per organization without an action
release. The action converts the whole-hour value to a BuildKit duration
and only overrides keepDuration; gc/all/parallelism keep their defaults.

Values outside 1..8760h, non-integers, zero and a missing field fall back
to the existing 192h default with a warning where applicable, so older
agents and backends keep today's behavior.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@piob-io
piob-io marked this pull request as ready for review September 2, 2026 21:47
@piob-io
piob-io requested a review from bruce-y September 2, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant