Skip to content

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

Merged
piob-io merged 2 commits into
release/v2from
devin/1788385046-v2-server-gc-keep-duration
Sep 4, 2026
Merged

piob-io merged 2 commits 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, commitEarlyDenyReason, 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..8760 → core.warning + default. v1 (main) does not read the field and is unchanged.

No dependency changes: the @buf/blacksmith_vm-agent.bufbuild_es build pinned on release/v2 (via #133) already includes BuildkitdConfig, so the field is read through the generated type. Rollout order is still free: an agent or backend without the field leaves it unset and the action keeps 192h.


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.

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

@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
@devin-ai-integration
devin-ai-integration Bot force-pushed the devin/1788385046-v2-server-gc-keep-duration branch from 0a05d46 to 5003303 Compare September 4, 2026 14:09
piob-io and others added 2 commits September 4, 2026 14:21
…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>
The pinned @buf/blacksmith_vm-agent.bufbuild_es build already carries
BuildkitdConfig, so the structural cast is unnecessary.
@devin-ai-integration
devin-ai-integration Bot force-pushed the devin/1788385046-v2-server-gc-keep-duration branch from 5003303 to 67f633c Compare September 4, 2026 14:22
@piob-io
piob-io merged commit fabc8a3 into release/v2 Sep 4, 2026
13 checks passed
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.

2 participants