* post: fstrim the buildkit sticky disk before unmount at commit
Pruned layers keep their RBD extents allocated on the backing store until
the guest discards them. Run a best-effort fstrim on /var/lib/buildkit
before unmount, only when the run is still on track to commit (integrity
check passed, no early deny, no SIGKILL, no failed steps) and only when
the host enabled it: the VM agent returns
GetStickyDiskResponse.fstrim_timeout_secs (fa live config
guest_fstrim_timeout_secs), saved in action state at mount time; 0 means
no trim. Any failure or timeout only logs.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit 3d2979f)
* setup: read fstrim_timeout_secs from unknown field 8 when the proto package predates it
The bundled GetStickyDiskResponse has no fstrim_timeout_secs yet, and protobuf-es keeps fields it does not know in $unknown (the gRPC transport is binary), so decode field 8 from there when the typed field is absent. Releases built before the field existed therefore honour the host budget once the agent sends it.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit 56214f0)
* setup: read fstrim_timeout_secs from the regenerated proto package
Bump @buf/blacksmith_vm-agent.bufbuild_es to the FastActions/fa main build
that carries GetStickyDiskResponse.fstrim_timeout_secs (and @bufbuild/protobuf
to its ^2.16.0 peer), read the typed field directly, and drop the unknown
field 8 decoding.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* post: report the fstrim result in DockerJobLifecycle
trimFilesystem returns outcome (ok/timeout/unsupported/failed/skipped),
duration and the fstrim -v byte count; the post step stores them on the
lifecycle so shipTeardownReport can send them once the proto package
carries the fields (fa: DockerJobLifecycle 28-30).
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* post: pass the host fstrim minimum free-extent size as fstrim -m
GetStickyDiskResponse.fstrim_min_extent_bytes (fa #6823) is saved as action
state next to the timeout budget and, when positive, becomes
`fstrim -m <bytes>` so free extents below the host's threshold are not
discarded. Zero or absent leaves fstrim at its default. Bumps the @buf
vm-agent package to the fa main build that carries field 9.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* post: report the fstrim result as DockerJobLifecycle fields 28-30
fa #6812 added fstrim_duration_ms, fstrim_outcome (FstrimOutcome enum) and
fstrim_bytes to DockerJobLifecycle; the post step already collected them,
this serializes them. fstrimOutcomeToProto maps the action's outcome
string onto the enum. Bumps the @buf vm-agent package to the fa main build
that carries the fields.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>