cachebudget

package
v1.5.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package cachebudget sizes the builder cache budget. It is a leaf so the build client and the managed BuildKit supervisor share one rule without importing each other.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Budget

type Budget struct {
	ReservedBytes int64
	MaxUsedBytes  int64
}

Budget is the builder cache size a post build prune keeps the cache under.

func BudgetFor

func BudgetFor(totalDiskBytes, reservedMB, maxUsedMB int64) Budget

BudgetFor sizes the budget with the GC policy rules, for builders the supervisor does not start (the engine's own BuildKit). 0 sizes from disk.

type Sizing

type Sizing struct {
	Budget
	MinFreePct int64
}

Sizing is a Budget plus the free space floor the GC policy also needs.

func Size

func Size(total, maxUsedMB, reservedMB, minFreePct int64) Sizing

Size derives the cache budget from the disk holding BuildKit state. An unknown disk (total <= 0) gets a small fixed budget so a failed statfs never leaves the cache unbounded. Explicit overrides win, but reserved is clamped to max used because BuildKit rejects a floor above the cap.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL