Skip to content

feat(builder): add builder.cleanup_on_start - #281

Merged
skylenet merged 1 commit into
masterfrom
builder-cleanup-on-start
Jul 10, 2026
Merged

feat(builder): add builder.cleanup_on_start#281
skylenet merged 1 commit into
masterfrom
builder-cleanup-on-start

Conversation

@skylenet

Copy link
Copy Markdown
Member

Summary

Adds builder.cleanup_on_start, the build-side analogue of runner.cleanup_on_start. When enabled, benchmarkoor build performs the same cleanup sweep as the standalone benchmarkoor cleanup command before starting the build.

It reuses the existing cleanup path verbatim (buildCleanupManagers + performCleanup), so it removes, across all available runtimes (Docker + Podman):

  • leftover benchmarkoor containers and volumes
  • the shared EEST build network
  • orphaned ZFS clones/snapshots
  • orphaned OverlayFS / fuse-overlayfs mounts and temp dirs
  • CPU-frequency state files (restoring original CPU settings)

This reclaims resources left behind by a previously killed build or run before a fresh build begins.

Changes

  • config: BuilderConfig.CleanupOnStart (cleanup_on_start, env BENCHMARKOOR_BUILDER_CLEANUP_ON_START), default false.
  • build cmd: runs the cleanup sweep right after the signal handler is installed and before buildBuilders, matching how run does it (cmd/benchmarkoor/run.go). Cleanup runs first so stale resources are gone before the build creates fresh ones.
  • docs: option row + env-var mapping in docs/configuration.md.

Tests

TestLoad_BuilderCleanupOnStart covers 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-only TestValidateDataDirMethods_SchelkBinary failure is unrelated — it needs Linux /proc/mounts.)

… 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
skylenet force-pushed the builder-cleanup-on-start branch from e63ac59 to 3c4692c Compare July 10, 2026 14:47
@skylenet
skylenet merged commit 8bdab5d into master Jul 10, 2026
7 checks passed
@skylenet
skylenet deleted the builder-cleanup-on-start branch July 10, 2026 15:08
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