feat(builder): add builder.cleanup_on_start - #281
Merged
Conversation
… a build Mirrors runner.cleanup_on_start on the build side. When set, `benchmarkoor build` runs the same cleanup sweep as the `benchmarkoor cleanup` command before starting — removing leftover benchmarkoor containers, volumes, the EEST build network, orphaned ZFS clones/snapshots, overlay mounts, and CPU-freq state files across all available runtimes (Docker + Podman). Useful for reclaiming resources left by a previously killed build or run. - config: add BuilderConfig.CleanupOnStart (yaml/env: builder.cleanup_on_start, BENCHMARKOOR_BUILDER_CLEANUP_ON_START), defaulting to false. - build cmd: invoke buildCleanupManagers/performCleanup before buildBuilders, reusing the existing runner cleanup path verbatim. - docs: document the option and its env var.
skylenet
force-pushed
the
builder-cleanup-on-start
branch
from
July 10, 2026 14:47
e63ac59 to
3c4692c
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
Adds
builder.cleanup_on_start, the build-side analogue ofrunner.cleanup_on_start. When enabled,benchmarkoor buildperforms the same cleanup sweep as the standalonebenchmarkoor cleanupcommand before starting the build.It reuses the existing cleanup path verbatim (
buildCleanupManagers+performCleanup), so it removes, across all available runtimes (Docker + Podman):This reclaims resources left behind by a previously killed build or run before a fresh build begins.
Changes
BuilderConfig.CleanupOnStart(cleanup_on_start, envBENCHMARKOOR_BUILDER_CLEANUP_ON_START), defaultfalse.buildBuilders, matching howrundoes it (cmd/benchmarkoor/run.go). Cleanup runs first so stale resources are gone before the build creates fresh ones.docs/configuration.md.Tests
TestLoad_BuilderCleanupOnStartcovers file value, default-false, and env-binding-when-absent.go build/go vet/ golangci-lint (--new-from-rev=origin/master) all clean. (Pre-existing macOS-onlyTestValidateDataDirMethods_SchelkBinaryfailure is unrelated — it needs Linux/proc/mounts.)