From f69c0798296a13cfe253ac100c83f06eef838388 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=B5nis=20Tiigi?= Date: Tue, 8 Oct 2024 08:28:40 -0700 Subject: [PATCH] Merge pull request #5359 from tonistiigi/gc-free-max-support update default and basic gc control to use free and max storage (cherry picked from commit 6860c8097dec4cdfdf2ca759214b7dd3bf5c7c61) --- api/services/control/control.pb.go | 360 +++++++++++------------ api/services/control/control.proto | 6 +- api/types/worker.pb.go | 121 ++++---- api/types/worker.proto | 8 +- cache/manager.go | 22 +- cache/manager_test.go | 28 +- client/prune.go | 24 +- client/workers.go | 12 +- cmd/buildctl/debug/workers.go | 14 +- cmd/buildkitd/config/config.go | 34 ++- cmd/buildkitd/config/gcpolicy.go | 55 +++- cmd/buildkitd/config/gcpolicy_unix.go | 8 +- cmd/buildkitd/config/gcpolicy_windows.go | 12 +- cmd/buildkitd/config/load_test.go | 24 +- cmd/buildkitd/main.go | 20 +- cmd/buildkitd/main_containerd_worker.go | 23 +- cmd/buildkitd/main_oci_worker.go | 23 +- cmd/buildkitd/util.go | 68 +++++ control/control.go | 24 +- solver/pb/caps.go | 9 + 20 files changed, 511 insertions(+), 384 deletions(-) create mode 100644 cmd/buildkitd/util.go diff --git a/api/services/control/control.pb.go b/api/services/control/control.pb.go index a1a830363869..feb1fe5f74b4 100644 --- a/api/services/control/control.pb.go +++ b/api/services/control/control.pb.go @@ -69,9 +69,9 @@ type PruneRequest struct { Filter []string `protobuf:"bytes,1,rep,name=filter,proto3" json:"filter,omitempty"` All bool `protobuf:"varint,2,opt,name=all,proto3" json:"all,omitempty"` KeepDuration int64 `protobuf:"varint,3,opt,name=keepDuration,proto3" json:"keepDuration,omitempty"` - MinStorage int64 `protobuf:"varint,5,opt,name=minStorage,proto3" json:"minStorage,omitempty"` - MaxStorage int64 `protobuf:"varint,4,opt,name=maxStorage,proto3" json:"maxStorage,omitempty"` - Free int64 `protobuf:"varint,6,opt,name=free,proto3" json:"free,omitempty"` + ReservedSpace int64 `protobuf:"varint,4,opt,name=reservedSpace,proto3" json:"reservedSpace,omitempty"` + MaxUsedSpace int64 `protobuf:"varint,5,opt,name=maxUsedSpace,proto3" json:"maxUsedSpace,omitempty"` + MinFreeSpace int64 `protobuf:"varint,6,opt,name=minFreeSpace,proto3" json:"minFreeSpace,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -131,23 +131,23 @@ func (m *PruneRequest) GetKeepDuration() int64 { return 0 } -func (m *PruneRequest) GetMinStorage() int64 { +func (m *PruneRequest) GetReservedSpace() int64 { if m != nil { - return m.MinStorage + return m.ReservedSpace } return 0 } -func (m *PruneRequest) GetMaxStorage() int64 { +func (m *PruneRequest) GetMaxUsedSpace() int64 { if m != nil { - return m.MaxStorage + return m.MaxUsedSpace } return 0 } -func (m *PruneRequest) GetFree() int64 { +func (m *PruneRequest) GetMinFreeSpace() int64 { if m != nil { - return m.Free + return m.MinFreeSpace } return 0 } @@ -2049,156 +2049,156 @@ func init() { func init() { proto.RegisterFile("control.proto", fileDescriptor_0c5120591600887d) } var fileDescriptor_0c5120591600887d = []byte{ - // 2374 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x19, 0x4d, 0x73, 0x1b, 0x59, - 0x31, 0x23, 0xc9, 0xb2, 0xd4, 0x92, 0x1c, 0xf9, 0x25, 0x1b, 0x86, 0x21, 0x6b, 0x3b, 0xb3, 0x09, - 0xb8, 0x42, 0x32, 0xf2, 0x0a, 0x42, 0xb2, 0x0e, 0x84, 0x58, 0x96, 0xd8, 0x38, 0x24, 0x15, 0xef, - 0xb3, 0xb3, 0xa1, 0xb6, 0x6a, 0xa1, 0xc6, 0xd2, 0xb3, 0x32, 0xe5, 0xd1, 0xcc, 0xf0, 0xe6, 0xc9, - 0x6b, 0x71, 0xe2, 0xca, 0x85, 0xe2,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31, 0x11, 0xae, 0x2b, 0x60, 0x09, 0x20, 0x04, 0xb9, 0x3d, 0xef, 0x77, 0xca, - 0x03, 0x58, 0xac, 0x91, 0x05, 0xf9, 0x5d, 0x97, 0x92, 0x80, 0x09, 0xef, 0x15, 0x1b, 0x19, 0xd3, - 0xc0, 0x0a, 0x83, 0x1a, 0x50, 0xdc, 0xa6, 0xc4, 0x65, 0xa4, 0xb3, 0xc5, 0x84, 0x5b, 0x4a, 0x75, - 0xcb, 0x91, 0xe7, 0xee, 0x24, 0xe7, 0xee, 0xec, 0x27, 0xe7, 0xde, 0x28, 0xbc, 0x7a, 0xbd, 0x7a, - 0xe1, 0x4f, 0xdf, 0xac, 0x1a, 0x78, 0xc4, 0x86, 0x1e, 0x02, 0x3c, 0x71, 0x63, 0xf6, 0x3c, 0x16, - 0x42, 0x16, 0xcf, 0x14, 0x92, 0x13, 0x02, 0x34, 0x1e, 0xb4, 0x02, 0x20, 0x9c, 0xb0, 0x1d, 0xf6, - 0x03, 0x66, 0x16, 0x84, 0xee, 0x1a, 0x06, 0xad, 0x41, 0xa9, 0x49, 0xe2, 0x36, 0xf5, 0x22, 0x11, - 0x2c, 0x45, 0xe1, 0x1e, 0x1d, 0xc5, 0x25, 0x48, 0x0f, 0xee, 0x0f, 0x22, 0x62, 0x82, 0x20, 0xd0, - 0x30, 0xfc, 0x2c, 0xf7, 0x5e, 0xba, 0x94, 0x74, 0xcc, 0x92, 0x70, 0x97, 0x82, 0xb8, 0x7f, 0xa5, - 0x27, 0x62, 0xb3, 0x2c, 0x0e, 0x39, 0x01, 0xed, 0xdf, 0x17, 0xa0, 0xbc, 0xc7, 0x93, 0x29, 0x09, - 0x87, 0x2a, 0x64, 0x31, 0x39, 0x54, 0x67, 0xc3, 0x97, 0xc8, 0x01, 0x68, 0x92, 0x43, 0x2f, 0xf0, - 0x84, 0x56, 0x19, 0x61, 0xf8, 0x92, 0x13, 0x1d, 0x38, 0x23, 0x2c, 0xd6, 0x28, 0x90, 0x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x6c, 0x95, 0xcf, 0x13, - 0x02, 0xf6, 0xdf, 0x0c, 0x58, 0x9e, 0xfa, 0x10, 0xbf, 0x12, 0xc5, 0xa5, 0x20, 0x45, 0x88, 0x35, - 0x6a, 0xc2, 0x82, 0x2c, 0x52, 0x19, 0xa1, 0xb0, 0x33, 0x87, 0xc2, 0x8e, 0x56, 0xa1, 0x24, 0xb3, - 0x75, 0x0f, 0xe0, 0xed, 0x82, 0xd5, 0xfe, 0x87, 0x01, 0x15, 0x55, 0x10, 0x54, 0xff, 0xe0, 0x42, - 0x75, 0x98, 0x63, 0x0a, 0xa7, 0x3a, 0x89, 0x3b, 0x33, 0x6b, 0x89, 0x24, 0x73, 0x26, 0xf9, 0xa4, - 0x8e, 0x53, 0xe2, 0xac, 0xed, 0x24, 0xae, 0x26, 0x48, 0xcf, 0xa5, 0xf9, 0x35, 0xa8, 0xec, 0x89, - 0x4e, 0x77, 0xe6, 0xb5, 0x68, 0xff, 0xcf, 0x80, 0xa5, 0x84, 0x46, 0x59, 0xf7, 0x63, 0x28, 0x1c, - 0x13, 0xca, 0xc8, 0x09, 0x89, 0x95, 0x55, 0xe6, 0xb4, 0x55, 0x9f, 0x0b, 0x0a, 0x3c, 0xa4, 0x44, - 0x9b, 0x50, 0x90, 0x5d, 0x35, 0x49, 0x0e, 0x6a, 0x65, 0x16, 0x97, 0xfa, 0xde, 0x90, 0x1e, 0xd5, - 0x20, 0xe7, 0x87, 0xdd, 0x58, 0xe5, 0xcc, 0xf7, 0x66, 0xf1, 0x3d, 0x09, 0xbb, 0x58, 0x10, 0xa2, - 0xfb, 0x50, 0xf8, 0xca, 0xa5, 0x81, 0x17, 0x74, 0x93, 0x2c, 0x58, 0x9d, 0xc5, 0xf4, 0x42, 0xd2, - 0xe1, 0x21, 0x03, 0x6f, 0xe3, 0xf2, 0x72, 0x0f, 0x3d, 0x86, 0x7c, 0xc7, 0xeb, 0x92, 0x98, 0x49, - 0x97, 0x34, 0xea, 0xfc, 0x3e, 0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, 0xc2, 0xb9, 0xcf, 0xcf, 0xfe, - 0x97, 0x01, 0xc5, 0x61, 0x6e, 0x69, 0xde, 0x35, 0xde, 0xd9, 0xbb, 0x63, 0x9e, 0xc9, 0xbc, 0x9d, - 0x67, 0xae, 0x40, 0x3e, 0x66, 0x94, 0xb8, 0x3d, 0x39, 0x71, 0x62, 0x05, 0xf1, 0x2a, 0xd6, 0x8b, - 0xbb, 0xe2, 0x84, 0xca, 0x98, 0x2f, 0xed, 0xff, 0x1b, 0x50, 0x19, 0x4b, 0xf7, 0xf7, 0x6a, 0xcb, - 0x65, 0x58, 0xf0, 0xc9, 0x31, 0x91, 0x33, 0x71, 0x16, 0x4b, 0x80, 0x63, 0xe3, 0x97, 0x21, 0x65, - 0x42, 0xb9, 0x32, 0x96, 0x00, 0xd7, 0xb9, 0x43, 0x98, 0xeb, 0xf9, 0xa2, 0x2e, 0x95, 0xb1, 0x82, - 0xb8, 0xce, 0x7d, 0xea, 0xab, 0x1e, 0x9d, 0x2f, 0x91, 0x0d, 0x39, 0x2f, 0x38, 0x0c, 0x55, 0xd8, - 0x88, 0xce, 0x46, 0xf6, 0x7a, 0x3b, 0xc1, 0x61, 0x88, 0xc5, 0x1e, 0xba, 0x06, 0x79, 0xea, 0x06, - 0x5d, 0x92, 0x34, 0xe8, 0x45, 0x4e, 0x85, 0x39, 0x06, 0xab, 0x0d, 0xdb, 0x86, 0x72, 0x63, 0xc0, - 0x48, 0xfc, 0x94, 0xc4, 0x7c, 0x06, 0xe3, 0x61, 0xdd, 0x71, 0x99, 0x2b, 0xcc, 0x2e, 0x63, 0xb1, - 0xb6, 0x6f, 0x01, 0x7a, 0xe2, 0xc5, 0xec, 0x85, 0x78, 0x95, 0x88, 0xcf, 0x1a, 0x99, 0xf7, 0xe0, - 0xd2, 0x18, 0xb5, 0xba, 0x16, 0x7e, 0x3a, 0x31, 0x34, 0x5f, 0x9f, 0xae, 0xb8, 0xe2, 0xf1, 0xc3, - 0x91, 0x8c, 0x13,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 0xfe, 0xba, 0xb1, 0x61, 0xa0, 0x2f, - 0xa0, 0xa4, 0x4d, 0x02, 0x28, 0xa5, 0x0f, 0x9d, 0x1e, 0x2b, 0xac, 0x1b, 0x67, 0x50, 0x29, 0xcb, - 0x5b, 0x90, 0x13, 0x05, 0x20, 0xc5, 0xd9, 0xda, 0xa0, 0x90, 0xa6, 0xe6, 0xd8, 0xe0, 0x70, 0x20, - 0x47, 0x1b, 0x12, 0xe8, 0xd1, 0x87, 0x6e, 0x9c, 0xd5, 0x91, 0xcc, 0x0c, 0x9b, 0xa9, 0x20, 0xde, - 0x30, 0x50, 0x08, 0x68, 0xba, 0xe8, 0xa3, 0x1f, 0xa6, 0x44, 0xc9, 0xac, 0x5b, 0xc9, 0xba, 0x35, - 0x1f, 0xb1, 0x34, 0xaa, 0x51, 0x7e, 0xf5, 0x66, 0xc5, 0xf8, 0xf7, 0x9b, 0x15, 0xe3, 0x3f, 0x6f, - 0x56, 0x8c, 0x83, 0xbc, 0xe8, 0x35, 0x7f, 0xf4, 0x6d, 0x00, 0x00, 0x00, 0xff, 0xff, 0x40, 0x05, - 0x0e, 0x94, 0xfd, 0x1e, 0x00, 0x00, + // 2383 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x59, 0x4f, 0x73, 0x1b, 0x49, + 0x15, 0xcf, 0x48, 0xb2, 0x2c, 0x3d, 0x49, 0x8e, 0xdc, 0xc9, 0x86, 0x61, 0xc8, 0xda, 0xce, 0x6c, + 0x02, 0xae, 0x90, 0x8c, 0xbc, 0x82, 0x90, 0xac, 0x03, 0x21, 0x96, 0xa5, 0xdd, 0x38, 0x24, 0x15, + 0x6f, 0xdb, 0xd9, 0x50, 0x5b, 0xb5, 0x50, 0x63, 0xa9, 0xad, 0x4c, 0x79, 0x34, 0x33, 0xf4, 0xb4, + 0xbc, 0x16, 0x27, 0xae, 0x5c, 0x28, 0x2e, 0x14, 0x17, 0xee, 0x9c, 0x38, 0x73, 0xe6, 0x40, 0x55, + 0x8e, 0x9c, 0xf7, 0x90, 0xa5, 0xf2, 0x01, 0x28, 0x8e, 0x1c, 0xa9, 0xfe, 0x33, 0x52, 0x4b, 0x1a, + 0xd9, 0x72, 0x92, 0x93, 0xfa, 0x75, 0xbf, 0xdf, 0x9b, 0xd7, 0xaf, 0xdf, 0x7b, 0xfd, 0x5e, 0x0b, + 0x2a, 0xed, 0x30, 0x60, 0x34, 0xf4, 0x9d, 0x88, 0x86, 0x2c, 0x44, 0xd5, 0x5e, 0x78, 0x30, 0x70, + 0x0e, 0xfa, 0x9e, 0xdf, 0x39, 0xf2, 0x98, 0x73, 0xfc, 0xb1, 0x55, 0xef, 0x7a, 0xec, 0x65, 0xff, + 0xc0, 0x69, 0x87, 0xbd, 0x5a, 0x37, 0xec, 0x86, 0xb5, 0x6e, 0x18, 0x76, 0x7d, 0xe2, 0x46, 0x5e, + 0xac, 0x86, 0x35, 0x1a, 0xb5, 0x6b, 0x31, 0x73, 0x59, 0x3f, 0x96, 0x52, 0xac, 0xdb, 0x93, 0x18, + 0x31, 0x7d, 0xd0, 0x3f, 0x14, 0x94, 0x20, 0xc4, 0x48, 0xb1, 0xd7, 0x34, 0x76, 0xfe, 0xfd, 0x5a, + 0xf2, 0xfd, 0x9a, 0x1b, 0x79, 0x35, 0x36, 0x88, 0x48, 0x5c, 0xfb, 0x3a, 0xa4, 0x47, 0x84, 0x2a, + 0xc0, 0xad, 0x99, 0x80, 0x38, 0xf4, 0x8f, 0x09, 0xad, 0x45, 0x07, 0xb5, 0x30, 0x4a, 0xb4, 0xb9, + 0x73, 0x0a, 0x77, 0x9f, 0xb6, 0x49, 0x14, 0xfa, 0x5e, 0x7b, 0xc0, 0x31, 0x72, 0xa4, 0x60, 0xab, + 0x6a, 0x77, 0x43, 0xdd, 0x99, 0xd7, 0x23, 0x31, 0x73, 0x7b, 0x91, 0x64, 0xb0, 0xdf, 0x18, 0x50, +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, 0x61, 0x27, 0x78, 0x1e, 0x13, 0x61, 0xd4, 0x02, + 0x96, 0x04, 0x42, 0x90, 0xdb, 0xf3, 0x7e, 0xab, 0xcc, 0x87, 0xc5, 0x18, 0x59, 0x90, 0xdf, 0x75, + 0x29, 0x09, 0x98, 0xb0, 0x54, 0xb1, 0x91, 0x31, 0x0d, 0xac, 0x66, 0x50, 0x03, 0x8a, 0xdb, 0x94, + 0xb8, 0x8c, 0x74, 0xb6, 0x98, 0x30, 0x4f, 0xa9, 0x6e, 0x39, 0xd2, 0x23, 0x9c, 0xc4, 0x23, 0x9c, + 0xfd, 0xc4, 0x23, 0x1a, 0x85, 0x57, 0xaf, 0x57, 0x2f, 0xfc, 0xf1, 0xdb, 0x55, 0x03, 0x8f, 0x60, + 0xe8, 0x21, 0xc0, 0x13, 0x37, 0x66, 0xdc, 0xec, 0x5b, 0xcc, 0x5c, 0x3c, 0x53, 0x48, 0x4e, 0x08, + 0xd0, 0x30, 0x68, 0x05, 0x40, 0x18, 0x61, 0x3b, 0xec, 0x07, 0xcc, 0x2c, 0x08, 0xdd, 0xb5, 0x19, + 0xb4, 0x06, 0xa5, 0x26, 0x89, 0xdb, 0xd4, 0x8b, 0x84, 0x1b, 0x15, 0x85, 0x79, 0xf4, 0x29, 0x2e, + 0x41, 0x5a, 0x70, 0x7f, 0x10, 0x11, 0x13, 0x04, 0x83, 0x36, 0xc3, 0xcf, 0x72, 0xef, 0xa5, 0x4b, + 0x49, 0xc7, 0x2c, 0x09, 0x73, 0x29, 0x8a, 0xdb, 0x57, 0x5a, 0x22, 0x36, 0xcb, 0xe2, 0x90, 0x13, + 0xd2, 0xfe, 0x5d, 0x01, 0xca, 0x7b, 0x3c, 0xcc, 0x12, 0x77, 0xa8, 0x42, 0x16, 0x93, 0x43, 0x75, + 0x36, 0x7c, 0x88, 0x1c, 0x80, 0x26, 0x39, 0xf4, 0x02, 0x4f, 0x68, 0x95, 0x11, 0x1b, 0x5f, 0x72, + 0xa2, 0x03, 0x67, 0x34, 0x8b, 0x35, 0x0e, 0xe4, 0x00, 0x6a, 0x9d, 0x44, 0x21, 0x65, 0x84, 0x36, + 0x49, 0x44, 0x49, 0x9b, 0x1b, 0x50, 0x9c, 0x5f, 0x11, 0xa7, 0xac, 0xa0, 0x3e, 0x7c, 0x27, 0x99, + 0xdd, 0x62, 0x8c, 0xc6, 0x1a, 0x28, 0x27, 0x9c, 0xec, 0xfe, 0xb4, 0x93, 0xe9, 0x2a, 0x3b, 0x33, + 0xd0, 0xad, 0x80, 0xd1, 0x01, 0x9e, 0x25, 0x9b, 0xdb, 0x64, 0x8f, 0xc4, 0x31, 0xdf, 0x93, 0x70, + 0x18, 0x9c, 0x90, 0xc8, 0x82, 0xc2, 0xa7, 0x34, 0x0c, 0x18, 0x09, 0x3a, 0xc2, 0x59, 0x8a, 0x78, + 0x48, 0xa3, 0x17, 0x50, 0x49, 0xc6, 0x42, 0xa0, 0xb9, 0x28, 0x54, 0xfc, 0xf8, 0x0c, 0x15, 0xc7, + 0x30, 0x52, 0xb1, 0x71, 0x39, 0x68, 0x13, 0x16, 0xb6, 0xdd, 0xf6, 0x4b, 0x22, 0xfc, 0xa2, 0x54, + 0x5f, 0x99, 0x16, 0x28, 0x96, 0x9f, 0x09, 0x47, 0x88, 0x45, 0x74, 0x5f, 0xc0, 0x12, 0x82, 0x7e, + 0x05, 0xe5, 0x56, 0xc0, 0x3c, 0xe6, 0x93, 0x9e, 0x38, 0xe3, 0x22, 0x3f, 0xe3, 0xc6, 0xe6, 0x37, + 0xaf, 0x57, 0x7f, 0x32, 0x33, 0x5b, 0xf6, 0x99, 0xe7, 0xd7, 0x88, 0x86, 0x72, 0x34, 0x11, 0x78, + 0x4c, 0x1e, 0xfa, 0x12, 0x96, 0x12, 0x65, 0x77, 0x82, 0xa8, 0xcf, 0x62, 0x13, 0xc4, 0xae, 0xeb, + 0x73, 0xee, 0x5a, 0x82, 0xe4, 0xb6, 0x27, 0x24, 0x71, 0x63, 0xef, 0x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5, 0x08, 0xac, 0xd9, 0x2a, 0x9f, 0xc7, 0x05, 0xec, 0xbf, 0x1a, 0xb0, 0x3c, 0xf5, + 0x21, 0x7e, 0x25, 0x8a, 0x4b, 0x41, 0x8a, 0x10, 0x63, 0xd4, 0x84, 0x05, 0x99, 0xa4, 0x32, 0x42, + 0x61, 0x67, 0x0e, 0x85, 0x1d, 0x2d, 0x43, 0x49, 0xb0, 0x75, 0x0f, 0xe0, 0xed, 0x9c, 0xd5, 0xfe, + 0xbb, 0x01, 0x15, 0x95, 0x10, 0x54, 0xfd, 0xe0, 0x42, 0x75, 0x18, 0x63, 0x6a, 0x4e, 0x55, 0x12, + 0x77, 0x66, 0xe6, 0x12, 0xc9, 0xe6, 0x4c, 0xe2, 0xa4, 0x8e, 0x53, 0xe2, 0xac, 0xed, 0xc4, 0xaf, + 0x26, 0x58, 0xcf, 0xa5, 0xf9, 0x35, 0xa8, 0xec, 0x89, 0x1a, 0x78, 0xe6, 0xb5, 0x68, 0xff, 0xd7, + 0x80, 0xa5, 0x84, 0x47, 0xed, 0xee, 0xc7, 0x50, 0x38, 0x26, 0x94, 0x91, 0x13, 0x12, 0xab, 0x5d, + 0x99, 0xd3, 0xbb, 0xfa, 0x42, 0x70, 0xe0, 0x21, 0x27, 0xda, 0x84, 0x82, 0xac, 0xb7, 0x49, 0x72, + 0x50, 0x2b, 0xb3, 0x50, 0xea, 0x7b, 0x43, 0x7e, 0x54, 0x83, 0x9c, 0x1f, 0x76, 0x63, 0x15, 0x33, + 0xdf, 0x9b, 0x85, 0x7b, 0x12, 0x76, 0xb1, 0x60, 0x44, 0xf7, 0xa1, 0xf0, 0xb5, 0x4b, 0x03, 0x2f, + 0xe8, 0x26, 0x51, 0xb0, 0x3a, 0x0b, 0xf4, 0x42, 0xf2, 0xe1, 0x21, 0x80, 0x97, 0x71, 0x79, 0xb9, + 0x86, 0x1e, 0x43, 0xbe, 0xe3, 0x75, 0x49, 0xcc, 0xa4, 0x49, 0x1a, 0x75, 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94, + 0xb6, 0x93, 0x44, 0x79, 0x8e, 0xa7, 0x12, 0x1d, 0x84, 0x36, 0x54, 0x61, 0x23, 0x53, 0xf3, 0xd5, + 0xe9, 0x2d, 0x26, 0xcf, 0x22, 0x21, 0x55, 0x95, 0xcd, 0x61, 0x4a, 0x69, 0x59, 0x14, 0x06, 0xda, + 0x9c, 0xcb, 0xf6, 0x73, 0xd6, 0x97, 0xe8, 0x13, 0xc8, 0x63, 0x12, 0xf7, 0x7d, 0x26, 0xde, 0x5f, + 0x4a, 0xf5, 0x6b, 0x33, 0xa4, 0x4b, 0x26, 0x11, 0xab, 0x0a, 0x80, 0x7e, 0x01, 0x8b, 0x72, 0x14, + 0x9b, 0xa5, 0x59, 0xcf, 0x06, 0x29, 0x9a, 0x29, 0x8c, 0x6a, 0x28, 0x14, 0xc5, 0xc3, 0xf1, 0x33, + 0x12, 0x10, 0xf5, 0xe6, 0xc8, 0x5b, 0xe3, 0x05, 0xac, 0xcd, 0xa0, 0x3a, 0x2c, 0x30, 0xea, 0xb6, + 0x89, 0x59, 0x99, 0xc3, 0x84, 0x92, 0x95, 0x27, 0xb6, 0xc8, 0x0b, 0x02, 0xd2, 0x31, 0x97, 0x64, + 0xa5, 0x24, 0x29, 0xf4, 0x7d, 0x58, 0x0a, 0xfa, 0x3d, 0xd1, 0x2c, 0x74, 0xf6, 0x18, 0x89, 0x62, + 0xf3, 0xa2, 0xf8, 0xde, 0xc4, 0x2c, 0xba, 0x0e, 0x95, 0xa0, 0xdf, 0xdb, 0xe7, 0x37, 0xbc, 0x64, + 0xab, 0x0a, 0xb6, 0xf1, 0x49, 0x74, 0x0b, 0x96, 0x39, 0x2e, 0x39, 0x6d, 0xc9, 0xb9, 0x2c, 0x38, + 0xa7, 0x17, 0x50, 0x03, 0x2a, 0xe4, 0x44, 0x3e, 0x08, 0xb4, 0x84, 0xff, 0xa2, 0x39, 0xf6, 0x33, + 0x0e, 0x41, 0x6b, 0x50, 0x0a, 0xfa, 0xbd, 0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1, 0x3a, 0x63, 0x7d, 0xdd, 0xd8, 0x30, 0xd0, 0x97, 0x50, 0xd2, 0x3a, 0x01, 0x94, 0x52, 0x87, + 0x4e, 0xb7, 0x15, 0xd6, 0x8d, 0x33, 0xb8, 0xd4, 0xce, 0x5b, 0x90, 0x13, 0x09, 0x20, 0xc5, 0xd8, + 0x5a, 0xa3, 0x90, 0xa6, 0xe6, 0x58, 0xe3, 0x70, 0x20, 0x5b, 0x1b, 0x12, 0xe8, 0xde, 0x87, 0x6e, + 0x9c, 0x55, 0x91, 0xcc, 0x74, 0x9b, 0x29, 0x27, 0xde, 0x30, 0x50, 0x08, 0x68, 0x3a, 0xe9, 0xa3, + 0x1f, 0xa6, 0x78, 0xc9, 0xac, 0x5b, 0xc9, 0xba, 0x35, 0x1f, 0xb3, 0xdc, 0x54, 0xa3, 0xfc, 0xea, + 0xcd, 0x8a, 0xf1, 0xaf, 0x37, 0x2b, 0xc6, 0xbf, 0xdf, 0xac, 0x18, 0x07, 0x79, 0x51, 0x6b, 0xfe, + 0xe8, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0xba, 0xc2, 0x97, 0xab, 0x17, 0x1f, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2707,18 +2707,18 @@ func (m *PruneRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } - if m.Free != 0 { - i = encodeVarintControl(dAtA, i, uint64(m.Free)) + if m.MinFreeSpace != 0 { + i = encodeVarintControl(dAtA, i, uint64(m.MinFreeSpace)) i-- dAtA[i] = 0x30 } - if m.MinStorage != 0 { - i = encodeVarintControl(dAtA, i, uint64(m.MinStorage)) + if m.MaxUsedSpace != 0 { + i = encodeVarintControl(dAtA, i, uint64(m.MaxUsedSpace)) i-- dAtA[i] = 0x28 } - if m.MaxStorage != 0 { - i = encodeVarintControl(dAtA, i, uint64(m.MaxStorage)) + if m.ReservedSpace != 0 { + i = encodeVarintControl(dAtA, i, uint64(m.ReservedSpace)) i-- dAtA[i] = 0x20 } @@ -4599,14 +4599,14 @@ func (m *PruneRequest) Size() (n int) { if m.KeepDuration != 0 { n += 1 + sovControl(uint64(m.KeepDuration)) } - if m.MaxStorage != 0 { - n += 1 + sovControl(uint64(m.MaxStorage)) + if m.ReservedSpace != 0 { + n += 1 + sovControl(uint64(m.ReservedSpace)) } - if m.MinStorage != 0 { - n += 1 + sovControl(uint64(m.MinStorage)) + if m.MaxUsedSpace != 0 { + n += 1 + sovControl(uint64(m.MaxUsedSpace)) } - if m.Free != 0 { - n += 1 + sovControl(uint64(m.Free)) + if m.MinFreeSpace != 0 { + n += 1 + sovControl(uint64(m.MinFreeSpace)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) @@ -5535,9 +5535,9 @@ func (m *PruneRequest) Unmarshal(dAtA []byte) error { } case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxStorage", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ReservedSpace", wireType) } - m.MaxStorage = 0 + m.ReservedSpace = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowControl @@ -5547,16 +5547,16 @@ func (m *PruneRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MaxStorage |= int64(b&0x7F) << shift + m.ReservedSpace |= int64(b&0x7F) << shift if b < 0x80 { break } } case 5: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinStorage", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MaxUsedSpace", wireType) } - m.MinStorage = 0 + m.MaxUsedSpace = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowControl @@ -5566,16 +5566,16 @@ func (m *PruneRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MinStorage |= int64(b&0x7F) << shift + m.MaxUsedSpace |= int64(b&0x7F) << shift if b < 0x80 { break } } case 6: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Free", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MinFreeSpace", wireType) } - m.Free = 0 + m.MinFreeSpace = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowControl @@ -5585,7 +5585,7 @@ func (m *PruneRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Free |= int64(b&0x7F) << shift + m.MinFreeSpace |= int64(b&0x7F) << shift if b < 0x80 { break } diff --git a/api/services/control/control.proto b/api/services/control/control.proto index d148b768ed69..a613a78e9e80 100644 --- a/api/services/control/control.proto +++ b/api/services/control/control.proto @@ -32,9 +32,9 @@ message PruneRequest { bool all = 2; int64 keepDuration = 3 [(gogoproto.nullable) = true]; - int64 minStorage = 5 [(gogoproto.nullable) = true]; - int64 maxStorage = 4 [(gogoproto.nullable) = true]; - int64 free = 6 [(gogoproto.nullable) = true]; + int64 reservedSpace = 4 [(gogoproto.nullable) = true]; + int64 maxUsedSpace = 5 [(gogoproto.nullable) = true]; + int64 minFreeSpace = 6 [(gogoproto.nullable) = true]; } message DiskUsageRequest { diff --git a/api/types/worker.pb.go b/api/types/worker.pb.go index 2ad6f16d436f..d1ad5531230a 100644 --- a/api/types/worker.pb.go +++ b/api/types/worker.pb.go @@ -107,10 +107,10 @@ type GCPolicy struct { All bool `protobuf:"varint,1,opt,name=all,proto3" json:"all,omitempty"` KeepDuration int64 `protobuf:"varint,2,opt,name=keepDuration,proto3" json:"keepDuration,omitempty"` Filters []string `protobuf:"bytes,4,rep,name=filters,proto3" json:"filters,omitempty"` - MinStorage int64 `protobuf:"varint,5,opt,name=minStorage,proto3" json:"minStorage,omitempty"` - // maxStorage was renamed from freeBytes - MaxStorage int64 `protobuf:"varint,3,opt,name=maxStorage,proto3" json:"maxStorage,omitempty"` - Free int64 `protobuf:"varint,6,opt,name=free,proto3" json:"free,omitempty"` + // reservedSpace was renamed from freeBytes + ReservedSpace int64 `protobuf:"varint,3,opt,name=reservedSpace,proto3" json:"reservedSpace,omitempty"` + MaxUsedSpace int64 `protobuf:"varint,5,opt,name=maxUsedSpace,proto3" json:"maxUsedSpace,omitempty"` + MinFreeSpace int64 `protobuf:"varint,6,opt,name=minFreeSpace,proto3" json:"minFreeSpace,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -170,23 +170,23 @@ func (m *GCPolicy) GetFilters() []string { return nil } -func (m *GCPolicy) GetMinStorage() int64 { +func (m *GCPolicy) GetReservedSpace() int64 { if m != nil { - return m.MinStorage + return m.ReservedSpace } return 0 } -func (m *GCPolicy) GetMaxStorage() int64 { +func (m *GCPolicy) GetMaxUsedSpace() int64 { if m != nil { - return m.MaxStorage + return m.MaxUsedSpace } return 0 } -func (m *GCPolicy) GetFree() int64 { +func (m *GCPolicy) GetMinFreeSpace() int64 { if m != nil { - return m.Free + return m.MinFreeSpace } return 0 } @@ -264,35 +264,36 @@ func init() { func init() { proto.RegisterFile("worker.proto", fileDescriptor_e4ff6184b07e587a) } var fileDescriptor_e4ff6184b07e587a = []byte{ - // 443 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xc1, 0x8e, 0xd3, 0x30, - 0x14, 0xc4, 0x49, 0xb7, 0xb4, 0x6e, 0x04, 0xc8, 0x42, 0xc8, 0xea, 0xa1, 0x54, 0x15, 0x12, 0x3d, - 0x80, 0xb3, 0x2c, 0x17, 0x40, 0x9c, 0x4a, 0x11, 0xac, 0xc4, 0x61, 0x31, 0x12, 0x9c, 0x9d, 0xae, - 0x5b, 0xa2, 0xb8, 0xb5, 0xe5, 0x38, 0x81, 0xfc, 0x1d, 0xc7, 0x3d, 0xf2, 0x05, 0x08, 0xf5, 0xc0, - 0x77, 0x20, 0xbf, 0x24, 0xdd, 0xec, 0xc2, 0xde, 0x3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xc0, 0xdf, 0xd3, 0xae, 0x28, 0x03, 0x00, 0x00, + // 455 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0x4d, 0x8f, 0xd3, 0x3c, + 0x14, 0x85, 0x5f, 0x27, 0xd3, 0xbe, 0xad, 0x1b, 0x3e, 0x64, 0x21, 0x14, 0x75, 0x51, 0xaa, 0x6e, + 0xa8, 0x10, 0x38, 0xc3, 0xb0, 0x01, 0xc4, 0xaa, 0x94, 0x8f, 0x91, 0x58, 0x0c, 0x46, 0xc0, 0xda, + 0x49, 0x6f, 0x4b, 0x14, 0xb7, 0xb6, 0xec, 0x24, 0x90, 0x7f, 0x38, 0x4b, 0xd6, 0x2c, 0x10, 0xea, + 0x82, 0xdf, 0x81, 0xec, 0x24, 0x33, 0xe9, 0xc0, 0xec, 0x7c, 0x7c, 0x9f, 0x73, 0x7a, 0x7d, 0x1a, + 0x1c, 0x7c, 0x95, 0x3a, 0x03, 0x4d, 0x95, 0x96, 0xb9, 0x24, 0x77, 0xb7, 0x32, 0xae, 0x68, 0x5c, + 0xa4, 0x62, 0x95, 0xa5, 0x39, 0x2d, 0x1f, 0xd3, 0xbc, 0x52, 0x60, 0xc6, 0x8f, 0x36, 0x69, 0xfe, + 0xa5, 0x88, 0x69, 0x22, 0xb7, 0xd1, 0x46, 0x6e, 0x64, 0xe4, 0xf0, 0xb8, 0x58, 0x3b, 0xe5, 0x84, + 0x3b, 0xd5, 0x31, 0xe3, 0x87, 0x1d, 0xdc, 0x26, 0x46, 0x6d, 0x62, 0x64, 0xa4, 0x28, 0x41, 0x47, + 0x2a, 0x8e, 0xa4, 0x32, 0x35, 0x3d, 0xfb, 0xed, 0xe1, 0xe0, 0xb3, 0xdb, 0x82, 0x41, 0x22, 0xf5, + 0x8a, 0xdc, 0xc4, 0xde, 0xe9, 0x32, 0x44, 0x53, 0x34, 0x1f, 0x32, 0xef, 0x74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56, 0x1f, 0x14, 0x4f, 0x20, 0xf4, 0xad, 0xdd, 0x15, 0x8a, 0xd8, 0xe1, 0x88, 0xcc, 0x71, + 0xb0, 0xe5, 0xdf, 0x3e, 0x9a, 0x16, 0xed, 0x75, 0xd0, 0x83, 0x89, 0x23, 0xd3, 0xdd, 0x6b, 0x0d, + 0x50, 0x93, 0xfd, 0x03, 0xb2, 0x33, 0x99, 0xf1, 0xbf, 0xaa, 0xb6, 0xcb, 0x2a, 0x9e, 0x64, 0x7c, + 0x03, 0x4d, 0x3f, 0xad, 0xb4, 0x93, 0xb2, 0xf9, 0x3f, 0xea, 0x96, 0x5a, 0x49, 0xc6, 0x78, 0xa0, + 0xa1, 0x4c, 0xdd, 0xc8, 0x77, 0xa3, 0x0b, 0xbd, 0x08, 0xce, 0xf7, 0x13, 0xf4, 0x7d, 0x3f, 0x41, + 0xbf, 0xf6, 0x13, 0x14, 0xf7, 0xdd, 0xd7, 0xfb, 0xe4, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x20, + 0x3f, 0x43, 0x00, 0x42, 0x03, 0x00, 0x00, } func (m *WorkerRecord) Marshal() (dAtA []byte, err error) { @@ -412,13 +413,13 @@ func (m *GCPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } - if m.Free != 0 { - i = encodeVarintWorker(dAtA, i, uint64(m.Free)) + if m.MinFreeSpace != 0 { + i = encodeVarintWorker(dAtA, i, uint64(m.MinFreeSpace)) i-- dAtA[i] = 0x30 } - if m.MinStorage != 0 { - i = encodeVarintWorker(dAtA, i, uint64(m.MinStorage)) + if m.MaxUsedSpace != 0 { + i = encodeVarintWorker(dAtA, i, uint64(m.MaxUsedSpace)) i-- dAtA[i] = 0x28 } @@ -431,8 +432,8 @@ func (m *GCPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x22 } } - if m.MaxStorage != 0 { - i = encodeVarintWorker(dAtA, i, uint64(m.MaxStorage)) + if m.ReservedSpace != 0 { + i = encodeVarintWorker(dAtA, i, uint64(m.ReservedSpace)) i-- dAtA[i] = 0x18 } @@ -565,8 +566,8 @@ func (m *GCPolicy) Size() (n int) { if m.KeepDuration != 0 { n += 1 + sovWorker(uint64(m.KeepDuration)) } - if m.MaxStorage != 0 { - n += 1 + sovWorker(uint64(m.MaxStorage)) + if m.ReservedSpace != 0 { + n += 1 + sovWorker(uint64(m.ReservedSpace)) } if len(m.Filters) > 0 { for _, s := range m.Filters { @@ -574,11 +575,11 @@ func (m *GCPolicy) Size() (n int) { n += 1 + l + sovWorker(uint64(l)) } } - if m.MinStorage != 0 { - n += 1 + sovWorker(uint64(m.MinStorage)) + if m.MaxUsedSpace != 0 { + n += 1 + sovWorker(uint64(m.MaxUsedSpace)) } - if m.Free != 0 { - n += 1 + sovWorker(uint64(m.Free)) + if m.MinFreeSpace != 0 { + n += 1 + sovWorker(uint64(m.MinFreeSpace)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) @@ -1000,9 +1001,9 @@ func (m *GCPolicy) Unmarshal(dAtA []byte) error { } case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxStorage", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ReservedSpace", wireType) } - m.MaxStorage = 0 + m.ReservedSpace = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowWorker @@ -1012,7 +1013,7 @@ func (m *GCPolicy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MaxStorage |= int64(b&0x7F) << shift + m.ReservedSpace |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -1051,9 +1052,9 @@ func (m *GCPolicy) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 5: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinStorage", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MaxUsedSpace", wireType) } - m.MinStorage = 0 + m.MaxUsedSpace = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowWorker @@ -1063,16 +1064,16 @@ func (m *GCPolicy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MinStorage |= int64(b&0x7F) << shift + m.MaxUsedSpace |= int64(b&0x7F) << shift if b < 0x80 { break } } case 6: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Free", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MinFreeSpace", wireType) } - m.Free = 0 + m.MinFreeSpace = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowWorker @@ -1082,7 +1083,7 @@ func (m *GCPolicy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Free |= int64(b&0x7F) << shift + m.MinFreeSpace |= int64(b&0x7F) << shift if b < 0x80 { break } diff --git a/api/types/worker.proto b/api/types/worker.proto index d277dde84908..7138ff5ca84f 100644 --- a/api/types/worker.proto +++ b/api/types/worker.proto @@ -22,10 +22,10 @@ message GCPolicy { int64 keepDuration = 2; repeated string filters = 4; - int64 minStorage = 5 [(gogoproto.nullable) = true]; - // maxStorage was renamed from freeBytes - int64 maxStorage = 3 [(gogoproto.nullable) = true]; - int64 free = 6 [(gogoproto.nullable) = true]; + // reservedSpace was renamed from freeBytes + int64 reservedSpace = 3 [(gogoproto.nullable) = true]; + int64 maxUsedSpace = 5 [(gogoproto.nullable) = true]; + int64 minFreeSpace = 6 [(gogoproto.nullable) = true]; } message BuildkitVersion { diff --git a/cache/manager.go b/cache/manager.go index c4e2e84f12fc..c1b3d52ec1d6 100644 --- a/cache/manager.go +++ b/cache/manager.go @@ -1045,7 +1045,7 @@ func (cm *cacheManager) pruneOnce(ctx context.Context, ch chan client.UsageInfo, } totalSize := int64(0) - if opt.MaxStorage != 0 { + if opt.MaxUsedSpace != 0 || opt.ReservedSpace != 0 || opt.MinFreeSpace != 0 { du, err := cm.DiskUsage(ctx, client.DiskUsageInfo{}) if err != nil { return err @@ -1058,14 +1058,12 @@ func (cm *cacheManager) pruneOnce(ctx context.Context, ch chan client.UsageInfo, } } - dstat, err := disk.GetDiskStat(cm.root) - if err != nil { - if opt.Free != 0 { - // if we are pruning based on disk space, failing to get info on it - // is fatal + var dstat disk.DiskStat + if opt.MinFreeSpace != 0 { + dstat, err = disk.GetDiskStat(cm.root) + if err != nil { return err } - bklog.L.Warnf("failed to get disk size: %v", err) } return cm.prune(ctx, ch, pruneOpt{ @@ -1080,15 +1078,15 @@ func (cm *cacheManager) pruneOnce(ctx context.Context, ch chan client.UsageInfo, func calculateKeepBytes(totalSize int64, dstat disk.DiskStat, opt client.PruneInfo) int64 { // 0 values are special, and means we have no keep cap - if opt.MaxStorage == 0 && opt.MinStorage == 0 && opt.Free == 0 { + if opt.MaxUsedSpace == 0 && opt.ReservedSpace == 0 && opt.MinFreeSpace == 0 { return 0 } // try and keep as many bytes as we can - keepBytes := opt.MaxStorage + keepBytes := opt.MaxUsedSpace // if we need to free up space, then decrease to that - if excess := opt.Free - dstat.Free; excess > 0 { + if excess := opt.MinFreeSpace - dstat.Free; excess > 0 { if keepBytes == 0 { keepBytes = totalSize - excess } else { @@ -1096,8 +1094,8 @@ func calculateKeepBytes(totalSize int64, dstat disk.DiskStat, opt client.PruneIn } } - // but make sure we don't take the total below the minimum - keepBytes = max(keepBytes, opt.MinStorage) + // but make sure we don't take the total below the reserved space + keepBytes = max(keepBytes, opt.ReservedSpace) return keepBytes } diff --git a/cache/manager_test.go b/cache/manager_test.go index 1aef32987104..bd7f24faee86 100644 --- a/cache/manager_test.go +++ b/cache/manager_test.go @@ -2480,7 +2480,7 @@ func TestCalculateKeepBytes(t *testing.T) { Free: 9000, }, opt: client.PruneInfo{ - MaxStorage: 2000, // 20% of the disk + MaxUsedSpace: 2000, // 20% of the disk }, result: 2000, }, @@ -2492,7 +2492,7 @@ func TestCalculateKeepBytes(t *testing.T) { Free: 3000, }, opt: client.PruneInfo{ - Free: 5000, // 50% of the disk + MinFreeSpace: 5000, // 50% of the disk }, result: 5000, }, @@ -2504,8 +2504,8 @@ func TestCalculateKeepBytes(t *testing.T) { Free: 3000, }, opt: client.PruneInfo{ - Free: 5000, // 50% of the disk - MinStorage: 6000, // 60% of the disk, + MinFreeSpace: 5000, // 50% of the disk + ReservedSpace: 6000, // 60% of the disk, }, result: 6000, }, @@ -2517,9 +2517,9 @@ func TestCalculateKeepBytes(t *testing.T) { Free: 3000, }, opt: client.PruneInfo{ - Free: 5000, // 50% of the disk - MinStorage: 2000, // 20% of the disk - MaxStorage: 4000, // 40% of the disk + MinFreeSpace: 5000, // 50% of the disk + ReservedSpace: 2000, // 20% of the disk + MaxUsedSpace: 4000, // 40% of the disk }, result: 4000, }, @@ -2531,7 +2531,7 @@ func TestCalculateKeepBytes(t *testing.T) { Free: 2000, // something else is using 4000 }, opt: client.PruneInfo{ - MaxStorage: 2000, // 20% of the disk + MaxUsedSpace: 2000, // 20% of the disk }, result: 2000, }, @@ -2543,7 +2543,7 @@ func TestCalculateKeepBytes(t *testing.T) { Free: 2000, // something else is using 4000 }, opt: client.PruneInfo{ - Free: 5000, // 50% of the disk + MinFreeSpace: 5000, // 50% of the disk }, result: 1000, }, @@ -2555,8 +2555,8 @@ func TestCalculateKeepBytes(t *testing.T) { Free: 2000, // something else is using 4000 }, opt: client.PruneInfo{ - Free: 5000, // 50% of the disk - MinStorage: 2000, // 20% of the disk + MinFreeSpace: 5000, // 50% of the disk + ReservedSpace: 2000, // 20% of the disk }, result: 2000, }, @@ -2568,9 +2568,9 @@ func TestCalculateKeepBytes(t *testing.T) { Free: 2000, // something else is using 4000 }, opt: client.PruneInfo{ - Free: 5000, // 50% of the disk - MinStorage: 2000, // 20% of the disk - MaxStorage: 4000, // 40% of the disk + MinFreeSpace: 5000, // 50% of the disk + ReservedSpace: 2000, // 20% of the disk + MaxUsedSpace: 4000, // 40% of the disk }, result: 2000, }, diff --git a/client/prune.go b/client/prune.go index eb547c72c397..8f5b1923695b 100644 --- a/client/prune.go +++ b/client/prune.go @@ -16,11 +16,11 @@ func (c *Client) Prune(ctx context.Context, ch chan UsageInfo, opts ...PruneOpti } req := &controlapi.PruneRequest{ - Filter: info.Filter, - KeepDuration: int64(info.KeepDuration), - MinStorage: int64(info.MinStorage), - MaxStorage: int64(info.MaxStorage), - Free: int64(info.Free), + Filter: info.Filter, + KeepDuration: int64(info.KeepDuration), + ReservedSpace: int64(info.ReservedSpace), + MaxUsedSpace: int64(info.MaxUsedSpace), + MinFreeSpace: int64(info.MinFreeSpace), } if info.All { req.All = true @@ -65,9 +65,9 @@ type PruneInfo struct { Filter []string `json:"filter"` KeepDuration time.Duration `json:"keepDuration"` - MinStorage int64 `json:"minStorage"` - MaxStorage int64 `json:"maxStorage"` - Free int64 `json:"free"` + ReservedSpace int64 `json:"reservedSpace"` + MaxUsedSpace int64 `json:"maxUsedSpace"` + MinFreeSpace int64 `json:"minFreeSpace"` } type pruneOptionFunc func(*PruneInfo) @@ -80,11 +80,11 @@ var PruneAll = pruneOptionFunc(func(pi *PruneInfo) { pi.All = true }) -func WithKeepOpt(duration time.Duration, minStorage int64, maxStorage int64, free int64) PruneOption { +func WithKeepOpt(duration time.Duration, reserved int64, max int64, free int64) PruneOption { return pruneOptionFunc(func(pi *PruneInfo) { pi.KeepDuration = duration - pi.MinStorage = minStorage - pi.MaxStorage = maxStorage - pi.Free = free + pi.ReservedSpace = reserved + pi.MaxUsedSpace = max + pi.MinFreeSpace = free }) } diff --git a/client/workers.go b/client/workers.go index 13d68925704b..10b0cbf85992 100644 --- a/client/workers.go +++ b/client/workers.go @@ -62,12 +62,12 @@ func fromAPIGCPolicy(in []*apitypes.GCPolicy) []PruneInfo { out := make([]PruneInfo, 0, len(in)) for _, p := range in { out = append(out, PruneInfo{ - All: p.All, - Filter: p.Filters, - KeepDuration: time.Duration(p.KeepDuration), - MinStorage: p.MinStorage, - MaxStorage: p.MaxStorage, - Free: p.Free, + All: p.All, + Filter: p.Filters, + KeepDuration: time.Duration(p.KeepDuration), + ReservedSpace: p.ReservedSpace, + MaxUsedSpace: p.MaxUsedSpace, + MinFreeSpace: p.MinFreeSpace, }) } return out diff --git a/cmd/buildctl/debug/workers.go b/cmd/buildctl/debug/workers.go index 6e88f4522b35..42703e971f9d 100644 --- a/cmd/buildctl/debug/workers.go +++ b/cmd/buildctl/debug/workers.go @@ -89,16 +89,16 @@ func printWorkersVerbose(tw *tabwriter.Writer, winfo []*client.WorkerInfo) { fmt.Fprintf(tw, "\tFilters:\t%s\n", strings.Join(rule.Filter, " ")) } if rule.KeepDuration > 0 { - fmt.Fprintf(tw, "\tKeep Duration:\t%v\n", rule.KeepDuration.String()) + fmt.Fprintf(tw, "\tKeep duration:\t%v\n", rule.KeepDuration.String()) } - if rule.MaxStorage > 0 { - fmt.Fprintf(tw, "\tKeep Bytes:\t%g\n", units.Bytes(rule.MaxStorage)) + if rule.ReservedSpace > 0 { + fmt.Fprintf(tw, "\tReserved space:\t%g\n", units.Bytes(rule.ReservedSpace)) } - if rule.MinStorage > 0 { - fmt.Fprintf(tw, "\tKeep Bytes (min):\t%g\n", units.Bytes(rule.MinStorage)) + if rule.MinFreeSpace > 0 { + fmt.Fprintf(tw, "\tMinimum free space:\t%g\n", units.Bytes(rule.MinFreeSpace)) } - if rule.Free > 0 { - fmt.Fprintf(tw, "\tFree Bytes:\t%g\n", units.Bytes(rule.MinStorage)) + if rule.MaxUsedSpace > 0 { + fmt.Fprintf(tw, "\tMaximum used space:\t%g\n", units.Bytes(rule.MaxUsedSpace)) } } fmt.Fprintf(tw, "\n") diff --git a/cmd/buildkitd/config/config.go b/cmd/buildkitd/config/config.go index 76bc9a4207c0..480f0450a443 100644 --- a/cmd/buildkitd/config/config.go +++ b/cmd/buildkitd/config/config.go @@ -75,9 +75,13 @@ type OTELConfig struct { } type GCConfig struct { - GC *bool `toml:"gc"` - GCKeepStorage DiskSpace `toml:"gckeepstorage"` - GCPolicy []GCPolicy `toml:"gcpolicy"` + GC *bool `toml:"gc"` + // Deprecated: use GCReservedSpace instead + GCKeepStorage DiskSpace `toml:"gckeepstorage"` + GCReservedSpace DiskSpace `toml:"reservedSpace"` + GCMaxUsedSpace DiskSpace `toml:"maxUsedSpace"` + GCMinFreeSpace DiskSpace `toml:"minFreeSpace"` + GCPolicy []GCPolicy `toml:"gcpolicy"` } type NetworkConfig struct { @@ -163,20 +167,20 @@ type GCPolicy struct { // to consume. Any storage above this mark can be cleared during a gc // sweep. // - // Deprecated: use MaxStorage instead + // Deprecated: use ReservedSpace instead KeepBytes DiskSpace `toml:"keepBytes"` - // MinStorage is the minimum amount of storage this policy is always - // allowed to consume. Any amount of storage below this mark will not be - // cleared by this policy. - MinStorage DiskSpace `toml:"minStorage"` - // MaxStorage is the maximum amount of storage this policy is ever allowed - // to consume. Any storage above this mark can be cleared during a gc - // sweep. - MaxStorage DiskSpace `toml:"maxStorage"` - // Free is the amount of storage the gc will attempt to leave free on the - // disk. However, it will never attempt to bring it below MinStorage. - Free DiskSpace `toml:"free"` + // ReservedSpace is the minimum amount of disk space this policy is guaranteed to retain. + // Any usage below this threshold will not be reclaimed during garbage collection. + ReservedSpace DiskSpace `toml:"reservedSpace"` + + // MaxUsedSpace is the maximum amount of disk space this policy is allowed to use. + // Any usage exceeding this limit will be cleaned up during a garbage collection sweep. + MaxUsedSpace DiskSpace `toml:"maxUsedSpace"` + + // MinFreeSpace is the target amount of free disk space the garbage collector will attempt to leave. + // However, it will never let the available space fall below ReservedSpace. + MinFreeSpace DiskSpace `toml:"minFreeSpace"` } type DNSConfig struct { diff --git a/cmd/buildkitd/config/gcpolicy.go b/cmd/buildkitd/config/gcpolicy.go index b9c34c7b0ca4..021d8b5d5e43 100644 --- a/cmd/buildkitd/config/gcpolicy.go +++ b/cmd/buildkitd/config/gcpolicy.go @@ -7,7 +7,6 @@ import ( "time" "github.com/docker/go-units" - "github.com/moby/buildkit/util/bklog" "github.com/moby/buildkit/util/disk" "github.com/pkg/errors" ) @@ -69,30 +68,39 @@ func (d *DiskSpace) UnmarshalText(textb []byte) error { const defaultCap int64 = 2e9 // 2GB -func DefaultGCPolicy(keep DiskSpace) []GCPolicy { - if keep == (DiskSpace{}) { - keep = DetectDefaultGCCap() +func DefaultGCPolicy(cfg GCConfig, dstat disk.DiskStat) []GCPolicy { + if cfg.IsUnset() { + cfg.GCReservedSpace = cfg.GCKeepStorage + } + if cfg.IsUnset() { + cfg = DetectDefaultGCCap(dstat) } return []GCPolicy{ // if build cache uses more than 512MB delete the most easily reproducible data after it has not been used for 2 days { Filters: []string{"type==source.local,type==exec.cachemount,type==source.git.checkout"}, KeepDuration: Duration{Duration: time.Duration(48) * time.Hour}, // 48h - MaxStorage: DiskSpace{Bytes: 512 * 1e6}, // 512MB + MaxUsedSpace: DiskSpace{Bytes: 512 * 1e6}, // 512MB }, // remove any data not used for 60 days { - KeepDuration: Duration{Duration: time.Duration(60) * 24 * time.Hour}, // 60d - MaxStorage: keep, + KeepDuration: Duration{Duration: time.Duration(60) * 24 * time.Hour}, // 60d + MinFreeSpace: cfg.GCMinFreeSpace, + ReservedSpace: cfg.GCReservedSpace, + MaxUsedSpace: cfg.GCMaxUsedSpace, }, // keep the unshared build cache under cap { - MaxStorage: keep, + MinFreeSpace: cfg.GCMinFreeSpace, + ReservedSpace: cfg.GCReservedSpace, + MaxUsedSpace: cfg.GCMaxUsedSpace, }, // if previous policies were insufficient start deleting internal data to keep build cache under cap { - All: true, - MaxStorage: keep, + All: true, + MinFreeSpace: cfg.GCMinFreeSpace, + ReservedSpace: cfg.GCReservedSpace, + MaxUsedSpace: cfg.GCMaxUsedSpace, }, } } @@ -107,11 +115,23 @@ func stripQuotes(s string) string { return s } -func DetectDefaultGCCap() DiskSpace { - return DiskSpace{Percentage: DiskSpacePercentage} +func DetectDefaultGCCap(dstat disk.DiskStat) GCConfig { + reserve := DiskSpace{Percentage: DiskSpaceReservePercentage} + if reserve.AsBytes(dstat) > DiskSpaceReserveBytes { + reserve = DiskSpace{Bytes: DiskSpaceReserveBytes} + } + max := DiskSpace{Percentage: DiskSpaceMaxPercentage} + if max.AsBytes(dstat) > DiskSpaceMaxBytes { + max = DiskSpace{Bytes: DiskSpaceMaxBytes} + } + return GCConfig{ + GCReservedSpace: reserve, + GCMinFreeSpace: DiskSpace{Percentage: DiskSpaceFreePercentage}, + GCMaxUsedSpace: max, + } } -func (d DiskSpace) AsBytes(root string) int64 { +func (d DiskSpace) AsBytes(dstat disk.DiskStat) int64 { if d.Bytes != 0 { return d.Bytes } @@ -119,12 +139,15 @@ func (d DiskSpace) AsBytes(root string) int64 { return 0 } - dstat, err := disk.GetDiskStat(root) - if err != nil { - bklog.L.Warnf("failed to get disk size: %v", err) + if dstat.Total == 0 { return defaultCap } + avail := dstat.Total * d.Percentage / 100 rounded := (avail/(1<<30) + 1) * 1e9 // round up return rounded } + +func (cfg *GCConfig) IsUnset() bool { + return cfg.GCReservedSpace == DiskSpace{} && cfg.GCMaxUsedSpace == DiskSpace{} && cfg.GCMinFreeSpace == DiskSpace{} +} diff --git a/cmd/buildkitd/config/gcpolicy_unix.go b/cmd/buildkitd/config/gcpolicy_unix.go index f033e65be927..ce86993cdb95 100644 --- a/cmd/buildkitd/config/gcpolicy_unix.go +++ b/cmd/buildkitd/config/gcpolicy_unix.go @@ -3,4 +3,10 @@ package config -var DiskSpacePercentage int64 = 10 +const ( + DiskSpaceReservePercentage int64 = 10 + DiskSpaceReserveBytes int64 = 10 * 1e9 // 10GB + DiskSpaceFreePercentage int64 = 20 + DiskSpaceMaxPercentage int64 = 80 + DiskSpaceMaxBytes int64 = 100 * 1e9 // 100GB +) diff --git a/cmd/buildkitd/config/gcpolicy_windows.go b/cmd/buildkitd/config/gcpolicy_windows.go index ec5900e48522..429307a4c8f9 100644 --- a/cmd/buildkitd/config/gcpolicy_windows.go +++ b/cmd/buildkitd/config/gcpolicy_windows.go @@ -3,6 +3,12 @@ package config -// set as double that for Linux since -// Windows images are generally larger. -var DiskSpacePercentage int64 = 20 +const ( + // Windows images are generally larger. + // set as double that for Linux since + DiskSpaceReservePercentage int64 = 20 + DiskSpaceReserveBytes int64 = 10 * 1e9 // 10GB + DiskSpaceFreePercentage int64 = 20 + DiskSpaceMaxPercentage int64 = 80 + DiskSpaceMaxBytes int64 = 100 * 1e9 // 100GB +) diff --git a/cmd/buildkitd/config/load_test.go b/cmd/buildkitd/config/load_test.go index 5ae1ea10c4fd..b576351f287d 100644 --- a/cmd/buildkitd/config/load_test.go +++ b/cmd/buildkitd/config/load_test.go @@ -49,18 +49,18 @@ options.foo="bar" [[worker.containerd.gcpolicy]] all=true filters=["foo==bar"] -keepBytes=20 +reservedSpace=20 keepDuration=3600 [[worker.containerd.gcpolicy]] -keepBytes="40MB" +reservedSpace="40MB" keepDuration=7200 [[worker.containerd.gcpolicy]] -keepBytes="20%" +reservedSpace="20%" keepDuration="24h" [[worker.containerd.gcpolicy]] -minStorage="10GB" -maxStorage="80%" -free="10%" +reservedSpace="10GB" +maxUsedSpace="80%" +minFreeSpace="10%" [registry."docker.io"] mirrors=["hub.docker.io"] @@ -119,22 +119,22 @@ searchDomains=["example.com"] require.Nil(t, cfg.Workers.Containerd.GC) require.Equal(t, true, cfg.Workers.Containerd.GCPolicy[0].All) require.Equal(t, 1, len(cfg.Workers.Containerd.GCPolicy[0].Filters)) - require.Equal(t, int64(20), cfg.Workers.Containerd.GCPolicy[0].KeepBytes.Bytes) + require.Equal(t, int64(20), cfg.Workers.Containerd.GCPolicy[0].ReservedSpace.Bytes) require.Equal(t, time.Duration(3600), cfg.Workers.Containerd.GCPolicy[0].KeepDuration.Duration/time.Second) require.Equal(t, false, cfg.Workers.Containerd.GCPolicy[1].All) - require.Equal(t, int64(40*1024*1024), cfg.Workers.Containerd.GCPolicy[1].KeepBytes.Bytes) + require.Equal(t, int64(40*1024*1024), cfg.Workers.Containerd.GCPolicy[1].ReservedSpace.Bytes) require.Equal(t, time.Duration(7200), cfg.Workers.Containerd.GCPolicy[1].KeepDuration.Duration/time.Second) require.Equal(t, 0, len(cfg.Workers.Containerd.GCPolicy[1].Filters)) require.Equal(t, false, cfg.Workers.Containerd.GCPolicy[2].All) - require.Equal(t, int64(20), cfg.Workers.Containerd.GCPolicy[2].KeepBytes.Percentage) + require.Equal(t, int64(20), cfg.Workers.Containerd.GCPolicy[2].ReservedSpace.Percentage) require.Equal(t, time.Duration(86400), cfg.Workers.Containerd.GCPolicy[2].KeepDuration.Duration/time.Second) require.Equal(t, false, cfg.Workers.Containerd.GCPolicy[3].All) - require.Equal(t, int64(10*1024*1024*1024), cfg.Workers.Containerd.GCPolicy[3].MinStorage.Bytes) - require.Equal(t, int64(80), cfg.Workers.Containerd.GCPolicy[3].MaxStorage.Percentage) - require.Equal(t, int64(10), cfg.Workers.Containerd.GCPolicy[3].Free.Percentage) + require.Equal(t, int64(10*1024*1024*1024), cfg.Workers.Containerd.GCPolicy[3].ReservedSpace.Bytes) + require.Equal(t, int64(80), cfg.Workers.Containerd.GCPolicy[3].MaxUsedSpace.Percentage) + require.Equal(t, int64(10), cfg.Workers.Containerd.GCPolicy[3].MinFreeSpace.Percentage) require.Equal(t, true, *cfg.Registries["docker.io"].PlainHTTP) require.Equal(t, true, *cfg.Registries["docker.io"].Insecure) diff --git a/cmd/buildkitd/main.go b/cmd/buildkitd/main.go index 7c90021f98d3..3caad7f7841b 100644 --- a/cmd/buildkitd/main.go +++ b/cmd/buildkitd/main.go @@ -47,6 +47,7 @@ import ( "github.com/moby/buildkit/util/archutil" "github.com/moby/buildkit/util/bklog" "github.com/moby/buildkit/util/db/boltutil" + "github.com/moby/buildkit/util/disk" "github.com/moby/buildkit/util/grpcerrors" "github.com/moby/buildkit/util/profiler" "github.com/moby/buildkit/util/resolver" @@ -920,22 +921,23 @@ func getGCPolicy(cfg config.GCConfig, root string) []client.PruneInfo { if cfg.GC != nil && !*cfg.GC { return nil } + dstat, _ := disk.GetDiskStat(root) if len(cfg.GCPolicy) == 0 { - cfg.GCPolicy = config.DefaultGCPolicy(cfg.GCKeepStorage) + cfg.GCPolicy = config.DefaultGCPolicy(cfg, dstat) } out := make([]client.PruneInfo, 0, len(cfg.GCPolicy)) for _, rule := range cfg.GCPolicy { //nolint:staticcheck - if rule.KeepBytes != (config.DiskSpace{}) { - rule.MaxStorage = rule.KeepBytes + if rule.ReservedSpace == (config.DiskSpace{}) && rule.KeepBytes != (config.DiskSpace{}) { + rule.ReservedSpace = rule.KeepBytes } out = append(out, client.PruneInfo{ - Filter: rule.Filters, - All: rule.All, - KeepDuration: rule.KeepDuration.Duration, - MinStorage: rule.MinStorage.AsBytes(root), - MaxStorage: rule.MaxStorage.AsBytes(root), - Free: rule.Free.AsBytes(root), + Filter: rule.Filters, + All: rule.All, + KeepDuration: rule.KeepDuration.Duration, + ReservedSpace: rule.ReservedSpace.AsBytes(dstat), + MaxUsedSpace: rule.MaxUsedSpace.AsBytes(dstat), + MinFreeSpace: rule.MinFreeSpace.AsBytes(dstat), }) } return out diff --git a/cmd/buildkitd/main_containerd_worker.go b/cmd/buildkitd/main_containerd_worker.go index be9e0a575c39..3b39083e555c 100644 --- a/cmd/buildkitd/main_containerd_worker.go +++ b/cmd/buildkitd/main_containerd_worker.go @@ -13,6 +13,7 @@ import ( "github.com/containerd/containerd/defaults" "github.com/moby/buildkit/cmd/buildkitd/config" "github.com/moby/buildkit/util/bklog" + "github.com/moby/buildkit/util/disk" "github.com/moby/buildkit/util/network/cniprovider" "github.com/moby/buildkit/util/network/netproviders" "github.com/moby/buildkit/worker" @@ -149,15 +150,13 @@ func init() { Usage: "Enable automatic garbage collection on worker", }) } - flags = append(flags, cli.Int64Flag{ + flags = append(flags, cli.StringFlag{ Name: "containerd-worker-gc-keepstorage", - Usage: "Amount of storage GC keep locally (MB)", - Value: func() int64 { - keep := defaultConf.Workers.Containerd.GCKeepStorage.AsBytes(defaultConf.Root) - if keep == 0 { - keep = config.DetectDefaultGCCap().AsBytes(defaultConf.Root) - } - return keep / 1e6 + Usage: "Amount of storage GC keep locally, format \"Reserved[,Free[,Maximum]]\" (MB)", + Value: func() string { + cfg := defaultConf.Workers.Containerd.GCConfig + dstat, _ := disk.GetDiskStat(defaultConf.Root) + return gcConfigToString(cfg, dstat) }(), Hidden: len(defaultConf.Workers.Containerd.GCPolicy) != 0, }) @@ -229,7 +228,13 @@ func applyContainerdFlags(c *cli.Context, cfg *config.Config) error { } if c.GlobalIsSet("containerd-worker-gc-keepstorage") { - cfg.Workers.Containerd.GCKeepStorage = config.DiskSpace{Bytes: c.GlobalInt64("containerd-worker-gc-keepstorage") * 1e6} + gc, err := stringToGCConfig(c.GlobalString("containerd-worker-gc-keepstorage")) + if err != nil { + return err + } + cfg.Workers.Containerd.GCReservedSpace = gc.GCReservedSpace + cfg.Workers.Containerd.GCMinFreeSpace = gc.GCMinFreeSpace + cfg.Workers.Containerd.GCMaxUsedSpace = gc.GCMaxUsedSpace } if c.GlobalIsSet("containerd-worker-net") { diff --git a/cmd/buildkitd/main_oci_worker.go b/cmd/buildkitd/main_oci_worker.go index ea513b7cbc3d..26f84b6bb4e0 100644 --- a/cmd/buildkitd/main_oci_worker.go +++ b/cmd/buildkitd/main_oci_worker.go @@ -33,6 +33,7 @@ import ( "github.com/moby/buildkit/executor/oci" "github.com/moby/buildkit/session" "github.com/moby/buildkit/util/bklog" + "github.com/moby/buildkit/util/disk" "github.com/moby/buildkit/util/network/cniprovider" "github.com/moby/buildkit/util/network/netproviders" "github.com/moby/buildkit/util/resolver" @@ -149,15 +150,13 @@ func init() { Usage: "Enable automatic garbage collection on worker", }) } - flags = append(flags, cli.Int64Flag{ + flags = append(flags, cli.StringFlag{ Name: "oci-worker-gc-keepstorage", - Usage: "Amount of storage GC keep locally (MB)", - Value: func() int64 { - keep := defaultConf.Workers.OCI.GCKeepStorage.AsBytes(defaultConf.Root) - if keep == 0 { - keep = config.DetectDefaultGCCap().AsBytes(defaultConf.Root) - } - return keep / 1e6 + Usage: "Amount of storage GC keep locally, format \"Reserved[,Free[,Maximum]]\" (MB)", + Value: func() string { + cfg := defaultConf.Workers.OCI.GCConfig + dstat, _ := disk.GetDiskStat(defaultConf.Root) + return gcConfigToString(cfg, dstat) }(), Hidden: len(defaultConf.Workers.OCI.GCPolicy) != 0, }) @@ -222,7 +221,13 @@ func applyOCIFlags(c *cli.Context, cfg *config.Config) error { } if c.GlobalIsSet("oci-worker-gc-keepstorage") { - cfg.Workers.OCI.GCKeepStorage = config.DiskSpace{Bytes: c.GlobalInt64("oci-worker-gc-keepstorage") * 1e6} + gc, err := stringToGCConfig(c.GlobalString("oci-worker-gc-keepstorage")) + if err != nil { + return err + } + cfg.Workers.OCI.GCReservedSpace = gc.GCReservedSpace + cfg.Workers.OCI.GCMaxUsedSpace = gc.GCMaxUsedSpace + cfg.Workers.OCI.GCMinFreeSpace = gc.GCMinFreeSpace } if c.GlobalIsSet("oci-worker-net") { diff --git a/cmd/buildkitd/util.go b/cmd/buildkitd/util.go new file mode 100644 index 000000000000..f079f737bb1c --- /dev/null +++ b/cmd/buildkitd/util.go @@ -0,0 +1,68 @@ +package main + +import ( + "strconv" + "strings" + + "github.com/moby/buildkit/cmd/buildkitd/config" + "github.com/moby/buildkit/util/disk" + "github.com/pkg/errors" +) + +func gcConfigToString(cfg config.GCConfig, dstat disk.DiskStat) string { + if cfg.IsUnset() { + //nolint:staticcheck // used for backward compatibility + cfg.GCReservedSpace = cfg.GCKeepStorage + } + if cfg.IsUnset() { + cfg = config.DetectDefaultGCCap(dstat) + } + out := []int64{cfg.GCReservedSpace.AsBytes(disk.DiskStat{}) / 1e6} + free := cfg.GCMinFreeSpace.AsBytes(dstat) / 1e6 + max := cfg.GCMaxUsedSpace.AsBytes(dstat) / 1e6 + if free != 0 || max != 0 { + out = append(out, free) + if max != 0 { + out = append(out, max) + } + } + return strings.Join(int64ToString(out), ",") +} + +func int64ToString(in []int64) []string { + out := make([]string, len(in)) + for i, v := range in { + out[i] = strconv.FormatInt(v, 10) + } + return out +} + +func stringToGCConfig(in string) (config.GCConfig, error) { + var cfg config.GCConfig + if in == "" { + return cfg, nil + } + parts := strings.SplitN(in, ",", 3) + reserved, err := strconv.ParseInt(parts[0], 10, 64) + if err != nil { + return cfg, errors.Wrapf(err, "failed to parse storage %q", in) + } + cfg.GCReservedSpace = config.DiskSpace{Bytes: reserved * 1e6} + if len(parts) == 1 { + return cfg, nil + } + free, err := strconv.ParseInt(parts[1], 10, 64) + if err != nil { + return cfg, errors.Wrapf(err, "failed to parse free storage %q", in) + } + cfg.GCMinFreeSpace = config.DiskSpace{Bytes: free * 1e6} + if len(parts) == 2 { + return cfg, nil + } + max, err := strconv.ParseInt(parts[2], 10, 64) + if err != nil { + return cfg, errors.Wrapf(err, "failed to parse max storage %q", in) + } + cfg.GCMaxUsedSpace = config.DiskSpace{Bytes: max * 1e6} + return cfg, nil +} diff --git a/control/control.go b/control/control.go index 7557b2ea6333..4a3b9a6baed8 100644 --- a/control/control.go +++ b/control/control.go @@ -213,12 +213,12 @@ func (c *Controller) Prune(req *controlapi.PruneRequest, stream controlapi.Contr func(w worker.Worker) { eg.Go(func() error { return w.Prune(ctx, ch, client.PruneInfo{ - Filter: req.Filter, - All: req.All, - KeepDuration: time.Duration(req.KeepDuration), - MinStorage: req.MinStorage, - MaxStorage: req.MaxStorage, - Free: req.Free, + Filter: req.Filter, + All: req.All, + KeepDuration: time.Duration(req.KeepDuration), + ReservedSpace: req.ReservedSpace, + MaxUsedSpace: req.MaxUsedSpace, + MinFreeSpace: req.MinFreeSpace, }) }) }(w) @@ -636,12 +636,12 @@ func toPBGCPolicy(in []client.PruneInfo) []*apitypes.GCPolicy { policy := make([]*apitypes.GCPolicy, 0, len(in)) for _, p := range in { policy = append(policy, &apitypes.GCPolicy{ - All: p.All, - Filters: p.Filter, - KeepDuration: int64(p.KeepDuration), - MinStorage: p.MinStorage, - MaxStorage: p.MaxStorage, - Free: p.Free, + All: p.All, + Filters: p.Filter, + KeepDuration: int64(p.KeepDuration), + ReservedSpace: p.ReservedSpace, + MaxUsedSpace: p.MaxUsedSpace, + MinFreeSpace: p.MinFreeSpace, }) } return policy diff --git a/solver/pb/caps.go b/solver/pb/caps.go index 2ef56039e598..939ea8a6d89c 100644 --- a/solver/pb/caps.go +++ b/solver/pb/caps.go @@ -91,6 +91,9 @@ const ( CapMultipleExporters apicaps.CapID = "exporter.multiple" CapSourcePolicy apicaps.CapID = "source.policy" + + // GC/Prune controls allow MinFreeSpace and MaxUsedSpace to be set + CapGCFreeSpaceFilter apicaps.CapID = "gc.freespacefilter" ) func init() { @@ -488,4 +491,10 @@ func init() { Enabled: true, Status: apicaps.CapStatusExperimental, }) + + Caps.Init(apicaps.Cap{ + ID: CapGCFreeSpaceFilter, + Enabled: true, + Status: apicaps.CapStatusExperimental, + }) }