Description
BuildKit 0.17 is changing the configuration for Garbage Collection;
These settings are currently exposed to end-users through the daemon.json, so we need to;
Update reference documentation
The (dockerd reference describes the fields;
"builder": {
"gc": {
"enabled": true,
"defaultKeepStorage": "10GB",
"policy": [
{ "keepStorage": "10GB", "filter": ["unused-for=2200h"] },
{ "keepStorage": "50GB", "filter": ["unused-for=3300h"] },
{ "keepStorage": "100GB", "all": true }
]
}
},
update manuals
The Build garbage collection page describes the fields
Deprecate old field (KeepBytes -> ReservedSpace)
❓ We need to look at a transition period likely, to prevent the daemon failing to start if old/new options are used
👉 We need to deprecate the renamed field (KeepBytes -> ReservedSpace), and add deprecation warnings -> deprecation
👉 Docker Desktop may also be setting a default that may need updating(?)
Wire-up new fields
Besides the renamed field (KeepBytes -> ReservedSpace), 2 new fields were added that need to be wired up;
Changes;
- The
KeepBytes field was renamed to ReservedSpace
- New field
MaxUsedSpace added
- New field
MinFreeSpace added
Old Type:
|
type PruneInfo struct { |
|
Filter []string `json:"filter"` |
|
All bool `json:"all"` |
|
KeepDuration time.Duration `json:"keepDuration"` |
|
KeepBytes int64 `json:"keepBytes"` |
|
} |
New Type;
https://github.com/moby/buildkit/blob/2534310fd4c59018ae3874e8d0fad493086e2575/client/prune.go#L69-L77
type PruneInfo struct {
All bool `json:"all"`
Filter []string `json:"filter"`
KeepDuration time.Duration `json:"keepDuration"`
ReservedSpace int64 `json:"reservedSpace"`
MaxUsedSpace int64 `json:"maxUsedSpace"`
MinFreeSpace int64 `json:"minFreeSpace"`
}
Verify connection with docker system prune, docker builder prune
Verify if defaults need updating
The daemon currently sets defaults; we need to check if those needs updating
|
func DefaultGCPolicy(p string, defaultKeepBytes int64) []client.PruneInfo { |
Description
BuildKit 0.17 is changing the configuration for Garbage Collection;
These settings are currently exposed to end-users through the
daemon.json, so we need to;KeepBytes->ReservedSpace)Update reference documentation
The (dockerd reference describes the fields;
update manuals
The Build garbage collection page describes the fields
Deprecate old field (
KeepBytes->ReservedSpace)❓ We need to look at a transition period likely, to prevent the daemon failing to start if old/new options are used
👉 We need to deprecate the renamed field (
KeepBytes->ReservedSpace), and add deprecation warnings -> deprecation👉 Docker Desktop may also be setting a default that may need updating(?)
Wire-up new fields
Besides the renamed field (
KeepBytes->ReservedSpace), 2 new fields were added that need to be wired up;Changes;
KeepBytesfield was renamed toReservedSpaceMaxUsedSpaceaddedMinFreeSpaceaddedOld Type:
moby/vendor/github.com/moby/buildkit/client/prune.go
Lines 61 to 66 in c09e526
New Type;
https://github.com/moby/buildkit/blob/2534310fd4c59018ae3874e8d0fad493086e2575/client/prune.go#L69-L77
Verify connection with
docker system prune,docker builder pruneVerify if defaults need updating
The daemon currently sets defaults; we need to check if those needs updating
moby/builder/builder-next/worker/gc.go
Line 18 in c09e526