diff --git a/.github/workflows/breakage.yaml b/.github/workflows/breakage.yaml index a6fbb267..09167f82 100644 --- a/.github/workflows/breakage.yaml +++ b/.github/workflows/breakage.yaml @@ -11,6 +11,8 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Fetch main branch + run: git fetch origin main:main - name: Setup env uses: HatsuneMiku3939/direnv-action@v1 - run: | diff --git a/go/provider/v1/service.pb.go b/go/provider/v1/service.pb.go index c1251c63..ba81b2c5 100644 --- a/go/provider/v1/service.pb.go +++ b/go/provider/v1/service.pb.go @@ -30,26 +30,27 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package func init() { proto.RegisterFile("akash/provider/v1/service.proto", fileDescriptor_518d1307e7e58072) } var fileDescriptor_518d1307e7e58072 = []byte{ - // 294 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xcc, 0x4e, 0x2c, - 0xce, 0xd0, 0x2f, 0x28, 0xca, 0x2f, 0xcb, 0x4c, 0x49, 0x2d, 0xd2, 0x2f, 0x33, 0xd4, 0x2f, 0x4e, - 0x2d, 0x2a, 0xcb, 0x4c, 0x4e, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x04, 0x2b, 0xd0, - 0x83, 0x29, 0xd0, 0x2b, 0x33, 0x94, 0x92, 0x4e, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x07, 0x2b, - 0x48, 0x2a, 0x4d, 0xd3, 0x4f, 0xcd, 0x2d, 0x28, 0xa9, 0x84, 0xa8, 0x97, 0x92, 0x81, 0x4a, 0x26, - 0x16, 0x64, 0xea, 0x27, 0xe6, 0xe5, 0xe5, 0x97, 0x24, 0x96, 0x64, 0xe6, 0xe7, 0x15, 0x43, 0x65, - 0xe5, 0xb0, 0x58, 0x57, 0x92, 0x58, 0x52, 0x0a, 0x93, 0x57, 0xc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, 0xfe, 0x01, 0x00, 0x00, + // 315 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0xd0, 0xb1, 0x4a, 0x03, 0x31, + 0x18, 0x07, 0xf0, 0xa6, 0x83, 0xe0, 0x59, 0x90, 0x06, 0x14, 0x7a, 0x4a, 0x0a, 0x37, 0x28, 0x14, + 0x4c, 0xac, 0x3a, 0x39, 0xb6, 0x88, 0x6b, 0x69, 0x71, 0x71, 0xcb, 0xf5, 0x3e, 0xcf, 0xd0, 0xf6, + 0x12, 0x93, 0x34, 0xe0, 0x26, 0x3e, 0x81, 0xe0, 0x6b, 0xf8, 0x20, 0x8e, 0x05, 0x17, 0x47, 0x69, + 0x7d, 0x10, 0x69, 0xee, 0x0e, 0x0b, 0x2d, 0x08, 0xce, 0xff, 0x5f, 0xbe, 0xef, 0xff, 0x25, 0x68, + 0xf2, 0x11, 0x37, 0xf7, 0x4c, 0x69, 0xe9, 0x44, 0x02, 0x9a, 0xb9, 0x36, 0x33, 0xa0, 0x9d, 0x18, + 0x02, 0x55, 0x5a, 0x5a, 0x89, 0xeb, 0x1e, 0xd0, 0x12, 0x50, 0xd7, 0x0e, 0x0f, 0x52, 0x29, 0xd3, + 0x31, 0x30, 0x0f, 0xe2, 0xe9, 0x1d, 0x83, 0x89, 0xb2, 0x8f, 0xb9, 0x0f, 0x0f, 0x8b, 0x90, 0x2b, + 0xc1, 0x78, 0x96, 0x49, 0xcb, 0xad, 0x90, 0x99, 0x29, 0x52, 0xb2, 0x61, 0x9d, 0xe5, 0x76, 0x5a, + 0xe6, 0xd1, 0x7a, 0xee, 0xf8, 0x58, 0x24, 0x7e, 0x48, 0x6e, 0xce, 0xde, 0xaa, 0xc1, 0x4e, 0xaf, + 0x00, 0xfd, 0x5e, 0x17, 0xdf, 0x04, 0xdb, 0xd7, 0x60, 0x07, 0x7e, 0x0c, 0xde, 0xa7, 0xf9, 0x7e, + 0x5a, 0x96, 0xa3, 0x57, 0xcb, 0x72, 0x61, 0x83, 0xae, 0xdd, 0x41, 0xf3, 0x27, 0xd1, 0xde, 0xf3, + 0xc7, 0xf7, 0x6b, 0x75, 0x37, 0x46, 0x2d, 0x1c, 0xfc, 0x16, 0xc2, 0xdd, 0xa0, 0x36, 0xb0, 0x1a, + 0xf8, 0xe4, 0xdf, 0x93, 0x4f, 0x11, 0x7e, 0x42, 0x41, 0xad, 0x23, 0x92, 0xc1, 0x50, 0x03, 0x64, + 0x22, 0x4b, 0xf1, 0xd1, 0x06, 0xbd, 0x0a, 0xfa, 0xf0, 0x30, 0x05, 0x63, 0xc3, 0xe3, 0x3f, 0x9d, + 0x51, 0x32, 0x33, 0x10, 0x35, 0x7d, 0xfb, 0xc6, 0x25, 0x6a, 0xc5, 0xa8, 0x15, 0xd5, 0x97, 0x07, + 0xc4, 0x22, 0x39, 0x31, 0x25, 0xec, 0x5c, 0xbc, 0xcf, 0x09, 0x9a, 0xcd, 0x09, 0xfa, 0x9a, 0x13, + 0xf4, 0xb2, 0x20, 0x95, 0xd9, 0x82, 0x54, 0x3e, 0x17, 0xa4, 0x72, 0x1b, 0xaa, 0x51, 0x4a, 0xf9, + 0xc8, 0xd2, 0x04, 0x1c, 0x4b, 0xe5, 0xea, 0xaf, 0xc7, 0x5b, 0xfe, 0xca, 0xf3, 0x9f, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x49, 0x49, 0x4e, 0x98, 0x20, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/go/provider/v1/service.pb.gw.go b/go/provider/v1/service.pb.gw.go index 90914aa5..c79ae8d4 100644 --- a/go/provider/v1/service.pb.gw.go +++ b/go/provider/v1/service.pb.gw.go @@ -52,6 +52,40 @@ func local_request_ProviderRPC_GetStatus_0(ctx context.Context, marshaler runtim } +func request_ProviderRPC_BidScreening_0(ctx context.Context, marshaler runtime.Marshaler, client ProviderRPCClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq BidScreeningRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.BidScreening(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ProviderRPC_BidScreening_0(ctx context.Context, marshaler runtime.Marshaler, server ProviderRPCServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq BidScreeningRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.BidScreening(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterProviderRPCHandlerServer registers the http handlers for service ProviderRPC to "mux". // UnaryRPC :call ProviderRPCServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -81,6 +115,29 @@ func RegisterProviderRPCHandlerServer(ctx context.Context, mux *runtime.ServeMux }) + mux.Handle("POST", pattern_ProviderRPC_BidScreening_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ProviderRPC_BidScreening_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ProviderRPC_BidScreening_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -142,13 +199,37 @@ func RegisterProviderRPCHandlerClient(ctx context.Context, mux *runtime.ServeMux }) + mux.Handle("POST", pattern_ProviderRPC_BidScreening_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ProviderRPC_BidScreening_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ProviderRPC_BidScreening_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } var ( pattern_ProviderRPC_GetStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "status"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_ProviderRPC_BidScreening_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "bid-screening"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( forward_ProviderRPC_GetStatus_0 = runtime.ForwardResponseMessage + + forward_ProviderRPC_BidScreening_0 = runtime.ForwardResponseMessage ) diff --git a/go/provider/v1/validation.pb.go b/go/provider/v1/validation.pb.go index 73665078..4ca46ba7 100644 --- a/go/provider/v1/validation.pb.go +++ b/go/provider/v1/validation.pb.go @@ -89,8 +89,8 @@ type BidScreeningResponse struct { Passed bool `protobuf:"varint,1,opt,name=passed,proto3" json:"passed" yaml:"passed"` // Reasons contains explanations when screening fails. Reasons []string `protobuf:"bytes,2,rep,name=reasons,proto3" json:"reasons,omitempty" yaml:"reasons,omitempty"` - // ResourceOffer is the provider's resource offer for the screened group, if passed. - ResourceOffer *v1beta5.ResourceOffer `protobuf:"bytes,3,opt,name=resource_offer,json=resourceOffer,proto3" json:"resource_offer,omitempty" yaml:"resource_offer,omitempty"` + // ResourceOffers contains the provider's resource offers for the screened group, one per service in the GroupSpec. + ResourceOffers []*v1beta5.ResourceOffer `protobuf:"bytes,3,rep,name=resource_offers,json=resourceOffers,proto3" json:"resource_offers,omitempty" yaml:"resource_offers,omitempty"` // Price is the minimum bid price for the screened group. Price *types.DecCoin `protobuf:"bytes,4,opt,name=price,proto3" json:"price,omitempty" yaml:"price,omitempty"` } @@ -142,9 +142,9 @@ func (m *BidScreeningResponse) GetReasons() []string { return nil } -func (m *BidScreeningResponse) GetResourceOffer() *v1beta5.ResourceOffer { +func (m *BidScreeningResponse) GetResourceOffers() []*v1beta5.ResourceOffer { if m != nil { - return m.ResourceOffer + return m.ResourceOffers } return nil } @@ -166,40 +166,41 @@ func init() { } var fileDescriptor_186392e80df5133b = []byte{ - // 527 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x93, 0x4d, 0x6f, 0xd3, 0x30, - 0x1c, 0xc6, 0x17, 0xc6, 0x3a, 0x1a, 0x54, 0xa0, 0x61, 0x42, 0x51, 0x85, 0xe2, 0x11, 0x84, 0x54, - 0x24, 0xe4, 0x50, 0xd8, 0x2e, 0x13, 0x08, 0x29, 0x20, 0x71, 0x64, 0xca, 0x10, 0x07, 0x2e, 0x93, - 0x9b, 0xfc, 0x97, 0x45, 0x6d, 0x62, 0x63, 0xa7, 0x91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0x73, 0x8f, 0xf1, 0x24, 0x04, 0xfb, 0x76, 0x53, 0xec, - 0x31, 0x56, 0xcf, 0x14, 0xd7, 0xcf, 0x54, 0xf7, 0x9a, 0xe0, 0x0f, 0x10, 0xbe, 0xa7, 0x49, 0xe6, - 0x9f, 0xe8, 0x46, 0x7b, 0xa7, 0xf5, 0x94, 0x4a, 0xa2, 0xfb, 0xcd, 0xdc, 0x4e, 0x81, 0x47, 0xfa, - 0x88, 0xbb, 0x86, 0x1b, 0xa8, 0x65, 0xfc, 0xa3, 0xab, 0xd2, 0x31, 0xae, 0x4b, 0xc7, 0xf8, 0x53, - 0x3a, 0xc6, 0xf7, 0x95, 0xb3, 0x73, 0xbd, 0x72, 0x76, 0x7e, 0xaf, 0x9c, 0x9d, 0xaf, 0x23, 0x36, - 0x8b, 0x31, 0x99, 0xe5, 0x38, 0x82, 0xc2, 0x8b, 0xe9, 0xf6, 0x6f, 0x37, 0xed, 0x35, 0xcf, 0xf9, - 0xf5, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfe, 0x39, 0xe5, 0xd5, 0x92, 0x03, 0x00, 0x00, + // 532 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x93, 0xc1, 0x8a, 0xd3, 0x40, + 0x18, 0xc7, 0x1b, 0xeb, 0x76, 0x6d, 0xc4, 0x5d, 0x1b, 0x17, 0xa9, 0x45, 0x32, 0x35, 0x22, 0x54, + 0x90, 0x89, 0xd5, 0xdd, 0xcb, 0xa2, 0x08, 0x51, 0xf0, 0xe8, 0x92, 0x05, 0x05, 0x2f, 0xcb, 0x34, + 0xf9, 0x36, 0x1b, 0xda, 0x64, 0xc6, 0x99, 0x34, 0xd0, 0xb7, 0xf0, 0x25, 0x7c, 0x14, 0x61, 0x0f, + 0x1e, 0xf6, 0xe8, 0x69, 0x90, 0xf4, 0xd6, 0x63, 0x9f, 0x40, 0x92, 0x99, 0x6c, 0x1b, 0x65, 0x6f, + 0x99, 0xef, 0xff, 0x9b, 0xff, 0xfc, 0x67, 0xbe, 0x2f, 0xa6, 0x43, 0xa6, 0x44, 0x5c, 0xb8, 0x8c, + 0xd3, 0x3c, 0x0e, 0x81, 0xbb, 0xf9, 0xd8, 0xcd, 0xc9, 0x2c, 0x0e, 0x49, 0x16, 0xd3, 0x14, 0x33, + 0x4e, 0x33, 0x6a, 0xf5, 0x2a, 0x06, 0xd7, 0x0c, 0xce, 0xc7, 0x83, 0x83, 0x88, 0x46, 0xb4, 0x52, + 0xdd, 0xf2, 0x4b, 0x81, 0x03, 0x3b, 0xa0, 0x22, 0xa1, 0xc2, 0x9d, 0x10, 0x01, 0x6e, 0x3e, 0x9e, + 0x40, 0x46, 0xc6, 0x6e, 0x40, 0x63, 0x6d, 0x34, 0x18, 0xa9, 0xc3, 0x42, 0x60, 0x33, 0xba, 0x48, + 0x20, 0xcd, 0x34, 0x74, 0xe8, 0x46, 0x9c, 0xce, 0x99, 0x60, 0x10, 0x68, 0xf2, 0xb9, 0x22, 0x13, + 0xc2, 0xa7, 0x50, 0x53, 0x47, 0x2e, 0x07, 0x41, 0xe7, 0x3c, 0x00, 0x41, 0xcf, 0xcf, 0x81, 0x2b, + 0xd4, 0xf9, 0x65, 0x98, 0x0f, 0xbc, 0x38, 0x3c, 0x0d, 0x38, 0x40, 0x1a, 0xa7, 0x91, 0x0f, 0xdf, + 0xe6, 0x20, 0x32, 0x2b, 0x33, 0xcd, 0xca, 0xf5, 0xac, 0xb4, 0xed, 0x1b, 0x43, 0x63, 0x74, 0xf7, + 0xd5, 0x53, 0xac, 0xae, 0xb2, 0x49, 0x80, 0x75, 0x02, 0xfc, 0xb1, 0x64, 0x4f, 0x19, 0x04, 0xde, + 0xcb, 0x42, 0xa2, 0xee, 0xf5, 0x72, 0x25, 0xd1, 0x96, 0xcf, 0x5a, 0xa2, 0xde, 0x82, 0x24, 0xb3, + 0x63, 0x67, 0x53, 0x73,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5, 0xac, 0xea, 0x6c, 0x63, 0xfc, + 0x01, 0x82, 0xf7, 0x34, 0x4e, 0xbd, 0x63, 0x9d, 0x6a, 0xe7, 0xa4, 0xdc, 0xb2, 0x92, 0x68, 0xbf, + 0xda, 0xdb, 0x88, 0xf0, 0x50, 0xbf, 0x73, 0x53, 0x70, 0x7c, 0x75, 0x8c, 0x77, 0x78, 0x59, 0xd8, + 0xc6, 0x55, 0x61, 0x1b, 0x7f, 0x0a, 0xdb, 0xf8, 0xbe, 0xb4, 0x5b, 0x57, 0x4b, 0xbb, 0xf5, 0x7b, + 0x69, 0xb7, 0xbe, 0x0e, 0xd8, 0x34, 0xc2, 0x64, 0x9a, 0xe1, 0x10, 0x72, 0x37, 0xa2, 0xdb, 0xff, + 0xde, 0xa4, 0x53, 0xcd, 0xf4, 0xeb, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x2e, 0x9c, 0xcb, 0x2d, + 0x97, 0x03, 0x00, 0x00, } func (m *BidScreeningRequest) Marshal() (dAtA []byte, err error) { @@ -278,17 +279,19 @@ func (m *BidScreeningResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x22 } - if m.ResourceOffer != nil { - { - size, err := m.ResourceOffer.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.ResourceOffers) > 0 { + for iNdEx := len(m.ResourceOffers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ResourceOffers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintValidation(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintValidation(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a } - i-- - dAtA[i] = 0x1a } if len(m.Reasons) > 0 { for iNdEx := len(m.Reasons) - 1; iNdEx >= 0; iNdEx-- { @@ -357,9 +360,11 @@ func (m *BidScreeningResponse) Size() (n int) { n += 1 + l + sovValidation(uint64(l)) } } - if m.ResourceOffer != nil { - l = m.ResourceOffer.Size() - n += 1 + l + sovValidation(uint64(l)) + if len(m.ResourceOffers) > 0 { + for _, e := range m.ResourceOffers { + l = e.Size() + n += 1 + l + sovValidation(uint64(l)) + } } if m.Price != nil { l = m.Price.Size() @@ -575,7 +580,7 @@ func (m *BidScreeningResponse) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResourceOffer", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ResourceOffers", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -602,10 +607,8 @@ func (m *BidScreeningResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ResourceOffer == nil { - m.ResourceOffer = &v1beta5.ResourceOffer{} - } - if err := m.ResourceOffer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.ResourceOffers = append(m.ResourceOffers, &v1beta5.ResourceOffer{}) + if err := m.ResourceOffers[len(m.ResourceOffers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/make/lint.mk b/make/lint.mk index 0f03259d..8b8c6fdc 100644 --- a/make/lint.mk +++ b/make/lint.mk @@ -29,9 +29,16 @@ lint-shell: .PHONY: lint lint: $(patsubst %, lint-%,$(SUB_LINT)) +PROTO_AGAINST_DIR := $(AKASH_DEVCACHE_TMP)/proto-against + .PHONY: proto-check-breaking proto-check-breaking: $(BUF) - $(BUF) breaking --against '.git#branch=main' + @git worktree remove --force $(PROTO_AGAINST_DIR) 2>/dev/null || true + @git worktree prune + @git worktree add $(PROTO_AGAINST_DIR) main + @cp -r go/vendor $(PROTO_AGAINST_DIR)/go/ + $(BUF) breaking --against '$(PROTO_AGAINST_DIR)' + @git worktree remove --force $(PROTO_AGAINST_DIR) .PHONY: proto-format proto-format: diff --git a/proto/provider/akash/provider/v1/service.proto b/proto/provider/akash/provider/v1/service.proto index 502fded8..952b89f8 100644 --- a/proto/provider/akash/provider/v1/service.proto +++ b/proto/provider/akash/provider/v1/service.proto @@ -27,5 +27,11 @@ service ProviderRPC { rpc StreamStatus(google.protobuf.Empty) returns (stream Status); // BidScreening screens a deployment group spec for bid eligibility and returns pricing - rpc BidScreening(BidScreeningRequest) returns (BidScreeningResponse); + rpc BidScreening(BidScreeningRequest) returns (BidScreeningResponse) { + option (google.api.http) = { + post: "/v1/bid-screening", + body: "*", + response_body: "*" + }; + } } diff --git a/proto/provider/akash/provider/v1/validation.proto b/proto/provider/akash/provider/v1/validation.proto index e4d87e9b..8ba1a586 100644 --- a/proto/provider/akash/provider/v1/validation.proto +++ b/proto/provider/akash/provider/v1/validation.proto @@ -42,12 +42,12 @@ message BidScreeningResponse { (gogoproto.moretags) = "yaml:\"reasons,omitempty\"" ]; - // ResourceOffer is the provider's resource offer for the screened group, if passed. - akash.market.v1beta5.ResourceOffer resource_offer = 3 [ + // ResourceOffers contains the provider's resource offers for the screened group, one per service in the GroupSpec. + repeated akash.market.v1beta5.ResourceOffer resource_offers = 3 [ (gogoproto.nullable) = true, - (gogoproto.customname) = "ResourceOffer", - (gogoproto.jsontag) = "resource_offer,omitempty", - (gogoproto.moretags) = "yaml:\"resource_offer,omitempty\"" + (gogoproto.customname) = "ResourceOffers", + (gogoproto.jsontag) = "resource_offers,omitempty", + (gogoproto.moretags) = "yaml:\"resource_offers,omitempty\"" ]; // Price is the minimum bid price for the screened group. diff --git a/ts/src/generated/protos/akash/provider/v1/service_akash.ts b/ts/src/generated/protos/akash/provider/v1/service_akash.ts index 90992790..384e67db 100644 --- a/ts/src/generated/protos/akash/provider/v1/service_akash.ts +++ b/ts/src/generated/protos/akash/provider/v1/service_akash.ts @@ -21,6 +21,8 @@ export const ProviderRPC = { }, bidScreening: { name: "BidScreening", + httpMethod: "post", + httpPath: "/v1/bid-screening", input: BidScreeningRequest, output: BidScreeningResponse, get parent() { return ProviderRPC; }, diff --git a/ts/src/generated/protos/akash/provider/v1/validation.ts b/ts/src/generated/protos/akash/provider/v1/validation.ts index 95409c96..08e80aea 100644 --- a/ts/src/generated/protos/akash/provider/v1/validation.ts +++ b/ts/src/generated/protos/akash/provider/v1/validation.ts @@ -35,10 +35,8 @@ export interface BidScreeningResponse { passed: boolean; /** Reasons contains explanations when screening fails. */ reasons: string[]; - /** ResourceOffer is the provider's resource offer for the screened group, if passed. */ - resourceOffer: - | ResourceOffer - | undefined; + /** ResourceOffers contains the provider's resource offers for the screened group, one per service in the GroupSpec. */ + resourceOffers: ResourceOffer[]; /** Price is the minimum bid price for the screened group. */ price: DecCoin | undefined; } @@ -122,7 +120,7 @@ export const BidScreeningRequest: MessageFns = { @@ -135,8 +133,8 @@ export const BidScreeningResponse: MessageFns globalThis.String(e)) : [], - resourceOffer: isSet(object.resource_offer) ? ResourceOffer.fromJSON(object.resource_offer) : undefined, + resourceOffers: globalThis.Array.isArray(object?.resource_offers) + ? object.resource_offers.map((e: any) => ResourceOffer.fromJSON(e)) + : [], price: isSet(object.price) ? DecCoin.fromJSON(object.price) : undefined, }; }, @@ -209,8 +209,8 @@ export const BidScreeningResponse: MessageFns ResourceOffer.toJSON(e)); } if (message.price !== undefined) { obj.price = DecCoin.toJSON(message.price); @@ -221,9 +221,7 @@ export const BidScreeningResponse: MessageFns e) || []; - message.resourceOffer = (object.resourceOffer !== undefined && object.resourceOffer !== null) - ? ResourceOffer.fromPartial(object.resourceOffer) - : undefined; + message.resourceOffers = object.resourceOffers?.map((e) => ResourceOffer.fromPartial(e)) || []; message.price = (object.price !== undefined && object.price !== null) ? DecCoin.fromPartial(object.price) : undefined;