From 301ea54fb8c86e70d8b5478893ff5d6a0fecca1d Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Tue, 6 Dec 2022 22:05:38 -0800 Subject: [PATCH] history api: deletion and pinning support Signed-off-by: Tonis Tiigi --- api/services/control/control.pb.go | 785 ++++++++++++++++++++----- api/services/control/control.proto | 13 +- client/client_test.go | 23 +- cmd/buildctl/debug.go | 1 + cmd/buildctl/debug/ctl.go | 67 +++ cmd/buildkitd/config/config.go | 7 + cmd/buildkitd/main.go | 1 + control/control.go | 19 + docs/buildkitd.toml.md | 7 + frontend/dockerfile/dockerfile_test.go | 21 +- solver/llbsolver/history.go | 147 ++++- solver/llbsolver/solver.go | 8 +- 12 files changed, 950 insertions(+), 149 deletions(-) create mode 100644 cmd/buildctl/debug/ctl.go diff --git a/api/services/control/control.pb.go b/api/services/control/control.pb.go index f88052864..a024d42a9 100644 --- a/api/services/control/control.pb.go +++ b/api/services/control/control.pb.go @@ -1358,6 +1358,7 @@ func (m *InfoResponse) GetBuildkitVersion() *types.BuildkitVersion { type BuildHistoryRequest struct { ActiveOnly bool `protobuf:"varint,1,opt,name=ActiveOnly,proto3" json:"ActiveOnly,omitempty"` Ref string `protobuf:"bytes,2,opt,name=Ref,proto3" json:"Ref,omitempty"` + EarlyExit bool `protobuf:"varint,3,opt,name=EarlyExit,proto3" json:"EarlyExit,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1410,6 +1411,13 @@ func (m *BuildHistoryRequest) GetRef() string { return "" } +func (m *BuildHistoryRequest) GetEarlyExit() bool { + if m != nil { + return m.EarlyExit + } + return false +} + type BuildHistoryEvent struct { Type BuildHistoryEventType `protobuf:"varint,1,opt,name=type,proto3,enum=moby.buildkit.v1.BuildHistoryEventType" json:"type,omitempty"` Record *BuildHistoryRecord `protobuf:"bytes,2,opt,name=record,proto3" json:"record,omitempty"` @@ -1479,6 +1487,7 @@ type BuildHistoryRecord struct { Results map[string]*BuildResultInfo `protobuf:"bytes,11,rep,name=Results,proto3" json:"Results,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` Generation int32 `protobuf:"varint,12,opt,name=Generation,proto3" json:"Generation,omitempty"` Trace *Descriptor `protobuf:"bytes,13,opt,name=trace,proto3" json:"trace,omitempty"` + Pinned bool `protobuf:"varint,14,opt,name=pinned,proto3" json:"pinned,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1608,6 +1617,115 @@ func (m *BuildHistoryRecord) GetTrace() *Descriptor { return nil } +func (m *BuildHistoryRecord) GetPinned() bool { + if m != nil { + return m.Pinned + } + return false +} + +type UpdateBuildHistoryRequest struct { + Ref string `protobuf:"bytes,1,opt,name=Ref,proto3" json:"Ref,omitempty"` + Pinned bool `protobuf:"varint,2,opt,name=Pinned,proto3" json:"Pinned,omitempty"` + Delete bool `protobuf:"varint,3,opt,name=Delete,proto3" json:"Delete,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UpdateBuildHistoryRequest) Reset() { *m = UpdateBuildHistoryRequest{} } +func (m *UpdateBuildHistoryRequest) String() string { return proto.CompactTextString(m) } +func (*UpdateBuildHistoryRequest) ProtoMessage() {} +func (*UpdateBuildHistoryRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0c5120591600887d, []int{22} +} +func (m *UpdateBuildHistoryRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UpdateBuildHistoryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UpdateBuildHistoryRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UpdateBuildHistoryRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateBuildHistoryRequest.Merge(m, src) +} +func (m *UpdateBuildHistoryRequest) XXX_Size() int { + return m.Size() +} +func (m *UpdateBuildHistoryRequest) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateBuildHistoryRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateBuildHistoryRequest proto.InternalMessageInfo + +func (m *UpdateBuildHistoryRequest) GetRef() string { + if m != nil { + return m.Ref + } + return "" +} + +func (m *UpdateBuildHistoryRequest) GetPinned() bool { + if m != nil { + return m.Pinned + } + return false +} + +func (m *UpdateBuildHistoryRequest) GetDelete() bool { + if m != nil { + return m.Delete + } + return false +} + +type UpdateBuildHistoryResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UpdateBuildHistoryResponse) Reset() { *m = UpdateBuildHistoryResponse{} } +func (m *UpdateBuildHistoryResponse) String() string { return proto.CompactTextString(m) } +func (*UpdateBuildHistoryResponse) ProtoMessage() {} +func (*UpdateBuildHistoryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0c5120591600887d, []int{23} +} +func (m *UpdateBuildHistoryResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UpdateBuildHistoryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UpdateBuildHistoryResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UpdateBuildHistoryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateBuildHistoryResponse.Merge(m, src) +} +func (m *UpdateBuildHistoryResponse) XXX_Size() int { + return m.Size() +} +func (m *UpdateBuildHistoryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateBuildHistoryResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateBuildHistoryResponse proto.InternalMessageInfo + type Descriptor struct { MediaType string `protobuf:"bytes,1,opt,name=media_type,json=mediaType,proto3" json:"media_type,omitempty"` Digest github_com_opencontainers_go_digest.Digest `protobuf:"bytes,2,opt,name=digest,proto3,customtype=github.com/opencontainers/go-digest.Digest" json:"digest"` @@ -1622,7 +1740,7 @@ func (m *Descriptor) Reset() { *m = Descriptor{} } func (m *Descriptor) String() string { return proto.CompactTextString(m) } func (*Descriptor) ProtoMessage() {} func (*Descriptor) Descriptor() ([]byte, []int) { - return fileDescriptor_0c5120591600887d, []int{22} + return fileDescriptor_0c5120591600887d, []int{24} } func (m *Descriptor) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1684,7 +1802,7 @@ func (m *BuildResultInfo) Reset() { *m = BuildResultInfo{} } func (m *BuildResultInfo) String() string { return proto.CompactTextString(m) } func (*BuildResultInfo) ProtoMessage() {} func (*BuildResultInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_0c5120591600887d, []int{23} + return fileDescriptor_0c5120591600887d, []int{25} } func (m *BuildResultInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1739,7 +1857,7 @@ func (m *Exporter) Reset() { *m = Exporter{} } func (m *Exporter) String() string { return proto.CompactTextString(m) } func (*Exporter) ProtoMessage() {} func (*Exporter) Descriptor() ([]byte, []int) { - return fileDescriptor_0c5120591600887d, []int{24} + return fileDescriptor_0c5120591600887d, []int{26} } func (m *Exporter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1815,6 +1933,8 @@ func init() { proto.RegisterMapType((map[string]string)(nil), "moby.buildkit.v1.BuildHistoryRecord.ExporterResponseEntry") proto.RegisterMapType((map[string]string)(nil), "moby.buildkit.v1.BuildHistoryRecord.FrontendAttrsEntry") proto.RegisterMapType((map[string]*BuildResultInfo)(nil), "moby.buildkit.v1.BuildHistoryRecord.ResultsEntry") + proto.RegisterType((*UpdateBuildHistoryRequest)(nil), "moby.buildkit.v1.UpdateBuildHistoryRequest") + proto.RegisterType((*UpdateBuildHistoryResponse)(nil), "moby.buildkit.v1.UpdateBuildHistoryResponse") proto.RegisterType((*Descriptor)(nil), "moby.buildkit.v1.Descriptor") proto.RegisterMapType((map[string]string)(nil), "moby.buildkit.v1.Descriptor.AnnotationsEntry") proto.RegisterType((*BuildResultInfo)(nil), "moby.buildkit.v1.BuildResultInfo") @@ -1825,137 +1945,143 @@ func init() { func init() { proto.RegisterFile("control.proto", fileDescriptor_0c5120591600887d) } var fileDescriptor_0c5120591600887d = []byte{ - // 2072 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x19, 0x4d, 0x6f, 0x1b, 0xc7, - 0x35, 0xcb, 0x6f, 0x3e, 0x52, 0x8a, 0x3c, 0x76, 0x82, 0xc5, 0xb6, 0x91, 0xe4, 0x8d, 0x8d, 0x0a, - 0x46, 0xbc, 0x54, 0xd8, 0xa4, 0x76, 0xe4, 0xd6, 0xb5, 0x28, 0xaa, 0xb6, 0x5c, 0x0b, 0x76, 0x46, - 0x72, 0x0c, 0x04, 0x48, 0x8b, 0x15, 0x39, 0xa2, 0x17, 0x5a, 0xee, 0x6e, 0x67, 0x86, 0x4a, 0x94, - 0x1f, 0x50, 0xa0, 0x97, 0xa2, 0x97, 0xa2, 0x3d, 0xf4, 0xd6, 0x43, 0x4f, 0x3d, 0xf7, 0x17, 0x14, - 0xf0, 0xb1, 0xe7, 0x1c, 0xdc, 0xc2, 0x40, 0xaf, 0x45, 0x8f, 0x3d, 0x16, 0xf3, 0xb1, 0xe4, 0x90, - 0x5c, 0x4a, 0xa4, 0xed, 0x13, 0xe7, 0xcd, 0xbc, 0xf7, 0xf6, 0x7d, 0xce, 0x7b, 0x6f, 0x08, 0x4b, - 0x9d, 0x38, 0xe2, 0x34, 0x0e, 0xbd, 0x84, 0xc6, 0x3c, 0x46, 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x56, 0xf9, 0x2d, 0x9b, 0x2f, 0xfa, 0x09, 0x94, 0xd5, 0x41, - 0x9a, 0x98, 0x1f, 0x9e, 0xff, 0x09, 0xc5, 0x2c, 0xa5, 0x11, 0xe4, 0x4a, 0x0f, 0x66, 0x17, 0x17, - 0x20, 0xd7, 0x34, 0xce, 0x03, 0x70, 0x66, 0x8b, 0xbc, 0x48, 0x08, 0xb8, 0x7f, 0xb1, 0xe0, 0xd2, - 0xd4, 0x87, 0x44, 0xd5, 0x90, 0xf7, 0xa6, 0x62, 0x21, 0xd7, 0xa8, 0x0d, 0x45, 0x95, 0xf9, 0x39, - 0x29, 0xb0, 0x37, 0x87, 0xc0, 0x9e, 0x91, 0xf6, 0x8a, 0xd8, 0xb9, 0x0d, 0xf0, 0x7a, 0xc1, 0xea, - 0xfe, 0xcd, 0x82, 0x25, 0x9d, 0x65, 0xba, 0xc4, 0xfa, 0xb0, 0x92, 0xa6, 0x50, 0xba, 0xa7, 0x8b, - 0xed, 0xa7, 0x33, 0x13, 0x54, 0xa1, 0x79, 0x93, 0x74, 0x4a, 0xc6, 0x29, 0x76, 0xce, 0x4e, 0x1a, - 0x57, 0x13, 0xa8, 0x0b, 0x49, 0x7e, 0x15, 0x96, 0x0e, 0x64, 0x93, 0x33, 0xb3, 0x72, 0xb8, 0xff, - 0xb5, 0x60, 0x39, 0xc5, 0xd1, 0xda, 0x7d, 0x02, 0x95, 0x53, 0x42, 0x39, 0xf9, 0x86, 0x30, 0xad, - 0x95, 0x3d, 0xad, 0xd5, 0x17, 0x12, 0x03, 0x0f, 0x31, 0xd1, 0x16, 0x54, 0x54, 0x43, 0x45, 0x52, - 0x47, 0xad, 0xce, 0xa2, 0xd2, 0xdf, 0x1b, 0xe2, 0xa3, 0x06, 0x14, 0xc2, 0xb8, 0xc7, 0x74, 0xce, - 0x7c, 0x6f, 0x16, 0xdd, 0xa3, 0xb8, 0x87, 0x25, 0x22, 0xba, 0x03, 0x95, 0xaf, 0x7d, 0x1a, 0x05, - 0x51, 0x2f, 0xcd, 0x82, 0xb5, 0x59, 0x44, 0xcf, 0x14, 0x1e, 0x1e, 0x12, 0x88, 0x4e, 0xa7, 0xa4, - 0xce, 0xd0, 0x43, 0x28, 0x75, 0x83, 0x1e, 0x61, 0x5c, 0x99, 0xa4, 0xd5, 0x14, 0x97, 0xfc, 0x77, - 0x2f, 0xd7, 0x6e, 0x18, 0xb7, 0x78, 0x9c, 0x90, 0x48, 0x34, 0xc8, 0x7e, 0x10, 0x11, 0x2a, 0x1a, - 0xc8, 0x9b, 0x8a, 0xc4, 0x6b, 0xcb, 0x1f, 0xac, 0x39, 0x08, 0x5e, 0x81, 0xba, 0xab, 0xe5, 0x7d, - 0xf1, 0x7a, 0xbc, 0x14, 0x07, 0x91, 0x06, 0x91, 0xdf, 0x27, 0xba, 0x36, 0xcb, 0xb5, 0x68, 0x1c, - 0x3a, 0x22, 0xce, 0xbb, 0xb2, 0xa5, 0xaa, 0x60, 0x0d, 0xa1, 0x2d, 0x28, 0x33, 0xee, 0x53, 0x71, - 0xe7, 0x14, 0xe7, 0xec, 0x78, 0x52, 0x02, 0x74, 0x17, 0xaa, 0x9d, 0xb8, 0x9f, 0x84, 0x44, 0x50, - 0x97, 0xe6, 0xa4, 0x1e, 0x91, 0x88, 0xd0, 0x23, 0x94, 0xc6, 0x54, 0xf6, 0x5a, 0x55, 0xac, 0x00, - 0x74, 0x0b, 0x96, 0x12, 0x1a, 0xf7, 0x28, 0x61, 0xec, 0x3e, 0x8d, 0x07, 0x89, 0xae, 0xb0, 0x97, - 0xc4, 0xe5, 0xfd, 0xc4, 0x3c, 0xc0, 0xe3, 0x78, 0xee, 0x7f, 0x72, 0x50, 0x37, 0x43, 0x64, 0xaa, - 0x09, 0x7d, 0x08, 0x25, 0x15, 0x70, 0x2a, 0xd6, 0x5f, 0xcf, 0xc6, 0x8a, 0x43, 0xa6, 0x8d, 0x6d, - 0x28, 0x77, 0x06, 0x54, 0x76, 0xa8, 0xaa, 0x6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c, - 0x3f, 0x93, 0x43, 0x32, 0xbb, 0x68, 0xaa, 0x3c, 0x80, 0xcb, 0x63, 0xd8, 0xba, 0x2c, 0xfc, 0x78, - 0x62, 0xae, 0xbc, 0x36, 0x7d, 0xe3, 0xca, 0x59, 0xdc, 0x53, 0x84, 0x13, 0xe3, 0xe5, 0x12, 0xd4, - 0xa4, 0x5e, 0xea, 0xdb, 0xae, 0x0f, 0x75, 0x05, 0x6a, 0xe6, 0x9f, 0xc3, 0xbb, 0x29, 0xa3, 0x2f, - 0x08, 0x95, 0x33, 0x82, 0x25, 0xed, 0xf2, 0x83, 0x59, 0x5f, 0x69, 0x8d, 0xa3, 0xe3, 0x49, 0x7a, - 0xf7, 0x3e, 0x5c, 0x96, 0x38, 0x0f, 0x02, 0xc6, 0x63, 0x7a, 0x96, 0x6a, 0xbd, 0x0a, 0xb0, 0xdd, - 0xe1, 0xc1, 0x29, 0x79, 0x1c, 0x85, 0xaa, 0x8c, 0x56, 0xb0, 0xb1, 0x93, 0x96, 0xc8, 0xdc, 0xa8, - 0x44, 0xfe, 0xd6, 0x82, 0x4b, 0x26, 0xa7, 0xdd, 0x53, 0x71, 0x21, 0xdc, 0x81, 0x02, 0x4f, 0x3b, - 0x95, 0xe5, 0x2c, 0x31, 0xa7, 0x48, 0x44, 0x33, 0x83, 0x25, 0x91, 0x61, 0x4b, 0x95, 0x1a, 0xd7, - 0xce, 0x27, 0x9f, 0xb0, 0xe5, 0xbf, 0xcb, 0x80, 0xa6, 0x8f, 0x33, 0xc6, 0x42, 0x73, 0xae, 0xca, - 0x4d, 0xcc, 0x55, 0x5f, 0x4d, 0xce, 0x55, 0xaa, 0xf8, 0xde, 0x9a, 0x47, 0x92, 0x39, 0xa6, 0xab, - 0xdb, 0x50, 0x4d, 0xfb, 0x97, 0xb4, 0x44, 0x3b, 0xd3, 0xac, 0x87, 0x2d, 0xce, 0x08, 0x19, 0x6d, - 0xa4, 0x35, 0x45, 0x55, 0x33, 0x94, 0xde, 0x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e, 0x94, 0xf4, 0x04, 0x92, 0x85, 0x6a, 0x8e, 0xd4, 0xce, 0xfa, 0x6c, 0x04, - 0xc5, 0x6c, 0xd3, 0x42, 0xfb, 0xc3, 0x97, 0xcf, 0x2c, 0xd1, 0xcc, 0xf6, 0xcd, 0xb9, 0xe0, 0x7c, - 0xc3, 0xda, 0xb4, 0xd0, 0x97, 0x50, 0x33, 0x1a, 0x34, 0x94, 0xd1, 0x3c, 0x4c, 0x77, 0x7b, 0xce, - 0xf5, 0x0b, 0xb0, 0xb4, 0xe6, 0xbb, 0x50, 0x90, 0x89, 0x94, 0x61, 0x6c, 0xa3, 0x7f, 0xcb, 0x12, - 0x73, 0xac, 0x9f, 0x3b, 0x52, 0x1d, 0x27, 0x89, 0xcc, 0xe8, 0x43, 0xd7, 0x2f, 0x2a, 0x23, 0x33, - 0xc3, 0x66, 0x2a, 0x88, 0x37, 0xad, 0x56, 0xfd, 0xc5, 0xab, 0x55, 0xeb, 0x1f, 0xaf, 0x56, 0xad, - 0x7f, 0xbd, 0x5a, 0xb5, 0x8e, 0x4a, 0xb2, 0x5e, 0xff, 0xf0, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, - 0x28, 0xfc, 0xe7, 0x5b, 0xcd, 0x1a, 0x00, 0x00, + // 2161 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x39, 0x4f, 0x6f, 0x1b, 0xc7, + 0xf5, 0x5e, 0x52, 0xfc, 0xf7, 0x48, 0x29, 0xf2, 0xd8, 0x31, 0xf6, 0xb7, 0x3f, 0x47, 0x92, 0x37, + 0x36, 0x2a, 0xb8, 0xf6, 0x52, 0x61, 0x93, 0xda, 0x91, 0x5b, 0xd7, 0xa2, 0xc8, 0xc6, 0x72, 0x6d, + 0xd8, 0x19, 0xc9, 0x31, 0x10, 0xc0, 0x2d, 0x56, 0xe4, 0x88, 0x5e, 0x68, 0xb9, 0xb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fe, 0xd6, 0x82, 0xf3, 0xe6, 0x77, 0xda, 0x47, 0xa2, 0x5c, 0xdc, 0x81, 0x05, 0x9e, + 0xf6, 0x31, 0x4b, 0x59, 0x4a, 0x4c, 0x91, 0x88, 0x56, 0x07, 0x4b, 0x22, 0xc3, 0xd2, 0x2a, 0x71, + 0xae, 0x9e, 0x4c, 0x3e, 0x61, 0xe9, 0xff, 0x96, 0x00, 0x4d, 0x1f, 0x67, 0x0c, 0x8d, 0xe6, 0xd4, + 0x95, 0x9b, 0x98, 0xba, 0x9e, 0x4f, 0x4e, 0x5d, 0xea, 0x6a, 0xbe, 0x35, 0x8f, 0x24, 0x73, 0xcc, + 0x5e, 0xb7, 0xa1, 0x92, 0x76, 0x37, 0xe9, 0x05, 0xee, 0x4c, 0xb3, 0x1e, 0x36, 0x40, 0x23, 0x64, + 0xb4, 0x9e, 0xde, 0x38, 0xea, 0xae, 0x43, 0x69, 0x4d, 0xa1, 0x49, 0xc7, 0xd3, 0x7d, 0x85, 0xbe, + 0x85, 0xee, 0x9e, 0xed, 0x41, 0x61, 0x61, 0xf2, 0x31, 0xa1, 0x09, 0xd5, 0xed, 0xb4, 0x50, 0x9e, + 0xe1, 0x35, 0xc1, 0x24, 0x42, 0x1b, 0xba, 0xb1, 0x51, 0xa5, 0xf9, 0xf2, 0xb4, 0x8a, 0xe9, 0xcb, + 0x41, 0x4c, 0x75, 0x67, 0x73, 0x90, 0xd1, 0x5a, 0x56, 0xa4, 0x81, 0x36, 0xe7, 0xb2, 0xfd, 0x9c, + 0xfd, 0x25, 0xfa, 0x1c, 0x8a, 0x98, 0xb0, 0x41, 0xc8, 0xe5, 0x13, 0x45, 0xb5, 0x71, 0x65, 0x06, + 0x77, 0x85, 0x24, 0x73, 0x55, 0x13, 0xa0, 0x5f, 0x40, 0x49, 0xad, 0x98, 0x5d, 0x9d, 0x35, 0x8b, + 0x67, 0x48, 0xa6, 0x69, 0xf4, 0x40, 0xa1, 0x21, 0x91, 0x8e, 0x5f, 0x90, 0x88, 0xe8, 0xa7, 0xb3, + 0xda, 0x9a, 0xb5, 0x5e, 0xc0, 0xc6, 0x0e, 0x6a, 0x40, 0x81, 0x53, 0xbf, 0x43, 0xec, 0xc5, 0x39, + 0x4c, 0xa8, 0x50, 0x45, 0x61, 0x4b, 0x82, 0x28, 0x22, 0x5d, 0x7b, 0x49, 0x75, 0x4a, 0x0a, 0x7a, + 0x0f, 0x73, 0xeb, 0xfb, 0xe8, 0xca, 0x9d, 0xe7, 0x50, 0x33, 0x6d, 0x91, 0x41, 0x7b, 0x6b, 0x7c, + 0xea, 0x9d, 0xc3, 0x37, 0x46, 0xd3, 0xff, 0x1c, 0xfe, 0xef, 0x69, 0xd2, 0xf5, 0x39, 0xc9, 0xaa, + 0x7e, 0xd3, 0x55, 0xe0, 0x12, 0x14, 0x9f, 0x28, 0x63, 0xa9, 0x67, 0x3d, 0x0d, 0x89, 0xfd, 0x16, + 0x11, 0x71, 0xac, 0x4b, 0x9e, 0x86, 0xdc, 0xcb, 0xe0, 0x64, 0xb1, 0x57, 0xc6, 0x70, 0xff, 0x98, + 0x03, 0x18, 0x39, 0x04, 0x7d, 0x04, 0xd0, 0x27, 0xdd, 0xc0, 0xff, 0x15, 0x1f, 0x0d, 0x75, 0x15, + 0xb9, 0x23, 0x27, 0xbb, 0x51, 0xfb, 0x9d, 0x7b, 0xe7, 0xf6, 0x1b, 0xc1, 0x02, 0x0b, 0xbe, 0x25, + 0xba, 0x55, 0x90, 0x6b, 0xf4, 0x18, 0xaa, 0x7e, 0x14, 0xc5, 0x5c, 0x86, 0x52, 0x3a, 0xf0, 0xde, + 0x3c, 0x29, 0x84, 0xbc, 0xad, 0x11, 0xbe, 0x8a, 0x54, 0x93, 0x83, 0x73, 0x17, 0x96, 0x27, 0x11, + 0xce, 0x34, 0x90, 0x7d, 0x67, 0xc1, 0x07, 0x13, 0xae, 0x43, 0x9f, 0x0e, 0x33, 0xd1, 0x9a, 0x23, + 0xc4, 0xd3, 0x24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7, 0xda, 0x29, 0x58, 0x5a, 0xf3, 0x36, 0x2c, 0xc8, 0x44, + 0xca, 0x30, 0xb6, 0xd1, 0x72, 0x66, 0x89, 0x39, 0xd6, 0x82, 0xee, 0xab, 0x26, 0x99, 0x44, 0x66, + 0xf4, 0xa1, 0x6b, 0xa7, 0xdd, 0x6d, 0x33, 0xc3, 0x66, 0x2a, 0x88, 0x37, 0x2c, 0x14, 0x03, 0x9a, + 0x2e, 0x9e, 0xe8, 0x87, 0x19, 0x51, 0x32, 0xab, 0x82, 0x3b, 0x37, 0xe6, 0x43, 0x56, 0x4a, 0x35, + 0x6b, 0xaf, 0xde, 0xac, 0x58, 0x7f, 0x7f, 0xb3, 0x62, 0xfd, 0xf3, 0xcd, 0x8a, 0xb5, 0x5f, 0x94, + 0x5d, 0xcb, 0x8f, 0xfe, 0x17, 0x00, 0x00, 0xff, 0xff, 0xbb, 0x8f, 0x57, 0x7c, 0xf1, 0x1b, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1978,6 +2104,7 @@ type ControlClient interface { ListWorkers(ctx context.Context, in *ListWorkersRequest, opts ...grpc.CallOption) (*ListWorkersResponse, error) Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) ListenBuildHistory(ctx context.Context, in *BuildHistoryRequest, opts ...grpc.CallOption) (Control_ListenBuildHistoryClient, error) + UpdateBuildHistory(ctx context.Context, in *UpdateBuildHistoryRequest, opts ...grpc.CallOption) (*UpdateBuildHistoryResponse, error) } type controlClient struct { @@ -2151,6 +2278,15 @@ func (x *controlListenBuildHistoryClient) Recv() (*BuildHistoryEvent, error) { return m, nil } +func (c *controlClient) UpdateBuildHistory(ctx context.Context, in *UpdateBuildHistoryRequest, opts ...grpc.CallOption) (*UpdateBuildHistoryResponse, error) { + out := new(UpdateBuildHistoryResponse) + err := c.cc.Invoke(ctx, "/moby.buildkit.v1.Control/UpdateBuildHistory", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // ControlServer is the server API for Control service. type ControlServer interface { DiskUsage(context.Context, *DiskUsageRequest) (*DiskUsageResponse, error) @@ -2161,6 +2297,7 @@ type ControlServer interface { ListWorkers(context.Context, *ListWorkersRequest) (*ListWorkersResponse, error) Info(context.Context, *InfoRequest) (*InfoResponse, error) ListenBuildHistory(*BuildHistoryRequest, Control_ListenBuildHistoryServer) error + UpdateBuildHistory(context.Context, *UpdateBuildHistoryRequest) (*UpdateBuildHistoryResponse, error) } // UnimplementedControlServer can be embedded to have forward compatible implementations. @@ -2191,6 +2328,9 @@ func (*UnimplementedControlServer) Info(ctx context.Context, req *InfoRequest) ( func (*UnimplementedControlServer) ListenBuildHistory(req *BuildHistoryRequest, srv Control_ListenBuildHistoryServer) error { return status.Errorf(codes.Unimplemented, "method ListenBuildHistory not implemented") } +func (*UnimplementedControlServer) UpdateBuildHistory(ctx context.Context, req *UpdateBuildHistoryRequest) (*UpdateBuildHistoryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateBuildHistory not implemented") +} func RegisterControlServer(s *grpc.Server, srv ControlServer) { s.RegisterService(&_Control_serviceDesc, srv) @@ -2357,6 +2497,24 @@ func (x *controlListenBuildHistoryServer) Send(m *BuildHistoryEvent) error { return x.ServerStream.SendMsg(m) } +func _Control_UpdateBuildHistory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateBuildHistoryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ControlServer).UpdateBuildHistory(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/moby.buildkit.v1.Control/UpdateBuildHistory", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ControlServer).UpdateBuildHistory(ctx, req.(*UpdateBuildHistoryRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Control_serviceDesc = grpc.ServiceDesc{ ServiceName: "moby.buildkit.v1.Control", HandlerType: (*ControlServer)(nil), @@ -2377,6 +2535,10 @@ var _Control_serviceDesc = grpc.ServiceDesc{ MethodName: "Info", Handler: _Control_Info_Handler, }, + { + MethodName: "UpdateBuildHistory", + Handler: _Control_UpdateBuildHistory_Handler, + }, }, Streams: []grpc.StreamDesc{ { @@ -3643,6 +3805,16 @@ func (m *BuildHistoryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if m.EarlyExit { + i-- + if m.EarlyExit { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } if len(m.Ref) > 0 { i -= len(m.Ref) copy(dAtA[i:], m.Ref) @@ -3731,6 +3903,16 @@ func (m *BuildHistoryRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if m.Pinned { + i-- + if m.Pinned { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x70 + } if m.Trace != nil { { size, err := m.Trace.MarshalToSizedBuffer(dAtA[:i]) @@ -3899,6 +4081,87 @@ func (m *BuildHistoryRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *UpdateBuildHistoryRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UpdateBuildHistoryRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateBuildHistoryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Delete { + i-- + if m.Delete { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.Pinned { + i-- + if m.Pinned { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.Ref) > 0 { + i -= len(m.Ref) + copy(dAtA[i:], m.Ref) + i = encodeVarintControl(dAtA, i, uint64(len(m.Ref))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UpdateBuildHistoryResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UpdateBuildHistoryResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateBuildHistoryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + return len(dAtA) - i, nil +} + func (m *Descriptor) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -4652,6 +4915,9 @@ func (m *BuildHistoryRequest) Size() (n int) { if l > 0 { n += 1 + l + sovControl(uint64(l)) } + if m.EarlyExit { + n += 2 + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -4753,6 +5019,43 @@ func (m *BuildHistoryRecord) Size() (n int) { l = m.Trace.Size() n += 1 + l + sovControl(uint64(l)) } + if m.Pinned { + n += 2 + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *UpdateBuildHistoryRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Ref) + if l > 0 { + n += 1 + l + sovControl(uint64(l)) + } + if m.Pinned { + n += 2 + } + if m.Delete { + n += 2 + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *UpdateBuildHistoryResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -8668,6 +8971,26 @@ func (m *BuildHistoryRequest) Unmarshal(dAtA []byte) error { } m.Ref = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EarlyExit", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowControl + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EarlyExit = bool(v != 0) default: iNdEx = preIndex skippy, err := skipControl(dAtA[iNdEx:]) @@ -9541,6 +9864,200 @@ func (m *BuildHistoryRecord) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Pinned", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowControl + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Pinned = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipControl(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthControl + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UpdateBuildHistoryRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowControl + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UpdateBuildHistoryRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpdateBuildHistoryRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ref", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowControl + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthControl + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthControl + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ref = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Pinned", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowControl + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Pinned = bool(v != 0) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Delete", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowControl + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Delete = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipControl(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthControl + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UpdateBuildHistoryResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowControl + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UpdateBuildHistoryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpdateBuildHistoryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { default: iNdEx = preIndex skippy, err := skipControl(dAtA[iNdEx:]) diff --git a/api/services/control/control.proto b/api/services/control/control.proto index 075a34475..81de83ad9 100644 --- a/api/services/control/control.proto +++ b/api/services/control/control.proto @@ -23,6 +23,7 @@ service Control { rpc Info(InfoRequest) returns (InfoResponse); rpc ListenBuildHistory(BuildHistoryRequest) returns (stream BuildHistoryEvent); + rpc UpdateBuildHistory(UpdateBuildHistoryRequest) returns (UpdateBuildHistoryResponse); } message PruneRequest { @@ -171,6 +172,7 @@ message InfoResponse { message BuildHistoryRequest { bool ActiveOnly = 1; string Ref = 2; + bool EarlyExit = 3; } enum BuildHistoryEventType { @@ -199,12 +201,21 @@ message BuildHistoryRecord { map Results = 11; int32 Generation = 12; Descriptor trace = 13; + bool pinned = 14; // TODO: tags // TODO: steps/cache summary // TODO: unclipped logs - // TODO: pinning } + +message UpdateBuildHistoryRequest { + string Ref = 1; + bool Pinned = 2; + bool Delete = 3; +} + +message UpdateBuildHistoryResponse {} + message Descriptor { string media_type = 1; string digest = 2 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false]; diff --git a/client/client_test.go b/client/client_test.go index 58ed3cea8..c364d94f6 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -35,6 +35,7 @@ import ( "github.com/containerd/containerd/snapshots" "github.com/containerd/continuity/fs/fstest" intoto "github.com/in-toto/in-toto-golang/in_toto" + controlapi "github.com/moby/buildkit/api/services/control" "github.com/moby/buildkit/client/llb" "github.com/moby/buildkit/exporter/containerimage/exptypes" gateway "github.com/moby/buildkit/frontend/gateway/client" @@ -6098,6 +6099,24 @@ func ensurePruneAll(t *testing.T, c *Client, sb integration.Sandbox) { } func checkAllReleasable(t *testing.T, c *Client, sb integration.Sandbox, checkContent bool) { + cl, err := c.ControlClient().ListenBuildHistory(sb.Context(), &controlapi.BuildHistoryRequest{ + EarlyExit: true, + }) + require.NoError(t, err) + + for { + resp, err := cl.Recv() + if err == io.EOF { + break + } + require.NoError(t, err) + _, err = c.ControlClient().UpdateBuildHistory(sb.Context(), &controlapi.UpdateBuildHistoryRequest{ + Ref: resp.Record.Ref, + Delete: true, + }) + require.NoError(t, err) + } + retries := 0 loop0: for { @@ -6114,7 +6133,7 @@ loop0: break } - err := c.Prune(sb.Context(), nil, PruneAll) + err = c.Prune(sb.Context(), nil, PruneAll) require.NoError(t, err) du, err := c.DiskUsage(sb.Context()) @@ -6170,7 +6189,7 @@ loop0: if count == 0 { break } - if retries >= 20 { + if retries >= 50 { require.FailNowf(t, "content still exists", "%+v", infos) } retries++ diff --git a/cmd/buildctl/debug.go b/cmd/buildctl/debug.go index fa1ee8081..504a4b3f1 100644 --- a/cmd/buildctl/debug.go +++ b/cmd/buildctl/debug.go @@ -15,5 +15,6 @@ var debugCommand = cli.Command{ debug.InfoCommand, debug.MonitorCommand, debug.LogsCommand, + debug.CtlCommand, }, } diff --git a/cmd/buildctl/debug/ctl.go b/cmd/buildctl/debug/ctl.go new file mode 100644 index 000000000..2ebbe6ca9 --- /dev/null +++ b/cmd/buildctl/debug/ctl.go @@ -0,0 +1,67 @@ +package debug + +import ( + controlapi "github.com/moby/buildkit/api/services/control" + bccommon "github.com/moby/buildkit/cmd/buildctl/common" + "github.com/moby/buildkit/util/appcontext" + "github.com/pkg/errors" + "github.com/urfave/cli" +) + +var CtlCommand = cli.Command{ + Name: "ctl", + Usage: "control build records", + Action: ctl, + Flags: []cli.Flag{ + cli.BoolFlag{ + Name: "pin", + Usage: "Pin build so it will not be garbage collected", + }, + cli.BoolFlag{ + Name: "unpin", + Usage: "Unpin build so it will be garbage collected", + }, + cli.BoolFlag{ + Name: "delete", + Usage: "Delete build record", + }, + }, +} + +func ctl(clicontext *cli.Context) error { + args := clicontext.Args() + if len(args) == 0 { + return errors.Errorf("build ref must be specified") + } + ref := args[0] + + c, err := bccommon.ResolveClient(clicontext) + if err != nil { + return err + } + + ctx := appcontext.Context() + + pin := clicontext.Bool("pin") + unpin := clicontext.Bool("unpin") + del := clicontext.Bool("delete") + + if !pin && !unpin && !del { + return errors.Errorf("must specify one of --pin, --unpin, --delete") + } + + if pin && unpin { + return errors.Errorf("cannot specify both --pin and --unpin") + } + + if del && (pin || unpin) { + return errors.Errorf("cannot specify --delete with --pin or --unpin") + } + + _, err = c.ControlClient().UpdateBuildHistory(ctx, &controlapi.UpdateBuildHistoryRequest{ + Ref: ref, + Pinned: pin, + Delete: del, + }) + return err +} diff --git a/cmd/buildkitd/config/config.go b/cmd/buildkitd/config/config.go index 3bd8c6b8b..1734d5e15 100644 --- a/cmd/buildkitd/config/config.go +++ b/cmd/buildkitd/config/config.go @@ -24,6 +24,8 @@ type Config struct { Registries map[string]resolverconfig.RegistryConfig `toml:"registry"` DNS *DNSConfig `toml:"dns"` + + History *HistoryConfig `toml:"history"` } type GRPCConfig struct { @@ -123,3 +125,8 @@ type DNSConfig struct { Options []string `toml:"options"` SearchDomains []string `toml:"searchDomains"` } + +type HistoryConfig struct { + MaxAge int64 `toml:"maxAge"` + MaxEntries int64 `toml:"maxEntries"` +} diff --git a/cmd/buildkitd/main.go b/cmd/buildkitd/main.go index 1713c372f..350129902 100644 --- a/cmd/buildkitd/main.go +++ b/cmd/buildkitd/main.go @@ -692,6 +692,7 @@ func newController(c *cli.Context, cfg *config.Config) (*control.Controller, err HistoryDB: historyDB, LeaseManager: w.LeaseManager(), ContentStore: w.ContentStore(), + HistoryConfig: cfg.History, }) } diff --git a/control/control.go b/control/control.go index 96dab1ed7..e0c9eb13f 100644 --- a/control/control.go +++ b/control/control.go @@ -17,6 +17,7 @@ import ( apitypes "github.com/moby/buildkit/api/types" "github.com/moby/buildkit/cache/remotecache" "github.com/moby/buildkit/client" + "github.com/moby/buildkit/cmd/buildkitd/config" controlgateway "github.com/moby/buildkit/control/gateway" "github.com/moby/buildkit/exporter" "github.com/moby/buildkit/exporter/util/epoch" @@ -57,6 +58,7 @@ type Opt struct { HistoryDB *bbolt.DB LeaseManager leases.Manager ContentStore content.Store + HistoryConfig *config.HistoryConfig } type Controller struct { // TODO: ControlService @@ -81,6 +83,7 @@ func NewController(opt Opt) (*Controller, error) { DB: opt.HistoryDB, LeaseManager: opt.LeaseManager, ContentStore: opt.ContentStore, + CleanConfig: opt.HistoryConfig, }) s, err := llbsolver.New(llbsolver.Opt{ @@ -252,6 +255,22 @@ func (c *Controller) ListenBuildHistory(req *controlapi.BuildHistoryRequest, srv }) } +func (c *Controller) UpdateBuildHistory(ctx context.Context, req *controlapi.UpdateBuildHistoryRequest) (*controlapi.UpdateBuildHistoryResponse, error) { + if !req.Delete { + err := c.history.UpdateRef(ctx, req.Ref, func(r *controlapi.BuildHistoryRecord) error { + if req.Pinned == r.Pinned { + return nil + } + r.Pinned = req.Pinned + return nil + }) + return &controlapi.UpdateBuildHistoryResponse{}, err + } + + err := c.history.Delete(ctx, req.Ref) + return &controlapi.UpdateBuildHistoryResponse{}, err +} + func translateLegacySolveRequest(req *controlapi.SolveRequest) error { // translates ExportRef and ExportAttrs to new Exports (v0.4.0) if legacyExportRef := req.Cache.ExportRefDeprecated; legacyExportRef != "" { diff --git a/docs/buildkitd.toml.md b/docs/buildkitd.toml.md index bd6ec0a2d..50b7a670a 100644 --- a/docs/buildkitd.toml.md +++ b/docs/buildkitd.toml.md @@ -29,6 +29,13 @@ insecure-entitlements = [ "network.host", "security.insecure" ] key = "/etc/buildkit/tls.key" ca = "/etc/buildkit/tlsca.crt" +# config for build history API that stores information about completed build commands +[history] + # maxAge is the maximum age of history entries to keep, in seconds. + maxAge = 172800 + # maxEntries is the maximum number of history entries to keep. + maxEntries = 50 + [worker.oci] enabled = true # platforms is manually configure platforms, detected automatically if unset. diff --git a/frontend/dockerfile/dockerfile_test.go b/frontend/dockerfile/dockerfile_test.go index cd40e68b4..53a0d0cf0 100644 --- a/frontend/dockerfile/dockerfile_test.go +++ b/frontend/dockerfile/dockerfile_test.go @@ -28,6 +28,7 @@ import ( "github.com/containerd/containerd/snapshots" "github.com/containerd/continuity/fs/fstest" intoto "github.com/in-toto/in-toto-golang/in_toto" + controlapi "github.com/moby/buildkit/api/services/control" "github.com/moby/buildkit/client" "github.com/moby/buildkit/client/llb" "github.com/moby/buildkit/frontend/dockerfile/builder" @@ -6430,6 +6431,24 @@ func ensurePruneAll(t *testing.T, c *client.Client, sb integration.Sandbox) { } func checkAllReleasable(t *testing.T, c *client.Client, sb integration.Sandbox, checkContent bool) { + cl, err := c.ControlClient().ListenBuildHistory(sb.Context(), &controlapi.BuildHistoryRequest{ + EarlyExit: true, + }) + require.NoError(t, err) + + for { + resp, err := cl.Recv() + if err == io.EOF { + break + } + require.NoError(t, err) + _, err = c.ControlClient().UpdateBuildHistory(sb.Context(), &controlapi.UpdateBuildHistoryRequest{ + Ref: resp.Record.Ref, + Delete: true, + }) + require.NoError(t, err) + } + retries := 0 loop0: for { @@ -6446,7 +6465,7 @@ loop0: break } - err := c.Prune(sb.Context(), nil, client.PruneAll) + err = c.Prune(sb.Context(), nil, client.PruneAll) require.NoError(t, err) du, err := c.DiskUsage(sb.Context()) diff --git a/solver/llbsolver/history.go b/solver/llbsolver/history.go index 967cab84f..e06e32743 100644 --- a/solver/llbsolver/history.go +++ b/solver/llbsolver/history.go @@ -6,6 +6,7 @@ import ( "encoding/binary" "io" "os" + "sort" "sync" "time" @@ -14,6 +15,7 @@ import ( "github.com/containerd/containerd/leases" controlapi "github.com/moby/buildkit/api/services/control" "github.com/moby/buildkit/client" + "github.com/moby/buildkit/cmd/buildkitd/config" "github.com/moby/buildkit/util/leaseutil" digest "github.com/opencontainers/go-digest" ocispecs "github.com/opencontainers/image-spec/specs-go/v1" @@ -29,24 +31,119 @@ type HistoryQueueOpt struct { DB *bolt.DB LeaseManager leases.Manager ContentStore content.Store + CleanConfig *config.HistoryConfig } type HistoryQueue struct { mu sync.Mutex initOnce sync.Once HistoryQueueOpt - ps *pubsub[*controlapi.BuildHistoryEvent] - active map[string]*controlapi.BuildHistoryRecord + ps *pubsub[*controlapi.BuildHistoryEvent] + active map[string]*controlapi.BuildHistoryRecord + refs map[string]int + deleted map[string]struct{} } func NewHistoryQueue(opt HistoryQueueOpt) *HistoryQueue { - return &HistoryQueue{ + if opt.CleanConfig == nil { + opt.CleanConfig = &config.HistoryConfig{ + MaxAge: int64((48 * time.Hour).Seconds()), + MaxEntries: 50, + } + } + h := &HistoryQueue{ HistoryQueueOpt: opt, ps: &pubsub[*controlapi.BuildHistoryEvent]{ m: map[*channel[*controlapi.BuildHistoryEvent]]struct{}{}, }, - active: map[string]*controlapi.BuildHistoryRecord{}, + active: map[string]*controlapi.BuildHistoryRecord{}, + refs: map[string]int{}, + deleted: map[string]struct{}{}, } + + go func() { + for { + h.gc() + time.Sleep(120 * time.Second) + } + }() + + return h +} + +func (h *HistoryQueue) gc() error { + var records []*controlapi.BuildHistoryRecord + + if err := h.DB.View(func(tx *bolt.Tx) error { + b := tx.Bucket([]byte(recordsBucket)) + if b == nil { + return nil + } + return b.ForEach(func(key, dt []byte) error { + var br controlapi.BuildHistoryRecord + if err := br.Unmarshal(dt); err != nil { + return errors.Wrapf(err, "failed to unmarshal build record %s", key) + } + if br.Pinned { + return nil + } + records = append(records, &br) + return nil + }) + }); err != nil { + return err + } + + // in order for record to get deleted by gc it exceed both maxentries and maxage criteria + + if len(records) < int(h.CleanConfig.MaxEntries) { + return nil + } + + sort.Slice(records, func(i, j int) bool { + return records[i].CompletedAt.Before(*records[j].CompletedAt) + }) + + h.mu.Lock() + defer h.mu.Unlock() + + now := time.Now() + for _, r := range records[h.CleanConfig.MaxEntries:] { + if now.Add(time.Duration(h.CleanConfig.MaxAge) * -time.Second).After(*r.CompletedAt) { + if err := h.delete(r.Ref, false); err != nil { + return err + } + } + } + + return nil +} + +func (h *HistoryQueue) delete(ref string, sync bool) error { + if _, ok := h.refs[ref]; ok { + h.deleted[ref] = struct{}{} + return nil + } + delete(h.deleted, ref) + if err := h.DB.Update(func(tx *bolt.Tx) error { + b := tx.Bucket([]byte(recordsBucket)) + if b == nil { + return os.ErrNotExist + } + err1 := b.Delete([]byte(ref)) + var opts []leases.DeleteOpt + if sync { + opts = append(opts, leases.SynchronousDelete) + } + err2 := h.LeaseManager.Delete(context.TODO(), leases.Lease{ID: h.leaseID(ref)}, opts...) + if err1 != nil { + return err1 + } + return err2 + }); err != nil { + return err + } + return nil } func (h *HistoryQueue) init() error { @@ -109,15 +206,20 @@ func (h *HistoryQueue) UpdateRef(ctx context.Context, ref string, upt func(r *co if err := h.update(ctx, br); err != nil { return err } + h.ps.Send(&controlapi.BuildHistoryEvent{ + Type: controlapi.BuildHistoryEventType_COMPLETE, + Record: &br, + }) return nil } func (h *HistoryQueue) Status(ctx context.Context, ref string, st chan<- *client.SolveStatus) error { + h.init() var br controlapi.BuildHistoryRecord if err := h.DB.View(func(tx *bolt.Tx) error { b := tx.Bucket([]byte(recordsBucket)) if b == nil { - return nil + return os.ErrNotExist } dt := b.Get([]byte(ref)) if dt == nil { @@ -231,6 +333,13 @@ func (h *HistoryQueue) Update(ctx context.Context, e *controlapi.BuildHistoryEve return nil } +func (h *HistoryQueue) Delete(ctx context.Context, ref string) error { + h.mu.Lock() + defer h.mu.Unlock() + + return h.delete(ref, true) +} + func (h *HistoryQueue) OpenBlobWriter(ctx context.Context, mt string) (_ *Writer, err error) { l, err := h.LeaseManager.Create(ctx, leases.WithRandomID(), leases.WithExpiration(5*time.Minute), leaseutil.MakeTemporary) if err != nil { @@ -357,12 +466,36 @@ func (h *HistoryQueue) Listen(ctx context.Context, req *controlapi.BuildHistoryR sub := h.ps.Subscribe() defer sub.close() + if req.Ref != "" { + if _, ok := h.deleted[req.Ref]; ok { + h.mu.Unlock() + return errors.Wrapf(os.ErrNotExist, "ref %s is deleted", req.Ref) + } + + h.refs[req.Ref]++ + defer func() { + h.mu.Lock() + h.refs[req.Ref]-- + if _, ok := h.deleted[req.Ref]; ok { + if h.refs[req.Ref] == 0 { + delete(h.refs, req.Ref) + h.delete(req.Ref, false) + } + } + h.mu.Unlock() + }() + } + for _, e := range h.active { + if req.Ref != "" && e.Ref != req.Ref { + continue + } sub.ps.Send(&controlapi.BuildHistoryEvent{ Type: controlapi.BuildHistoryEventType_STARTED, Record: e, }) } + h.mu.Unlock() if !req.ActiveOnly { @@ -392,6 +525,10 @@ func (h *HistoryQueue) Listen(ctx context.Context, req *controlapi.BuildHistoryR } } + if req.EarlyExit { + return nil + } + for { select { case <-ctx.Done(): diff --git a/solver/llbsolver/solver.go b/solver/llbsolver/solver.go index 486fecf4b..d0b590b22 100644 --- a/solver/llbsolver/solver.go +++ b/solver/llbsolver/solver.go @@ -180,11 +180,7 @@ func (s *Solver) Solve(ctx context.Context, id string, sessionID string, req fro if err != nil { return err } - defer func() { - if err != nil && release != nil { - release() - } - }() + defer release() if err := s.history.UpdateRef(context.TODO(), id, func(rec *controlapi.BuildHistoryRecord) error { rec.Trace = &controlapi.Descriptor{ @@ -198,7 +194,7 @@ func (s *Solver) Solve(ctx context.Context, id string, sessionID string, req fro } return nil }(); err != nil { - logrus.Errorf("failed to save trace for %s", id) + logrus.Errorf("failed to save trace for %s: %+v", id, err) } }() }()