From b622a87c5d236224cac4fc9c0cde1550d587b492 Mon Sep 17 00:00:00 2001 From: Edgar Lee Date: Fri, 15 Nov 2019 15:21:32 -0800 Subject: [PATCH 1/3] Change result type to array of refs Signed-off-by: Edgar Lee --- frontend/gateway/gateway.go | 58 +- frontend/gateway/grpcclient/client.go | 35 +- frontend/gateway/pb/gateway.pb.go | 998 ++++++++++++++++++++++---- frontend/gateway/pb/gateway.proto | 19 +- 4 files changed, 942 insertions(+), 168 deletions(-) diff --git a/frontend/gateway/gateway.go b/frontend/gateway/gateway.go index fa9de6f9..3727b98e 100644 --- a/frontend/gateway/gateway.go +++ b/frontend/gateway/gateway.go @@ -475,7 +475,16 @@ func (lbf *llbBridgeForwarder) Solve(ctx context.Context, req *pb.SolveRequest) } ids[k] = id } - pbRes.Result = &pb.Result_Refs{Refs: &pb.RefMap{Refs: ids}} + + if req.AllowResultArrayRef { + refMap := make(map[string]*pb.Ref, len(res.Refs)) + for k, id := range ids { + refMap[k] = &pb.Ref{Ids: []string{id}} + } + pbRes.Result = &pb.Result_Refs{Refs: &pb.RefMap{Refs: refMap}} + } else { + pbRes.Result = &pb.Result_RefsDeprecated{RefsDeprecated: &pb.RefMapDeprecated{Refs: ids}} + } } else { id := identity.NewID() if res.Ref == nil { @@ -484,7 +493,12 @@ func (lbf *llbBridgeForwarder) Solve(ctx context.Context, req *pb.SolveRequest) lbf.refs[id] = res.Ref } defaultID = id - pbRes.Result = &pb.Result_Ref{Ref: id} + + if req.AllowResultArrayRef { + pbRes.Result = &pb.Result_Ref{Ref: &pb.Ref{Ids: []string{id}}} + } else { + pbRes.Result = &pb.Result_RefDeprecated{RefDeprecated: id} + } } lbf.mu.Unlock() @@ -635,16 +649,42 @@ func (lbf *llbBridgeForwarder) Return(ctx context.Context, in *pb.ReturnRequest) } switch res := in.Result.Result.(type) { + case *pb.Result_RefDeprecated: + var ids []string + if res.RefDeprecated != "" { + ids = append(ids, res.RefDeprecated) + } + + ref, err := lbf.convertRef(ids) + if err != nil { + return nil, err + } + r.Ref = ref + case *pb.Result_RefsDeprecated: + m := map[string]solver.CachedResult{} + for k, v := range res.RefsDeprecated.Refs { + var ids []string + if v != "" { + ids = append(ids, v) + } + + ref, err := lbf.convertRef(ids) + if err != nil { + return nil, err + } + m[k] = ref + } + r.Refs = m case *pb.Result_Ref: - ref, err := lbf.convertRef(res.Ref) + ref, err := lbf.convertRef(res.Ref.Ids) if err != nil { return nil, err } r.Ref = ref case *pb.Result_Refs: m := map[string]solver.CachedResult{} - for k, v := range res.Refs.Refs { - ref, err := lbf.convertRef(v) + for k, ref := range res.Refs.Refs { + ref, err := lbf.convertRef(ref.Ids) if err != nil { return nil, err } @@ -656,16 +696,20 @@ func (lbf *llbBridgeForwarder) Return(ctx context.Context, in *pb.ReturnRequest) } } -func (lbf *llbBridgeForwarder) convertRef(id string) (solver.CachedResult, error) { - if id == "" { +func (lbf *llbBridgeForwarder) convertRef(ids []string) (solver.CachedResult, error) { + if len(ids) == 0 { return nil, nil } + lbf.mu.Lock() defer lbf.mu.Unlock() + + id := ids[0] r, ok := lbf.refs[id] if !ok { return nil, errors.Errorf("return reference %s not found", id) } + return r, nil } diff --git a/frontend/gateway/grpcclient/client.go b/frontend/gateway/grpcclient/client.go index 1a1ff075..ae1eaab5 100644 --- a/frontend/gateway/grpcclient/client.go +++ b/frontend/gateway/grpcclient/client.go @@ -105,14 +105,14 @@ func (c *grpcClient) Run(ctx context.Context, f client.BuildFunc) (retError erro Metadata: res.Metadata, } if res.Refs != nil { - m := map[string]string{} + m := map[string]*pb.Ref{} for k, r := range res.Refs { id, err := convertRef(r) if err != nil { retError = err continue } - m[k] = id + m[k] = &pb.Ref{Ids: []string{id}} } pbRes.Result = &pb.Result_Refs{Refs: &pb.RefMap{Refs: m}} } else { @@ -120,7 +120,7 @@ func (c *grpcClient) Run(ctx context.Context, f client.BuildFunc) (retError erro if err != nil { retError = err } else { - pbRes.Result = &pb.Result_Ref{Ref: id} + pbRes.Result = &pb.Result_Ref{Ref: &pb.Ref{Ids: []string{id}}} } } if retError == nil { @@ -280,10 +280,11 @@ func (c *grpcClient) Solve(ctx context.Context, creq client.SolveRequest) (*clie } req := &pb.SolveRequest{ - Definition: creq.Definition, - Frontend: creq.Frontend, - FrontendOpt: creq.FrontendOpt, - AllowResultReturn: true, + Definition: creq.Definition, + Frontend: creq.Frontend, + FrontendOpt: creq.FrontendOpt, + AllowResultReturn: true, + AllowResultArrayRef: true, // old API ImportCacheRefsDeprecated: legacyRegistryCacheImports, // new API @@ -310,18 +311,30 @@ func (c *grpcClient) Solve(ctx context.Context, creq client.SolveRequest) (*clie } else { res.Metadata = resp.Result.Metadata switch pbRes := resp.Result.Result.(type) { - case *pb.Result_Ref: - if id := pbRes.Ref; id != "" { + case *pb.Result_RefDeprecated: + if id := pbRes.RefDeprecated; id != "" { res.SetRef(&reference{id: id, c: c}) } - case *pb.Result_Refs: - for k, v := range pbRes.Refs.Refs { + case *pb.Result_RefsDeprecated: + for k, v := range pbRes.RefsDeprecated.Refs { ref := &reference{id: v, c: c} if v == "" { ref = nil } res.AddRef(k, ref) } + case *pb.Result_Ref: + if ids := pbRes.Ref.Ids; len(ids) > 0 { + res.SetRef(&reference{id: ids[0], c: c}) + } + case *pb.Result_Refs: + for k, v := range pbRes.Refs.Refs { + var ref *reference + if len(v.Ids) > 0 { + ref = &reference{id: v.Ids[0], c: c} + } + res.AddRef(k, ref) + } } } diff --git a/frontend/gateway/pb/gateway.pb.go b/frontend/gateway/pb/gateway.pb.go index 412892fe..444fb169 100644 --- a/frontend/gateway/pb/gateway.pb.go +++ b/frontend/gateway/pb/gateway.pb.go @@ -35,6 +35,8 @@ const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package type Result struct { // Types that are valid to be assigned to Result: + // *Result_RefDeprecated + // *Result_RefsDeprecated // *Result_Ref // *Result_Refs Result isResult_Result `protobuf_oneof:"result"` @@ -48,7 +50,7 @@ func (m *Result) Reset() { *m = Result{} } func (m *Result) String() string { return proto.CompactTextString(m) } func (*Result) ProtoMessage() {} func (*Result) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{0} + return fileDescriptor_gateway_f66b6a1c7ba3b979, []int{0} } func (m *Result) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -83,15 +85,23 @@ type isResult_Result interface { Size() int } +type Result_RefDeprecated struct { + RefDeprecated string `protobuf:"bytes,1,opt,name=refDeprecated,proto3,oneof"` +} +type Result_RefsDeprecated struct { + RefsDeprecated *RefMapDeprecated `protobuf:"bytes,2,opt,name=refsDeprecated,proto3,oneof"` +} type Result_Ref struct { - Ref string `protobuf:"bytes,1,opt,name=ref,proto3,oneof"` + Ref *Ref `protobuf:"bytes,3,opt,name=ref,proto3,oneof"` } type Result_Refs struct { - Refs *RefMap `protobuf:"bytes,2,opt,name=refs,proto3,oneof"` + Refs *RefMap `protobuf:"bytes,4,opt,name=refs,proto3,oneof"` } -func (*Result_Ref) isResult_Result() {} -func (*Result_Refs) isResult_Result() {} +func (*Result_RefDeprecated) isResult_Result() {} +func (*Result_RefsDeprecated) isResult_Result() {} +func (*Result_Ref) isResult_Result() {} +func (*Result_Refs) isResult_Result() {} func (m *Result) GetResult() isResult_Result { if m != nil { @@ -100,11 +110,25 @@ func (m *Result) GetResult() isResult_Result { return nil } -func (m *Result) GetRef() string { +func (m *Result) GetRefDeprecated() string { + if x, ok := m.GetResult().(*Result_RefDeprecated); ok { + return x.RefDeprecated + } + return "" +} + +func (m *Result) GetRefsDeprecated() *RefMapDeprecated { + if x, ok := m.GetResult().(*Result_RefsDeprecated); ok { + return x.RefsDeprecated + } + return nil +} + +func (m *Result) GetRef() *Ref { if x, ok := m.GetResult().(*Result_Ref); ok { return x.Ref } - return "" + return nil } func (m *Result) GetRefs() *RefMap { @@ -124,6 +148,8 @@ func (m *Result) GetMetadata() map[string][]byte { // XXX_OneofFuncs is for the internal use of the proto package. func (*Result) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _Result_OneofMarshaler, _Result_OneofUnmarshaler, _Result_OneofSizer, []interface{}{ + (*Result_RefDeprecated)(nil), + (*Result_RefsDeprecated)(nil), (*Result_Ref)(nil), (*Result_Refs)(nil), } @@ -133,11 +159,21 @@ func _Result_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { m := msg.(*Result) // result switch x := m.Result.(type) { - case *Result_Ref: + case *Result_RefDeprecated: _ = b.EncodeVarint(1<<3 | proto.WireBytes) - _ = b.EncodeStringBytes(x.Ref) - case *Result_Refs: + _ = b.EncodeStringBytes(x.RefDeprecated) + case *Result_RefsDeprecated: _ = b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.RefsDeprecated); err != nil { + return err + } + case *Result_Ref: + _ = b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Ref); err != nil { + return err + } + case *Result_Refs: + _ = b.EncodeVarint(4<<3 | proto.WireBytes) if err := b.EncodeMessage(x.Refs); err != nil { return err } @@ -151,14 +187,30 @@ func _Result_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { func _Result_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { m := msg.(*Result) switch tag { - case 1: // result.ref + case 1: // result.refDeprecated if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } x, err := b.DecodeStringBytes() - m.Result = &Result_Ref{x} + m.Result = &Result_RefDeprecated{x} return true, err - case 2: // result.refs + case 2: // result.refsDeprecated + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(RefMapDeprecated) + err := b.DecodeMessage(msg) + m.Result = &Result_RefsDeprecated{msg} + return true, err + case 3: // result.ref + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Ref) + err := b.DecodeMessage(msg) + m.Result = &Result_Ref{msg} + return true, err + case 4: // result.refs if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } @@ -175,10 +227,20 @@ func _Result_OneofSizer(msg proto.Message) (n int) { m := msg.(*Result) // result switch x := m.Result.(type) { - case *Result_Ref: + case *Result_RefDeprecated: n += 1 // tag and wire - n += proto.SizeVarint(uint64(len(x.Ref))) - n += len(x.Ref) + n += proto.SizeVarint(uint64(len(x.RefDeprecated))) + n += len(x.RefDeprecated) + case *Result_RefsDeprecated: + s := proto.Size(x.RefsDeprecated) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *Result_Ref: + s := proto.Size(x.Ref) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s case *Result_Refs: s := proto.Size(x.Refs) n += 1 // tag and wire @@ -191,18 +253,112 @@ func _Result_OneofSizer(msg proto.Message) (n int) { return n } -type RefMap struct { +type RefMapDeprecated struct { Refs map[string]string `protobuf:"bytes,1,rep,name=refs,proto3" json:"refs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } +func (m *RefMapDeprecated) Reset() { *m = RefMapDeprecated{} } +func (m *RefMapDeprecated) String() string { return proto.CompactTextString(m) } +func (*RefMapDeprecated) ProtoMessage() {} +func (*RefMapDeprecated) Descriptor() ([]byte, []int) { + return fileDescriptor_gateway_f66b6a1c7ba3b979, []int{1} +} +func (m *RefMapDeprecated) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RefMapDeprecated) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RefMapDeprecated.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *RefMapDeprecated) XXX_Merge(src proto.Message) { + xxx_messageInfo_RefMapDeprecated.Merge(dst, src) +} +func (m *RefMapDeprecated) XXX_Size() int { + return m.Size() +} +func (m *RefMapDeprecated) XXX_DiscardUnknown() { + xxx_messageInfo_RefMapDeprecated.DiscardUnknown(m) +} + +var xxx_messageInfo_RefMapDeprecated proto.InternalMessageInfo + +func (m *RefMapDeprecated) GetRefs() map[string]string { + if m != nil { + return m.Refs + } + return nil +} + +type Ref struct { + Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Ref) Reset() { *m = Ref{} } +func (m *Ref) String() string { return proto.CompactTextString(m) } +func (*Ref) ProtoMessage() {} +func (*Ref) Descriptor() ([]byte, []int) { + return fileDescriptor_gateway_f66b6a1c7ba3b979, []int{2} +} +func (m *Ref) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Ref) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Ref.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *Ref) XXX_Merge(src proto.Message) { + xxx_messageInfo_Ref.Merge(dst, src) +} +func (m *Ref) XXX_Size() int { + return m.Size() +} +func (m *Ref) XXX_DiscardUnknown() { + xxx_messageInfo_Ref.DiscardUnknown(m) +} + +var xxx_messageInfo_Ref proto.InternalMessageInfo + +func (m *Ref) GetIds() []string { + if m != nil { + return m.Ids + } + return nil +} + +type RefMap struct { + Refs map[string]*Ref `protobuf:"bytes,1,rep,name=refs,proto3" json:"refs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + func (m *RefMap) Reset() { *m = RefMap{} } func (m *RefMap) String() string { return proto.CompactTextString(m) } func (*RefMap) ProtoMessage() {} func (*RefMap) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{1} + return fileDescriptor_gateway_f66b6a1c7ba3b979, []int{3} } func (m *RefMap) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -231,7 +387,7 @@ func (m *RefMap) XXX_DiscardUnknown() { var xxx_messageInfo_RefMap proto.InternalMessageInfo -func (m *RefMap) GetRefs() map[string]string { +func (m *RefMap) GetRefs() map[string]*Ref { if m != nil { return m.Refs } @@ -250,7 +406,7 @@ func (m *ReturnRequest) Reset() { *m = ReturnRequest{} } func (m *ReturnRequest) String() string { return proto.CompactTextString(m) } func (*ReturnRequest) ProtoMessage() {} func (*ReturnRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{2} + return fileDescriptor_gateway_f66b6a1c7ba3b979, []int{4} } func (m *ReturnRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -303,7 +459,7 @@ func (m *ReturnResponse) Reset() { *m = ReturnResponse{} } func (m *ReturnResponse) String() string { return proto.CompactTextString(m) } func (*ReturnResponse) ProtoMessage() {} func (*ReturnResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{3} + return fileDescriptor_gateway_f66b6a1c7ba3b979, []int{5} } func (m *ReturnResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -346,7 +502,7 @@ func (m *ResolveImageConfigRequest) Reset() { *m = ResolveImageConfigReq func (m *ResolveImageConfigRequest) String() string { return proto.CompactTextString(m) } func (*ResolveImageConfigRequest) ProtoMessage() {} func (*ResolveImageConfigRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{4} + return fileDescriptor_gateway_f66b6a1c7ba3b979, []int{6} } func (m *ResolveImageConfigRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -415,7 +571,7 @@ func (m *ResolveImageConfigResponse) Reset() { *m = ResolveImageConfigRe func (m *ResolveImageConfigResponse) String() string { return proto.CompactTextString(m) } func (*ResolveImageConfigResponse) ProtoMessage() {} func (*ResolveImageConfigResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{5} + return fileDescriptor_gateway_f66b6a1c7ba3b979, []int{7} } func (m *ResolveImageConfigResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -461,6 +617,7 @@ type SolveRequest struct { // for each of the ImportCacheRefs entry to CacheImports for compatibility. (planned to be removed) ImportCacheRefsDeprecated []string `protobuf:"bytes,4,rep,name=ImportCacheRefsDeprecated,proto3" json:"ImportCacheRefsDeprecated,omitempty"` AllowResultReturn bool `protobuf:"varint,5,opt,name=allowResultReturn,proto3" json:"allowResultReturn,omitempty"` + AllowResultArrayRef bool `protobuf:"varint,6,opt,name=allowResultArrayRef,proto3" json:"allowResultArrayRef,omitempty"` // apicaps.CapSolveInlineReturn deprecated Final bool `protobuf:"varint,10,opt,name=Final,proto3" json:"Final,omitempty"` ExporterAttr []byte `protobuf:"bytes,11,opt,name=ExporterAttr,proto3" json:"ExporterAttr,omitempty"` @@ -476,7 +633,7 @@ func (m *SolveRequest) Reset() { *m = SolveRequest{} } func (m *SolveRequest) String() string { return proto.CompactTextString(m) } func (*SolveRequest) ProtoMessage() {} func (*SolveRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{6} + return fileDescriptor_gateway_f66b6a1c7ba3b979, []int{8} } func (m *SolveRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -540,6 +697,13 @@ func (m *SolveRequest) GetAllowResultReturn() bool { return false } +func (m *SolveRequest) GetAllowResultArrayRef() bool { + if m != nil { + return m.AllowResultArrayRef + } + return false +} + func (m *SolveRequest) GetFinal() bool { if m != nil { return m.Final @@ -574,7 +738,7 @@ func (m *CacheOptionsEntry) Reset() { *m = CacheOptionsEntry{} } func (m *CacheOptionsEntry) String() string { return proto.CompactTextString(m) } func (*CacheOptionsEntry) ProtoMessage() {} func (*CacheOptionsEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{7} + return fileDescriptor_gateway_f66b6a1c7ba3b979, []int{9} } func (m *CacheOptionsEntry) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -631,7 +795,7 @@ func (m *SolveResponse) Reset() { *m = SolveResponse{} } func (m *SolveResponse) String() string { return proto.CompactTextString(m) } func (*SolveResponse) ProtoMessage() {} func (*SolveResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{8} + return fileDescriptor_gateway_f66b6a1c7ba3b979, []int{10} } func (m *SolveResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -687,7 +851,7 @@ func (m *ReadFileRequest) Reset() { *m = ReadFileRequest{} } func (m *ReadFileRequest) String() string { return proto.CompactTextString(m) } func (*ReadFileRequest) ProtoMessage() {} func (*ReadFileRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{9} + return fileDescriptor_gateway_f66b6a1c7ba3b979, []int{11} } func (m *ReadFileRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -749,7 +913,7 @@ func (m *FileRange) Reset() { *m = FileRange{} } func (m *FileRange) String() string { return proto.CompactTextString(m) } func (*FileRange) ProtoMessage() {} func (*FileRange) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{10} + return fileDescriptor_gateway_f66b6a1c7ba3b979, []int{12} } func (m *FileRange) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -803,7 +967,7 @@ func (m *ReadFileResponse) Reset() { *m = ReadFileResponse{} } func (m *ReadFileResponse) String() string { return proto.CompactTextString(m) } func (*ReadFileResponse) ProtoMessage() {} func (*ReadFileResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{11} + return fileDescriptor_gateway_f66b6a1c7ba3b979, []int{13} } func (m *ReadFileResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -852,7 +1016,7 @@ func (m *ReadDirRequest) Reset() { *m = ReadDirRequest{} } func (m *ReadDirRequest) String() string { return proto.CompactTextString(m) } func (*ReadDirRequest) ProtoMessage() {} func (*ReadDirRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{12} + return fileDescriptor_gateway_f66b6a1c7ba3b979, []int{14} } func (m *ReadDirRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -913,7 +1077,7 @@ func (m *ReadDirResponse) Reset() { *m = ReadDirResponse{} } func (m *ReadDirResponse) String() string { return proto.CompactTextString(m) } func (*ReadDirResponse) ProtoMessage() {} func (*ReadDirResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{13} + return fileDescriptor_gateway_f66b6a1c7ba3b979, []int{15} } func (m *ReadDirResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -961,7 +1125,7 @@ func (m *StatFileRequest) Reset() { *m = StatFileRequest{} } func (m *StatFileRequest) String() string { return proto.CompactTextString(m) } func (*StatFileRequest) ProtoMessage() {} func (*StatFileRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{14} + return fileDescriptor_gateway_f66b6a1c7ba3b979, []int{16} } func (m *StatFileRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1015,7 +1179,7 @@ func (m *StatFileResponse) Reset() { *m = StatFileResponse{} } func (m *StatFileResponse) String() string { return proto.CompactTextString(m) } func (*StatFileResponse) ProtoMessage() {} func (*StatFileResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{15} + return fileDescriptor_gateway_f66b6a1c7ba3b979, []int{17} } func (m *StatFileResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1061,7 +1225,7 @@ func (m *PingRequest) Reset() { *m = PingRequest{} } func (m *PingRequest) String() string { return proto.CompactTextString(m) } func (*PingRequest) ProtoMessage() {} func (*PingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{16} + return fileDescriptor_gateway_f66b6a1c7ba3b979, []int{18} } func (m *PingRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1103,7 +1267,7 @@ func (m *PongResponse) Reset() { *m = PongResponse{} } func (m *PongResponse) String() string { return proto.CompactTextString(m) } func (*PongResponse) ProtoMessage() {} func (*PongResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_gateway_eff078cadb286ceb, []int{17} + return fileDescriptor_gateway_f66b6a1c7ba3b979, []int{19} } func (m *PongResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1156,8 +1320,11 @@ func (m *PongResponse) GetWorkers() []*types1.WorkerRecord { func init() { proto.RegisterType((*Result)(nil), "moby.buildkit.v1.frontend.Result") proto.RegisterMapType((map[string][]byte)(nil), "moby.buildkit.v1.frontend.Result.MetadataEntry") + proto.RegisterType((*RefMapDeprecated)(nil), "moby.buildkit.v1.frontend.RefMapDeprecated") + proto.RegisterMapType((map[string]string)(nil), "moby.buildkit.v1.frontend.RefMapDeprecated.RefsEntry") + proto.RegisterType((*Ref)(nil), "moby.buildkit.v1.frontend.Ref") proto.RegisterType((*RefMap)(nil), "moby.buildkit.v1.frontend.RefMap") - proto.RegisterMapType((map[string]string)(nil), "moby.buildkit.v1.frontend.RefMap.RefsEntry") + proto.RegisterMapType((map[string]*Ref)(nil), "moby.buildkit.v1.frontend.RefMap.RefsEntry") proto.RegisterType((*ReturnRequest)(nil), "moby.buildkit.v1.frontend.ReturnRequest") proto.RegisterType((*ReturnResponse)(nil), "moby.buildkit.v1.frontend.ReturnResponse") proto.RegisterType((*ResolveImageConfigRequest)(nil), "moby.buildkit.v1.frontend.ResolveImageConfigRequest") @@ -1509,21 +1676,21 @@ func (m *Result) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func (m *Result_Ref) MarshalTo(dAtA []byte) (int, error) { +func (m *Result_RefDeprecated) MarshalTo(dAtA []byte) (int, error) { i := 0 dAtA[i] = 0xa i++ - i = encodeVarintGateway(dAtA, i, uint64(len(m.Ref))) - i += copy(dAtA[i:], m.Ref) + i = encodeVarintGateway(dAtA, i, uint64(len(m.RefDeprecated))) + i += copy(dAtA[i:], m.RefDeprecated) return i, nil } -func (m *Result_Refs) MarshalTo(dAtA []byte) (int, error) { +func (m *Result_RefsDeprecated) MarshalTo(dAtA []byte) (int, error) { i := 0 - if m.Refs != nil { + if m.RefsDeprecated != nil { dAtA[i] = 0x12 i++ - i = encodeVarintGateway(dAtA, i, uint64(m.Refs.Size())) - n2, err := m.Refs.MarshalTo(dAtA[i:]) + i = encodeVarintGateway(dAtA, i, uint64(m.RefsDeprecated.Size())) + n2, err := m.RefsDeprecated.MarshalTo(dAtA[i:]) if err != nil { return 0, err } @@ -1531,7 +1698,35 @@ func (m *Result_Refs) MarshalTo(dAtA []byte) (int, error) { } return i, nil } -func (m *RefMap) Marshal() (dAtA []byte, err error) { +func (m *Result_Ref) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.Ref != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintGateway(dAtA, i, uint64(m.Ref.Size())) + n3, err := m.Ref.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n3 + } + return i, nil +} +func (m *Result_Refs) MarshalTo(dAtA []byte) (int, error) { + i := 0 + if m.Refs != nil { + dAtA[i] = 0x22 + i++ + i = encodeVarintGateway(dAtA, i, uint64(m.Refs.Size())) + n4, err := m.Refs.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n4 + } + return i, nil +} +func (m *RefMapDeprecated) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -1541,7 +1736,7 @@ func (m *RefMap) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *RefMap) MarshalTo(dAtA []byte) (int, error) { +func (m *RefMapDeprecated) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int @@ -1569,6 +1764,91 @@ func (m *RefMap) MarshalTo(dAtA []byte) (int, error) { return i, nil } +func (m *Ref) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Ref) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Ids) > 0 { + for _, s := range m.Ids { + dAtA[i] = 0xa + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) + } + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *RefMap) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RefMap) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Refs) > 0 { + for k, _ := range m.Refs { + dAtA[i] = 0xa + i++ + v := m.Refs[k] + msgSize := 0 + if v != nil { + msgSize = v.Size() + msgSize += 1 + sovGateway(uint64(msgSize)) + } + mapSize := 1 + len(k) + sovGateway(uint64(len(k))) + msgSize + i = encodeVarintGateway(dAtA, i, uint64(mapSize)) + dAtA[i] = 0xa + i++ + i = encodeVarintGateway(dAtA, i, uint64(len(k))) + i += copy(dAtA[i:], k) + if v != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintGateway(dAtA, i, uint64(v.Size())) + n5, err := v.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n5 + } + } + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + func (m *ReturnRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1588,21 +1868,21 @@ func (m *ReturnRequest) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGateway(dAtA, i, uint64(m.Result.Size())) - n3, err := m.Result.MarshalTo(dAtA[i:]) + n6, err := m.Result.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n3 + i += n6 } if m.Error != nil { dAtA[i] = 0x12 i++ i = encodeVarintGateway(dAtA, i, uint64(m.Error.Size())) - n4, err := m.Error.MarshalTo(dAtA[i:]) + n7, err := m.Error.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n4 + i += n7 } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) @@ -1656,11 +1936,11 @@ func (m *ResolveImageConfigRequest) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGateway(dAtA, i, uint64(m.Platform.Size())) - n5, err := m.Platform.MarshalTo(dAtA[i:]) + n8, err := m.Platform.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n5 + i += n8 } if len(m.ResolveMode) > 0 { dAtA[i] = 0x1a @@ -1732,11 +2012,11 @@ func (m *SolveRequest) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGateway(dAtA, i, uint64(m.Definition.Size())) - n6, err := m.Definition.MarshalTo(dAtA[i:]) + n9, err := m.Definition.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n6 + i += n9 } if len(m.Frontend) > 0 { dAtA[i] = 0x12 @@ -1786,6 +2066,16 @@ func (m *SolveRequest) MarshalTo(dAtA []byte) (int, error) { } i++ } + if m.AllowResultArrayRef { + dAtA[i] = 0x30 + i++ + if m.AllowResultArrayRef { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + } if m.Final { dAtA[i] = 0x50 i++ @@ -1889,11 +2179,11 @@ func (m *SolveResponse) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintGateway(dAtA, i, uint64(m.Result.Size())) - n7, err := m.Result.MarshalTo(dAtA[i:]) + n10, err := m.Result.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n7 + i += n10 } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) @@ -1932,11 +2222,11 @@ func (m *ReadFileRequest) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintGateway(dAtA, i, uint64(m.Range.Size())) - n8, err := m.Range.MarshalTo(dAtA[i:]) + n11, err := m.Range.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n8 + i += n11 } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) @@ -2126,11 +2416,11 @@ func (m *StatFileResponse) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGateway(dAtA, i, uint64(m.Stat.Size())) - n9, err := m.Stat.MarshalTo(dAtA[i:]) + n12, err := m.Stat.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n9 + i += n12 } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) @@ -2252,14 +2542,38 @@ func (m *Result) Size() (n int) { return n } +func (m *Result_RefDeprecated) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RefDeprecated) + n += 1 + l + sovGateway(uint64(l)) + return n +} +func (m *Result_RefsDeprecated) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RefsDeprecated != nil { + l = m.RefsDeprecated.Size() + n += 1 + l + sovGateway(uint64(l)) + } + return n +} func (m *Result_Ref) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Ref) - n += 1 + l + sovGateway(uint64(l)) + if m.Ref != nil { + l = m.Ref.Size() + n += 1 + l + sovGateway(uint64(l)) + } return n } func (m *Result_Refs) Size() (n int) { @@ -2274,7 +2588,7 @@ func (m *Result_Refs) Size() (n int) { } return n } -func (m *RefMap) Size() (n int) { +func (m *RefMapDeprecated) Size() (n int) { if m == nil { return 0 } @@ -2294,6 +2608,49 @@ func (m *RefMap) Size() (n int) { return n } +func (m *Ref) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Ids) > 0 { + for _, s := range m.Ids { + l = len(s) + n += 1 + l + sovGateway(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RefMap) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Refs) > 0 { + for k, v := range m.Refs { + _ = k + _ = v + l = 0 + if v != nil { + l = v.Size() + l += 1 + sovGateway(uint64(l)) + } + mapEntrySize := 1 + len(k) + sovGateway(uint64(len(k))) + l + n += mapEntrySize + 1 + sovGateway(uint64(mapEntrySize)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + func (m *ReturnRequest) Size() (n int) { if m == nil { return 0 @@ -2405,6 +2762,9 @@ func (m *SolveRequest) Size() (n int) { if m.AllowResultReturn { n += 2 } + if m.AllowResultArrayRef { + n += 2 + } if m.Final { n += 2 } @@ -2690,7 +3050,7 @@ func (m *Result) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ref", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RefDeprecated", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2715,9 +3075,73 @@ func (m *Result) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Result = &Result_Ref{string(dAtA[iNdEx:postIndex])} + m.Result = &Result_RefDeprecated{string(dAtA[iNdEx:postIndex])} iNdEx = postIndex case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RefsDeprecated", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGateway + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &RefMapDeprecated{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Result = &Result_RefsDeprecated{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ref", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGateway + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Ref{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Result = &Result_Ref{v} + iNdEx = postIndex + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Refs", wireType) } @@ -2890,7 +3314,7 @@ func (m *Result) Unmarshal(dAtA []byte) error { } return nil } -func (m *RefMap) Unmarshal(dAtA []byte) error { +func (m *RefMapDeprecated) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2913,10 +3337,10 @@ func (m *RefMap) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RefMap: wiretype end group for non-group") + return fmt.Errorf("proto: RefMapDeprecated: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RefMap: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RefMapDeprecated: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3059,6 +3483,260 @@ func (m *RefMap) Unmarshal(dAtA []byte) error { } return nil } +func (m *Ref) 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 ErrIntOverflowGateway + } + 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: Ref: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Ref: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ids", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + 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 ErrInvalidLengthGateway + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ids = append(m.Ids, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGateway(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGateway + } + 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 *RefMap) 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 ErrIntOverflowGateway + } + 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: RefMap: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RefMap: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Refs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGateway + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Refs == nil { + m.Refs = make(map[string]*Ref) + } + var mapkey string + var mapvalue *Ref + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGateway + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGateway + } + postmsgIndex := iNdEx + mapmsglen + if mapmsglen < 0 { + return ErrInvalidLengthGateway + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &Ref{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGateway(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGateway + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Refs[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGateway(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGateway + } + 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 *ReturnRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3767,6 +4445,26 @@ func (m *SolveRequest) Unmarshal(dAtA []byte) error { } } m.AllowResultReturn = bool(v != 0) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowResultArrayRef", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.AllowResultArrayRef = bool(v != 0) case 10: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Final", wireType) @@ -5208,85 +5906,91 @@ var ( ErrIntOverflowGateway = fmt.Errorf("proto: integer overflow") ) -func init() { proto.RegisterFile("gateway.proto", fileDescriptor_gateway_eff078cadb286ceb) } +func init() { proto.RegisterFile("gateway.proto", fileDescriptor_gateway_f66b6a1c7ba3b979) } -var fileDescriptor_gateway_eff078cadb286ceb = []byte{ - // 1224 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0xcd, 0x6e, 0xdb, 0xc6, - 0x13, 0x0f, 0x23, 0xc9, 0xb6, 0xc6, 0x72, 0xa2, 0x2c, 0xfe, 0xf8, 0x83, 0xe1, 0x21, 0x51, 0x89, - 0xc2, 0x55, 0x12, 0x87, 0x44, 0x9d, 0x16, 0x4e, 0x93, 0x22, 0x69, 0x14, 0x27, 0x88, 0x5b, 0xbb, - 0x11, 0x36, 0x05, 0x02, 0x04, 0x2d, 0xd0, 0x95, 0xb8, 0x62, 0x16, 0xa1, 0xb8, 0xec, 0x72, 0x15, - 0xd7, 0xe8, 0xa5, 0xed, 0x2b, 0xf4, 0x45, 0xfa, 0x18, 0xb9, 0xb5, 0xe7, 0x1e, 0x82, 0xc2, 0xb7, - 0x5e, 0xfa, 0x0c, 0xc5, 0x7e, 0x50, 0xa2, 0x3f, 0x44, 0x5b, 0x27, 0xee, 0x2c, 0xe7, 0x37, 0xf3, - 0x9b, 0xd9, 0x99, 0xd9, 0x85, 0xb5, 0x98, 0x48, 0xba, 0x4f, 0x0e, 0x82, 0x4c, 0x70, 0xc9, 0xd1, - 0xd5, 0x31, 0x1f, 0x1c, 0x04, 0x83, 0x09, 0x4b, 0xa2, 0x37, 0x4c, 0x06, 0x6f, 0x3f, 0x0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6, 0x53, 0x84, 0x3e, 0x0d, 0x00, 0x00, +var fileDescriptor_gateway_f66b6a1c7ba3b979 = []byte{ + // 1321 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x57, 0x5f, 0x6f, 0x1b, 0x45, + 0x10, 0xcf, 0xc5, 0xce, 0x1f, 0x4f, 0x9c, 0xd4, 0x5d, 0x10, 0xb8, 0xf7, 0x90, 0x86, 0x13, 0x0a, + 0x6e, 0x9b, 0xde, 0x41, 0xda, 0x2a, 0xa5, 0x45, 0x2d, 0x75, 0xd3, 0x2a, 0x81, 0x84, 0x5a, 0x5b, + 0x50, 0xa5, 0x0a, 0x24, 0xce, 0xbe, 0xbd, 0xeb, 0xaa, 0xe7, 0xdb, 0x63, 0x6f, 0xdd, 0x62, 0xf1, + 0x02, 0x6f, 0xbc, 0x23, 0xf1, 0x8c, 0xf8, 0x04, 0x7c, 0x8c, 0xbe, 0xc1, 0x33, 0x0f, 0x15, 0xca, + 0x27, 0x41, 0xfb, 0xe7, 0xe2, 0xb3, 0x93, 0x9c, 0xe3, 0x27, 0xef, 0xce, 0xcd, 0x6f, 0xe6, 0x37, + 0xb3, 0x33, 0xb3, 0x6b, 0x58, 0x8d, 0x7c, 0x41, 0x5e, 0xfb, 0x43, 0x37, 0xe5, 0x4c, 0x30, 0x74, + 0xa9, 0xcf, 0xba, 0x43, 0xb7, 0x3b, 0xa0, 0x71, 0xf0, 0x92, 0x0a, 0xf7, 0xd5, 0x27, 0x6e, 0xc8, + 0x59, 0x22, 0x48, 0x12, 0xd8, 0xd7, 0x23, 0x2a, 0x5e, 0x0c, 0xba, 0x6e, 0x8f, 0xf5, 0xbd, 0x88, + 0x45, 0xcc, 0x53, 0x88, 0xee, 0x20, 0x54, 0x3b, 0xb5, 0x51, 0x2b, 0x6d, 0xc9, 0xde, 0x9e, 0x54, + 0x8f, 0x18, 0x8b, 0x62, 0xe2, 0x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db, 0x6b, + 0x34, 0x88, 0x2a, 0x33, 0x0e, 0x22, 0xe7, 0x27, 0xb8, 0x80, 0x89, 0x1f, 0x3c, 0xa6, 0x31, 0x39, + 0x7b, 0x82, 0xc8, 0xbe, 0xa0, 0x31, 0xe9, 0xf8, 0xe2, 0xc5, 0x71, 0x5f, 0x98, 0x3d, 0xba, 0x03, + 0x0b, 0xd8, 0x4f, 0x22, 0x62, 0x5c, 0x7f, 0x58, 0xe2, 0x5a, 0x39, 0x91, 0xba, 0x58, 0x43, 0x9c, + 0xbb, 0x50, 0x3b, 0x96, 0xc9, 0xae, 0x7e, 0x12, 0x86, 0x19, 0xd1, 0x13, 0xa2, 0x82, 0xcd, 0x4e, + 0xca, 0x0f, 0x48, 0x12, 0x19, 0xd7, 0x15, 0x6c, 0x76, 0xce, 0xa6, 0xbc, 0xe4, 0x72, 0xe6, 0x26, + 0x35, 0x08, 0xaa, 0xbb, 0xf2, 0x26, 0xb6, 0x54, 0x31, 0xaa, 0xb5, 0x13, 0xc8, 0x01, 0xea, 0x07, + 0xbb, 0x94, 0x9f, 0x1d, 0x60, 0x13, 0x96, 0x76, 0x29, 0x2f, 0xc4, 0x97, 0x6f, 0xd1, 0x26, 0xac, + 0xed, 0x27, 0xbd, 0x78, 0x10, 0xc8, 0x68, 0x05, 0xe1, 0x89, 0x99, 0x8a, 0x13, 0x52, 0xe7, 0xbe, + 0xce, 0xa3, 0xf2, 0x62, 0xc8, 0x6c, 0xc1, 0x12, 0x49, 0x04, 0xa7, 0x24, 0xbf, 0xcc, 0x90, 0xab, + 0x1f, 0x4f, 0xae, 0x7a, 0x3c, 0xa9, 0x39, 0x8f, 0x73, 0x15, 0x67, 0x07, 0x2e, 0x48, 0x41, 0xf9, + 0x41, 0x20, 0xa8, 0x16, 0x48, 0xaa, 0xb5, 0x73, 0x07, 0x1a, 0x23, 0xa0, 0x71, 0xbd, 0x09, 0x55, + 0xf9, 0x34, 0x33, 0x23, 0xef, 0x34, 0xbf, 0xea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0x09, 0xa8, 0xd0, 0x2e, + 0x76, 0xd9, 0x71, 0x8d, 0xb5, 0xd1, 0x77, 0xf2, 0x75, 0xab, 0x6e, 0xdf, 0x56, 0x69, 0xcc, 0x85, + 0xc7, 0xa5, 0x7d, 0xe5, 0x1c, 0x9a, 0xda, 0x7c, 0xbb, 0xfe, 0xe6, 0x68, 0xdd, 0xfa, 0xe7, 0x68, + 0xdd, 0xfa, 0xef, 0x68, 0xdd, 0xea, 0x2e, 0xaa, 0xff, 0x63, 0x37, 0xfe, 0x0f, 0x00, 0x00, 0xff, + 0xff, 0xbd, 0xb4, 0x1b, 0xf0, 0xe1, 0x0e, 0x00, 0x00, } diff --git a/frontend/gateway/pb/gateway.proto b/frontend/gateway/pb/gateway.proto index aed5634e..0a395152 100644 --- a/frontend/gateway/pb/gateway.proto +++ b/frontend/gateway/pb/gateway.proto @@ -30,16 +30,28 @@ service LLBBridge { message Result { oneof result { - string ref = 1; - RefMap refs = 2; + // Deprecated non-array refs. + string refDeprecated = 1; + RefMapDeprecated refsDeprecated = 2; + + Ref ref = 3; + RefMap refs = 4; } map metadata = 10; } -message RefMap { +message RefMapDeprecated { map refs = 1; } +message Ref { + repeated string ids = 1; +} + +message RefMap { + map refs = 1; +} + message ReturnRequest { Result result = 1; google.rpc.Status error = 2; @@ -70,6 +82,7 @@ message SolveRequest { // for each of the ImportCacheRefs entry to CacheImports for compatibility. (planned to be removed) repeated string ImportCacheRefsDeprecated = 4; bool allowResultReturn = 5; + bool allowResultArrayRef = 6; // apicaps.CapSolveInlineReturn deprecated bool Final = 10; From 7562a6638ac7552170c275c4d6dcfa1946df496c Mon Sep 17 00:00:00 2001 From: Edgar Lee Date: Thu, 5 Dec 2019 11:08:12 -0800 Subject: [PATCH 2/3] Fix empty string id in result ref Signed-off-by: Edgar Lee --- frontend/gateway/gateway.go | 4 ++-- frontend/gateway/grpcclient/client.go | 4 ++-- frontend/gateway/pb/ref.go | 9 +++++++++ 3 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 frontend/gateway/pb/ref.go diff --git a/frontend/gateway/gateway.go b/frontend/gateway/gateway.go index 3727b98e..392ee261 100644 --- a/frontend/gateway/gateway.go +++ b/frontend/gateway/gateway.go @@ -479,7 +479,7 @@ func (lbf *llbBridgeForwarder) Solve(ctx context.Context, req *pb.SolveRequest) if req.AllowResultArrayRef { refMap := make(map[string]*pb.Ref, len(res.Refs)) for k, id := range ids { - refMap[k] = &pb.Ref{Ids: []string{id}} + refMap[k] = pb.NewRef(id) } pbRes.Result = &pb.Result_Refs{Refs: &pb.RefMap{Refs: refMap}} } else { @@ -495,7 +495,7 @@ func (lbf *llbBridgeForwarder) Solve(ctx context.Context, req *pb.SolveRequest) defaultID = id if req.AllowResultArrayRef { - pbRes.Result = &pb.Result_Ref{Ref: &pb.Ref{Ids: []string{id}}} + pbRes.Result = &pb.Result_Ref{Ref: pb.NewRef(id)} } else { pbRes.Result = &pb.Result_RefDeprecated{RefDeprecated: id} } diff --git a/frontend/gateway/grpcclient/client.go b/frontend/gateway/grpcclient/client.go index ae1eaab5..b7dba2b7 100644 --- a/frontend/gateway/grpcclient/client.go +++ b/frontend/gateway/grpcclient/client.go @@ -112,7 +112,7 @@ func (c *grpcClient) Run(ctx context.Context, f client.BuildFunc) (retError erro retError = err continue } - m[k] = &pb.Ref{Ids: []string{id}} + m[k] = pb.NewRef(id) } pbRes.Result = &pb.Result_Refs{Refs: &pb.RefMap{Refs: m}} } else { @@ -120,7 +120,7 @@ func (c *grpcClient) Run(ctx context.Context, f client.BuildFunc) (retError erro if err != nil { retError = err } else { - pbRes.Result = &pb.Result_Ref{Ref: &pb.Ref{Ids: []string{id}}} + pbRes.Result = &pb.Result_Ref{Ref: pb.NewRef(id)} } } if retError == nil { diff --git a/frontend/gateway/pb/ref.go b/frontend/gateway/pb/ref.go new file mode 100644 index 00000000..882fae57 --- /dev/null +++ b/frontend/gateway/pb/ref.go @@ -0,0 +1,9 @@ +package moby_buildkit_v1_frontend + +func NewRef(id string) *Ref { + var ref Ref + if id != "" { + ref.Ids = append(ref.Ids, id) + } + return &ref +} From 359574093ba7a2da722c413044808547e1ffa11e Mon Sep 17 00:00:00 2001 From: Edgar Lee Date: Mon, 16 Dec 2019 14:12:30 -0800 Subject: [PATCH 3/3] Add erroring on multi-result arrays Signed-off-by: Edgar Lee --- frontend/gateway/gateway.go | 4 ++++ frontend/gateway/grpcclient/client.go | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/frontend/gateway/gateway.go b/frontend/gateway/gateway.go index 392ee261..5587f45e 100644 --- a/frontend/gateway/gateway.go +++ b/frontend/gateway/gateway.go @@ -701,6 +701,10 @@ func (lbf *llbBridgeForwarder) convertRef(ids []string) (solver.CachedResult, er return nil, nil } + if len(ids) > 1 { + return nil, errors.Errorf("return reference has multi-result array") + } + lbf.mu.Lock() defer lbf.mu.Unlock() diff --git a/frontend/gateway/grpcclient/client.go b/frontend/gateway/grpcclient/client.go index b7dba2b7..7f06f75d 100644 --- a/frontend/gateway/grpcclient/client.go +++ b/frontend/gateway/grpcclient/client.go @@ -324,13 +324,20 @@ func (c *grpcClient) Solve(ctx context.Context, creq client.SolveRequest) (*clie res.AddRef(k, ref) } case *pb.Result_Ref: - if ids := pbRes.Ref.Ids; len(ids) > 0 { + ids := pbRes.Ref.Ids + if len(ids) > 0 { + if len(ids) > 1 { + return nil, errors.Errorf("solve returned multi-result array") + } res.SetRef(&reference{id: ids[0], c: c}) } case *pb.Result_Refs: for k, v := range pbRes.Refs.Refs { var ref *reference if len(v.Ids) > 0 { + if len(v.Ids) > 1 { + return nil, errors.Errorf("solve returned multi-result array") + } ref = &reference{id: v.Ids[0], c: c} } res.AddRef(k, ref)