From 75719caec980adbad21e9e22ca8a7c4109c09114 Mon Sep 17 00:00:00 2001 From: Andrey Melnikov Date: Fri, 6 Aug 2021 16:07:27 -0700 Subject: [PATCH 1/9] feat: model deployment API --- api/api.swagger.json | 110 ++++++++ api/gen/model.pb.go | 561 +++++++++++++++++++++++++++++++++++++++ api/gen/model.pb.gw.go | 201 ++++++++++++++ api/gen/model_grpc.pb.go | 97 +++++++ api/proto/model.proto | 48 ++++ main.go | 2 + pkg/model.go | 42 +++ pkg/model_types.go | 61 +++++ server/model_server.go | 54 ++++ 9 files changed, 1176 insertions(+) create mode 100644 api/gen/model.pb.go create mode 100644 api/gen/model.pb.gw.go create mode 100644 api/gen/model_grpc.pb.go create mode 100644 api/proto/model.proto create mode 100644 pkg/model.go create mode 100644 pkg/model_types.go create mode 100644 server/model_server.go diff --git a/api/api.swagger.json b/api/api.swagger.json index 850a870..6ed6c5b 100644 --- a/api/api.swagger.json +++ b/api/api.swagger.json @@ -763,6 +763,44 @@ ] } }, + "/apis/v1beta1/{namespace}/models/deploy": { + "post": { + "operationId": "DeployModel", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/DeployModelResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeployModelRequest" + } + } + ], + "tags": [ + "ModelService" + ] + } + }, "/apis/v1beta1/{namespace}/secrets": { "get": { "operationId": "ListSecrets", @@ -3362,6 +3400,28 @@ } } }, + "DeployModelRequest": { + "type": "object", + "properties": { + "namespace": { + "type": "string" + }, + "name": { + "type": "string" + }, + "predictor": { + "$ref": "#/definitions/Predictor" + } + } + }, + "DeployModelResponse": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + }, "File": { "type": "object", "properties": { @@ -3973,6 +4033,17 @@ } } }, + "NodeSelector": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, "Parameter": { "type": "object", "properties": { @@ -4016,6 +4087,45 @@ } } }, + "Predictor": { + "type": "object", + "properties": { + "nodeSelector": { + "$ref": "#/definitions/NodeSelector" + }, + "server": { + "$ref": "#/definitions/PredictorServer" + } + } + }, + "PredictorServer": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "runtimeVersion": { + "type": "string" + }, + "storageUri": { + "type": "string" + }, + "limits": { + "$ref": "#/definitions/ResourceLimits" + } + } + }, + "ResourceLimits": { + "type": "object", + "properties": { + "cpu": { + "type": "string" + }, + "memory": { + "type": "string" + } + } + }, "Secret": { "type": "object", "properties": { diff --git a/api/gen/model.pb.go b/api/gen/model.pb.go new file mode 100644 index 0000000..31f5679 --- /dev/null +++ b/api/gen/model.pb.go @@ -0,0 +1,561 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.14.0 +// source: model.proto + +package gen + +import ( + proto "github.com/golang/protobuf/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type NodeSelector struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *NodeSelector) Reset() { + *x = NodeSelector{} + if protoimpl.UnsafeEnabled { + mi := &file_model_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NodeSelector) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NodeSelector) ProtoMessage() {} + +func (x *NodeSelector) ProtoReflect() protoreflect.Message { + mi := &file_model_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NodeSelector.ProtoReflect.Descriptor instead. +func (*NodeSelector) Descriptor() ([]byte, []int) { + return file_model_proto_rawDescGZIP(), []int{0} +} + +func (x *NodeSelector) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *NodeSelector) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type ResourceLimits struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Cpu string `protobuf:"bytes,1,opt,name=cpu,proto3" json:"cpu,omitempty"` + Memory string `protobuf:"bytes,2,opt,name=memory,proto3" json:"memory,omitempty"` +} + +func (x *ResourceLimits) Reset() { + *x = ResourceLimits{} + if protoimpl.UnsafeEnabled { + mi := &file_model_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResourceLimits) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResourceLimits) ProtoMessage() {} + +func (x *ResourceLimits) ProtoReflect() protoreflect.Message { + mi := &file_model_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResourceLimits.ProtoReflect.Descriptor instead. +func (*ResourceLimits) Descriptor() ([]byte, []int) { + return file_model_proto_rawDescGZIP(), []int{1} +} + +func (x *ResourceLimits) GetCpu() string { + if x != nil { + return x.Cpu + } + return "" +} + +func (x *ResourceLimits) GetMemory() string { + if x != nil { + return x.Memory + } + return "" +} + +type PredictorServer struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + RuntimeVersion string `protobuf:"bytes,2,opt,name=runtimeVersion,proto3" json:"runtimeVersion,omitempty"` + StorageUri string `protobuf:"bytes,3,opt,name=storageUri,proto3" json:"storageUri,omitempty"` + Limits *ResourceLimits `protobuf:"bytes,4,opt,name=limits,proto3" json:"limits,omitempty"` +} + +func (x *PredictorServer) Reset() { + *x = PredictorServer{} + if protoimpl.UnsafeEnabled { + mi := &file_model_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PredictorServer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PredictorServer) ProtoMessage() {} + +func (x *PredictorServer) ProtoReflect() protoreflect.Message { + mi := &file_model_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PredictorServer.ProtoReflect.Descriptor instead. +func (*PredictorServer) Descriptor() ([]byte, []int) { + return file_model_proto_rawDescGZIP(), []int{2} +} + +func (x *PredictorServer) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *PredictorServer) GetRuntimeVersion() string { + if x != nil { + return x.RuntimeVersion + } + return "" +} + +func (x *PredictorServer) GetStorageUri() string { + if x != nil { + return x.StorageUri + } + return "" +} + +func (x *PredictorServer) GetLimits() *ResourceLimits { + if x != nil { + return x.Limits + } + return nil +} + +type Predictor struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeSelector *NodeSelector `protobuf:"bytes,1,opt,name=nodeSelector,proto3" json:"nodeSelector,omitempty"` + Server *PredictorServer `protobuf:"bytes,2,opt,name=server,proto3" json:"server,omitempty"` +} + +func (x *Predictor) Reset() { + *x = Predictor{} + if protoimpl.UnsafeEnabled { + mi := &file_model_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Predictor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Predictor) ProtoMessage() {} + +func (x *Predictor) ProtoReflect() protoreflect.Message { + mi := &file_model_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Predictor.ProtoReflect.Descriptor instead. +func (*Predictor) Descriptor() ([]byte, []int) { + return file_model_proto_rawDescGZIP(), []int{3} +} + +func (x *Predictor) GetNodeSelector() *NodeSelector { + if x != nil { + return x.NodeSelector + } + return nil +} + +func (x *Predictor) GetServer() *PredictorServer { + if x != nil { + return x.Server + } + return nil +} + +type DeployModelRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Predictor *Predictor `protobuf:"bytes,3,opt,name=predictor,proto3" json:"predictor,omitempty"` +} + +func (x *DeployModelRequest) Reset() { + *x = DeployModelRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_model_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeployModelRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeployModelRequest) ProtoMessage() {} + +func (x *DeployModelRequest) ProtoReflect() protoreflect.Message { + mi := &file_model_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeployModelRequest.ProtoReflect.Descriptor instead. +func (*DeployModelRequest) Descriptor() ([]byte, []int) { + return file_model_proto_rawDescGZIP(), []int{4} +} + +func (x *DeployModelRequest) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *DeployModelRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *DeployModelRequest) GetPredictor() *Predictor { + if x != nil { + return x.Predictor + } + return nil +} + +type DeployModelResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *DeployModelResponse) Reset() { + *x = DeployModelResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_model_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeployModelResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeployModelResponse) ProtoMessage() {} + +func (x *DeployModelResponse) ProtoReflect() protoreflect.Message { + mi := &file_model_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeployModelResponse.ProtoReflect.Descriptor instead. +func (*DeployModelResponse) Descriptor() ([]byte, []int) { + return file_model_proto_rawDescGZIP(), []int{5} +} + +func (x *DeployModelResponse) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +var File_model_proto protoreflect.FileDescriptor + +var file_model_proto_rawDesc = []byte{ + 0x0a, 0x0b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x61, + 0x70, 0x69, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x36, 0x0a, 0x0c, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x3a, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x70, + 0x75, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x70, 0x75, 0x12, 0x16, 0x0a, 0x06, + 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, + 0x6d, 0x6f, 0x72, 0x79, 0x22, 0x9a, 0x01, 0x0a, 0x0f, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, + 0x6f, 0x72, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e, + 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x55, + 0x72, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x55, 0x72, 0x69, 0x12, 0x2b, 0x0a, 0x06, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x06, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x73, 0x22, 0x70, 0x0a, 0x09, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x35, + 0x0a, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x53, + 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x6c, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x72, 0x65, 0x64, + 0x69, 0x63, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x06, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x22, 0x74, 0x0a, 0x12, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4d, 0x6f, 0x64, + 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2c, 0x0a, 0x09, 0x70, + 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x09, + 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, 0x72, 0x22, 0x29, 0x0a, 0x13, 0x44, 0x65, 0x70, + 0x6c, 0x6f, 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x32, 0x84, 0x01, 0x0a, 0x0c, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x74, 0x0a, 0x0b, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4d, + 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, + 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x22, + 0x27, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, + 0x73, 0x2f, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x3a, 0x01, 0x2a, 0x42, 0x24, 0x5a, 0x22, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x65, 0x70, 0x61, 0x6e, + 0x65, 0x6c, 0x69, 0x6f, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, + 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_model_proto_rawDescOnce sync.Once + file_model_proto_rawDescData = file_model_proto_rawDesc +) + +func file_model_proto_rawDescGZIP() []byte { + file_model_proto_rawDescOnce.Do(func() { + file_model_proto_rawDescData = protoimpl.X.CompressGZIP(file_model_proto_rawDescData) + }) + return file_model_proto_rawDescData +} + +var file_model_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_model_proto_goTypes = []interface{}{ + (*NodeSelector)(nil), // 0: api.NodeSelector + (*ResourceLimits)(nil), // 1: api.ResourceLimits + (*PredictorServer)(nil), // 2: api.PredictorServer + (*Predictor)(nil), // 3: api.Predictor + (*DeployModelRequest)(nil), // 4: api.DeployModelRequest + (*DeployModelResponse)(nil), // 5: api.DeployModelResponse +} +var file_model_proto_depIdxs = []int32{ + 1, // 0: api.PredictorServer.limits:type_name -> api.ResourceLimits + 0, // 1: api.Predictor.nodeSelector:type_name -> api.NodeSelector + 2, // 2: api.Predictor.server:type_name -> api.PredictorServer + 3, // 3: api.DeployModelRequest.predictor:type_name -> api.Predictor + 4, // 4: api.ModelService.DeployModel:input_type -> api.DeployModelRequest + 5, // 5: api.ModelService.DeployModel:output_type -> api.DeployModelResponse + 5, // [5:6] is the sub-list for method output_type + 4, // [4:5] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_model_proto_init() } +func file_model_proto_init() { + if File_model_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_model_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NodeSelector); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_model_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResourceLimits); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_model_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PredictorServer); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_model_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Predictor); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_model_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeployModelRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_model_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeployModelResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_model_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_model_proto_goTypes, + DependencyIndexes: file_model_proto_depIdxs, + MessageInfos: file_model_proto_msgTypes, + }.Build() + File_model_proto = out.File + file_model_proto_rawDesc = nil + file_model_proto_goTypes = nil + file_model_proto_depIdxs = nil +} diff --git a/api/gen/model.pb.gw.go b/api/gen/model.pb.gw.go new file mode 100644 index 0000000..c540cae --- /dev/null +++ b/api/gen/model.pb.gw.go @@ -0,0 +1,201 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: model.proto + +/* +Package gen is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package gen + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_ModelService_DeployModel_0(ctx context.Context, marshaler runtime.Marshaler, client ModelServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeployModelRequest + 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) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["namespace"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace") + } + + protoReq.Namespace, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err) + } + + msg, err := client.DeployModel(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ModelService_DeployModel_0(ctx context.Context, marshaler runtime.Marshaler, server ModelServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeployModelRequest + 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) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["namespace"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace") + } + + protoReq.Namespace, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err) + } + + msg, err := server.DeployModel(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterModelServiceHandlerServer registers the http handlers for service ModelService to "mux". +// UnaryRPC :call ModelServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterModelServiceHandlerFromEndpoint instead. +func RegisterModelServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ModelServiceServer) error { + + mux.Handle("POST", pattern_ModelService_DeployModel_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, "/api.ModelService/DeployModel") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ModelService_DeployModel_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_ModelService_DeployModel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterModelServiceHandlerFromEndpoint is same as RegisterModelServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterModelServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterModelServiceHandler(ctx, mux, conn) +} + +// RegisterModelServiceHandler registers the http handlers for service ModelService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterModelServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterModelServiceHandlerClient(ctx, mux, NewModelServiceClient(conn)) +} + +// RegisterModelServiceHandlerClient registers the http handlers for service ModelService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ModelServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ModelServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "ModelServiceClient" to call the correct interceptors. +func RegisterModelServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ModelServiceClient) error { + + mux.Handle("POST", pattern_ModelService_DeployModel_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, "/api.ModelService/DeployModel") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ModelService_DeployModel_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ModelService_DeployModel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_ModelService_DeployModel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 2, 4}, []string{"apis", "v1beta1", "namespace", "models", "deploy"}, "")) +) + +var ( + forward_ModelService_DeployModel_0 = runtime.ForwardResponseMessage +) diff --git a/api/gen/model_grpc.pb.go b/api/gen/model_grpc.pb.go new file mode 100644 index 0000000..c15ac1a --- /dev/null +++ b/api/gen/model_grpc.pb.go @@ -0,0 +1,97 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package gen + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion7 + +// ModelServiceClient is the client API for ModelService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ModelServiceClient interface { + DeployModel(ctx context.Context, in *DeployModelRequest, opts ...grpc.CallOption) (*DeployModelResponse, error) +} + +type modelServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewModelServiceClient(cc grpc.ClientConnInterface) ModelServiceClient { + return &modelServiceClient{cc} +} + +func (c *modelServiceClient) DeployModel(ctx context.Context, in *DeployModelRequest, opts ...grpc.CallOption) (*DeployModelResponse, error) { + out := new(DeployModelResponse) + err := c.cc.Invoke(ctx, "/api.ModelService/DeployModel", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ModelServiceServer is the server API for ModelService service. +// All implementations must embed UnimplementedModelServiceServer +// for forward compatibility +type ModelServiceServer interface { + DeployModel(context.Context, *DeployModelRequest) (*DeployModelResponse, error) + mustEmbedUnimplementedModelServiceServer() +} + +// UnimplementedModelServiceServer must be embedded to have forward compatible implementations. +type UnimplementedModelServiceServer struct { +} + +func (UnimplementedModelServiceServer) DeployModel(context.Context, *DeployModelRequest) (*DeployModelResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeployModel not implemented") +} +func (UnimplementedModelServiceServer) mustEmbedUnimplementedModelServiceServer() {} + +// UnsafeModelServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ModelServiceServer will +// result in compilation errors. +type UnsafeModelServiceServer interface { + mustEmbedUnimplementedModelServiceServer() +} + +func RegisterModelServiceServer(s grpc.ServiceRegistrar, srv ModelServiceServer) { + s.RegisterService(&_ModelService_serviceDesc, srv) +} + +func _ModelService_DeployModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeployModelRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelServiceServer).DeployModel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.ModelService/DeployModel", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelServiceServer).DeployModel(ctx, req.(*DeployModelRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ModelService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "api.ModelService", + HandlerType: (*ModelServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "DeployModel", + Handler: _ModelService_DeployModel_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "model.proto", +} diff --git a/api/proto/model.proto b/api/proto/model.proto new file mode 100644 index 0000000..8b3d0b5 --- /dev/null +++ b/api/proto/model.proto @@ -0,0 +1,48 @@ +syntax = "proto3"; + +package api; +option go_package = "github.com/onepanelio/core/api/gen"; + +import "google/api/annotations.proto"; + +service ModelService { + rpc DeployModel (DeployModelRequest) returns (DeployModelResponse) { + option (google.api.http) = { + post: "/apis/v1beta1/{namespace}/models/deploy" + body: "*" + }; + } +} + +message NodeSelector { + string key = 1; + string value = 2; +} + +message ResourceLimits { + string cpu = 1; + string memory = 2; +} + +message PredictorServer { + string name = 1; + string runtimeVersion = 2; + string storageUri = 3; + ResourceLimits limits = 4; +} + +message Predictor { + NodeSelector nodeSelector = 1; + PredictorServer server = 2; +} + +message DeployModelRequest { + string namespace = 1; + string name = 2; + + Predictor predictor = 3; +} + +message DeployModelResponse { + string name = 1; +} diff --git a/main.go b/main.go index de44c75..c0f49e7 100644 --- a/main.go +++ b/main.go @@ -158,6 +158,7 @@ func startRPCServer(db *v1.DB, kubeConfig *v1.Config, sysConfig v1.SystemConfig, api.RegisterConfigServiceServer(s, server.NewConfigServer()) api.RegisterServiceServiceServer(s, server.NewServiceServer()) api.RegisterFileServiceServer(s, server.NewFileServer()) + api.RegisterModelServiceServer(s, server.NewModelServer()) go func() { if err := s.Serve(lis); err != nil { @@ -194,6 +195,7 @@ func startHTTPProxy() { registerHandler(api.RegisterConfigServiceHandlerFromEndpoint, ctx, mux, endpoint, opts) registerHandler(api.RegisterServiceServiceHandlerFromEndpoint, ctx, mux, endpoint, opts) registerHandler(api.RegisterFileServiceHandlerFromEndpoint, ctx, mux, endpoint, opts) + registerHandler(api.RegisterModelServiceHandlerFromEndpoint, ctx, mux, endpoint, opts) log.Printf("Starting HTTP proxy on port %v", *httpPort) diff --git a/pkg/model.go b/pkg/model.go new file mode 100644 index 0000000..fc98acc --- /dev/null +++ b/pkg/model.go @@ -0,0 +1,42 @@ +package v1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/util/json" + "k8s.io/client-go/kubernetes/scheme" + "k8s.io/client-go/rest" +) + +func modelRestClient() (*rest.RESTClient, error) { + config := *NewConfig() + config.GroupVersion = &schema.GroupVersion{Group: "serving.kubeflow.org", Version: "v1beta1"} + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + return rest.RESTClientFor(&config) +} + +// DeployModel creates an InferenceService with KFServing +func (c *Client) DeployModel(deployment *ModelDeployment) error { + resource := deployment.ToResource() + + data, err := json.Marshal(resource) + if err != nil { + return err + } + + restClient, err := modelRestClient() + if err != nil { + return err + } + + err = restClient.Post(). + Namespace(deployment.Namespace). + Name(deployment.Name). + Resource("InferenceServices"). + Body(data). + Do(). + Error() + + return err +} diff --git a/pkg/model_types.go b/pkg/model_types.go new file mode 100644 index 0000000..92b9cec --- /dev/null +++ b/pkg/model_types.go @@ -0,0 +1,61 @@ +package v1 + +// ResourceLimits are the cpu/memory limits +type ResourceLimits struct { + CPU string + Memory string +} + +// NodeSelector provides a key/value to select a Node +type NodeSelector struct { + Key string + Value string +} + +// PredictorServer contains information on a server that serves models +type PredictorServer struct { + Name string + RuntimeVersion string + StorageURI string + ResourceLimits ResourceLimits + NodeSelector NodeSelector +} + +// ModelDeployment represents the information necessary to deploy a model +type ModelDeployment struct { + Name string + Namespace string + + PredictorServer PredictorServer +} + +// ToResource converts the ModelDeployment into a KFServing spec +func (m *ModelDeployment) ToResource() interface{} { + resource := map[string]interface{}{ + "apiVersion": "serving.kubeflow.org/v1beta1", + "kind": "InferenceService", + "metadata": map[string]string{ + "namespace": m.Namespace, + "name": m.Name, + }, + "spec": map[string]interface{}{ + "predictor": map[string]interface{}{ + "nodeSelector": map[string]string{ + m.PredictorServer.NodeSelector.Key: m.PredictorServer.NodeSelector.Value, + }, + m.PredictorServer.Name: map[string]interface{}{ + "resources": map[string]interface{}{ + "limits": map[string]string{ + "cpu": m.PredictorServer.ResourceLimits.CPU, + "memory": m.PredictorServer.ResourceLimits.Memory, + }, + }, + "runtimeVersion": m.PredictorServer.RuntimeVersion, + "storageUri": m.PredictorServer.StorageURI, + }, + }, + }, + } + + return resource +} diff --git a/server/model_server.go b/server/model_server.go new file mode 100644 index 0000000..02ada61 --- /dev/null +++ b/server/model_server.go @@ -0,0 +1,54 @@ +package server + +import ( + "context" + api "github.com/onepanelio/core/api/gen" + v1 "github.com/onepanelio/core/pkg" + "github.com/onepanelio/core/server/auth" +) + +// ModelServer is an implementation of the grpc ModelServer +type ModelServer struct { + api.UnimplementedModelServiceServer +} + +// NewModelServer creates a new ModelServer +func NewModelServer() *ModelServer { + return &ModelServer{} +} + +// DeployModel deploys a model server with a model(s) +func (s *ModelServer) DeployModel(ctx context.Context, req *api.DeployModelRequest) (*api.DeployModelResponse, error) { + client := getClient(ctx) + allowed, err := auth.IsAuthorized(client, req.Namespace, "create", "serving.kubeflow.org", "InferenceService", "") + if err != nil || !allowed { + return nil, err + } + + model := &v1.ModelDeployment{ + Name: req.Name, + Namespace: req.Namespace, + PredictorServer: v1.PredictorServer{ + Name: req.Predictor.Server.Name, + RuntimeVersion: req.Predictor.Server.RuntimeVersion, + StorageURI: req.Predictor.Server.StorageUri, + ResourceLimits: v1.ResourceLimits{ + CPU: req.Predictor.Server.Limits.Cpu, + Memory: req.Predictor.Server.Limits.Memory, + }, + NodeSelector: v1.NodeSelector{ + Key: req.Predictor.NodeSelector.Key, + Value: req.Predictor.NodeSelector.Value, + }, + }, + } + + err = client.DeployModel(model) + if err != nil { + return nil, err + } + + return &api.DeployModelResponse{ + Name: "test", + }, nil +} From d8e0e5c96838a5a4bfdfc85ba0bb9eb131be0fd2 Mon Sep 17 00:00:00 2001 From: Andrey Melnikov Date: Tue, 10 Aug 2021 09:54:17 -0700 Subject: [PATCH 2/9] feat: add defaults for model deployment and add get status and delete endpoints --- api/api.swagger.json | 138 +++++++- api/gen/model.pb.go | 669 +++++++++++++++++++++++++++++++++------ api/gen/model.pb.gw.go | 240 +++++++++++++- api/gen/model_grpc.pb.go | 83 ++++- api/proto/model.proto | 51 ++- pkg/model.go | 41 ++- pkg/model_types.go | 131 ++++++-- server/model_server.go | 103 +++++- 8 files changed, 1313 insertions(+), 143 deletions(-) diff --git a/api/api.swagger.json b/api/api.swagger.json index 6ed6c5b..128588e 100644 --- a/api/api.swagger.json +++ b/api/api.swagger.json @@ -763,14 +763,14 @@ ] } }, - "/apis/v1beta1/{namespace}/models/deploy": { + "/apis/v1beta1/{namespace}/models": { "post": { "operationId": "DeployModel", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DeployModelResponse" + "properties": {} } }, "default": { @@ -801,6 +801,76 @@ ] } }, + "/apis/v1beta1/{namespace}/models/{name}": { + "get": { + "operationId": "GetModelStatus", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ModelStatus" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "name", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "ModelService" + ] + }, + "delete": { + "operationId": "DeleteModel", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "properties": {} + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/google.rpc.Status" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "name", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "ModelService" + ] + } + }, "/apis/v1beta1/{namespace}/secrets": { "get": { "operationId": "ListSecrets", @@ -3298,6 +3368,23 @@ } } }, + "Container": { + "type": "object", + "properties": { + "image": { + "type": "string" + }, + "name": { + "type": "string" + }, + "env": { + "type": "array", + "items": { + "$ref": "#/definitions/Env" + } + } + } + }, "CreateWorkflowExecutionBody": { "type": "object", "properties": { @@ -3411,14 +3498,20 @@ }, "predictor": { "$ref": "#/definitions/Predictor" + }, + "transformer": { + "$ref": "#/definitions/Transformer" } } }, - "DeployModelResponse": { + "Env": { "type": "object", "properties": { "name": { "type": "string" + }, + "value": { + "type": "string" } } }, @@ -4000,6 +4093,34 @@ } } }, + "ModelCondition": { + "type": "object", + "properties": { + "lastTransitionTime": { + "type": "string" + }, + "status": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "ModelStatus": { + "type": "object", + "properties": { + "ready": { + "type": "boolean" + }, + "conditions": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelCondition" + } + } + } + }, "Namespace": { "type": "object", "properties": { @@ -4171,6 +4292,17 @@ } } }, + "Transformer": { + "type": "object", + "properties": { + "containers": { + "type": "array", + "items": { + "$ref": "#/definitions/Container" + } + } + } + }, "UpdateSecretKeyValueResponse": { "type": "object", "properties": { diff --git a/api/gen/model.pb.go b/api/gen/model.pb.go index 31f5679..9faf8cd 100644 --- a/api/gen/model.pb.go +++ b/api/gen/model.pb.go @@ -11,6 +11,7 @@ import ( _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" reflect "reflect" sync "sync" ) @@ -26,6 +27,61 @@ const ( // of the legacy proto package is being used. const _ = proto.ProtoPackageIsVersion4 +type ModelIdentifier struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *ModelIdentifier) Reset() { + *x = ModelIdentifier{} + if protoimpl.UnsafeEnabled { + mi := &file_model_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ModelIdentifier) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ModelIdentifier) ProtoMessage() {} + +func (x *ModelIdentifier) ProtoReflect() protoreflect.Message { + mi := &file_model_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ModelIdentifier.ProtoReflect.Descriptor instead. +func (*ModelIdentifier) Descriptor() ([]byte, []int) { + return file_model_proto_rawDescGZIP(), []int{0} +} + +func (x *ModelIdentifier) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *ModelIdentifier) GetName() string { + if x != nil { + return x.Name + } + return "" +} + type NodeSelector struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -38,7 +94,7 @@ type NodeSelector struct { func (x *NodeSelector) Reset() { *x = NodeSelector{} if protoimpl.UnsafeEnabled { - mi := &file_model_proto_msgTypes[0] + mi := &file_model_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -51,7 +107,7 @@ func (x *NodeSelector) String() string { func (*NodeSelector) ProtoMessage() {} func (x *NodeSelector) ProtoReflect() protoreflect.Message { - mi := &file_model_proto_msgTypes[0] + mi := &file_model_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -64,7 +120,7 @@ func (x *NodeSelector) ProtoReflect() protoreflect.Message { // Deprecated: Use NodeSelector.ProtoReflect.Descriptor instead. func (*NodeSelector) Descriptor() ([]byte, []int) { - return file_model_proto_rawDescGZIP(), []int{0} + return file_model_proto_rawDescGZIP(), []int{1} } func (x *NodeSelector) GetKey() string { @@ -93,7 +149,7 @@ type ResourceLimits struct { func (x *ResourceLimits) Reset() { *x = ResourceLimits{} if protoimpl.UnsafeEnabled { - mi := &file_model_proto_msgTypes[1] + mi := &file_model_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -106,7 +162,7 @@ func (x *ResourceLimits) String() string { func (*ResourceLimits) ProtoMessage() {} func (x *ResourceLimits) ProtoReflect() protoreflect.Message { - mi := &file_model_proto_msgTypes[1] + mi := &file_model_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -119,7 +175,7 @@ func (x *ResourceLimits) ProtoReflect() protoreflect.Message { // Deprecated: Use ResourceLimits.ProtoReflect.Descriptor instead. func (*ResourceLimits) Descriptor() ([]byte, []int) { - return file_model_proto_rawDescGZIP(), []int{1} + return file_model_proto_rawDescGZIP(), []int{2} } func (x *ResourceLimits) GetCpu() string { @@ -150,7 +206,7 @@ type PredictorServer struct { func (x *PredictorServer) Reset() { *x = PredictorServer{} if protoimpl.UnsafeEnabled { - mi := &file_model_proto_msgTypes[2] + mi := &file_model_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -163,7 +219,7 @@ func (x *PredictorServer) String() string { func (*PredictorServer) ProtoMessage() {} func (x *PredictorServer) ProtoReflect() protoreflect.Message { - mi := &file_model_proto_msgTypes[2] + mi := &file_model_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -176,7 +232,7 @@ func (x *PredictorServer) ProtoReflect() protoreflect.Message { // Deprecated: Use PredictorServer.ProtoReflect.Descriptor instead. func (*PredictorServer) Descriptor() ([]byte, []int) { - return file_model_proto_rawDescGZIP(), []int{2} + return file_model_proto_rawDescGZIP(), []int{3} } func (x *PredictorServer) GetName() string { @@ -207,6 +263,171 @@ func (x *PredictorServer) GetLimits() *ResourceLimits { return nil } +type Env struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *Env) Reset() { + *x = Env{} + if protoimpl.UnsafeEnabled { + mi := &file_model_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Env) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Env) ProtoMessage() {} + +func (x *Env) ProtoReflect() protoreflect.Message { + mi := &file_model_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Env.ProtoReflect.Descriptor instead. +func (*Env) Descriptor() ([]byte, []int) { + return file_model_proto_rawDescGZIP(), []int{4} +} + +func (x *Env) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Env) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type Container struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Image string `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Env []*Env `protobuf:"bytes,3,rep,name=env,proto3" json:"env,omitempty"` +} + +func (x *Container) Reset() { + *x = Container{} + if protoimpl.UnsafeEnabled { + mi := &file_model_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Container) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Container) ProtoMessage() {} + +func (x *Container) ProtoReflect() protoreflect.Message { + mi := &file_model_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Container.ProtoReflect.Descriptor instead. +func (*Container) Descriptor() ([]byte, []int) { + return file_model_proto_rawDescGZIP(), []int{5} +} + +func (x *Container) GetImage() string { + if x != nil { + return x.Image + } + return "" +} + +func (x *Container) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Container) GetEnv() []*Env { + if x != nil { + return x.Env + } + return nil +} + +type Transformer struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Containers []*Container `protobuf:"bytes,1,rep,name=containers,proto3" json:"containers,omitempty"` +} + +func (x *Transformer) Reset() { + *x = Transformer{} + if protoimpl.UnsafeEnabled { + mi := &file_model_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Transformer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Transformer) ProtoMessage() {} + +func (x *Transformer) ProtoReflect() protoreflect.Message { + mi := &file_model_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Transformer.ProtoReflect.Descriptor instead. +func (*Transformer) Descriptor() ([]byte, []int) { + return file_model_proto_rawDescGZIP(), []int{6} +} + +func (x *Transformer) GetContainers() []*Container { + if x != nil { + return x.Containers + } + return nil +} + type Predictor struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -219,7 +440,7 @@ type Predictor struct { func (x *Predictor) Reset() { *x = Predictor{} if protoimpl.UnsafeEnabled { - mi := &file_model_proto_msgTypes[3] + mi := &file_model_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -232,7 +453,7 @@ func (x *Predictor) String() string { func (*Predictor) ProtoMessage() {} func (x *Predictor) ProtoReflect() protoreflect.Message { - mi := &file_model_proto_msgTypes[3] + mi := &file_model_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -245,7 +466,7 @@ func (x *Predictor) ProtoReflect() protoreflect.Message { // Deprecated: Use Predictor.ProtoReflect.Descriptor instead. func (*Predictor) Descriptor() ([]byte, []int) { - return file_model_proto_rawDescGZIP(), []int{3} + return file_model_proto_rawDescGZIP(), []int{7} } func (x *Predictor) GetNodeSelector() *NodeSelector { @@ -267,15 +488,16 @@ type DeployModelRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Predictor *Predictor `protobuf:"bytes,3,opt,name=predictor,proto3" json:"predictor,omitempty"` + Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Predictor *Predictor `protobuf:"bytes,3,opt,name=predictor,proto3" json:"predictor,omitempty"` + Transformer *Transformer `protobuf:"bytes,4,opt,name=transformer,proto3" json:"transformer,omitempty"` } func (x *DeployModelRequest) Reset() { *x = DeployModelRequest{} if protoimpl.UnsafeEnabled { - mi := &file_model_proto_msgTypes[4] + mi := &file_model_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -288,7 +510,7 @@ func (x *DeployModelRequest) String() string { func (*DeployModelRequest) ProtoMessage() {} func (x *DeployModelRequest) ProtoReflect() protoreflect.Message { - mi := &file_model_proto_msgTypes[4] + mi := &file_model_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -301,7 +523,7 @@ func (x *DeployModelRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeployModelRequest.ProtoReflect.Descriptor instead. func (*DeployModelRequest) Descriptor() ([]byte, []int) { - return file_model_proto_rawDescGZIP(), []int{4} + return file_model_proto_rawDescGZIP(), []int{8} } func (x *DeployModelRequest) GetNamespace() string { @@ -325,18 +547,25 @@ func (x *DeployModelRequest) GetPredictor() *Predictor { return nil } +func (x *DeployModelRequest) GetTransformer() *Transformer { + if x != nil { + return x.Transformer + } + return nil +} + type DeployModelResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` } func (x *DeployModelResponse) Reset() { *x = DeployModelResponse{} if protoimpl.UnsafeEnabled { - mi := &file_model_proto_msgTypes[5] + mi := &file_model_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -349,7 +578,7 @@ func (x *DeployModelResponse) String() string { func (*DeployModelResponse) ProtoMessage() {} func (x *DeployModelResponse) ProtoReflect() protoreflect.Message { - mi := &file_model_proto_msgTypes[5] + mi := &file_model_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -362,68 +591,233 @@ func (x *DeployModelResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeployModelResponse.ProtoReflect.Descriptor instead. func (*DeployModelResponse) Descriptor() ([]byte, []int) { - return file_model_proto_rawDescGZIP(), []int{5} + return file_model_proto_rawDescGZIP(), []int{9} } -func (x *DeployModelResponse) GetName() string { +func (x *DeployModelResponse) GetStatus() string { if x != nil { - return x.Name + return x.Status } return "" } +type ModelCondition struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LastTransitionTime string `protobuf:"bytes,1,opt,name=lastTransitionTime,proto3" json:"lastTransitionTime,omitempty"` + Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` + Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` +} + +func (x *ModelCondition) Reset() { + *x = ModelCondition{} + if protoimpl.UnsafeEnabled { + mi := &file_model_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ModelCondition) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ModelCondition) ProtoMessage() {} + +func (x *ModelCondition) ProtoReflect() protoreflect.Message { + mi := &file_model_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ModelCondition.ProtoReflect.Descriptor instead. +func (*ModelCondition) Descriptor() ([]byte, []int) { + return file_model_proto_rawDescGZIP(), []int{10} +} + +func (x *ModelCondition) GetLastTransitionTime() string { + if x != nil { + return x.LastTransitionTime + } + return "" +} + +func (x *ModelCondition) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *ModelCondition) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +type ModelStatus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ready bool `protobuf:"varint,1,opt,name=ready,proto3" json:"ready,omitempty"` + Conditions []*ModelCondition `protobuf:"bytes,2,rep,name=conditions,proto3" json:"conditions,omitempty"` +} + +func (x *ModelStatus) Reset() { + *x = ModelStatus{} + if protoimpl.UnsafeEnabled { + mi := &file_model_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ModelStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ModelStatus) ProtoMessage() {} + +func (x *ModelStatus) ProtoReflect() protoreflect.Message { + mi := &file_model_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ModelStatus.ProtoReflect.Descriptor instead. +func (*ModelStatus) Descriptor() ([]byte, []int) { + return file_model_proto_rawDescGZIP(), []int{11} +} + +func (x *ModelStatus) GetReady() bool { + if x != nil { + return x.Ready + } + return false +} + +func (x *ModelStatus) GetConditions() []*ModelCondition { + if x != nil { + return x.Conditions + } + return nil +} + var File_model_proto protoreflect.FileDescriptor var file_model_proto_rawDesc = []byte{ 0x0a, 0x0b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x61, 0x70, 0x69, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0x36, 0x0a, 0x0c, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x3a, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x70, - 0x75, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x70, 0x75, 0x12, 0x16, 0x0a, 0x06, - 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, - 0x6d, 0x6f, 0x72, 0x79, 0x22, 0x9a, 0x01, 0x0a, 0x0f, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, - 0x6f, 0x72, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e, - 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x55, - 0x72, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x55, 0x72, 0x69, 0x12, 0x2b, 0x0a, 0x06, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x06, 0x6c, 0x69, 0x6d, 0x69, 0x74, - 0x73, 0x22, 0x70, 0x0a, 0x09, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x35, - 0x0a, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x53, - 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x6c, - 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x72, 0x65, 0x64, - 0x69, 0x63, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x06, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x22, 0x74, 0x0a, 0x12, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4d, 0x6f, 0x64, - 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, - 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, - 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2c, 0x0a, 0x09, 0x70, - 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x09, - 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, 0x72, 0x22, 0x29, 0x0a, 0x13, 0x44, 0x65, 0x70, - 0x6c, 0x6f, 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x32, 0x84, 0x01, 0x0a, 0x0c, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x74, 0x0a, 0x0b, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4d, - 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, - 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x22, - 0x27, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, - 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, - 0x73, 0x2f, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x3a, 0x01, 0x2a, 0x42, 0x24, 0x5a, 0x22, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x65, 0x70, 0x61, 0x6e, - 0x65, 0x6c, 0x69, 0x6f, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, - 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x43, 0x0a, + 0x0f, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, + 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x22, 0x36, 0x0a, 0x0c, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x3a, 0x0a, 0x0e, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x10, 0x0a, 0x03, + 0x63, 0x70, 0x75, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x70, 0x75, 0x12, 0x16, + 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x22, 0x9a, 0x01, 0x0a, 0x0f, 0x50, 0x72, 0x65, 0x64, 0x69, + 0x63, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, + 0x0a, 0x0e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x55, 0x72, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x55, 0x72, 0x69, 0x12, 0x2b, 0x0a, 0x06, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x06, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x73, 0x22, 0x2f, 0x0a, 0x03, 0x45, 0x6e, 0x76, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x22, 0x51, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x03, 0x65, + 0x6e, 0x76, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x45, + 0x6e, 0x76, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x22, 0x3d, 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x12, 0x2e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x22, 0x70, 0x0a, 0x09, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, + 0x74, 0x6f, 0x72, 0x12, 0x35, 0x0a, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x0c, 0x6e, 0x6f, + 0x64, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x22, 0xa8, 0x01, 0x0a, 0x12, 0x44, 0x65, 0x70, + 0x6c, 0x6f, 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x2c, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x72, 0x65, 0x64, 0x69, + 0x63, 0x74, 0x6f, 0x72, 0x52, 0x09, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, 0x72, 0x12, + 0x32, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, + 0x6d, 0x65, 0x72, 0x22, 0x2d, 0x0a, 0x13, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4d, 0x6f, 0x64, + 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x22, 0x6c, 0x0a, 0x0e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x43, 0x6f, 0x6e, 0x64, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x12, 0x6c, 0x61, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x12, 0x6c, 0x61, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x54, 0x69, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x22, 0x58, 0x0a, 0x0b, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x14, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, + 0x72, 0x65, 0x61, 0x64, 0x79, 0x12, 0x33, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, + 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x32, 0xd4, 0x02, 0x0a, 0x0c, 0x4d, + 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6b, 0x0a, 0x0b, 0x44, + 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x17, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x2b, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x25, 0x22, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x6d, + 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0x69, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4d, + 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, + 0x1a, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x61, 0x70, 0x69, + 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x7b, 0x6e, 0x61, + 0x6d, 0x65, 0x7d, 0x12, 0x6c, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x6f, 0x64, + 0x65, 0x6c, 0x12, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x49, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x2a, 0x27, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x7d, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, + 0x7d, 0x42, 0x24, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x6f, 0x6e, 0x65, 0x70, 0x61, 0x6e, 0x65, 0x6c, 0x69, 0x6f, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -438,27 +832,42 @@ func file_model_proto_rawDescGZIP() []byte { return file_model_proto_rawDescData } -var file_model_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_model_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_model_proto_goTypes = []interface{}{ - (*NodeSelector)(nil), // 0: api.NodeSelector - (*ResourceLimits)(nil), // 1: api.ResourceLimits - (*PredictorServer)(nil), // 2: api.PredictorServer - (*Predictor)(nil), // 3: api.Predictor - (*DeployModelRequest)(nil), // 4: api.DeployModelRequest - (*DeployModelResponse)(nil), // 5: api.DeployModelResponse + (*ModelIdentifier)(nil), // 0: api.ModelIdentifier + (*NodeSelector)(nil), // 1: api.NodeSelector + (*ResourceLimits)(nil), // 2: api.ResourceLimits + (*PredictorServer)(nil), // 3: api.PredictorServer + (*Env)(nil), // 4: api.Env + (*Container)(nil), // 5: api.Container + (*Transformer)(nil), // 6: api.Transformer + (*Predictor)(nil), // 7: api.Predictor + (*DeployModelRequest)(nil), // 8: api.DeployModelRequest + (*DeployModelResponse)(nil), // 9: api.DeployModelResponse + (*ModelCondition)(nil), // 10: api.ModelCondition + (*ModelStatus)(nil), // 11: api.ModelStatus + (*emptypb.Empty)(nil), // 12: google.protobuf.Empty } var file_model_proto_depIdxs = []int32{ - 1, // 0: api.PredictorServer.limits:type_name -> api.ResourceLimits - 0, // 1: api.Predictor.nodeSelector:type_name -> api.NodeSelector - 2, // 2: api.Predictor.server:type_name -> api.PredictorServer - 3, // 3: api.DeployModelRequest.predictor:type_name -> api.Predictor - 4, // 4: api.ModelService.DeployModel:input_type -> api.DeployModelRequest - 5, // 5: api.ModelService.DeployModel:output_type -> api.DeployModelResponse - 5, // [5:6] is the sub-list for method output_type - 4, // [4:5] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 2, // 0: api.PredictorServer.limits:type_name -> api.ResourceLimits + 4, // 1: api.Container.env:type_name -> api.Env + 5, // 2: api.Transformer.containers:type_name -> api.Container + 1, // 3: api.Predictor.nodeSelector:type_name -> api.NodeSelector + 3, // 4: api.Predictor.server:type_name -> api.PredictorServer + 7, // 5: api.DeployModelRequest.predictor:type_name -> api.Predictor + 6, // 6: api.DeployModelRequest.transformer:type_name -> api.Transformer + 10, // 7: api.ModelStatus.conditions:type_name -> api.ModelCondition + 8, // 8: api.ModelService.DeployModel:input_type -> api.DeployModelRequest + 0, // 9: api.ModelService.GetModelStatus:input_type -> api.ModelIdentifier + 0, // 10: api.ModelService.DeleteModel:input_type -> api.ModelIdentifier + 12, // 11: api.ModelService.DeployModel:output_type -> google.protobuf.Empty + 11, // 12: api.ModelService.GetModelStatus:output_type -> api.ModelStatus + 12, // 13: api.ModelService.DeleteModel:output_type -> google.protobuf.Empty + 11, // [11:14] is the sub-list for method output_type + 8, // [8:11] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } func init() { file_model_proto_init() } @@ -468,7 +877,7 @@ func file_model_proto_init() { } if !protoimpl.UnsafeEnabled { file_model_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NodeSelector); i { + switch v := v.(*ModelIdentifier); i { case 0: return &v.state case 1: @@ -480,7 +889,7 @@ func file_model_proto_init() { } } file_model_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResourceLimits); i { + switch v := v.(*NodeSelector); i { case 0: return &v.state case 1: @@ -492,7 +901,7 @@ func file_model_proto_init() { } } file_model_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PredictorServer); i { + switch v := v.(*ResourceLimits); i { case 0: return &v.state case 1: @@ -504,7 +913,7 @@ func file_model_proto_init() { } } file_model_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Predictor); i { + switch v := v.(*PredictorServer); i { case 0: return &v.state case 1: @@ -516,7 +925,7 @@ func file_model_proto_init() { } } file_model_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeployModelRequest); i { + switch v := v.(*Env); i { case 0: return &v.state case 1: @@ -528,6 +937,54 @@ func file_model_proto_init() { } } file_model_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Container); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_model_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Transformer); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_model_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Predictor); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_model_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeployModelRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_model_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeployModelResponse); i { case 0: return &v.state @@ -539,6 +996,30 @@ func file_model_proto_init() { return nil } } + file_model_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ModelCondition); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_model_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ModelStatus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -546,7 +1027,7 @@ func file_model_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_model_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 12, NumExtensions: 0, NumServices: 1, }, diff --git a/api/gen/model.pb.gw.go b/api/gen/model.pb.gw.go index c540cae..32c0837 100644 --- a/api/gen/model.pb.gw.go +++ b/api/gen/model.pb.gw.go @@ -99,6 +99,150 @@ func local_request_ModelService_DeployModel_0(ctx context.Context, marshaler run } +func request_ModelService_GetModelStatus_0(ctx context.Context, marshaler runtime.Marshaler, client ModelServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ModelIdentifier + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["namespace"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace") + } + + protoReq.Namespace, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err) + } + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + msg, err := client.GetModelStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ModelService_GetModelStatus_0(ctx context.Context, marshaler runtime.Marshaler, server ModelServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ModelIdentifier + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["namespace"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace") + } + + protoReq.Namespace, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err) + } + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + msg, err := server.GetModelStatus(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ModelService_DeleteModel_0(ctx context.Context, marshaler runtime.Marshaler, client ModelServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ModelIdentifier + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["namespace"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace") + } + + protoReq.Namespace, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err) + } + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + msg, err := client.DeleteModel(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ModelService_DeleteModel_0(ctx context.Context, marshaler runtime.Marshaler, server ModelServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ModelIdentifier + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["namespace"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace") + } + + protoReq.Namespace, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err) + } + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + msg, err := server.DeleteModel(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterModelServiceHandlerServer registers the http handlers for service ModelService to "mux". // UnaryRPC :call ModelServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -128,6 +272,52 @@ func RegisterModelServiceHandlerServer(ctx context.Context, mux *runtime.ServeMu }) + mux.Handle("GET", pattern_ModelService_GetModelStatus_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, "/api.ModelService/GetModelStatus") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ModelService_GetModelStatus_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_ModelService_GetModelStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_ModelService_DeleteModel_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, "/api.ModelService/DeleteModel") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ModelService_DeleteModel_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_ModelService_DeleteModel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -189,13 +379,61 @@ func RegisterModelServiceHandlerClient(ctx context.Context, mux *runtime.ServeMu }) + mux.Handle("GET", pattern_ModelService_GetModelStatus_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, "/api.ModelService/GetModelStatus") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ModelService_GetModelStatus_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ModelService_GetModelStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_ModelService_DeleteModel_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, "/api.ModelService/DeleteModel") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ModelService_DeleteModel_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ModelService_DeleteModel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } var ( - pattern_ModelService_DeployModel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 2, 4}, []string{"apis", "v1beta1", "namespace", "models", "deploy"}, "")) + pattern_ModelService_DeployModel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"apis", "v1beta1", "namespace", "models"}, "")) + + pattern_ModelService_GetModelStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"apis", "v1beta1", "namespace", "models", "name"}, "")) + + pattern_ModelService_DeleteModel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"apis", "v1beta1", "namespace", "models", "name"}, "")) ) var ( forward_ModelService_DeployModel_0 = runtime.ForwardResponseMessage + + forward_ModelService_GetModelStatus_0 = runtime.ForwardResponseMessage + + forward_ModelService_DeleteModel_0 = runtime.ForwardResponseMessage ) diff --git a/api/gen/model_grpc.pb.go b/api/gen/model_grpc.pb.go index c15ac1a..e3d64e3 100644 --- a/api/gen/model_grpc.pb.go +++ b/api/gen/model_grpc.pb.go @@ -7,6 +7,7 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" ) // This is a compile-time assertion to ensure that this generated file @@ -17,7 +18,9 @@ const _ = grpc.SupportPackageIsVersion7 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type ModelServiceClient interface { - DeployModel(ctx context.Context, in *DeployModelRequest, opts ...grpc.CallOption) (*DeployModelResponse, error) + DeployModel(ctx context.Context, in *DeployModelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + GetModelStatus(ctx context.Context, in *ModelIdentifier, opts ...grpc.CallOption) (*ModelStatus, error) + DeleteModel(ctx context.Context, in *ModelIdentifier, opts ...grpc.CallOption) (*emptypb.Empty, error) } type modelServiceClient struct { @@ -28,8 +31,8 @@ func NewModelServiceClient(cc grpc.ClientConnInterface) ModelServiceClient { return &modelServiceClient{cc} } -func (c *modelServiceClient) DeployModel(ctx context.Context, in *DeployModelRequest, opts ...grpc.CallOption) (*DeployModelResponse, error) { - out := new(DeployModelResponse) +func (c *modelServiceClient) DeployModel(ctx context.Context, in *DeployModelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) err := c.cc.Invoke(ctx, "/api.ModelService/DeployModel", in, out, opts...) if err != nil { return nil, err @@ -37,11 +40,31 @@ func (c *modelServiceClient) DeployModel(ctx context.Context, in *DeployModelReq return out, nil } +func (c *modelServiceClient) GetModelStatus(ctx context.Context, in *ModelIdentifier, opts ...grpc.CallOption) (*ModelStatus, error) { + out := new(ModelStatus) + err := c.cc.Invoke(ctx, "/api.ModelService/GetModelStatus", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *modelServiceClient) DeleteModel(ctx context.Context, in *ModelIdentifier, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.ModelService/DeleteModel", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // ModelServiceServer is the server API for ModelService service. // All implementations must embed UnimplementedModelServiceServer // for forward compatibility type ModelServiceServer interface { - DeployModel(context.Context, *DeployModelRequest) (*DeployModelResponse, error) + DeployModel(context.Context, *DeployModelRequest) (*emptypb.Empty, error) + GetModelStatus(context.Context, *ModelIdentifier) (*ModelStatus, error) + DeleteModel(context.Context, *ModelIdentifier) (*emptypb.Empty, error) mustEmbedUnimplementedModelServiceServer() } @@ -49,9 +72,15 @@ type ModelServiceServer interface { type UnimplementedModelServiceServer struct { } -func (UnimplementedModelServiceServer) DeployModel(context.Context, *DeployModelRequest) (*DeployModelResponse, error) { +func (UnimplementedModelServiceServer) DeployModel(context.Context, *DeployModelRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method DeployModel not implemented") } +func (UnimplementedModelServiceServer) GetModelStatus(context.Context, *ModelIdentifier) (*ModelStatus, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetModelStatus not implemented") +} +func (UnimplementedModelServiceServer) DeleteModel(context.Context, *ModelIdentifier) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteModel not implemented") +} func (UnimplementedModelServiceServer) mustEmbedUnimplementedModelServiceServer() {} // UnsafeModelServiceServer may be embedded to opt out of forward compatibility for this service. @@ -83,6 +112,42 @@ func _ModelService_DeployModel_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _ModelService_GetModelStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ModelIdentifier) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelServiceServer).GetModelStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.ModelService/GetModelStatus", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelServiceServer).GetModelStatus(ctx, req.(*ModelIdentifier)) + } + return interceptor(ctx, in, info, handler) +} + +func _ModelService_DeleteModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ModelIdentifier) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelServiceServer).DeleteModel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.ModelService/DeleteModel", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelServiceServer).DeleteModel(ctx, req.(*ModelIdentifier)) + } + return interceptor(ctx, in, info, handler) +} + var _ModelService_serviceDesc = grpc.ServiceDesc{ ServiceName: "api.ModelService", HandlerType: (*ModelServiceServer)(nil), @@ -91,6 +156,14 @@ var _ModelService_serviceDesc = grpc.ServiceDesc{ MethodName: "DeployModel", Handler: _ModelService_DeployModel_Handler, }, + { + MethodName: "GetModelStatus", + Handler: _ModelService_GetModelStatus_Handler, + }, + { + MethodName: "DeleteModel", + Handler: _ModelService_DeleteModel_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "model.proto", diff --git a/api/proto/model.proto b/api/proto/model.proto index 8b3d0b5..448c1bc 100644 --- a/api/proto/model.proto +++ b/api/proto/model.proto @@ -4,14 +4,32 @@ package api; option go_package = "github.com/onepanelio/core/api/gen"; import "google/api/annotations.proto"; +import "google/protobuf/empty.proto"; service ModelService { - rpc DeployModel (DeployModelRequest) returns (DeployModelResponse) { + rpc DeployModel (DeployModelRequest) returns (google.protobuf.Empty) { option (google.api.http) = { - post: "/apis/v1beta1/{namespace}/models/deploy" + post: "/apis/v1beta1/{namespace}/models" body: "*" }; } + + rpc GetModelStatus (ModelIdentifier) returns (ModelStatus) { + option (google.api.http) = { + get: "/apis/v1beta1/{namespace}/models/{name}" + }; + } + + rpc DeleteModel (ModelIdentifier) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/apis/v1beta1/{namespace}/models/{name}" + }; + } +} + +message ModelIdentifier { + string namespace = 1; + string name = 2; } message NodeSelector { @@ -31,6 +49,21 @@ message PredictorServer { ResourceLimits limits = 4; } +message Env { + string name = 1; + string value = 2; +} + +message Container { + string image = 1; + string name = 2; + repeated Env env = 3; +} + +message Transformer { + repeated Container containers = 1; +} + message Predictor { NodeSelector nodeSelector = 1; PredictorServer server = 2; @@ -41,8 +74,20 @@ message DeployModelRequest { string name = 2; Predictor predictor = 3; + Transformer transformer = 4; } message DeployModelResponse { - string name = 1; + string status = 1; } + +message ModelCondition { + string lastTransitionTime = 1; + string status = 2; + string type = 3; +} + +message ModelStatus { + bool ready = 1; + repeated ModelCondition conditions = 2; +} \ No newline at end of file diff --git a/pkg/model.go b/pkg/model.go index fc98acc..97861f5 100644 --- a/pkg/model.go +++ b/pkg/model.go @@ -33,10 +33,49 @@ func (c *Client) DeployModel(deployment *ModelDeployment) error { err = restClient.Post(). Namespace(deployment.Namespace). Name(deployment.Name). - Resource("InferenceServices"). + Resource(modelResource). Body(data). Do(). Error() return err } + +// GetModelStatus returns the model's status +func (c *Client) GetModelStatus(namespace, name string) (*ModelStatus, error) { + restClient, err := modelRestClient() + if err != nil { + return nil, err + } + + result := &k8sModel{} + + err = restClient.Get(). + Namespace(namespace). + Name(name). + Resource(modelResource). + Do(). + Into(result) + + status := &ModelStatus{ + Conditions: result.Status.Conditions, + Ready: result.Status.Ready(), + } + + return status, err +} + +// DeleteModel deletes the model +func (c *Client) DeleteModel(namespace, name string) error { + restClient, err := modelRestClient() + if err != nil { + return err + } + + return restClient.Delete(). + Namespace(namespace). + Name(name). + Resource(modelResource). + Do(). + Error() +} diff --git a/pkg/model_types.go b/pkg/model_types.go index 92b9cec..c4aea98 100644 --- a/pkg/model_types.go +++ b/pkg/model_types.go @@ -1,5 +1,13 @@ package v1 +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "time" +) + +const modelResource = "InferenceServices" + // ResourceLimits are the cpu/memory limits type ResourceLimits struct { CPU string @@ -15,10 +23,33 @@ type NodeSelector struct { // PredictorServer contains information on a server that serves models type PredictorServer struct { Name string - RuntimeVersion string + RuntimeVersion *string StorageURI string - ResourceLimits ResourceLimits - NodeSelector NodeSelector + ResourceLimits *ResourceLimits +} + +// Predictor contains information on what type of predictor we are using, and what resources it has available +type Predictor struct { + NodeSelector *NodeSelector + Server PredictorServer +} + +// Env is a name/value environment variable +type Env struct { + Name string `json:"name"` + Value string `json:"value"` +} + +// TransformerContainer is a container specific to a Transformer +type TransformerContainer struct { + Image string `json:"image"` + Name string `json:"name"` + Env []Env `json:"env"` +} + +// Transformer is a unit that can convert model input and output to different formats in json +type Transformer struct { + Containers []TransformerContainer } // ModelDeployment represents the information necessary to deploy a model @@ -26,11 +57,85 @@ type ModelDeployment struct { Name string Namespace string - PredictorServer PredictorServer + Transformer *Transformer + Predictor *Predictor +} + +// ModelStatus represents information about a model's status +type ModelStatus struct { + Ready bool + Conditions []modelCondition +} + +type modelCondition struct { + LastTransitionTime time.Time `json:"lastTransitionTime"` + Status string `json:"status"` + Type string `json:"type"` +} + +type modelStatus struct { + Conditions []modelCondition `json:"conditions"` +} + +// Ready returns true if there is a condition called Ready: true. +func (m *modelStatus) Ready() bool { + for _, condition := range m.Conditions { + if condition.Type == "Ready" && condition.Status == "True" { + return true + } + } + + return false +} + +// TODO +// k8sModel +type k8sModel struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata" protobuf:"bytes,1,opt,name=metadata"` + Status modelStatus `json:"status,omitempty"` +} + +func (k k8sModel) DeepCopyObject() runtime.Object { + panic("implement me") } // ToResource converts the ModelDeployment into a KFServing spec func (m *ModelDeployment) ToResource() interface{} { + spec := map[string]interface{}{ + "predictor": map[string]interface{}{ + m.Predictor.Server.Name: map[string]interface{}{ + "storageUri": m.Predictor.Server.StorageURI, + }, + }, + } + + predictor := spec["predictor"].(map[string]interface{}) + predictorServer := predictor[m.Predictor.Server.Name].(map[string]interface{}) + + if m.Predictor.Server.RuntimeVersion != nil { + predictorServer["runtimeVersion"] = m.Predictor.Server.RuntimeVersion + } + + if m.Predictor.NodeSelector != nil { + predictor["nodeSelector"] = map[string]string{ + m.Predictor.NodeSelector.Key: m.Predictor.NodeSelector.Value, + } + } + + if m.Predictor.Server.ResourceLimits != nil { + predictorServer["resources"] = map[string]string{ + "cpu": m.Predictor.Server.ResourceLimits.CPU, + "memory": m.Predictor.Server.ResourceLimits.Memory, + } + } + + if m.Transformer != nil { + spec["transformer"] = map[string]interface{}{ + "containers": m.Transformer.Containers, + } + } + resource := map[string]interface{}{ "apiVersion": "serving.kubeflow.org/v1beta1", "kind": "InferenceService", @@ -38,23 +143,7 @@ func (m *ModelDeployment) ToResource() interface{} { "namespace": m.Namespace, "name": m.Name, }, - "spec": map[string]interface{}{ - "predictor": map[string]interface{}{ - "nodeSelector": map[string]string{ - m.PredictorServer.NodeSelector.Key: m.PredictorServer.NodeSelector.Value, - }, - m.PredictorServer.Name: map[string]interface{}{ - "resources": map[string]interface{}{ - "limits": map[string]string{ - "cpu": m.PredictorServer.ResourceLimits.CPU, - "memory": m.PredictorServer.ResourceLimits.Memory, - }, - }, - "runtimeVersion": m.PredictorServer.RuntimeVersion, - "storageUri": m.PredictorServer.StorageURI, - }, - }, - }, + "spec": spec, } return resource diff --git a/server/model_server.go b/server/model_server.go index 02ada61..3c9ade2 100644 --- a/server/model_server.go +++ b/server/model_server.go @@ -2,9 +2,11 @@ package server import ( "context" + "github.com/golang/protobuf/ptypes/empty" api "github.com/onepanelio/core/api/gen" v1 "github.com/onepanelio/core/pkg" "github.com/onepanelio/core/server/auth" + "time" ) // ModelServer is an implementation of the grpc ModelServer @@ -18,9 +20,9 @@ func NewModelServer() *ModelServer { } // DeployModel deploys a model server with a model(s) -func (s *ModelServer) DeployModel(ctx context.Context, req *api.DeployModelRequest) (*api.DeployModelResponse, error) { +func (s *ModelServer) DeployModel(ctx context.Context, req *api.DeployModelRequest) (*empty.Empty, error) { client := getClient(ctx) - allowed, err := auth.IsAuthorized(client, req.Namespace, "create", "serving.kubeflow.org", "InferenceService", "") + allowed, err := auth.IsAuthorized(client, req.Namespace, "create", "serving.kubeflow.org", "inferenceservices", "") if err != nil || !allowed { return nil, err } @@ -28,27 +30,98 @@ func (s *ModelServer) DeployModel(ctx context.Context, req *api.DeployModelReque model := &v1.ModelDeployment{ Name: req.Name, Namespace: req.Namespace, - PredictorServer: v1.PredictorServer{ - Name: req.Predictor.Server.Name, - RuntimeVersion: req.Predictor.Server.RuntimeVersion, - StorageURI: req.Predictor.Server.StorageUri, - ResourceLimits: v1.ResourceLimits{ - CPU: req.Predictor.Server.Limits.Cpu, - Memory: req.Predictor.Server.Limits.Memory, - }, - NodeSelector: v1.NodeSelector{ - Key: req.Predictor.NodeSelector.Key, - Value: req.Predictor.NodeSelector.Value, + Predictor: &v1.Predictor{ + Server: v1.PredictorServer{ + Name: req.Predictor.Server.Name, + StorageURI: req.Predictor.Server.StorageUri, }, }, } + if req.Predictor.Server.RuntimeVersion != "" { + model.Predictor.Server.RuntimeVersion = &req.Predictor.Server.RuntimeVersion + } + + if req.Predictor.Server.Limits != nil { + model.Predictor.Server.ResourceLimits = &v1.ResourceLimits{ + CPU: req.Predictor.Server.Limits.Cpu, + Memory: req.Predictor.Server.Limits.Memory, + } + } + + if req.Predictor.NodeSelector != nil { + model.Predictor.NodeSelector = &v1.NodeSelector{ + Key: req.Predictor.NodeSelector.Key, + Value: req.Predictor.NodeSelector.Value, + } + } + + if req.Transformer != nil { + model.Transformer = &v1.Transformer{} + + for _, container := range req.Transformer.Containers { + modelContainer := v1.TransformerContainer{ + Image: container.Image, + Name: container.Name, + } + + for _, env := range container.Env { + modelContainer.Env = append(modelContainer.Env, v1.Env{ + Name: env.Name, + Value: env.Value, + }) + } + + model.Transformer.Containers = append(model.Transformer.Containers, modelContainer) + } + } + err = client.DeployModel(model) if err != nil { return nil, err } - return &api.DeployModelResponse{ - Name: "test", + return &empty.Empty{}, nil +} + +// GetModelStatus returns the status of a model +func (s *ModelServer) GetModelStatus(ctx context.Context, req *api.ModelIdentifier) (*api.ModelStatus, error) { + client := getClient(ctx) + allowed, err := auth.IsAuthorized(client, req.Namespace, "get", "serving.kubeflow.org", "inferenceservices", req.Name) + if err != nil || !allowed { + return nil, err + } + + status, err := client.GetModelStatus(req.Namespace, req.Name) + if err != nil { + return nil, err + } + + apiConditions := make([]*api.ModelCondition, len(status.Conditions)) + for i := range status.Conditions { + condition := status.Conditions[i] + apiConditions[i] = &api.ModelCondition{ + LastTransitionTime: condition.LastTransitionTime.Format(time.RFC3339), + Status: condition.Status, + Type: condition.Type, + } + } + + return &api.ModelStatus{ + Ready: status.Ready, + Conditions: apiConditions, }, nil } + +// DeleteModel deletes a model +func (s *ModelServer) DeleteModel(ctx context.Context, req *api.ModelIdentifier) (*empty.Empty, error) { + client := getClient(ctx) + allowed, err := auth.IsAuthorized(client, req.Namespace, "delete", "serving.kubeflow.org", "inferenceservices", req.Name) + if err != nil || !allowed { + return nil, err + } + + err = client.DeleteModel(req.Namespace, req.Name) + + return &empty.Empty{}, err +} From 51fb86e3feb70f6a9f7731e4b024a2752ba4bc70 Mon Sep 17 00:00:00 2001 From: Andrey Melnikov Date: Tue, 10 Aug 2021 13:36:44 -0700 Subject: [PATCH 3/9] feat: simplify API for model services and rename it to inferenceservice --- api/api.swagger.json | 146 +-- api/gen/inference_service.pb.go | 861 ++++++++++++++ ...el.pb.gw.go => inference_service.pb.gw.go} | 128 +- api/gen/inference_service_grpc.pb.go | 170 +++ api/gen/model.pb.go | 1042 ----------------- api/gen/model_grpc.pb.go | 170 --- .../{model.proto => inference_service.proto} | 54 +- main.go | 4 +- pkg/{model.go => inference_service.go} | 27 +- ...el_types.go => inference_service_types.go} | 63 +- server/inferenceservice_server.go | 177 +++ server/model_server.go | 127 -- 12 files changed, 1401 insertions(+), 1568 deletions(-) create mode 100644 api/gen/inference_service.pb.go rename api/gen/{model.pb.gw.go => inference_service.pb.gw.go} (56%) create mode 100644 api/gen/inference_service_grpc.pb.go delete mode 100644 api/gen/model.pb.go delete mode 100644 api/gen/model_grpc.pb.go rename api/proto/{model.proto => inference_service.proto} (50%) rename pkg/{model.go => inference_service.go} (66%) rename pkg/{model_types.go => inference_service_types.go} (62%) create mode 100644 server/inferenceservice_server.go delete mode 100644 server/model_server.go diff --git a/api/api.swagger.json b/api/api.swagger.json index 128588e..ec44728 100644 --- a/api/api.swagger.json +++ b/api/api.swagger.json @@ -763,9 +763,9 @@ ] } }, - "/apis/v1beta1/{namespace}/models": { + "/apis/v1beta1/{namespace}/inferenceservice": { "post": { - "operationId": "DeployModel", + "operationId": "CreateInferenceService", "responses": { "200": { "description": "A successful response.", @@ -792,23 +792,23 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/DeployModelRequest" + "$ref": "#/definitions/CreateInferenceServiceRequest" } } ], "tags": [ - "ModelService" + "InferenceService" ] } }, - "/apis/v1beta1/{namespace}/models/{name}": { + "/apis/v1beta1/{namespace}/inferenceservice/{name}": { "get": { - "operationId": "GetModelStatus", + "operationId": "GetInferenceServiceStatus", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ModelStatus" + "$ref": "#/definitions/InferenceServiceStatus" } }, "default": { @@ -833,11 +833,11 @@ } ], "tags": [ - "ModelService" + "InferenceService" ] }, "delete": { - "operationId": "DeleteModel", + "operationId": "DeleteInferenceService", "responses": { "200": { "description": "A successful response.", @@ -867,7 +867,7 @@ } ], "tags": [ - "ModelService" + "InferenceService" ] } }, @@ -3385,6 +3385,26 @@ } } }, + "CreateInferenceServiceRequest": { + "type": "object", + "properties": { + "namespace": { + "type": "string" + }, + "name": { + "type": "string" + }, + "transformerImage": { + "type": "string" + }, + "predictor": { + "$ref": "#/definitions/Predictor" + }, + "transformer": { + "$ref": "#/definitions/Transformer" + } + } + }, "CreateWorkflowExecutionBody": { "type": "object", "properties": { @@ -3487,23 +3507,6 @@ } } }, - "DeployModelRequest": { - "type": "object", - "properties": { - "namespace": { - "type": "string" - }, - "name": { - "type": "string" - }, - "predictor": { - "$ref": "#/definitions/Predictor" - }, - "transformer": { - "$ref": "#/definitions/Transformer" - } - } - }, "Env": { "type": "object", "properties": { @@ -3650,6 +3653,34 @@ } } }, + "InferenceServiceCondition": { + "type": "object", + "properties": { + "lastTransitionTime": { + "type": "string" + }, + "status": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "InferenceServiceStatus": { + "type": "object", + "properties": { + "ready": { + "type": "boolean" + }, + "conditions": { + "type": "array", + "items": { + "$ref": "#/definitions/InferenceServiceCondition" + } + } + } + }, "IsAuthorized": { "type": "object", "properties": { @@ -4093,34 +4124,6 @@ } } }, - "ModelCondition": { - "type": "object", - "properties": { - "lastTransitionTime": { - "type": "string" - }, - "status": { - "type": "string" - }, - "type": { - "type": "string" - } - } - }, - "ModelStatus": { - "type": "object", - "properties": { - "ready": { - "type": "boolean" - }, - "conditions": { - "type": "array", - "items": { - "$ref": "#/definitions/ModelCondition" - } - } - } - }, "Namespace": { "type": "object", "properties": { @@ -4154,17 +4157,6 @@ } } }, - "NodeSelector": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "string" - } - } - }, "Parameter": { "type": "object", "properties": { @@ -4209,17 +4201,6 @@ } }, "Predictor": { - "type": "object", - "properties": { - "nodeSelector": { - "$ref": "#/definitions/NodeSelector" - }, - "server": { - "$ref": "#/definitions/PredictorServer" - } - } - }, - "PredictorServer": { "type": "object", "properties": { "name": { @@ -4231,14 +4212,9 @@ "storageUri": { "type": "string" }, - "limits": { - "$ref": "#/definitions/ResourceLimits" - } - } - }, - "ResourceLimits": { - "type": "object", - "properties": { + "nodeSelector": { + "type": "string" + }, "cpu": { "type": "string" }, diff --git a/api/gen/inference_service.pb.go b/api/gen/inference_service.pb.go new file mode 100644 index 0000000..7698ec5 --- /dev/null +++ b/api/gen/inference_service.pb.go @@ -0,0 +1,861 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.14.0 +// source: inference_service.proto + +package gen + +import ( + proto "github.com/golang/protobuf/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type InferenceServiceIdentifier struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *InferenceServiceIdentifier) Reset() { + *x = InferenceServiceIdentifier{} + if protoimpl.UnsafeEnabled { + mi := &file_inference_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InferenceServiceIdentifier) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InferenceServiceIdentifier) ProtoMessage() {} + +func (x *InferenceServiceIdentifier) ProtoReflect() protoreflect.Message { + mi := &file_inference_service_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InferenceServiceIdentifier.ProtoReflect.Descriptor instead. +func (*InferenceServiceIdentifier) Descriptor() ([]byte, []int) { + return file_inference_service_proto_rawDescGZIP(), []int{0} +} + +func (x *InferenceServiceIdentifier) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *InferenceServiceIdentifier) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type Env struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *Env) Reset() { + *x = Env{} + if protoimpl.UnsafeEnabled { + mi := &file_inference_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Env) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Env) ProtoMessage() {} + +func (x *Env) ProtoReflect() protoreflect.Message { + mi := &file_inference_service_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Env.ProtoReflect.Descriptor instead. +func (*Env) Descriptor() ([]byte, []int) { + return file_inference_service_proto_rawDescGZIP(), []int{1} +} + +func (x *Env) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Env) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type Container struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Image string `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Env []*Env `protobuf:"bytes,3,rep,name=env,proto3" json:"env,omitempty"` +} + +func (x *Container) Reset() { + *x = Container{} + if protoimpl.UnsafeEnabled { + mi := &file_inference_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Container) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Container) ProtoMessage() {} + +func (x *Container) ProtoReflect() protoreflect.Message { + mi := &file_inference_service_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Container.ProtoReflect.Descriptor instead. +func (*Container) Descriptor() ([]byte, []int) { + return file_inference_service_proto_rawDescGZIP(), []int{2} +} + +func (x *Container) GetImage() string { + if x != nil { + return x.Image + } + return "" +} + +func (x *Container) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Container) GetEnv() []*Env { + if x != nil { + return x.Env + } + return nil +} + +type Transformer struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Containers []*Container `protobuf:"bytes,1,rep,name=containers,proto3" json:"containers,omitempty"` +} + +func (x *Transformer) Reset() { + *x = Transformer{} + if protoimpl.UnsafeEnabled { + mi := &file_inference_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Transformer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Transformer) ProtoMessage() {} + +func (x *Transformer) ProtoReflect() protoreflect.Message { + mi := &file_inference_service_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Transformer.ProtoReflect.Descriptor instead. +func (*Transformer) Descriptor() ([]byte, []int) { + return file_inference_service_proto_rawDescGZIP(), []int{3} +} + +func (x *Transformer) GetContainers() []*Container { + if x != nil { + return x.Containers + } + return nil +} + +type Predictor struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + RuntimeVersion string `protobuf:"bytes,2,opt,name=runtimeVersion,proto3" json:"runtimeVersion,omitempty"` + StorageUri string `protobuf:"bytes,3,opt,name=storageUri,proto3" json:"storageUri,omitempty"` + NodeSelector string `protobuf:"bytes,4,opt,name=nodeSelector,proto3" json:"nodeSelector,omitempty"` + Cpu string `protobuf:"bytes,5,opt,name=cpu,proto3" json:"cpu,omitempty"` + Memory string `protobuf:"bytes,6,opt,name=memory,proto3" json:"memory,omitempty"` +} + +func (x *Predictor) Reset() { + *x = Predictor{} + if protoimpl.UnsafeEnabled { + mi := &file_inference_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Predictor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Predictor) ProtoMessage() {} + +func (x *Predictor) ProtoReflect() protoreflect.Message { + mi := &file_inference_service_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Predictor.ProtoReflect.Descriptor instead. +func (*Predictor) Descriptor() ([]byte, []int) { + return file_inference_service_proto_rawDescGZIP(), []int{4} +} + +func (x *Predictor) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Predictor) GetRuntimeVersion() string { + if x != nil { + return x.RuntimeVersion + } + return "" +} + +func (x *Predictor) GetStorageUri() string { + if x != nil { + return x.StorageUri + } + return "" +} + +func (x *Predictor) GetNodeSelector() string { + if x != nil { + return x.NodeSelector + } + return "" +} + +func (x *Predictor) GetCpu() string { + if x != nil { + return x.Cpu + } + return "" +} + +func (x *Predictor) GetMemory() string { + if x != nil { + return x.Memory + } + return "" +} + +type CreateInferenceServiceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + TransformerImage string `protobuf:"bytes,3,opt,name=transformerImage,proto3" json:"transformerImage,omitempty"` + Predictor *Predictor `protobuf:"bytes,4,opt,name=predictor,proto3" json:"predictor,omitempty"` + Transformer *Transformer `protobuf:"bytes,5,opt,name=transformer,proto3" json:"transformer,omitempty"` +} + +func (x *CreateInferenceServiceRequest) Reset() { + *x = CreateInferenceServiceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_inference_service_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateInferenceServiceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateInferenceServiceRequest) ProtoMessage() {} + +func (x *CreateInferenceServiceRequest) ProtoReflect() protoreflect.Message { + mi := &file_inference_service_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateInferenceServiceRequest.ProtoReflect.Descriptor instead. +func (*CreateInferenceServiceRequest) Descriptor() ([]byte, []int) { + return file_inference_service_proto_rawDescGZIP(), []int{5} +} + +func (x *CreateInferenceServiceRequest) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *CreateInferenceServiceRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateInferenceServiceRequest) GetTransformerImage() string { + if x != nil { + return x.TransformerImage + } + return "" +} + +func (x *CreateInferenceServiceRequest) GetPredictor() *Predictor { + if x != nil { + return x.Predictor + } + return nil +} + +func (x *CreateInferenceServiceRequest) GetTransformer() *Transformer { + if x != nil { + return x.Transformer + } + return nil +} + +type DeployModelResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` +} + +func (x *DeployModelResponse) Reset() { + *x = DeployModelResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_inference_service_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeployModelResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeployModelResponse) ProtoMessage() {} + +func (x *DeployModelResponse) ProtoReflect() protoreflect.Message { + mi := &file_inference_service_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeployModelResponse.ProtoReflect.Descriptor instead. +func (*DeployModelResponse) Descriptor() ([]byte, []int) { + return file_inference_service_proto_rawDescGZIP(), []int{6} +} + +func (x *DeployModelResponse) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +type InferenceServiceCondition struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LastTransitionTime string `protobuf:"bytes,1,opt,name=lastTransitionTime,proto3" json:"lastTransitionTime,omitempty"` + Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` + Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` +} + +func (x *InferenceServiceCondition) Reset() { + *x = InferenceServiceCondition{} + if protoimpl.UnsafeEnabled { + mi := &file_inference_service_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InferenceServiceCondition) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InferenceServiceCondition) ProtoMessage() {} + +func (x *InferenceServiceCondition) ProtoReflect() protoreflect.Message { + mi := &file_inference_service_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InferenceServiceCondition.ProtoReflect.Descriptor instead. +func (*InferenceServiceCondition) Descriptor() ([]byte, []int) { + return file_inference_service_proto_rawDescGZIP(), []int{7} +} + +func (x *InferenceServiceCondition) GetLastTransitionTime() string { + if x != nil { + return x.LastTransitionTime + } + return "" +} + +func (x *InferenceServiceCondition) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *InferenceServiceCondition) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +type InferenceServiceStatus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ready bool `protobuf:"varint,1,opt,name=ready,proto3" json:"ready,omitempty"` + Conditions []*InferenceServiceCondition `protobuf:"bytes,2,rep,name=conditions,proto3" json:"conditions,omitempty"` +} + +func (x *InferenceServiceStatus) Reset() { + *x = InferenceServiceStatus{} + if protoimpl.UnsafeEnabled { + mi := &file_inference_service_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InferenceServiceStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InferenceServiceStatus) ProtoMessage() {} + +func (x *InferenceServiceStatus) ProtoReflect() protoreflect.Message { + mi := &file_inference_service_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InferenceServiceStatus.ProtoReflect.Descriptor instead. +func (*InferenceServiceStatus) Descriptor() ([]byte, []int) { + return file_inference_service_proto_rawDescGZIP(), []int{8} +} + +func (x *InferenceServiceStatus) GetReady() bool { + if x != nil { + return x.Ready + } + return false +} + +func (x *InferenceServiceStatus) GetConditions() []*InferenceServiceCondition { + if x != nil { + return x.Conditions + } + return nil +} + +var File_inference_service_proto protoreflect.FileDescriptor + +var file_inference_service_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x69, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x61, 0x70, 0x69, 0x1a, 0x1c, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, + 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4e, 0x0a, 0x1a, 0x49, 0x6e, 0x66, + 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x2f, 0x0a, 0x03, 0x45, 0x6e, 0x76, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x51, 0x0a, 0x09, 0x43, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x1a, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x45, 0x6e, 0x76, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x22, 0x3d, 0x0a, + 0x0b, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x12, 0x2e, 0x0a, 0x0a, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x22, 0xb5, 0x01, 0x0a, + 0x09, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, + 0x0a, 0x0e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x55, 0x72, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x55, 0x72, 0x69, 0x12, 0x22, 0x0a, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x53, 0x65, + 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6e, 0x6f, + 0x64, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x70, + 0x75, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x70, 0x75, 0x12, 0x16, 0x0a, 0x06, + 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, + 0x6d, 0x6f, 0x72, 0x79, 0x22, 0xdf, 0x01, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, + 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x10, 0x74, 0x72, 0x61, 0x6e, + 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x49, + 0x6d, 0x61, 0x67, 0x65, 0x12, 0x2c, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, + 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x72, + 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x09, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, + 0x6f, 0x72, 0x12, 0x32, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, + 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x22, 0x2d, 0x0a, 0x13, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, + 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x77, 0x0a, 0x19, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, + 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x12, 0x6c, 0x61, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, + 0x6c, 0x61, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, + 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x6e, + 0x0a, 0x16, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x64, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x12, 0x3e, + 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, + 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x32, 0xc6, + 0x03, 0x0a, 0x10, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x8b, 0x01, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x22, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x65, 0x72, + 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x2f, 0x22, 0x2a, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x69, 0x6e, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x01, + 0x2a, 0x12, 0x94, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, + 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, + 0x1a, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x39, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x12, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, + 0x2f, 0x69, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x12, 0x8c, 0x01, 0x0a, 0x16, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, + 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x66, 0x69, 0x65, 0x72, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x39, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x33, 0x2a, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, + 0x69, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x42, 0x24, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x65, 0x70, 0x61, 0x6e, 0x65, 0x6c, 0x69, 0x6f, + 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_inference_service_proto_rawDescOnce sync.Once + file_inference_service_proto_rawDescData = file_inference_service_proto_rawDesc +) + +func file_inference_service_proto_rawDescGZIP() []byte { + file_inference_service_proto_rawDescOnce.Do(func() { + file_inference_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_inference_service_proto_rawDescData) + }) + return file_inference_service_proto_rawDescData +} + +var file_inference_service_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_inference_service_proto_goTypes = []interface{}{ + (*InferenceServiceIdentifier)(nil), // 0: api.InferenceServiceIdentifier + (*Env)(nil), // 1: api.Env + (*Container)(nil), // 2: api.Container + (*Transformer)(nil), // 3: api.Transformer + (*Predictor)(nil), // 4: api.Predictor + (*CreateInferenceServiceRequest)(nil), // 5: api.CreateInferenceServiceRequest + (*DeployModelResponse)(nil), // 6: api.DeployModelResponse + (*InferenceServiceCondition)(nil), // 7: api.InferenceServiceCondition + (*InferenceServiceStatus)(nil), // 8: api.InferenceServiceStatus + (*emptypb.Empty)(nil), // 9: google.protobuf.Empty +} +var file_inference_service_proto_depIdxs = []int32{ + 1, // 0: api.Container.env:type_name -> api.Env + 2, // 1: api.Transformer.containers:type_name -> api.Container + 4, // 2: api.CreateInferenceServiceRequest.predictor:type_name -> api.Predictor + 3, // 3: api.CreateInferenceServiceRequest.transformer:type_name -> api.Transformer + 7, // 4: api.InferenceServiceStatus.conditions:type_name -> api.InferenceServiceCondition + 5, // 5: api.InferenceService.CreateInferenceService:input_type -> api.CreateInferenceServiceRequest + 0, // 6: api.InferenceService.GetInferenceServiceStatus:input_type -> api.InferenceServiceIdentifier + 0, // 7: api.InferenceService.DeleteInferenceService:input_type -> api.InferenceServiceIdentifier + 9, // 8: api.InferenceService.CreateInferenceService:output_type -> google.protobuf.Empty + 8, // 9: api.InferenceService.GetInferenceServiceStatus:output_type -> api.InferenceServiceStatus + 9, // 10: api.InferenceService.DeleteInferenceService:output_type -> google.protobuf.Empty + 8, // [8:11] is the sub-list for method output_type + 5, // [5:8] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_inference_service_proto_init() } +func file_inference_service_proto_init() { + if File_inference_service_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_inference_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InferenceServiceIdentifier); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_inference_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Env); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_inference_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Container); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_inference_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Transformer); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_inference_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Predictor); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_inference_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateInferenceServiceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_inference_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeployModelResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_inference_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InferenceServiceCondition); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_inference_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InferenceServiceStatus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_inference_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 9, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_inference_service_proto_goTypes, + DependencyIndexes: file_inference_service_proto_depIdxs, + MessageInfos: file_inference_service_proto_msgTypes, + }.Build() + File_inference_service_proto = out.File + file_inference_service_proto_rawDesc = nil + file_inference_service_proto_goTypes = nil + file_inference_service_proto_depIdxs = nil +} diff --git a/api/gen/model.pb.gw.go b/api/gen/inference_service.pb.gw.go similarity index 56% rename from api/gen/model.pb.gw.go rename to api/gen/inference_service.pb.gw.go index 32c0837..d08ea87 100644 --- a/api/gen/model.pb.gw.go +++ b/api/gen/inference_service.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: model.proto +// source: inference_service.proto /* Package gen is a reverse proxy. @@ -31,8 +31,8 @@ var _ = runtime.String var _ = utilities.NewDoubleArray var _ = metadata.Join -func request_ModelService_DeployModel_0(ctx context.Context, marshaler runtime.Marshaler, client ModelServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeployModelRequest +func request_InferenceService_CreateInferenceService_0(ctx context.Context, marshaler runtime.Marshaler, client InferenceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateInferenceServiceRequest var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) @@ -60,13 +60,13 @@ func request_ModelService_DeployModel_0(ctx context.Context, marshaler runtime.M return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err) } - msg, err := client.DeployModel(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.CreateInferenceService(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_ModelService_DeployModel_0(ctx context.Context, marshaler runtime.Marshaler, server ModelServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeployModelRequest +func local_request_InferenceService_CreateInferenceService_0(ctx context.Context, marshaler runtime.Marshaler, server InferenceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateInferenceServiceRequest var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) @@ -94,13 +94,13 @@ func local_request_ModelService_DeployModel_0(ctx context.Context, marshaler run return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err) } - msg, err := server.DeployModel(ctx, &protoReq) + msg, err := server.CreateInferenceService(ctx, &protoReq) return msg, metadata, err } -func request_ModelService_GetModelStatus_0(ctx context.Context, marshaler runtime.Marshaler, client ModelServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ModelIdentifier +func request_InferenceService_GetInferenceServiceStatus_0(ctx context.Context, marshaler runtime.Marshaler, client InferenceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq InferenceServiceIdentifier var metadata runtime.ServerMetadata var ( @@ -130,13 +130,13 @@ func request_ModelService_GetModelStatus_0(ctx context.Context, marshaler runtim return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } - msg, err := client.GetModelStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.GetInferenceServiceStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_ModelService_GetModelStatus_0(ctx context.Context, marshaler runtime.Marshaler, server ModelServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ModelIdentifier +func local_request_InferenceService_GetInferenceServiceStatus_0(ctx context.Context, marshaler runtime.Marshaler, server InferenceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq InferenceServiceIdentifier var metadata runtime.ServerMetadata var ( @@ -166,13 +166,13 @@ func local_request_ModelService_GetModelStatus_0(ctx context.Context, marshaler return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } - msg, err := server.GetModelStatus(ctx, &protoReq) + msg, err := server.GetInferenceServiceStatus(ctx, &protoReq) return msg, metadata, err } -func request_ModelService_DeleteModel_0(ctx context.Context, marshaler runtime.Marshaler, client ModelServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ModelIdentifier +func request_InferenceService_DeleteInferenceService_0(ctx context.Context, marshaler runtime.Marshaler, client InferenceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq InferenceServiceIdentifier var metadata runtime.ServerMetadata var ( @@ -202,13 +202,13 @@ func request_ModelService_DeleteModel_0(ctx context.Context, marshaler runtime.M return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } - msg, err := client.DeleteModel(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.DeleteInferenceService(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_ModelService_DeleteModel_0(ctx context.Context, marshaler runtime.Marshaler, server ModelServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ModelIdentifier +func local_request_InferenceService_DeleteInferenceService_0(ctx context.Context, marshaler runtime.Marshaler, server InferenceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq InferenceServiceIdentifier var metadata runtime.ServerMetadata var ( @@ -238,29 +238,29 @@ func local_request_ModelService_DeleteModel_0(ctx context.Context, marshaler run return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } - msg, err := server.DeleteModel(ctx, &protoReq) + msg, err := server.DeleteInferenceService(ctx, &protoReq) return msg, metadata, err } -// RegisterModelServiceHandlerServer registers the http handlers for service ModelService to "mux". -// UnaryRPC :call ModelServiceServer directly. +// RegisterInferenceServiceHandlerServer registers the http handlers for service InferenceService to "mux". +// UnaryRPC :call InferenceServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterModelServiceHandlerFromEndpoint instead. -func RegisterModelServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ModelServiceServer) error { +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterInferenceServiceHandlerFromEndpoint instead. +func RegisterInferenceServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server InferenceServiceServer) error { - mux.Handle("POST", pattern_ModelService_DeployModel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_InferenceService_CreateInferenceService_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, "/api.ModelService/DeployModel") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/api.InferenceService/CreateInferenceService") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_ModelService_DeployModel_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_InferenceService_CreateInferenceService_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 { @@ -268,22 +268,22 @@ func RegisterModelServiceHandlerServer(ctx context.Context, mux *runtime.ServeMu return } - forward_ModelService_DeployModel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_InferenceService_CreateInferenceService_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_ModelService_GetModelStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_InferenceService_GetInferenceServiceStatus_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, "/api.ModelService/GetModelStatus") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/api.InferenceService/GetInferenceServiceStatus") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_ModelService_GetModelStatus_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_InferenceService_GetInferenceServiceStatus_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 { @@ -291,22 +291,22 @@ func RegisterModelServiceHandlerServer(ctx context.Context, mux *runtime.ServeMu return } - forward_ModelService_GetModelStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_InferenceService_GetInferenceServiceStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("DELETE", pattern_ModelService_DeleteModel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("DELETE", pattern_InferenceService_DeleteInferenceService_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, "/api.ModelService/DeleteModel") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/api.InferenceService/DeleteInferenceService") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_ModelService_DeleteModel_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_InferenceService_DeleteInferenceService_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 { @@ -314,16 +314,16 @@ func RegisterModelServiceHandlerServer(ctx context.Context, mux *runtime.ServeMu return } - forward_ModelService_DeleteModel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_InferenceService_DeleteInferenceService_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) return nil } -// RegisterModelServiceHandlerFromEndpoint is same as RegisterModelServiceHandler but +// RegisterInferenceServiceHandlerFromEndpoint is same as RegisterInferenceServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterModelServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { +func RegisterInferenceServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { conn, err := grpc.Dial(endpoint, opts...) if err != nil { return err @@ -343,79 +343,79 @@ func RegisterModelServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.S }() }() - return RegisterModelServiceHandler(ctx, mux, conn) + return RegisterInferenceServiceHandler(ctx, mux, conn) } -// RegisterModelServiceHandler registers the http handlers for service ModelService to "mux". +// RegisterInferenceServiceHandler registers the http handlers for service InferenceService to "mux". // The handlers forward requests to the grpc endpoint over "conn". -func RegisterModelServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterModelServiceHandlerClient(ctx, mux, NewModelServiceClient(conn)) +func RegisterInferenceServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterInferenceServiceHandlerClient(ctx, mux, NewInferenceServiceClient(conn)) } -// RegisterModelServiceHandlerClient registers the http handlers for service ModelService -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ModelServiceClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ModelServiceClient" +// RegisterInferenceServiceHandlerClient registers the http handlers for service InferenceService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "InferenceServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "InferenceServiceClient" // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "ModelServiceClient" to call the correct interceptors. -func RegisterModelServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ModelServiceClient) error { +// "InferenceServiceClient" to call the correct interceptors. +func RegisterInferenceServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client InferenceServiceClient) error { - mux.Handle("POST", pattern_ModelService_DeployModel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_InferenceService_CreateInferenceService_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, "/api.ModelService/DeployModel") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/api.InferenceService/CreateInferenceService") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_ModelService_DeployModel_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_InferenceService_CreateInferenceService_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_ModelService_DeployModel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_InferenceService_CreateInferenceService_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_ModelService_GetModelStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_InferenceService_GetInferenceServiceStatus_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, "/api.ModelService/GetModelStatus") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/api.InferenceService/GetInferenceServiceStatus") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_ModelService_GetModelStatus_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_InferenceService_GetInferenceServiceStatus_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_ModelService_GetModelStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_InferenceService_GetInferenceServiceStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("DELETE", pattern_ModelService_DeleteModel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("DELETE", pattern_InferenceService_DeleteInferenceService_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, "/api.ModelService/DeleteModel") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/api.InferenceService/DeleteInferenceService") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_ModelService_DeleteModel_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_InferenceService_DeleteInferenceService_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_ModelService_DeleteModel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_InferenceService_DeleteInferenceService_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -423,17 +423,17 @@ func RegisterModelServiceHandlerClient(ctx context.Context, mux *runtime.ServeMu } var ( - pattern_ModelService_DeployModel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"apis", "v1beta1", "namespace", "models"}, "")) + pattern_InferenceService_CreateInferenceService_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"apis", "v1beta1", "namespace", "inferenceservice"}, "")) - pattern_ModelService_GetModelStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"apis", "v1beta1", "namespace", "models", "name"}, "")) + pattern_InferenceService_GetInferenceServiceStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"apis", "v1beta1", "namespace", "inferenceservice", "name"}, "")) - pattern_ModelService_DeleteModel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"apis", "v1beta1", "namespace", "models", "name"}, "")) + pattern_InferenceService_DeleteInferenceService_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"apis", "v1beta1", "namespace", "inferenceservice", "name"}, "")) ) var ( - forward_ModelService_DeployModel_0 = runtime.ForwardResponseMessage + forward_InferenceService_CreateInferenceService_0 = runtime.ForwardResponseMessage - forward_ModelService_GetModelStatus_0 = runtime.ForwardResponseMessage + forward_InferenceService_GetInferenceServiceStatus_0 = runtime.ForwardResponseMessage - forward_ModelService_DeleteModel_0 = runtime.ForwardResponseMessage + forward_InferenceService_DeleteInferenceService_0 = runtime.ForwardResponseMessage ) diff --git a/api/gen/inference_service_grpc.pb.go b/api/gen/inference_service_grpc.pb.go new file mode 100644 index 0000000..6991531 --- /dev/null +++ b/api/gen/inference_service_grpc.pb.go @@ -0,0 +1,170 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package gen + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion7 + +// InferenceServiceClient is the client API for InferenceService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type InferenceServiceClient interface { + CreateInferenceService(ctx context.Context, in *CreateInferenceServiceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + GetInferenceServiceStatus(ctx context.Context, in *InferenceServiceIdentifier, opts ...grpc.CallOption) (*InferenceServiceStatus, error) + DeleteInferenceService(ctx context.Context, in *InferenceServiceIdentifier, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type inferenceServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewInferenceServiceClient(cc grpc.ClientConnInterface) InferenceServiceClient { + return &inferenceServiceClient{cc} +} + +func (c *inferenceServiceClient) CreateInferenceService(ctx context.Context, in *CreateInferenceServiceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.InferenceService/CreateInferenceService", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *inferenceServiceClient) GetInferenceServiceStatus(ctx context.Context, in *InferenceServiceIdentifier, opts ...grpc.CallOption) (*InferenceServiceStatus, error) { + out := new(InferenceServiceStatus) + err := c.cc.Invoke(ctx, "/api.InferenceService/GetInferenceServiceStatus", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *inferenceServiceClient) DeleteInferenceService(ctx context.Context, in *InferenceServiceIdentifier, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/api.InferenceService/DeleteInferenceService", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// InferenceServiceServer is the server API for InferenceService service. +// All implementations must embed UnimplementedInferenceServiceServer +// for forward compatibility +type InferenceServiceServer interface { + CreateInferenceService(context.Context, *CreateInferenceServiceRequest) (*emptypb.Empty, error) + GetInferenceServiceStatus(context.Context, *InferenceServiceIdentifier) (*InferenceServiceStatus, error) + DeleteInferenceService(context.Context, *InferenceServiceIdentifier) (*emptypb.Empty, error) + mustEmbedUnimplementedInferenceServiceServer() +} + +// UnimplementedInferenceServiceServer must be embedded to have forward compatible implementations. +type UnimplementedInferenceServiceServer struct { +} + +func (UnimplementedInferenceServiceServer) CreateInferenceService(context.Context, *CreateInferenceServiceRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateInferenceService not implemented") +} +func (UnimplementedInferenceServiceServer) GetInferenceServiceStatus(context.Context, *InferenceServiceIdentifier) (*InferenceServiceStatus, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetInferenceServiceStatus not implemented") +} +func (UnimplementedInferenceServiceServer) DeleteInferenceService(context.Context, *InferenceServiceIdentifier) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteInferenceService not implemented") +} +func (UnimplementedInferenceServiceServer) mustEmbedUnimplementedInferenceServiceServer() {} + +// UnsafeInferenceServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to InferenceServiceServer will +// result in compilation errors. +type UnsafeInferenceServiceServer interface { + mustEmbedUnimplementedInferenceServiceServer() +} + +func RegisterInferenceServiceServer(s grpc.ServiceRegistrar, srv InferenceServiceServer) { + s.RegisterService(&_InferenceService_serviceDesc, srv) +} + +func _InferenceService_CreateInferenceService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateInferenceServiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InferenceServiceServer).CreateInferenceService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.InferenceService/CreateInferenceService", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InferenceServiceServer).CreateInferenceService(ctx, req.(*CreateInferenceServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _InferenceService_GetInferenceServiceStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InferenceServiceIdentifier) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InferenceServiceServer).GetInferenceServiceStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.InferenceService/GetInferenceServiceStatus", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InferenceServiceServer).GetInferenceServiceStatus(ctx, req.(*InferenceServiceIdentifier)) + } + return interceptor(ctx, in, info, handler) +} + +func _InferenceService_DeleteInferenceService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InferenceServiceIdentifier) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InferenceServiceServer).DeleteInferenceService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.InferenceService/DeleteInferenceService", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InferenceServiceServer).DeleteInferenceService(ctx, req.(*InferenceServiceIdentifier)) + } + return interceptor(ctx, in, info, handler) +} + +var _InferenceService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "api.InferenceService", + HandlerType: (*InferenceServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateInferenceService", + Handler: _InferenceService_CreateInferenceService_Handler, + }, + { + MethodName: "GetInferenceServiceStatus", + Handler: _InferenceService_GetInferenceServiceStatus_Handler, + }, + { + MethodName: "DeleteInferenceService", + Handler: _InferenceService_DeleteInferenceService_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "inference_service.proto", +} diff --git a/api/gen/model.pb.go b/api/gen/model.pb.go deleted file mode 100644 index 9faf8cd..0000000 --- a/api/gen/model.pb.go +++ /dev/null @@ -1,1042 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.14.0 -// source: model.proto - -package gen - -import ( - proto "github.com/golang/protobuf/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - -type ModelIdentifier struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *ModelIdentifier) Reset() { - *x = ModelIdentifier{} - if protoimpl.UnsafeEnabled { - mi := &file_model_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ModelIdentifier) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModelIdentifier) ProtoMessage() {} - -func (x *ModelIdentifier) ProtoReflect() protoreflect.Message { - mi := &file_model_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ModelIdentifier.ProtoReflect.Descriptor instead. -func (*ModelIdentifier) Descriptor() ([]byte, []int) { - return file_model_proto_rawDescGZIP(), []int{0} -} - -func (x *ModelIdentifier) GetNamespace() string { - if x != nil { - return x.Namespace - } - return "" -} - -func (x *ModelIdentifier) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -type NodeSelector struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *NodeSelector) Reset() { - *x = NodeSelector{} - if protoimpl.UnsafeEnabled { - mi := &file_model_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NodeSelector) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NodeSelector) ProtoMessage() {} - -func (x *NodeSelector) ProtoReflect() protoreflect.Message { - mi := &file_model_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NodeSelector.ProtoReflect.Descriptor instead. -func (*NodeSelector) Descriptor() ([]byte, []int) { - return file_model_proto_rawDescGZIP(), []int{1} -} - -func (x *NodeSelector) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *NodeSelector) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -type ResourceLimits struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Cpu string `protobuf:"bytes,1,opt,name=cpu,proto3" json:"cpu,omitempty"` - Memory string `protobuf:"bytes,2,opt,name=memory,proto3" json:"memory,omitempty"` -} - -func (x *ResourceLimits) Reset() { - *x = ResourceLimits{} - if protoimpl.UnsafeEnabled { - mi := &file_model_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResourceLimits) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResourceLimits) ProtoMessage() {} - -func (x *ResourceLimits) ProtoReflect() protoreflect.Message { - mi := &file_model_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ResourceLimits.ProtoReflect.Descriptor instead. -func (*ResourceLimits) Descriptor() ([]byte, []int) { - return file_model_proto_rawDescGZIP(), []int{2} -} - -func (x *ResourceLimits) GetCpu() string { - if x != nil { - return x.Cpu - } - return "" -} - -func (x *ResourceLimits) GetMemory() string { - if x != nil { - return x.Memory - } - return "" -} - -type PredictorServer struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - RuntimeVersion string `protobuf:"bytes,2,opt,name=runtimeVersion,proto3" json:"runtimeVersion,omitempty"` - StorageUri string `protobuf:"bytes,3,opt,name=storageUri,proto3" json:"storageUri,omitempty"` - Limits *ResourceLimits `protobuf:"bytes,4,opt,name=limits,proto3" json:"limits,omitempty"` -} - -func (x *PredictorServer) Reset() { - *x = PredictorServer{} - if protoimpl.UnsafeEnabled { - mi := &file_model_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PredictorServer) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PredictorServer) ProtoMessage() {} - -func (x *PredictorServer) ProtoReflect() protoreflect.Message { - mi := &file_model_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PredictorServer.ProtoReflect.Descriptor instead. -func (*PredictorServer) Descriptor() ([]byte, []int) { - return file_model_proto_rawDescGZIP(), []int{3} -} - -func (x *PredictorServer) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *PredictorServer) GetRuntimeVersion() string { - if x != nil { - return x.RuntimeVersion - } - return "" -} - -func (x *PredictorServer) GetStorageUri() string { - if x != nil { - return x.StorageUri - } - return "" -} - -func (x *PredictorServer) GetLimits() *ResourceLimits { - if x != nil { - return x.Limits - } - return nil -} - -type Env struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *Env) Reset() { - *x = Env{} - if protoimpl.UnsafeEnabled { - mi := &file_model_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Env) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Env) ProtoMessage() {} - -func (x *Env) ProtoReflect() protoreflect.Message { - mi := &file_model_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Env.ProtoReflect.Descriptor instead. -func (*Env) Descriptor() ([]byte, []int) { - return file_model_proto_rawDescGZIP(), []int{4} -} - -func (x *Env) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Env) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -type Container struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Image string `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Env []*Env `protobuf:"bytes,3,rep,name=env,proto3" json:"env,omitempty"` -} - -func (x *Container) Reset() { - *x = Container{} - if protoimpl.UnsafeEnabled { - mi := &file_model_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Container) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Container) ProtoMessage() {} - -func (x *Container) ProtoReflect() protoreflect.Message { - mi := &file_model_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Container.ProtoReflect.Descriptor instead. -func (*Container) Descriptor() ([]byte, []int) { - return file_model_proto_rawDescGZIP(), []int{5} -} - -func (x *Container) GetImage() string { - if x != nil { - return x.Image - } - return "" -} - -func (x *Container) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Container) GetEnv() []*Env { - if x != nil { - return x.Env - } - return nil -} - -type Transformer struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Containers []*Container `protobuf:"bytes,1,rep,name=containers,proto3" json:"containers,omitempty"` -} - -func (x *Transformer) Reset() { - *x = Transformer{} - if protoimpl.UnsafeEnabled { - mi := &file_model_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Transformer) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Transformer) ProtoMessage() {} - -func (x *Transformer) ProtoReflect() protoreflect.Message { - mi := &file_model_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Transformer.ProtoReflect.Descriptor instead. -func (*Transformer) Descriptor() ([]byte, []int) { - return file_model_proto_rawDescGZIP(), []int{6} -} - -func (x *Transformer) GetContainers() []*Container { - if x != nil { - return x.Containers - } - return nil -} - -type Predictor struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeSelector *NodeSelector `protobuf:"bytes,1,opt,name=nodeSelector,proto3" json:"nodeSelector,omitempty"` - Server *PredictorServer `protobuf:"bytes,2,opt,name=server,proto3" json:"server,omitempty"` -} - -func (x *Predictor) Reset() { - *x = Predictor{} - if protoimpl.UnsafeEnabled { - mi := &file_model_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Predictor) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Predictor) ProtoMessage() {} - -func (x *Predictor) ProtoReflect() protoreflect.Message { - mi := &file_model_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Predictor.ProtoReflect.Descriptor instead. -func (*Predictor) Descriptor() ([]byte, []int) { - return file_model_proto_rawDescGZIP(), []int{7} -} - -func (x *Predictor) GetNodeSelector() *NodeSelector { - if x != nil { - return x.NodeSelector - } - return nil -} - -func (x *Predictor) GetServer() *PredictorServer { - if x != nil { - return x.Server - } - return nil -} - -type DeployModelRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Predictor *Predictor `protobuf:"bytes,3,opt,name=predictor,proto3" json:"predictor,omitempty"` - Transformer *Transformer `protobuf:"bytes,4,opt,name=transformer,proto3" json:"transformer,omitempty"` -} - -func (x *DeployModelRequest) Reset() { - *x = DeployModelRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_model_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeployModelRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeployModelRequest) ProtoMessage() {} - -func (x *DeployModelRequest) ProtoReflect() protoreflect.Message { - mi := &file_model_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeployModelRequest.ProtoReflect.Descriptor instead. -func (*DeployModelRequest) Descriptor() ([]byte, []int) { - return file_model_proto_rawDescGZIP(), []int{8} -} - -func (x *DeployModelRequest) GetNamespace() string { - if x != nil { - return x.Namespace - } - return "" -} - -func (x *DeployModelRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *DeployModelRequest) GetPredictor() *Predictor { - if x != nil { - return x.Predictor - } - return nil -} - -func (x *DeployModelRequest) GetTransformer() *Transformer { - if x != nil { - return x.Transformer - } - return nil -} - -type DeployModelResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` -} - -func (x *DeployModelResponse) Reset() { - *x = DeployModelResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_model_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeployModelResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeployModelResponse) ProtoMessage() {} - -func (x *DeployModelResponse) ProtoReflect() protoreflect.Message { - mi := &file_model_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeployModelResponse.ProtoReflect.Descriptor instead. -func (*DeployModelResponse) Descriptor() ([]byte, []int) { - return file_model_proto_rawDescGZIP(), []int{9} -} - -func (x *DeployModelResponse) GetStatus() string { - if x != nil { - return x.Status - } - return "" -} - -type ModelCondition struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LastTransitionTime string `protobuf:"bytes,1,opt,name=lastTransitionTime,proto3" json:"lastTransitionTime,omitempty"` - Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` - Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` -} - -func (x *ModelCondition) Reset() { - *x = ModelCondition{} - if protoimpl.UnsafeEnabled { - mi := &file_model_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ModelCondition) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModelCondition) ProtoMessage() {} - -func (x *ModelCondition) ProtoReflect() protoreflect.Message { - mi := &file_model_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ModelCondition.ProtoReflect.Descriptor instead. -func (*ModelCondition) Descriptor() ([]byte, []int) { - return file_model_proto_rawDescGZIP(), []int{10} -} - -func (x *ModelCondition) GetLastTransitionTime() string { - if x != nil { - return x.LastTransitionTime - } - return "" -} - -func (x *ModelCondition) GetStatus() string { - if x != nil { - return x.Status - } - return "" -} - -func (x *ModelCondition) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -type ModelStatus struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Ready bool `protobuf:"varint,1,opt,name=ready,proto3" json:"ready,omitempty"` - Conditions []*ModelCondition `protobuf:"bytes,2,rep,name=conditions,proto3" json:"conditions,omitempty"` -} - -func (x *ModelStatus) Reset() { - *x = ModelStatus{} - if protoimpl.UnsafeEnabled { - mi := &file_model_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ModelStatus) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModelStatus) ProtoMessage() {} - -func (x *ModelStatus) ProtoReflect() protoreflect.Message { - mi := &file_model_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ModelStatus.ProtoReflect.Descriptor instead. -func (*ModelStatus) Descriptor() ([]byte, []int) { - return file_model_proto_rawDescGZIP(), []int{11} -} - -func (x *ModelStatus) GetReady() bool { - if x != nil { - return x.Ready - } - return false -} - -func (x *ModelStatus) GetConditions() []*ModelCondition { - if x != nil { - return x.Conditions - } - return nil -} - -var File_model_proto protoreflect.FileDescriptor - -var file_model_proto_rawDesc = []byte{ - 0x0a, 0x0b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x61, - 0x70, 0x69, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, - 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x43, 0x0a, - 0x0f, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, - 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x22, 0x36, 0x0a, 0x0c, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, - 0x6f, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x3a, 0x0a, 0x0e, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x10, 0x0a, 0x03, - 0x63, 0x70, 0x75, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x70, 0x75, 0x12, 0x16, - 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x22, 0x9a, 0x01, 0x0a, 0x0f, 0x50, 0x72, 0x65, 0x64, 0x69, - 0x63, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, - 0x0a, 0x0e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x55, 0x72, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x55, 0x72, 0x69, 0x12, 0x2b, 0x0a, 0x06, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x06, 0x6c, 0x69, 0x6d, - 0x69, 0x74, 0x73, 0x22, 0x2f, 0x0a, 0x03, 0x45, 0x6e, 0x76, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x22, 0x51, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x03, 0x65, - 0x6e, 0x76, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x45, - 0x6e, 0x76, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x22, 0x3d, 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x12, 0x2e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x22, 0x70, 0x0a, 0x09, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, - 0x74, 0x6f, 0x72, 0x12, 0x35, 0x0a, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, - 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x0c, 0x6e, 0x6f, - 0x64, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x22, 0xa8, 0x01, 0x0a, 0x12, 0x44, 0x65, 0x70, - 0x6c, 0x6f, 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x2c, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x72, 0x65, 0x64, 0x69, - 0x63, 0x74, 0x6f, 0x72, 0x52, 0x09, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, 0x72, 0x12, - 0x32, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, - 0x6d, 0x65, 0x72, 0x22, 0x2d, 0x0a, 0x13, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4d, 0x6f, 0x64, - 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x22, 0x6c, 0x0a, 0x0e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x43, 0x6f, 0x6e, 0x64, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x12, 0x6c, 0x61, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, - 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x12, 0x6c, 0x61, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x54, 0x69, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x22, 0x58, 0x0a, 0x0b, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, - 0x14, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, - 0x72, 0x65, 0x61, 0x64, 0x79, 0x12, 0x33, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, - 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x32, 0xd4, 0x02, 0x0a, 0x0c, 0x4d, - 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6b, 0x0a, 0x0b, 0x44, - 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x17, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x2b, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x25, 0x22, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x6d, - 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0x69, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4d, - 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, - 0x1a, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x61, 0x70, 0x69, - 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x7b, 0x6e, 0x61, - 0x6d, 0x65, 0x7d, 0x12, 0x6c, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x6f, 0x64, - 0x65, 0x6c, 0x12, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x49, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x2a, 0x27, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x7d, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, - 0x7d, 0x42, 0x24, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x6f, 0x6e, 0x65, 0x70, 0x61, 0x6e, 0x65, 0x6c, 0x69, 0x6f, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_model_proto_rawDescOnce sync.Once - file_model_proto_rawDescData = file_model_proto_rawDesc -) - -func file_model_proto_rawDescGZIP() []byte { - file_model_proto_rawDescOnce.Do(func() { - file_model_proto_rawDescData = protoimpl.X.CompressGZIP(file_model_proto_rawDescData) - }) - return file_model_proto_rawDescData -} - -var file_model_proto_msgTypes = make([]protoimpl.MessageInfo, 12) -var file_model_proto_goTypes = []interface{}{ - (*ModelIdentifier)(nil), // 0: api.ModelIdentifier - (*NodeSelector)(nil), // 1: api.NodeSelector - (*ResourceLimits)(nil), // 2: api.ResourceLimits - (*PredictorServer)(nil), // 3: api.PredictorServer - (*Env)(nil), // 4: api.Env - (*Container)(nil), // 5: api.Container - (*Transformer)(nil), // 6: api.Transformer - (*Predictor)(nil), // 7: api.Predictor - (*DeployModelRequest)(nil), // 8: api.DeployModelRequest - (*DeployModelResponse)(nil), // 9: api.DeployModelResponse - (*ModelCondition)(nil), // 10: api.ModelCondition - (*ModelStatus)(nil), // 11: api.ModelStatus - (*emptypb.Empty)(nil), // 12: google.protobuf.Empty -} -var file_model_proto_depIdxs = []int32{ - 2, // 0: api.PredictorServer.limits:type_name -> api.ResourceLimits - 4, // 1: api.Container.env:type_name -> api.Env - 5, // 2: api.Transformer.containers:type_name -> api.Container - 1, // 3: api.Predictor.nodeSelector:type_name -> api.NodeSelector - 3, // 4: api.Predictor.server:type_name -> api.PredictorServer - 7, // 5: api.DeployModelRequest.predictor:type_name -> api.Predictor - 6, // 6: api.DeployModelRequest.transformer:type_name -> api.Transformer - 10, // 7: api.ModelStatus.conditions:type_name -> api.ModelCondition - 8, // 8: api.ModelService.DeployModel:input_type -> api.DeployModelRequest - 0, // 9: api.ModelService.GetModelStatus:input_type -> api.ModelIdentifier - 0, // 10: api.ModelService.DeleteModel:input_type -> api.ModelIdentifier - 12, // 11: api.ModelService.DeployModel:output_type -> google.protobuf.Empty - 11, // 12: api.ModelService.GetModelStatus:output_type -> api.ModelStatus - 12, // 13: api.ModelService.DeleteModel:output_type -> google.protobuf.Empty - 11, // [11:14] is the sub-list for method output_type - 8, // [8:11] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name -} - -func init() { file_model_proto_init() } -func file_model_proto_init() { - if File_model_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_model_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ModelIdentifier); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_model_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NodeSelector); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_model_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResourceLimits); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_model_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PredictorServer); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_model_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Env); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_model_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Container); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_model_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Transformer); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_model_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Predictor); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_model_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeployModelRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_model_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeployModelResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_model_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ModelCondition); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_model_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ModelStatus); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_model_proto_rawDesc, - NumEnums: 0, - NumMessages: 12, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_model_proto_goTypes, - DependencyIndexes: file_model_proto_depIdxs, - MessageInfos: file_model_proto_msgTypes, - }.Build() - File_model_proto = out.File - file_model_proto_rawDesc = nil - file_model_proto_goTypes = nil - file_model_proto_depIdxs = nil -} diff --git a/api/gen/model_grpc.pb.go b/api/gen/model_grpc.pb.go deleted file mode 100644 index e3d64e3..0000000 --- a/api/gen/model_grpc.pb.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. - -package gen - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion7 - -// ModelServiceClient is the client API for ModelService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type ModelServiceClient interface { - DeployModel(ctx context.Context, in *DeployModelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - GetModelStatus(ctx context.Context, in *ModelIdentifier, opts ...grpc.CallOption) (*ModelStatus, error) - DeleteModel(ctx context.Context, in *ModelIdentifier, opts ...grpc.CallOption) (*emptypb.Empty, error) -} - -type modelServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewModelServiceClient(cc grpc.ClientConnInterface) ModelServiceClient { - return &modelServiceClient{cc} -} - -func (c *modelServiceClient) DeployModel(ctx context.Context, in *DeployModelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/api.ModelService/DeployModel", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *modelServiceClient) GetModelStatus(ctx context.Context, in *ModelIdentifier, opts ...grpc.CallOption) (*ModelStatus, error) { - out := new(ModelStatus) - err := c.cc.Invoke(ctx, "/api.ModelService/GetModelStatus", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *modelServiceClient) DeleteModel(ctx context.Context, in *ModelIdentifier, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/api.ModelService/DeleteModel", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ModelServiceServer is the server API for ModelService service. -// All implementations must embed UnimplementedModelServiceServer -// for forward compatibility -type ModelServiceServer interface { - DeployModel(context.Context, *DeployModelRequest) (*emptypb.Empty, error) - GetModelStatus(context.Context, *ModelIdentifier) (*ModelStatus, error) - DeleteModel(context.Context, *ModelIdentifier) (*emptypb.Empty, error) - mustEmbedUnimplementedModelServiceServer() -} - -// UnimplementedModelServiceServer must be embedded to have forward compatible implementations. -type UnimplementedModelServiceServer struct { -} - -func (UnimplementedModelServiceServer) DeployModel(context.Context, *DeployModelRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeployModel not implemented") -} -func (UnimplementedModelServiceServer) GetModelStatus(context.Context, *ModelIdentifier) (*ModelStatus, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetModelStatus not implemented") -} -func (UnimplementedModelServiceServer) DeleteModel(context.Context, *ModelIdentifier) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteModel not implemented") -} -func (UnimplementedModelServiceServer) mustEmbedUnimplementedModelServiceServer() {} - -// UnsafeModelServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to ModelServiceServer will -// result in compilation errors. -type UnsafeModelServiceServer interface { - mustEmbedUnimplementedModelServiceServer() -} - -func RegisterModelServiceServer(s grpc.ServiceRegistrar, srv ModelServiceServer) { - s.RegisterService(&_ModelService_serviceDesc, srv) -} - -func _ModelService_DeployModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeployModelRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ModelServiceServer).DeployModel(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/api.ModelService/DeployModel", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ModelServiceServer).DeployModel(ctx, req.(*DeployModelRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ModelService_GetModelStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModelIdentifier) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ModelServiceServer).GetModelStatus(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/api.ModelService/GetModelStatus", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ModelServiceServer).GetModelStatus(ctx, req.(*ModelIdentifier)) - } - return interceptor(ctx, in, info, handler) -} - -func _ModelService_DeleteModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModelIdentifier) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ModelServiceServer).DeleteModel(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/api.ModelService/DeleteModel", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ModelServiceServer).DeleteModel(ctx, req.(*ModelIdentifier)) - } - return interceptor(ctx, in, info, handler) -} - -var _ModelService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "api.ModelService", - HandlerType: (*ModelServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "DeployModel", - Handler: _ModelService_DeployModel_Handler, - }, - { - MethodName: "GetModelStatus", - Handler: _ModelService_GetModelStatus_Handler, - }, - { - MethodName: "DeleteModel", - Handler: _ModelService_DeleteModel_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "model.proto", -} diff --git a/api/proto/model.proto b/api/proto/inference_service.proto similarity index 50% rename from api/proto/model.proto rename to api/proto/inference_service.proto index 448c1bc..29325ea 100644 --- a/api/proto/model.proto +++ b/api/proto/inference_service.proto @@ -6,49 +6,32 @@ option go_package = "github.com/onepanelio/core/api/gen"; import "google/api/annotations.proto"; import "google/protobuf/empty.proto"; -service ModelService { - rpc DeployModel (DeployModelRequest) returns (google.protobuf.Empty) { +service InferenceService { + rpc CreateInferenceService (CreateInferenceServiceRequest) returns (google.protobuf.Empty) { option (google.api.http) = { - post: "/apis/v1beta1/{namespace}/models" + post: "/apis/v1beta1/{namespace}/inferenceservice" body: "*" }; } - rpc GetModelStatus (ModelIdentifier) returns (ModelStatus) { + rpc GetInferenceServiceStatus (InferenceServiceIdentifier) returns (InferenceServiceStatus) { option (google.api.http) = { - get: "/apis/v1beta1/{namespace}/models/{name}" + get: "/apis/v1beta1/{namespace}/inferenceservice/{name}" }; } - rpc DeleteModel (ModelIdentifier) returns (google.protobuf.Empty) { + rpc DeleteInferenceService (InferenceServiceIdentifier) returns (google.protobuf.Empty) { option (google.api.http) = { - delete: "/apis/v1beta1/{namespace}/models/{name}" + delete: "/apis/v1beta1/{namespace}/inferenceservice/{name}" }; } } -message ModelIdentifier { +message InferenceServiceIdentifier { string namespace = 1; string name = 2; } -message NodeSelector { - string key = 1; - string value = 2; -} - -message ResourceLimits { - string cpu = 1; - string memory = 2; -} - -message PredictorServer { - string name = 1; - string runtimeVersion = 2; - string storageUri = 3; - ResourceLimits limits = 4; -} - message Env { string name = 1; string value = 2; @@ -65,29 +48,34 @@ message Transformer { } message Predictor { - NodeSelector nodeSelector = 1; - PredictorServer server = 2; + string name = 1; + string runtimeVersion = 2; + string storageUri = 3; + string nodeSelector = 4; + string cpu = 5; + string memory = 6; } -message DeployModelRequest { +message CreateInferenceServiceRequest { string namespace = 1; string name = 2; + string transformerImage = 3; - Predictor predictor = 3; - Transformer transformer = 4; + Predictor predictor = 4; + Transformer transformer = 5; } message DeployModelResponse { string status = 1; } -message ModelCondition { +message InferenceServiceCondition { string lastTransitionTime = 1; string status = 2; string type = 3; } -message ModelStatus { +message InferenceServiceStatus { bool ready = 1; - repeated ModelCondition conditions = 2; + repeated InferenceServiceCondition conditions = 2; } \ No newline at end of file diff --git a/main.go b/main.go index c0f49e7..d36a068 100644 --- a/main.go +++ b/main.go @@ -158,7 +158,7 @@ func startRPCServer(db *v1.DB, kubeConfig *v1.Config, sysConfig v1.SystemConfig, api.RegisterConfigServiceServer(s, server.NewConfigServer()) api.RegisterServiceServiceServer(s, server.NewServiceServer()) api.RegisterFileServiceServer(s, server.NewFileServer()) - api.RegisterModelServiceServer(s, server.NewModelServer()) + api.RegisterInferenceServiceServer(s, server.NewInferenceService()) go func() { if err := s.Serve(lis); err != nil { @@ -195,7 +195,7 @@ func startHTTPProxy() { registerHandler(api.RegisterConfigServiceHandlerFromEndpoint, ctx, mux, endpoint, opts) registerHandler(api.RegisterServiceServiceHandlerFromEndpoint, ctx, mux, endpoint, opts) registerHandler(api.RegisterFileServiceHandlerFromEndpoint, ctx, mux, endpoint, opts) - registerHandler(api.RegisterModelServiceHandlerFromEndpoint, ctx, mux, endpoint, opts) + registerHandler(api.RegisterInferenceServiceHandlerFromEndpoint, ctx, mux, endpoint, opts) log.Printf("Starting HTTP proxy on port %v", *httpPort) diff --git a/pkg/model.go b/pkg/inference_service.go similarity index 66% rename from pkg/model.go rename to pkg/inference_service.go index 97861f5..a4484f9 100644 --- a/pkg/model.go +++ b/pkg/inference_service.go @@ -1,10 +1,14 @@ package v1 import ( + "fmt" + "github.com/onepanelio/core/pkg/util" + "google.golang.org/grpc/codes" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/json" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" + "strings" ) func modelRestClient() (*rest.RESTClient, error) { @@ -17,8 +21,13 @@ func modelRestClient() (*rest.RESTClient, error) { } // DeployModel creates an InferenceService with KFServing -func (c *Client) DeployModel(deployment *ModelDeployment) error { - resource := deployment.ToResource() +func (c *Client) DeployModel(deployment *InferenceService) error { + nodePoolLabel := c.systemConfig.NodePoolLabel() + if nodePoolLabel == nil { + return fmt.Errorf("applicationNodePoolLabel not set") + } + + resource := deployment.ToResource(*nodePoolLabel) data, err := json.Marshal(resource) if err != nil { @@ -33,7 +42,7 @@ func (c *Client) DeployModel(deployment *ModelDeployment) error { err = restClient.Post(). Namespace(deployment.Namespace). Name(deployment.Name). - Resource(modelResource). + Resource(inferenceServiceResource). Body(data). Do(). Error() @@ -42,7 +51,7 @@ func (c *Client) DeployModel(deployment *ModelDeployment) error { } // GetModelStatus returns the model's status -func (c *Client) GetModelStatus(namespace, name string) (*ModelStatus, error) { +func (c *Client) GetModelStatus(namespace, name string) (*InferenceServiceStatus, error) { restClient, err := modelRestClient() if err != nil { return nil, err @@ -53,11 +62,15 @@ func (c *Client) GetModelStatus(namespace, name string) (*ModelStatus, error) { err = restClient.Get(). Namespace(namespace). Name(name). - Resource(modelResource). + Resource(inferenceServiceResource). Do(). Into(result) - status := &ModelStatus{ + if err != nil && strings.Contains(err.Error(), "not found") { + return nil, util.NewUserError(codes.NotFound, "not found") + } + + status := &InferenceServiceStatus{ Conditions: result.Status.Conditions, Ready: result.Status.Ready(), } @@ -75,7 +88,7 @@ func (c *Client) DeleteModel(namespace, name string) error { return restClient.Delete(). Namespace(namespace). Name(name). - Resource(modelResource). + Resource(inferenceServiceResource). Do(). Error() } diff --git a/pkg/model_types.go b/pkg/inference_service_types.go similarity index 62% rename from pkg/model_types.go rename to pkg/inference_service_types.go index c4aea98..811fa51 100644 --- a/pkg/model_types.go +++ b/pkg/inference_service_types.go @@ -6,7 +6,7 @@ import ( "time" ) -const modelResource = "InferenceServices" +const inferenceServiceResource = "InferenceServices" // ResourceLimits are the cpu/memory limits type ResourceLimits struct { @@ -14,24 +14,13 @@ type ResourceLimits struct { Memory string } -// NodeSelector provides a key/value to select a Node -type NodeSelector struct { - Key string - Value string -} - -// PredictorServer contains information on a server that serves models -type PredictorServer struct { +// Predictor contains information on what type of predictor we are using, and what resources it has available +type Predictor struct { Name string RuntimeVersion *string StorageURI string ResourceLimits *ResourceLimits -} - -// Predictor contains information on what type of predictor we are using, and what resources it has available -type Predictor struct { - NodeSelector *NodeSelector - Server PredictorServer + NodeSelector *string } // Env is a name/value environment variable @@ -52,8 +41,8 @@ type Transformer struct { Containers []TransformerContainer } -// ModelDeployment represents the information necessary to deploy a model -type ModelDeployment struct { +// InferenceService represents the information necessary to deploy an inference service +type InferenceService struct { Name string Namespace string @@ -61,24 +50,24 @@ type ModelDeployment struct { Predictor *Predictor } -// ModelStatus represents information about a model's status -type ModelStatus struct { +// InferenceServiceStatus represents information about an InferenceService +type InferenceServiceStatus struct { Ready bool - Conditions []modelCondition + Conditions []inferenceServiceCondition } -type modelCondition struct { +type inferenceServiceCondition struct { LastTransitionTime time.Time `json:"lastTransitionTime"` Status string `json:"status"` Type string `json:"type"` } -type modelStatus struct { - Conditions []modelCondition `json:"conditions"` +type inferenceServiceStatus struct { + Conditions []inferenceServiceCondition `json:"conditions"` } // Ready returns true if there is a condition called Ready: true. -func (m *modelStatus) Ready() bool { +func (m *inferenceServiceStatus) Ready() bool { for _, condition := range m.Conditions { if condition.Type == "Ready" && condition.Status == "True" { return true @@ -88,45 +77,43 @@ func (m *modelStatus) Ready() bool { return false } -// TODO -// k8sModel type k8sModel struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata" protobuf:"bytes,1,opt,name=metadata"` - Status modelStatus `json:"status,omitempty"` + Status inferenceServiceStatus `json:"status,omitempty"` } func (k k8sModel) DeepCopyObject() runtime.Object { panic("implement me") } -// ToResource converts the ModelDeployment into a KFServing spec -func (m *ModelDeployment) ToResource() interface{} { +// ToResource converts the InferenceService into a KFServing spec +func (m *InferenceService) ToResource(nodeSelector string) interface{} { spec := map[string]interface{}{ "predictor": map[string]interface{}{ - m.Predictor.Server.Name: map[string]interface{}{ - "storageUri": m.Predictor.Server.StorageURI, + m.Predictor.Name: map[string]interface{}{ + "storageUri": m.Predictor.StorageURI, }, }, } predictor := spec["predictor"].(map[string]interface{}) - predictorServer := predictor[m.Predictor.Server.Name].(map[string]interface{}) + predictorServer := predictor[m.Predictor.Name].(map[string]interface{}) - if m.Predictor.Server.RuntimeVersion != nil { - predictorServer["runtimeVersion"] = m.Predictor.Server.RuntimeVersion + if m.Predictor.RuntimeVersion != nil { + predictorServer["runtimeVersion"] = m.Predictor.RuntimeVersion } if m.Predictor.NodeSelector != nil { predictor["nodeSelector"] = map[string]string{ - m.Predictor.NodeSelector.Key: m.Predictor.NodeSelector.Value, + nodeSelector: *m.Predictor.NodeSelector, } } - if m.Predictor.Server.ResourceLimits != nil { + if m.Predictor.ResourceLimits != nil { predictorServer["resources"] = map[string]string{ - "cpu": m.Predictor.Server.ResourceLimits.CPU, - "memory": m.Predictor.Server.ResourceLimits.Memory, + "cpu": m.Predictor.ResourceLimits.CPU, + "memory": m.Predictor.ResourceLimits.Memory, } } diff --git a/server/inferenceservice_server.go b/server/inferenceservice_server.go new file mode 100644 index 0000000..3335003 --- /dev/null +++ b/server/inferenceservice_server.go @@ -0,0 +1,177 @@ +package server + +import ( + "context" + "fmt" + "github.com/golang/protobuf/ptypes/empty" + api "github.com/onepanelio/core/api/gen" + v1 "github.com/onepanelio/core/pkg" + "github.com/onepanelio/core/pkg/util" + "github.com/onepanelio/core/server/auth" + "google.golang.org/grpc/codes" + "time" +) + +// InferenceServiceServer is an implementation of the grpc InferenceServiceServer +type InferenceServiceServer struct { + api.UnimplementedInferenceServiceServer +} + +// NewInferenceService creates a new InferenceServiceServer +func NewInferenceService() *InferenceServiceServer { + return &InferenceServiceServer{} +} + +// CreateInferenceService deploys an inference service +func (s *InferenceServiceServer) CreateInferenceService(ctx context.Context, req *api.CreateInferenceServiceRequest) (*empty.Empty, error) { + client := getClient(ctx) + allowed, err := auth.IsAuthorized(client, req.Namespace, "create", "serving.kubeflow.org", "inferenceservices", "") + if err != nil || !allowed { + return nil, err + } + + if req.Predictor.Name == "" { + return nil, util.NewUserError(codes.InvalidArgument, "missing key 'predictor.name'") + } + + if req.Predictor.StorageUri == "" { + return nil, util.NewUserError(codes.InvalidArgument, "missing key 'predictor.storageUri'") + } + + if req.TransformerImage != "" && req.Transformer != nil { + return nil, util.NewUserError(codes.InvalidArgument, "must set either transformerImage or transformer, but not both") + } + + model := &v1.InferenceService{ + Name: req.Name, + Namespace: req.Namespace, + Predictor: &v1.Predictor{ + Name: req.Predictor.Name, + StorageURI: req.Predictor.StorageUri, + }, + } + + if req.Predictor.RuntimeVersion != "" { + model.Predictor.RuntimeVersion = &req.Predictor.RuntimeVersion + } + + if req.Predictor.Cpu != "" || req.Predictor.Memory != "" { + model.Predictor.ResourceLimits = &v1.ResourceLimits{} + if req.Predictor.Cpu != "" { + model.Predictor.ResourceLimits.CPU = req.Predictor.Cpu + } + if req.Predictor.Memory != "" { + model.Predictor.ResourceLimits.Memory = req.Predictor.Memory + } + } + + if req.Predictor.NodeSelector != "" { + model.Predictor.NodeSelector = &req.Predictor.NodeSelector + } + + if req.Transformer != nil { + model.Transformer = &v1.Transformer{} + + for i, container := range req.Transformer.Containers { + modelContainer := v1.TransformerContainer{ + Image: container.Image, + } + + if container.Name == "" { + modelContainer.Name = fmt.Sprintf("kfserving-container-%v", i) + } else { + modelContainer.Name = container.Name + } + + for _, env := range container.Env { + modelContainer.Env = append(modelContainer.Env, v1.Env{ + Name: env.Name, + Value: env.Value, + }) + } + + if len(container.Env) == 0 { + modelContainer.Env = []v1.Env{ + { + Name: "STORAGE_URI", + Value: req.Predictor.StorageUri, + }, + { + Name: "model", + Value: req.Name, + }, + } + } + + model.Transformer.Containers = append(model.Transformer.Containers, modelContainer) + } + } else if req.TransformerImage != "" { + model.Transformer = &v1.Transformer{ + Containers: []v1.TransformerContainer{ + { + Image: req.TransformerImage, + Name: "kfserving-container", + Env: []v1.Env{ + { + Name: "STORAGE_URI", + Value: req.Predictor.StorageUri, + }, + { + Name: "model", + Value: req.Name, + }, + }, + }, + }, + } + } + + err = client.DeployModel(model) + if err != nil { + return nil, err + } + + return &empty.Empty{}, nil +} + +// GetInferenceServiceStatus returns the status of an inferenceservice +func (s *InferenceServiceServer) GetInferenceServiceStatus(ctx context.Context, req *api.InferenceServiceIdentifier) (*api.InferenceServiceStatus, error) { + client := getClient(ctx) + allowed, err := auth.IsAuthorized(client, req.Namespace, "get", "serving.kubeflow.org", "inferenceservices", req.Name) + if err != nil || !allowed { + return nil, err + } + + status, err := client.GetModelStatus(req.Namespace, req.Name) + if err != nil { + return nil, err + } + + apiConditions := make([]*api.InferenceServiceCondition, len(status.Conditions)) + for i := range status.Conditions { + condition := status.Conditions[i] + apiConditions[i] = &api.InferenceServiceCondition{ + LastTransitionTime: condition.LastTransitionTime.Format(time.RFC3339), + Status: condition.Status, + Type: condition.Type, + } + } + + return &api.InferenceServiceStatus{ + Ready: status.Ready, + Conditions: apiConditions, + }, nil +} + +// DeleteInferenceService deletes an inference service +func (s *InferenceServiceServer) DeleteInferenceService(ctx context.Context, req *api.InferenceServiceIdentifier) (*empty.Empty, error) { + client := getClient(ctx) + allowed, err := auth.IsAuthorized(client, req.Namespace, "delete", "serving.kubeflow.org", "inferenceservices", req.Name) + if err != nil || !allowed { + return nil, err + } + + err = client.DeleteModel(req.Namespace, req.Name) + + return &empty.Empty{}, err +} diff --git a/server/model_server.go b/server/model_server.go deleted file mode 100644 index 3c9ade2..0000000 --- a/server/model_server.go +++ /dev/null @@ -1,127 +0,0 @@ -package server - -import ( - "context" - "github.com/golang/protobuf/ptypes/empty" - api "github.com/onepanelio/core/api/gen" - v1 "github.com/onepanelio/core/pkg" - "github.com/onepanelio/core/server/auth" - "time" -) - -// ModelServer is an implementation of the grpc ModelServer -type ModelServer struct { - api.UnimplementedModelServiceServer -} - -// NewModelServer creates a new ModelServer -func NewModelServer() *ModelServer { - return &ModelServer{} -} - -// DeployModel deploys a model server with a model(s) -func (s *ModelServer) DeployModel(ctx context.Context, req *api.DeployModelRequest) (*empty.Empty, error) { - client := getClient(ctx) - allowed, err := auth.IsAuthorized(client, req.Namespace, "create", "serving.kubeflow.org", "inferenceservices", "") - if err != nil || !allowed { - return nil, err - } - - model := &v1.ModelDeployment{ - Name: req.Name, - Namespace: req.Namespace, - Predictor: &v1.Predictor{ - Server: v1.PredictorServer{ - Name: req.Predictor.Server.Name, - StorageURI: req.Predictor.Server.StorageUri, - }, - }, - } - - if req.Predictor.Server.RuntimeVersion != "" { - model.Predictor.Server.RuntimeVersion = &req.Predictor.Server.RuntimeVersion - } - - if req.Predictor.Server.Limits != nil { - model.Predictor.Server.ResourceLimits = &v1.ResourceLimits{ - CPU: req.Predictor.Server.Limits.Cpu, - Memory: req.Predictor.Server.Limits.Memory, - } - } - - if req.Predictor.NodeSelector != nil { - model.Predictor.NodeSelector = &v1.NodeSelector{ - Key: req.Predictor.NodeSelector.Key, - Value: req.Predictor.NodeSelector.Value, - } - } - - if req.Transformer != nil { - model.Transformer = &v1.Transformer{} - - for _, container := range req.Transformer.Containers { - modelContainer := v1.TransformerContainer{ - Image: container.Image, - Name: container.Name, - } - - for _, env := range container.Env { - modelContainer.Env = append(modelContainer.Env, v1.Env{ - Name: env.Name, - Value: env.Value, - }) - } - - model.Transformer.Containers = append(model.Transformer.Containers, modelContainer) - } - } - - err = client.DeployModel(model) - if err != nil { - return nil, err - } - - return &empty.Empty{}, nil -} - -// GetModelStatus returns the status of a model -func (s *ModelServer) GetModelStatus(ctx context.Context, req *api.ModelIdentifier) (*api.ModelStatus, error) { - client := getClient(ctx) - allowed, err := auth.IsAuthorized(client, req.Namespace, "get", "serving.kubeflow.org", "inferenceservices", req.Name) - if err != nil || !allowed { - return nil, err - } - - status, err := client.GetModelStatus(req.Namespace, req.Name) - if err != nil { - return nil, err - } - - apiConditions := make([]*api.ModelCondition, len(status.Conditions)) - for i := range status.Conditions { - condition := status.Conditions[i] - apiConditions[i] = &api.ModelCondition{ - LastTransitionTime: condition.LastTransitionTime.Format(time.RFC3339), - Status: condition.Status, - Type: condition.Type, - } - } - - return &api.ModelStatus{ - Ready: status.Ready, - Conditions: apiConditions, - }, nil -} - -// DeleteModel deletes a model -func (s *ModelServer) DeleteModel(ctx context.Context, req *api.ModelIdentifier) (*empty.Empty, error) { - client := getClient(ctx) - allowed, err := auth.IsAuthorized(client, req.Namespace, "delete", "serving.kubeflow.org", "inferenceservices", req.Name) - if err != nil || !allowed { - return nil, err - } - - err = client.DeleteModel(req.Namespace, req.Name) - - return &empty.Empty{}, err -} From edf7a30f64f45856fb1725fb5603a2c83559ddbd Mon Sep 17 00:00:00 2001 From: Andrey Melnikov Date: Tue, 10 Aug 2021 14:47:32 -0700 Subject: [PATCH 4/9] feat: support both resource requests and limits for InferenceService --- api/api.swagger.json | 22 ++- api/gen/inference_service.pb.go | 227 +++++++++++++++++++----------- api/proto/inference_service.proto | 12 +- pkg/inference_service.go | 8 +- pkg/inference_service_types.go | 31 ++-- server/inferenceservice_server.go | 44 +++++- 6 files changed, 235 insertions(+), 109 deletions(-) diff --git a/api/api.swagger.json b/api/api.swagger.json index ec44728..2dda6b4 100644 --- a/api/api.swagger.json +++ b/api/api.swagger.json @@ -4215,10 +4215,16 @@ "nodeSelector": { "type": "string" }, - "cpu": { + "minCpu": { "type": "string" }, - "memory": { + "minMemory": { + "type": "string" + }, + "maxCpu": { + "type": "string" + }, + "maxMemory": { "type": "string" } } @@ -4276,6 +4282,18 @@ "items": { "$ref": "#/definitions/Container" } + }, + "minCpu": { + "type": "string" + }, + "minMemory": { + "type": "string" + }, + "maxCpu": { + "type": "string" + }, + "maxMemory": { + "type": "string" } } }, diff --git a/api/gen/inference_service.pb.go b/api/gen/inference_service.pb.go index 7698ec5..30f273a 100644 --- a/api/gen/inference_service.pb.go +++ b/api/gen/inference_service.pb.go @@ -206,6 +206,10 @@ type Transformer struct { unknownFields protoimpl.UnknownFields Containers []*Container `protobuf:"bytes,1,rep,name=containers,proto3" json:"containers,omitempty"` + MinCpu string `protobuf:"bytes,2,opt,name=minCpu,proto3" json:"minCpu,omitempty"` + MinMemory string `protobuf:"bytes,3,opt,name=minMemory,proto3" json:"minMemory,omitempty"` + MaxCpu string `protobuf:"bytes,4,opt,name=maxCpu,proto3" json:"maxCpu,omitempty"` + MaxMemory string `protobuf:"bytes,5,opt,name=maxMemory,proto3" json:"maxMemory,omitempty"` } func (x *Transformer) Reset() { @@ -247,6 +251,34 @@ func (x *Transformer) GetContainers() []*Container { return nil } +func (x *Transformer) GetMinCpu() string { + if x != nil { + return x.MinCpu + } + return "" +} + +func (x *Transformer) GetMinMemory() string { + if x != nil { + return x.MinMemory + } + return "" +} + +func (x *Transformer) GetMaxCpu() string { + if x != nil { + return x.MaxCpu + } + return "" +} + +func (x *Transformer) GetMaxMemory() string { + if x != nil { + return x.MaxMemory + } + return "" +} + type Predictor struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -256,8 +288,10 @@ type Predictor struct { RuntimeVersion string `protobuf:"bytes,2,opt,name=runtimeVersion,proto3" json:"runtimeVersion,omitempty"` StorageUri string `protobuf:"bytes,3,opt,name=storageUri,proto3" json:"storageUri,omitempty"` NodeSelector string `protobuf:"bytes,4,opt,name=nodeSelector,proto3" json:"nodeSelector,omitempty"` - Cpu string `protobuf:"bytes,5,opt,name=cpu,proto3" json:"cpu,omitempty"` - Memory string `protobuf:"bytes,6,opt,name=memory,proto3" json:"memory,omitempty"` + MinCpu string `protobuf:"bytes,5,opt,name=minCpu,proto3" json:"minCpu,omitempty"` + MinMemory string `protobuf:"bytes,6,opt,name=minMemory,proto3" json:"minMemory,omitempty"` + MaxCpu string `protobuf:"bytes,7,opt,name=maxCpu,proto3" json:"maxCpu,omitempty"` + MaxMemory string `protobuf:"bytes,8,opt,name=maxMemory,proto3" json:"maxMemory,omitempty"` } func (x *Predictor) Reset() { @@ -320,16 +354,30 @@ func (x *Predictor) GetNodeSelector() string { return "" } -func (x *Predictor) GetCpu() string { +func (x *Predictor) GetMinCpu() string { if x != nil { - return x.Cpu + return x.MinCpu } return "" } -func (x *Predictor) GetMemory() string { +func (x *Predictor) GetMinMemory() string { if x != nil { - return x.Memory + return x.MinMemory + } + return "" +} + +func (x *Predictor) GetMaxCpu() string { + if x != nil { + return x.MaxCpu + } + return "" +} + +func (x *Predictor) GetMaxMemory() string { + if x != nil { + return x.MaxMemory } return "" } @@ -599,86 +647,97 @@ var file_inference_service_proto_rawDesc = []byte{ 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x45, 0x6e, 0x76, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x22, 0x3d, 0x0a, - 0x0b, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x12, 0x2e, 0x0a, 0x0a, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x22, 0xb5, 0x01, 0x0a, - 0x09, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, - 0x0a, 0x0e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x55, 0x72, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x55, 0x72, 0x69, 0x12, 0x22, 0x0a, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x53, 0x65, - 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6e, 0x6f, - 0x64, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x70, - 0x75, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x70, 0x75, 0x12, 0x16, 0x0a, 0x06, - 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, - 0x6d, 0x6f, 0x72, 0x79, 0x22, 0xdf, 0x01, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, - 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x10, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x49, - 0x6d, 0x61, 0x67, 0x65, 0x12, 0x2c, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, - 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x72, - 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x09, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, - 0x6f, 0x72, 0x12, 0x32, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, - 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, - 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x22, 0x2d, 0x0a, 0x13, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, - 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x77, 0x0a, 0x19, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, - 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x12, 0x6c, 0x61, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, - 0x6c, 0x61, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, - 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x6e, - 0x0a, 0x16, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x64, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x12, 0x3e, - 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, - 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x32, 0xc6, - 0x03, 0x0a, 0x10, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x8b, 0x01, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, - 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x22, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x2f, 0x22, 0x2a, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x69, 0x6e, - 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x01, - 0x2a, 0x12, 0x94, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, - 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, - 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, - 0x1a, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x39, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x12, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, - 0x2f, 0x69, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x12, 0x8c, 0x01, 0x0a, 0x16, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x66, 0x69, 0x65, 0x72, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x39, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x33, 0x2a, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x45, 0x6e, 0x76, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x22, 0xa9, 0x01, + 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x12, 0x2e, 0x0a, + 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x16, 0x0a, + 0x06, 0x6d, 0x69, 0x6e, 0x43, 0x70, 0x75, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, + 0x69, 0x6e, 0x43, 0x70, 0x75, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x4d, 0x65, 0x6d, 0x6f, + 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x4d, 0x65, 0x6d, + 0x6f, 0x72, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x61, 0x78, 0x43, 0x70, 0x75, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x61, 0x78, 0x43, 0x70, 0x75, 0x12, 0x1c, 0x0a, 0x09, 0x6d, + 0x61, 0x78, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x6d, 0x61, 0x78, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x22, 0xf7, 0x01, 0x0a, 0x09, 0x50, 0x72, + 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x72, + 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x56, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x55, 0x72, + 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x55, 0x72, 0x69, 0x12, 0x22, 0x0a, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x53, + 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x69, 0x6e, 0x43, 0x70, + 0x75, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x69, 0x6e, 0x43, 0x70, 0x75, 0x12, + 0x1c, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x16, 0x0a, + 0x06, 0x6d, 0x61, 0x78, 0x43, 0x70, 0x75, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, + 0x61, 0x78, 0x43, 0x70, 0x75, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x4d, 0x65, 0x6d, 0x6f, + 0x72, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4d, 0x65, 0x6d, + 0x6f, 0x72, 0x79, 0x22, 0xdf, 0x01, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x49, 0x6d, + 0x61, 0x67, 0x65, 0x12, 0x2c, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, 0x72, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x72, 0x65, + 0x64, 0x69, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x09, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, + 0x72, 0x12, 0x32, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, + 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x22, 0x2d, 0x0a, 0x13, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4d, + 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x22, 0x77, 0x0a, 0x19, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, + 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x2e, 0x0a, 0x12, 0x6c, 0x61, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x6c, + 0x61, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x6e, 0x0a, + 0x16, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x12, 0x3e, 0x0a, + 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, + 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x32, 0xc6, 0x03, + 0x0a, 0x10, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x8b, 0x01, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, + 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x22, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, + 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x2f, 0x22, 0x2a, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x69, 0x6e, 0x66, + 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x01, 0x2a, + 0x12, 0x94, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, + 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x1a, + 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x39, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x33, 0x12, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x69, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x42, 0x24, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x65, 0x70, 0x61, 0x6e, 0x65, 0x6c, 0x69, 0x6f, - 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x12, 0x8c, 0x01, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, + 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, + 0x69, 0x65, 0x72, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x39, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x33, 0x2a, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x69, + 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, + 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x42, 0x24, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x65, 0x70, 0x61, 0x6e, 0x65, 0x6c, 0x69, 0x6f, 0x2f, + 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/proto/inference_service.proto b/api/proto/inference_service.proto index 29325ea..dbc0ea8 100644 --- a/api/proto/inference_service.proto +++ b/api/proto/inference_service.proto @@ -44,7 +44,11 @@ message Container { } message Transformer { - repeated Container containers = 1; + repeated Container containers = 1; + string minCpu = 2; + string minMemory = 3; + string maxCpu = 4; + string maxMemory = 5; } message Predictor { @@ -52,8 +56,10 @@ message Predictor { string runtimeVersion = 2; string storageUri = 3; string nodeSelector = 4; - string cpu = 5; - string memory = 6; + string minCpu = 5; + string minMemory = 6; + string maxCpu = 7; + string maxMemory = 8; } message CreateInferenceServiceRequest { diff --git a/pkg/inference_service.go b/pkg/inference_service.go index a4484f9..640d6d9 100644 --- a/pkg/inference_service.go +++ b/pkg/inference_service.go @@ -20,8 +20,8 @@ func modelRestClient() (*rest.RESTClient, error) { return rest.RESTClientFor(&config) } -// DeployModel creates an InferenceService with KFServing -func (c *Client) DeployModel(deployment *InferenceService) error { +// CreateInferenceService creates an InferenceService with KFServing +func (c *Client) CreateInferenceService(deployment *InferenceService) error { nodePoolLabel := c.systemConfig.NodePoolLabel() if nodePoolLabel == nil { return fmt.Errorf("applicationNodePoolLabel not set") @@ -47,6 +47,10 @@ func (c *Client) DeployModel(deployment *InferenceService) error { Do(). Error() + if err != nil && strings.Contains(err.Error(), "already exists") { + return util.NewUserError(codes.AlreadyExists, fmt.Sprintf("InferenceService with name '%v' already exists", deployment.Name)) + } + return err } diff --git a/pkg/inference_service_types.go b/pkg/inference_service_types.go index 811fa51..8edad5f 100644 --- a/pkg/inference_service_types.go +++ b/pkg/inference_service_types.go @@ -8,19 +8,20 @@ import ( const inferenceServiceResource = "InferenceServices" -// ResourceLimits are the cpu/memory limits -type ResourceLimits struct { +// MachineResources are the cpu/memory limits +type MachineResources struct { CPU string Memory string } // Predictor contains information on what type of predictor we are using, and what resources it has available type Predictor struct { - Name string - RuntimeVersion *string - StorageURI string - ResourceLimits *ResourceLimits - NodeSelector *string + Name string + RuntimeVersion *string + StorageURI string + ResourceRequests *MachineResources + ResourceLimits *MachineResources + NodeSelector *string } // Env is a name/value environment variable @@ -38,7 +39,9 @@ type TransformerContainer struct { // Transformer is a unit that can convert model input and output to different formats in json type Transformer struct { - Containers []TransformerContainer + Containers []TransformerContainer + ResourceRequests *MachineResources + ResourceLimits *MachineResources } // InferenceService represents the information necessary to deploy an inference service @@ -111,9 +114,15 @@ func (m *InferenceService) ToResource(nodeSelector string) interface{} { } if m.Predictor.ResourceLimits != nil { - predictorServer["resources"] = map[string]string{ - "cpu": m.Predictor.ResourceLimits.CPU, - "memory": m.Predictor.ResourceLimits.Memory, + predictorServer["resources"] = map[string]interface{}{ + "requests": map[string]string{ + "cpu": m.Predictor.ResourceLimits.CPU, + "memory": m.Predictor.ResourceLimits.Memory, + }, + "limits": map[string]string{ + "cpu": "10", + "memory": "10Gi", + }, } } diff --git a/server/inferenceservice_server.go b/server/inferenceservice_server.go index 3335003..caaf48f 100644 --- a/server/inferenceservice_server.go +++ b/server/inferenceservice_server.go @@ -55,13 +55,23 @@ func (s *InferenceServiceServer) CreateInferenceService(ctx context.Context, req model.Predictor.RuntimeVersion = &req.Predictor.RuntimeVersion } - if req.Predictor.Cpu != "" || req.Predictor.Memory != "" { - model.Predictor.ResourceLimits = &v1.ResourceLimits{} - if req.Predictor.Cpu != "" { - model.Predictor.ResourceLimits.CPU = req.Predictor.Cpu + if req.Predictor.MinCpu != "" || req.Predictor.MinMemory != "" { + model.Predictor.ResourceLimits = &v1.MachineResources{} + if req.Predictor.MinCpu != "" { + model.Predictor.ResourceLimits.CPU = req.Predictor.MinCpu } - if req.Predictor.Memory != "" { - model.Predictor.ResourceLimits.Memory = req.Predictor.Memory + if req.Predictor.MinMemory != "" { + model.Predictor.ResourceLimits.Memory = req.Predictor.MinMemory + } + } + + if req.Predictor.MaxCpu != "" || req.Predictor.MaxMemory != "" { + model.Predictor.ResourceRequests = &v1.MachineResources{} + if req.Predictor.MaxCpu != "" { + model.Predictor.ResourceRequests.CPU = req.Predictor.MaxCpu + } + if req.Predictor.MaxMemory != "" { + model.Predictor.ResourceRequests.Memory = req.Predictor.MaxMemory } } @@ -72,6 +82,26 @@ func (s *InferenceServiceServer) CreateInferenceService(ctx context.Context, req if req.Transformer != nil { model.Transformer = &v1.Transformer{} + if req.Transformer.MinCpu != "" || req.Transformer.MinMemory != "" { + model.Transformer.ResourceRequests = &v1.MachineResources{} + if req.Transformer.MinCpu != "" { + model.Transformer.ResourceRequests.CPU = req.Transformer.MinCpu + } + if req.Transformer.MinMemory != "" { + model.Transformer.ResourceRequests.Memory = req.Transformer.MinMemory + } + } + + if req.Transformer.MaxCpu != "" || req.Transformer.MaxMemory != "" { + model.Transformer.ResourceLimits = &v1.MachineResources{} + if req.Transformer.MaxCpu != "" { + model.Transformer.ResourceLimits.CPU = req.Transformer.MaxCpu + } + if req.Transformer.MinMemory != "" { + model.Transformer.ResourceLimits.Memory = req.Transformer.MaxMemory + } + } + for i, container := range req.Transformer.Containers { modelContainer := v1.TransformerContainer{ Image: container.Image, @@ -126,7 +156,7 @@ func (s *InferenceServiceServer) CreateInferenceService(ctx context.Context, req } } - err = client.DeployModel(model) + err = client.CreateInferenceService(model) if err != nil { return nil, err } From 45289274632c3e98b78b5a51d3cc7fb544e780a6 Mon Sep 17 00:00:00 2001 From: Andrey Melnikov Date: Wed, 11 Aug 2021 11:40:18 -0700 Subject: [PATCH 5/9] feat: updated endpoint to get the status to include predictor url --- api/api.swagger.json | 83 +++++---- api/gen/inference_service.pb.go | 269 +++++++++++++++++---------- api/gen/inference_service.pb.gw.go | 28 +-- api/gen/inference_service_grpc.pb.go | 26 +-- api/proto/inference_service.proto | 13 +- pkg/inference_service.go | 7 + pkg/inference_service_types.go | 63 ++++--- server/inferenceservice_server.go | 38 ++-- 8 files changed, 315 insertions(+), 212 deletions(-) diff --git a/api/api.swagger.json b/api/api.swagger.json index 2dda6b4..d28b102 100644 --- a/api/api.swagger.json +++ b/api/api.swagger.json @@ -803,12 +803,12 @@ }, "/apis/v1beta1/{namespace}/inferenceservice/{name}": { "get": { - "operationId": "GetInferenceServiceStatus", + "operationId": "GetInferenceService", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/InferenceServiceStatus" + "$ref": "#/definitions/GetInferenceServiceResponse" } }, "default": { @@ -3398,7 +3398,7 @@ "type": "string" }, "predictor": { - "$ref": "#/definitions/Predictor" + "$ref": "#/definitions/InferenceServicePredictor" }, "transformer": { "$ref": "#/definitions/Transformer" @@ -3587,6 +3587,23 @@ } } }, + "GetInferenceServiceResponse": { + "type": "object", + "properties": { + "ready": { + "type": "boolean" + }, + "conditions": { + "type": "array", + "items": { + "$ref": "#/definitions/InferenceServiceCondition" + } + }, + "predictUrl": { + "type": "string" + } + } + }, "GetLabelsResponse": { "type": "object", "properties": { @@ -3667,17 +3684,32 @@ } } }, - "InferenceServiceStatus": { + "InferenceServicePredictor": { "type": "object", "properties": { - "ready": { - "type": "boolean" + "name": { + "type": "string" }, - "conditions": { - "type": "array", - "items": { - "$ref": "#/definitions/InferenceServiceCondition" - } + "runtimeVersion": { + "type": "string" + }, + "storageUri": { + "type": "string" + }, + "nodeSelector": { + "type": "string" + }, + "minCpu": { + "type": "string" + }, + "minMemory": { + "type": "string" + }, + "maxCpu": { + "type": "string" + }, + "maxMemory": { + "type": "string" } } }, @@ -4200,35 +4232,6 @@ } } }, - "Predictor": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "runtimeVersion": { - "type": "string" - }, - "storageUri": { - "type": "string" - }, - "nodeSelector": { - "type": "string" - }, - "minCpu": { - "type": "string" - }, - "minMemory": { - "type": "string" - }, - "maxCpu": { - "type": "string" - }, - "maxMemory": { - "type": "string" - } - } - }, "Secret": { "type": "object", "properties": { diff --git a/api/gen/inference_service.pb.go b/api/gen/inference_service.pb.go index 30f273a..e690589 100644 --- a/api/gen/inference_service.pb.go +++ b/api/gen/inference_service.pb.go @@ -279,7 +279,7 @@ func (x *Transformer) GetMaxMemory() string { return "" } -type Predictor struct { +type InferenceServicePredictor struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -294,8 +294,8 @@ type Predictor struct { MaxMemory string `protobuf:"bytes,8,opt,name=maxMemory,proto3" json:"maxMemory,omitempty"` } -func (x *Predictor) Reset() { - *x = Predictor{} +func (x *InferenceServicePredictor) Reset() { + *x = InferenceServicePredictor{} if protoimpl.UnsafeEnabled { mi := &file_inference_service_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -303,13 +303,13 @@ func (x *Predictor) Reset() { } } -func (x *Predictor) String() string { +func (x *InferenceServicePredictor) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Predictor) ProtoMessage() {} +func (*InferenceServicePredictor) ProtoMessage() {} -func (x *Predictor) ProtoReflect() protoreflect.Message { +func (x *InferenceServicePredictor) ProtoReflect() protoreflect.Message { mi := &file_inference_service_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -321,61 +321,61 @@ func (x *Predictor) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Predictor.ProtoReflect.Descriptor instead. -func (*Predictor) Descriptor() ([]byte, []int) { +// Deprecated: Use InferenceServicePredictor.ProtoReflect.Descriptor instead. +func (*InferenceServicePredictor) Descriptor() ([]byte, []int) { return file_inference_service_proto_rawDescGZIP(), []int{4} } -func (x *Predictor) GetName() string { +func (x *InferenceServicePredictor) GetName() string { if x != nil { return x.Name } return "" } -func (x *Predictor) GetRuntimeVersion() string { +func (x *InferenceServicePredictor) GetRuntimeVersion() string { if x != nil { return x.RuntimeVersion } return "" } -func (x *Predictor) GetStorageUri() string { +func (x *InferenceServicePredictor) GetStorageUri() string { if x != nil { return x.StorageUri } return "" } -func (x *Predictor) GetNodeSelector() string { +func (x *InferenceServicePredictor) GetNodeSelector() string { if x != nil { return x.NodeSelector } return "" } -func (x *Predictor) GetMinCpu() string { +func (x *InferenceServicePredictor) GetMinCpu() string { if x != nil { return x.MinCpu } return "" } -func (x *Predictor) GetMinMemory() string { +func (x *InferenceServicePredictor) GetMinMemory() string { if x != nil { return x.MinMemory } return "" } -func (x *Predictor) GetMaxCpu() string { +func (x *InferenceServicePredictor) GetMaxCpu() string { if x != nil { return x.MaxCpu } return "" } -func (x *Predictor) GetMaxMemory() string { +func (x *InferenceServicePredictor) GetMaxMemory() string { if x != nil { return x.MaxMemory } @@ -387,11 +387,11 @@ type CreateInferenceServiceRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - TransformerImage string `protobuf:"bytes,3,opt,name=transformerImage,proto3" json:"transformerImage,omitempty"` - Predictor *Predictor `protobuf:"bytes,4,opt,name=predictor,proto3" json:"predictor,omitempty"` - Transformer *Transformer `protobuf:"bytes,5,opt,name=transformer,proto3" json:"transformer,omitempty"` + Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + TransformerImage string `protobuf:"bytes,3,opt,name=transformerImage,proto3" json:"transformerImage,omitempty"` + Predictor *InferenceServicePredictor `protobuf:"bytes,4,opt,name=predictor,proto3" json:"predictor,omitempty"` + Transformer *Transformer `protobuf:"bytes,5,opt,name=transformer,proto3" json:"transformer,omitempty"` } func (x *CreateInferenceServiceRequest) Reset() { @@ -447,7 +447,7 @@ func (x *CreateInferenceServiceRequest) GetTransformerImage() string { return "" } -func (x *CreateInferenceServiceRequest) GetPredictor() *Predictor { +func (x *CreateInferenceServiceRequest) GetPredictor() *InferenceServicePredictor { if x != nil { return x.Predictor } @@ -571,17 +571,18 @@ func (x *InferenceServiceCondition) GetType() string { return "" } -type InferenceServiceStatus struct { +type GetInferenceServiceResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Ready bool `protobuf:"varint,1,opt,name=ready,proto3" json:"ready,omitempty"` Conditions []*InferenceServiceCondition `protobuf:"bytes,2,rep,name=conditions,proto3" json:"conditions,omitempty"` + PredictUrl string `protobuf:"bytes,3,opt,name=predictUrl,proto3" json:"predictUrl,omitempty"` } -func (x *InferenceServiceStatus) Reset() { - *x = InferenceServiceStatus{} +func (x *GetInferenceServiceResponse) Reset() { + *x = GetInferenceServiceResponse{} if protoimpl.UnsafeEnabled { mi := &file_inference_service_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -589,13 +590,13 @@ func (x *InferenceServiceStatus) Reset() { } } -func (x *InferenceServiceStatus) String() string { +func (x *GetInferenceServiceResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*InferenceServiceStatus) ProtoMessage() {} +func (*GetInferenceServiceResponse) ProtoMessage() {} -func (x *InferenceServiceStatus) ProtoReflect() protoreflect.Message { +func (x *GetInferenceServiceResponse) ProtoReflect() protoreflect.Message { mi := &file_inference_service_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -607,25 +608,79 @@ func (x *InferenceServiceStatus) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use InferenceServiceStatus.ProtoReflect.Descriptor instead. -func (*InferenceServiceStatus) Descriptor() ([]byte, []int) { +// Deprecated: Use GetInferenceServiceResponse.ProtoReflect.Descriptor instead. +func (*GetInferenceServiceResponse) Descriptor() ([]byte, []int) { return file_inference_service_proto_rawDescGZIP(), []int{8} } -func (x *InferenceServiceStatus) GetReady() bool { +func (x *GetInferenceServiceResponse) GetReady() bool { if x != nil { return x.Ready } return false } -func (x *InferenceServiceStatus) GetConditions() []*InferenceServiceCondition { +func (x *GetInferenceServiceResponse) GetConditions() []*InferenceServiceCondition { if x != nil { return x.Conditions } return nil } +func (x *GetInferenceServiceResponse) GetPredictUrl() string { + if x != nil { + return x.PredictUrl + } + return "" +} + +type InferenceServiceEndpoints struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Predict string `protobuf:"bytes,1,opt,name=predict,proto3" json:"predict,omitempty"` +} + +func (x *InferenceServiceEndpoints) Reset() { + *x = InferenceServiceEndpoints{} + if protoimpl.UnsafeEnabled { + mi := &file_inference_service_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InferenceServiceEndpoints) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InferenceServiceEndpoints) ProtoMessage() {} + +func (x *InferenceServiceEndpoints) ProtoReflect() protoreflect.Message { + mi := &file_inference_service_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InferenceServiceEndpoints.ProtoReflect.Descriptor instead. +func (*InferenceServiceEndpoints) Descriptor() ([]byte, []int) { + return file_inference_service_proto_rawDescGZIP(), []int{9} +} + +func (x *InferenceServiceEndpoints) GetPredict() string { + if x != nil { + return x.Predict + } + return "" +} + var File_inference_service_proto protoreflect.FileDescriptor var file_inference_service_proto_rawDesc = []byte{ @@ -658,7 +713,8 @@ var file_inference_service_proto_rawDesc = []byte{ 0x6f, 0x72, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x61, 0x78, 0x43, 0x70, 0x75, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x61, 0x78, 0x43, 0x70, 0x75, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x6d, 0x61, 0x78, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x22, 0xf7, 0x01, 0x0a, 0x09, 0x50, 0x72, + 0x6d, 0x61, 0x78, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x22, 0x87, 0x02, 0x0a, 0x19, 0x49, 0x6e, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, @@ -674,7 +730,7 @@ var file_inference_service_proto_rawDesc = []byte{ 0x06, 0x6d, 0x61, 0x78, 0x43, 0x70, 0x75, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x61, 0x78, 0x43, 0x70, 0x75, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4d, 0x65, 0x6d, - 0x6f, 0x72, 0x79, 0x22, 0xdf, 0x01, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, + 0x6f, 0x72, 0x79, 0x22, 0xef, 0x01, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, @@ -682,8 +738,9 @@ var file_inference_service_proto_rawDesc = []byte{ 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x49, 0x6d, - 0x61, 0x67, 0x65, 0x12, 0x2c, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, 0x72, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x72, 0x65, + 0x61, 0x67, 0x65, 0x12, 0x3c, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, 0x72, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x66, + 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x09, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x32, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x54, 0x72, 0x61, @@ -698,46 +755,51 @@ var file_inference_service_proto_rawDesc = []byte{ 0x61, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x6e, 0x0a, - 0x16, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x12, 0x3e, 0x0a, - 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, - 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x32, 0xc6, 0x03, - 0x0a, 0x10, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x8b, 0x01, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x22, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x2f, 0x22, 0x2a, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x69, 0x6e, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x01, 0x2a, - 0x12, 0x94, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, - 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x93, 0x01, + 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x72, 0x65, + 0x61, 0x64, 0x79, 0x12, 0x3e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, + 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x55, 0x72, + 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, + 0x55, 0x72, 0x6c, 0x22, 0x35, 0x0a, 0x19, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, + 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x32, 0xc5, 0x03, 0x0a, 0x10, 0x49, + 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x8b, 0x01, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, + 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x22, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x22, 0x2a, + 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x69, 0x6e, 0x66, 0x65, 0x72, 0x65, + 0x6e, 0x63, 0x65, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x01, 0x2a, 0x12, 0x93, 0x01, + 0x0a, 0x13, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x66, 0x65, + 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x1a, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, + 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, + 0x12, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, + 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x69, 0x6e, 0x66, 0x65, + 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, + 0x6d, 0x65, 0x7d, 0x12, 0x8c, 0x01, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x6e, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x1a, - 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x39, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x33, 0x12, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, - 0x69, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x12, 0x8c, 0x01, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, - 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, - 0x69, 0x65, 0x72, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x39, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x33, 0x2a, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x69, - 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, - 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x42, 0x24, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x65, 0x70, 0x61, 0x6e, 0x65, 0x6c, 0x69, 0x6f, 0x2f, - 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x39, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x2a, + 0x31, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x69, 0x6e, 0x66, 0x65, 0x72, + 0x65, 0x6e, 0x63, 0x65, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, + 0x65, 0x7d, 0x42, 0x24, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x6f, 0x6e, 0x65, 0x70, 0x61, 0x6e, 0x65, 0x6c, 0x69, 0x6f, 0x2f, 0x63, 0x6f, 0x72, 0x65, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -752,36 +814,37 @@ func file_inference_service_proto_rawDescGZIP() []byte { return file_inference_service_proto_rawDescData } -var file_inference_service_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_inference_service_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_inference_service_proto_goTypes = []interface{}{ (*InferenceServiceIdentifier)(nil), // 0: api.InferenceServiceIdentifier (*Env)(nil), // 1: api.Env (*Container)(nil), // 2: api.Container (*Transformer)(nil), // 3: api.Transformer - (*Predictor)(nil), // 4: api.Predictor + (*InferenceServicePredictor)(nil), // 4: api.InferenceServicePredictor (*CreateInferenceServiceRequest)(nil), // 5: api.CreateInferenceServiceRequest (*DeployModelResponse)(nil), // 6: api.DeployModelResponse (*InferenceServiceCondition)(nil), // 7: api.InferenceServiceCondition - (*InferenceServiceStatus)(nil), // 8: api.InferenceServiceStatus - (*emptypb.Empty)(nil), // 9: google.protobuf.Empty + (*GetInferenceServiceResponse)(nil), // 8: api.GetInferenceServiceResponse + (*InferenceServiceEndpoints)(nil), // 9: api.InferenceServiceEndpoints + (*emptypb.Empty)(nil), // 10: google.protobuf.Empty } var file_inference_service_proto_depIdxs = []int32{ - 1, // 0: api.Container.env:type_name -> api.Env - 2, // 1: api.Transformer.containers:type_name -> api.Container - 4, // 2: api.CreateInferenceServiceRequest.predictor:type_name -> api.Predictor - 3, // 3: api.CreateInferenceServiceRequest.transformer:type_name -> api.Transformer - 7, // 4: api.InferenceServiceStatus.conditions:type_name -> api.InferenceServiceCondition - 5, // 5: api.InferenceService.CreateInferenceService:input_type -> api.CreateInferenceServiceRequest - 0, // 6: api.InferenceService.GetInferenceServiceStatus:input_type -> api.InferenceServiceIdentifier - 0, // 7: api.InferenceService.DeleteInferenceService:input_type -> api.InferenceServiceIdentifier - 9, // 8: api.InferenceService.CreateInferenceService:output_type -> google.protobuf.Empty - 8, // 9: api.InferenceService.GetInferenceServiceStatus:output_type -> api.InferenceServiceStatus - 9, // 10: api.InferenceService.DeleteInferenceService:output_type -> google.protobuf.Empty - 8, // [8:11] is the sub-list for method output_type - 5, // [5:8] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 1, // 0: api.Container.env:type_name -> api.Env + 2, // 1: api.Transformer.containers:type_name -> api.Container + 4, // 2: api.CreateInferenceServiceRequest.predictor:type_name -> api.InferenceServicePredictor + 3, // 3: api.CreateInferenceServiceRequest.transformer:type_name -> api.Transformer + 7, // 4: api.GetInferenceServiceResponse.conditions:type_name -> api.InferenceServiceCondition + 5, // 5: api.InferenceService.CreateInferenceService:input_type -> api.CreateInferenceServiceRequest + 0, // 6: api.InferenceService.GetInferenceService:input_type -> api.InferenceServiceIdentifier + 0, // 7: api.InferenceService.DeleteInferenceService:input_type -> api.InferenceServiceIdentifier + 10, // 8: api.InferenceService.CreateInferenceService:output_type -> google.protobuf.Empty + 8, // 9: api.InferenceService.GetInferenceService:output_type -> api.GetInferenceServiceResponse + 10, // 10: api.InferenceService.DeleteInferenceService:output_type -> google.protobuf.Empty + 8, // [8:11] is the sub-list for method output_type + 5, // [5:8] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_inference_service_proto_init() } @@ -839,7 +902,7 @@ func file_inference_service_proto_init() { } } file_inference_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Predictor); i { + switch v := v.(*InferenceServicePredictor); i { case 0: return &v.state case 1: @@ -887,7 +950,19 @@ func file_inference_service_proto_init() { } } file_inference_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InferenceServiceStatus); i { + switch v := v.(*GetInferenceServiceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_inference_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InferenceServiceEndpoints); i { case 0: return &v.state case 1: @@ -905,7 +980,7 @@ func file_inference_service_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_inference_service_proto_rawDesc, NumEnums: 0, - NumMessages: 9, + NumMessages: 10, NumExtensions: 0, NumServices: 1, }, diff --git a/api/gen/inference_service.pb.gw.go b/api/gen/inference_service.pb.gw.go index d08ea87..60f95e1 100644 --- a/api/gen/inference_service.pb.gw.go +++ b/api/gen/inference_service.pb.gw.go @@ -99,7 +99,7 @@ func local_request_InferenceService_CreateInferenceService_0(ctx context.Context } -func request_InferenceService_GetInferenceServiceStatus_0(ctx context.Context, marshaler runtime.Marshaler, client InferenceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { +func request_InferenceService_GetInferenceService_0(ctx context.Context, marshaler runtime.Marshaler, client InferenceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq InferenceServiceIdentifier var metadata runtime.ServerMetadata @@ -130,12 +130,12 @@ func request_InferenceService_GetInferenceServiceStatus_0(ctx context.Context, m return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } - msg, err := client.GetInferenceServiceStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.GetInferenceService(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_InferenceService_GetInferenceServiceStatus_0(ctx context.Context, marshaler runtime.Marshaler, server InferenceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { +func local_request_InferenceService_GetInferenceService_0(ctx context.Context, marshaler runtime.Marshaler, server InferenceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq InferenceServiceIdentifier var metadata runtime.ServerMetadata @@ -166,7 +166,7 @@ func local_request_InferenceService_GetInferenceServiceStatus_0(ctx context.Cont return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } - msg, err := server.GetInferenceServiceStatus(ctx, &protoReq) + msg, err := server.GetInferenceService(ctx, &protoReq) return msg, metadata, err } @@ -272,18 +272,18 @@ func RegisterInferenceServiceHandlerServer(ctx context.Context, mux *runtime.Ser }) - mux.Handle("GET", pattern_InferenceService_GetInferenceServiceStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_InferenceService_GetInferenceService_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, "/api.InferenceService/GetInferenceServiceStatus") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/api.InferenceService/GetInferenceService") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_InferenceService_GetInferenceServiceStatus_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_InferenceService_GetInferenceService_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 { @@ -291,7 +291,7 @@ func RegisterInferenceServiceHandlerServer(ctx context.Context, mux *runtime.Ser return } - forward_InferenceService_GetInferenceServiceStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_InferenceService_GetInferenceService_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -379,23 +379,23 @@ func RegisterInferenceServiceHandlerClient(ctx context.Context, mux *runtime.Ser }) - mux.Handle("GET", pattern_InferenceService_GetInferenceServiceStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_InferenceService_GetInferenceService_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, "/api.InferenceService/GetInferenceServiceStatus") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/api.InferenceService/GetInferenceService") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_InferenceService_GetInferenceServiceStatus_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_InferenceService_GetInferenceService_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_InferenceService_GetInferenceServiceStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_InferenceService_GetInferenceService_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -425,7 +425,7 @@ func RegisterInferenceServiceHandlerClient(ctx context.Context, mux *runtime.Ser var ( pattern_InferenceService_CreateInferenceService_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"apis", "v1beta1", "namespace", "inferenceservice"}, "")) - pattern_InferenceService_GetInferenceServiceStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"apis", "v1beta1", "namespace", "inferenceservice", "name"}, "")) + pattern_InferenceService_GetInferenceService_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"apis", "v1beta1", "namespace", "inferenceservice", "name"}, "")) pattern_InferenceService_DeleteInferenceService_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"apis", "v1beta1", "namespace", "inferenceservice", "name"}, "")) ) @@ -433,7 +433,7 @@ var ( var ( forward_InferenceService_CreateInferenceService_0 = runtime.ForwardResponseMessage - forward_InferenceService_GetInferenceServiceStatus_0 = runtime.ForwardResponseMessage + forward_InferenceService_GetInferenceService_0 = runtime.ForwardResponseMessage forward_InferenceService_DeleteInferenceService_0 = runtime.ForwardResponseMessage ) diff --git a/api/gen/inference_service_grpc.pb.go b/api/gen/inference_service_grpc.pb.go index 6991531..98eae24 100644 --- a/api/gen/inference_service_grpc.pb.go +++ b/api/gen/inference_service_grpc.pb.go @@ -19,7 +19,7 @@ const _ = grpc.SupportPackageIsVersion7 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type InferenceServiceClient interface { CreateInferenceService(ctx context.Context, in *CreateInferenceServiceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - GetInferenceServiceStatus(ctx context.Context, in *InferenceServiceIdentifier, opts ...grpc.CallOption) (*InferenceServiceStatus, error) + GetInferenceService(ctx context.Context, in *InferenceServiceIdentifier, opts ...grpc.CallOption) (*GetInferenceServiceResponse, error) DeleteInferenceService(ctx context.Context, in *InferenceServiceIdentifier, opts ...grpc.CallOption) (*emptypb.Empty, error) } @@ -40,9 +40,9 @@ func (c *inferenceServiceClient) CreateInferenceService(ctx context.Context, in return out, nil } -func (c *inferenceServiceClient) GetInferenceServiceStatus(ctx context.Context, in *InferenceServiceIdentifier, opts ...grpc.CallOption) (*InferenceServiceStatus, error) { - out := new(InferenceServiceStatus) - err := c.cc.Invoke(ctx, "/api.InferenceService/GetInferenceServiceStatus", in, out, opts...) +func (c *inferenceServiceClient) GetInferenceService(ctx context.Context, in *InferenceServiceIdentifier, opts ...grpc.CallOption) (*GetInferenceServiceResponse, error) { + out := new(GetInferenceServiceResponse) + err := c.cc.Invoke(ctx, "/api.InferenceService/GetInferenceService", in, out, opts...) if err != nil { return nil, err } @@ -63,7 +63,7 @@ func (c *inferenceServiceClient) DeleteInferenceService(ctx context.Context, in // for forward compatibility type InferenceServiceServer interface { CreateInferenceService(context.Context, *CreateInferenceServiceRequest) (*emptypb.Empty, error) - GetInferenceServiceStatus(context.Context, *InferenceServiceIdentifier) (*InferenceServiceStatus, error) + GetInferenceService(context.Context, *InferenceServiceIdentifier) (*GetInferenceServiceResponse, error) DeleteInferenceService(context.Context, *InferenceServiceIdentifier) (*emptypb.Empty, error) mustEmbedUnimplementedInferenceServiceServer() } @@ -75,8 +75,8 @@ type UnimplementedInferenceServiceServer struct { func (UnimplementedInferenceServiceServer) CreateInferenceService(context.Context, *CreateInferenceServiceRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateInferenceService not implemented") } -func (UnimplementedInferenceServiceServer) GetInferenceServiceStatus(context.Context, *InferenceServiceIdentifier) (*InferenceServiceStatus, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetInferenceServiceStatus not implemented") +func (UnimplementedInferenceServiceServer) GetInferenceService(context.Context, *InferenceServiceIdentifier) (*GetInferenceServiceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetInferenceService not implemented") } func (UnimplementedInferenceServiceServer) DeleteInferenceService(context.Context, *InferenceServiceIdentifier) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteInferenceService not implemented") @@ -112,20 +112,20 @@ func _InferenceService_CreateInferenceService_Handler(srv interface{}, ctx conte return interceptor(ctx, in, info, handler) } -func _InferenceService_GetInferenceServiceStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _InferenceService_GetInferenceService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(InferenceServiceIdentifier) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(InferenceServiceServer).GetInferenceServiceStatus(ctx, in) + return srv.(InferenceServiceServer).GetInferenceService(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.InferenceService/GetInferenceServiceStatus", + FullMethod: "/api.InferenceService/GetInferenceService", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(InferenceServiceServer).GetInferenceServiceStatus(ctx, req.(*InferenceServiceIdentifier)) + return srv.(InferenceServiceServer).GetInferenceService(ctx, req.(*InferenceServiceIdentifier)) } return interceptor(ctx, in, info, handler) } @@ -157,8 +157,8 @@ var _InferenceService_serviceDesc = grpc.ServiceDesc{ Handler: _InferenceService_CreateInferenceService_Handler, }, { - MethodName: "GetInferenceServiceStatus", - Handler: _InferenceService_GetInferenceServiceStatus_Handler, + MethodName: "GetInferenceService", + Handler: _InferenceService_GetInferenceService_Handler, }, { MethodName: "DeleteInferenceService", diff --git a/api/proto/inference_service.proto b/api/proto/inference_service.proto index dbc0ea8..642a5b6 100644 --- a/api/proto/inference_service.proto +++ b/api/proto/inference_service.proto @@ -14,7 +14,7 @@ service InferenceService { }; } - rpc GetInferenceServiceStatus (InferenceServiceIdentifier) returns (InferenceServiceStatus) { + rpc GetInferenceService(InferenceServiceIdentifier) returns (GetInferenceServiceResponse) { option (google.api.http) = { get: "/apis/v1beta1/{namespace}/inferenceservice/{name}" }; @@ -51,7 +51,7 @@ message Transformer { string maxMemory = 5; } -message Predictor { +message InferenceServicePredictor { string name = 1; string runtimeVersion = 2; string storageUri = 3; @@ -67,7 +67,7 @@ message CreateInferenceServiceRequest { string name = 2; string transformerImage = 3; - Predictor predictor = 4; + InferenceServicePredictor predictor = 4; Transformer transformer = 5; } @@ -81,7 +81,12 @@ message InferenceServiceCondition { string type = 3; } -message InferenceServiceStatus { +message GetInferenceServiceResponse { bool ready = 1; repeated InferenceServiceCondition conditions = 2; + string predictUrl = 3; +} + +message InferenceServiceEndpoints { + string predict = 1; } \ No newline at end of file diff --git a/pkg/inference_service.go b/pkg/inference_service.go index 640d6d9..66b0458 100644 --- a/pkg/inference_service.go +++ b/pkg/inference_service.go @@ -74,9 +74,16 @@ func (c *Client) GetModelStatus(namespace, name string) (*InferenceServiceStatus return nil, util.NewUserError(codes.NotFound, "not found") } + predictURL := result.Status.URL + suffixIndex := strings.LastIndex(result.Status.Address.URL, "cluster.local") + if suffixIndex >= 0 { + predictURL += result.Status.Address.URL[suffixIndex+13:] + } + status := &InferenceServiceStatus{ Conditions: result.Status.Conditions, Ready: result.Status.Ready(), + PredictURL: predictURL, } return status, err diff --git a/pkg/inference_service_types.go b/pkg/inference_service_types.go index 8edad5f..5a5e30d 100644 --- a/pkg/inference_service_types.go +++ b/pkg/inference_service_types.go @@ -8,17 +8,32 @@ import ( const inferenceServiceResource = "InferenceServices" +type KeyMap = map[string]interface{} + // MachineResources are the cpu/memory limits type MachineResources struct { - CPU string - Memory string + CPU string `json:"cpu,omitempty"` + Memory string `json:"memory,omitempty"` +} + +// ToResource returns a mapping for cpu/memory to the values +func (m *MachineResources) ToResource() map[string]string { + return map[string]string{ + "cpu": m.CPU, + "memory": m.Memory, + } +} + +type Resources struct { + Limits *MachineResources `json:"limits"` + Requests *MachineResources `json:"requests"` } // Predictor contains information on what type of predictor we are using, and what resources it has available type Predictor struct { - Name string - RuntimeVersion *string - StorageURI string + Name string `json:"name"` + RuntimeVersion *string `json:"runtimeVersion"` + StorageURI string `json:"storageUri"` ResourceRequests *MachineResources ResourceLimits *MachineResources NodeSelector *string @@ -32,16 +47,15 @@ type Env struct { // TransformerContainer is a container specific to a Transformer type TransformerContainer struct { - Image string `json:"image"` - Name string `json:"name"` - Env []Env `json:"env"` + Image string `json:"image"` + Name string `json:"name"` + Env []Env `json:"env"` + Resources *Resources `json:"resources,omitempty"` } // Transformer is a unit that can convert model input and output to different formats in json type Transformer struct { - Containers []TransformerContainer - ResourceRequests *MachineResources - ResourceLimits *MachineResources + Containers []TransformerContainer } // InferenceService represents the information necessary to deploy an inference service @@ -57,6 +71,7 @@ type InferenceService struct { type InferenceServiceStatus struct { Ready bool Conditions []inferenceServiceCondition + PredictURL string } type inferenceServiceCondition struct { @@ -65,8 +80,14 @@ type inferenceServiceCondition struct { Type string `json:"type"` } +type inferenceServiceAddress struct { + URL string `json:"url"` +} + type inferenceServiceStatus struct { Conditions []inferenceServiceCondition `json:"conditions"` + Address inferenceServiceAddress `json:"address"` + URL string `json:"url"` } // Ready returns true if there is a condition called Ready: true. @@ -113,17 +134,17 @@ func (m *InferenceService) ToResource(nodeSelector string) interface{} { } } - if m.Predictor.ResourceLimits != nil { - predictorServer["resources"] = map[string]interface{}{ - "requests": map[string]string{ - "cpu": m.Predictor.ResourceLimits.CPU, - "memory": m.Predictor.ResourceLimits.Memory, - }, - "limits": map[string]string{ - "cpu": "10", - "memory": "10Gi", - }, + if m.Predictor.ResourceLimits != nil || m.Predictor.ResourceRequests != nil { + resources := map[string]interface{}{} + + if m.Predictor.ResourceLimits != nil { + resources["limits"] = m.Predictor.ResourceLimits.ToResource() } + if m.Predictor.ResourceRequests != nil { + resources["requests"] = m.Predictor.ResourceRequests.ToResource() + } + + predictorServer["resources"] = resources } if m.Transformer != nil { diff --git a/server/inferenceservice_server.go b/server/inferenceservice_server.go index caaf48f..92491cc 100644 --- a/server/inferenceservice_server.go +++ b/server/inferenceservice_server.go @@ -82,26 +82,6 @@ func (s *InferenceServiceServer) CreateInferenceService(ctx context.Context, req if req.Transformer != nil { model.Transformer = &v1.Transformer{} - if req.Transformer.MinCpu != "" || req.Transformer.MinMemory != "" { - model.Transformer.ResourceRequests = &v1.MachineResources{} - if req.Transformer.MinCpu != "" { - model.Transformer.ResourceRequests.CPU = req.Transformer.MinCpu - } - if req.Transformer.MinMemory != "" { - model.Transformer.ResourceRequests.Memory = req.Transformer.MinMemory - } - } - - if req.Transformer.MaxCpu != "" || req.Transformer.MaxMemory != "" { - model.Transformer.ResourceLimits = &v1.MachineResources{} - if req.Transformer.MaxCpu != "" { - model.Transformer.ResourceLimits.CPU = req.Transformer.MaxCpu - } - if req.Transformer.MinMemory != "" { - model.Transformer.ResourceLimits.Memory = req.Transformer.MaxMemory - } - } - for i, container := range req.Transformer.Containers { modelContainer := v1.TransformerContainer{ Image: container.Image, @@ -113,6 +93,17 @@ func (s *InferenceServiceServer) CreateInferenceService(ctx context.Context, req modelContainer.Name = container.Name } + modelContainer.Resources = &v1.Resources{ + Requests: &v1.MachineResources{ + CPU: req.Transformer.MinCpu, + Memory: req.Transformer.MinMemory, + }, + Limits: &v1.MachineResources{ + CPU: req.Transformer.MaxCpu, + Memory: req.Transformer.MaxMemory, + }, + } + for _, env := range container.Env { modelContainer.Env = append(modelContainer.Env, v1.Env{ Name: env.Name, @@ -164,8 +155,8 @@ func (s *InferenceServiceServer) CreateInferenceService(ctx context.Context, req return &empty.Empty{}, nil } -// GetInferenceServiceStatus returns the status of an inferenceservice -func (s *InferenceServiceServer) GetInferenceServiceStatus(ctx context.Context, req *api.InferenceServiceIdentifier) (*api.InferenceServiceStatus, error) { +// GetInferenceService returns the status of an inferenceservice +func (s *InferenceServiceServer) GetInferenceService(ctx context.Context, req *api.InferenceServiceIdentifier) (*api.GetInferenceServiceResponse, error) { client := getClient(ctx) allowed, err := auth.IsAuthorized(client, req.Namespace, "get", "serving.kubeflow.org", "inferenceservices", req.Name) if err != nil || !allowed { @@ -187,9 +178,10 @@ func (s *InferenceServiceServer) GetInferenceServiceStatus(ctx context.Context, } } - return &api.InferenceServiceStatus{ + return &api.GetInferenceServiceResponse{ Ready: status.Ready, Conditions: apiConditions, + PredictUrl: status.PredictURL, }, nil } From 22b3d984ecd24183a24c7c96225aaac41413cce3 Mon Sep 17 00:00:00 2001 From: Andrey Melnikov Date: Wed, 11 Aug 2021 16:29:10 -0700 Subject: [PATCH 6/9] clean: simplify marshaling of InferenceService --- pkg/inference_service.go | 7 +-- pkg/inference_service_types.go | 93 ++++++++++++++----------------- server/inferenceservice_server.go | 36 ++++-------- 3 files changed, 53 insertions(+), 83 deletions(-) diff --git a/pkg/inference_service.go b/pkg/inference_service.go index 66b0458..ba371b9 100644 --- a/pkg/inference_service.go +++ b/pkg/inference_service.go @@ -22,12 +22,7 @@ func modelRestClient() (*rest.RESTClient, error) { // CreateInferenceService creates an InferenceService with KFServing func (c *Client) CreateInferenceService(deployment *InferenceService) error { - nodePoolLabel := c.systemConfig.NodePoolLabel() - if nodePoolLabel == nil { - return fmt.Errorf("applicationNodePoolLabel not set") - } - - resource := deployment.ToResource(*nodePoolLabel) + resource := deployment.ToResource() data, err := json.Marshal(resource) if err != nil { diff --git a/pkg/inference_service_types.go b/pkg/inference_service_types.go index 5a5e30d..99a8a21 100644 --- a/pkg/inference_service_types.go +++ b/pkg/inference_service_types.go @@ -8,35 +8,53 @@ import ( const inferenceServiceResource = "InferenceServices" -type KeyMap = map[string]interface{} - // MachineResources are the cpu/memory limits type MachineResources struct { CPU string `json:"cpu,omitempty"` Memory string `json:"memory,omitempty"` } -// ToResource returns a mapping for cpu/memory to the values -func (m *MachineResources) ToResource() map[string]string { - return map[string]string{ - "cpu": m.CPU, - "memory": m.Memory, - } -} - type Resources struct { - Limits *MachineResources `json:"limits"` - Requests *MachineResources `json:"requests"` + Limits *MachineResources `json:"limits,omitempty"` + Requests *MachineResources `json:"requests,omitempty"` } // Predictor contains information on what type of predictor we are using, and what resources it has available type Predictor struct { - Name string `json:"name"` - RuntimeVersion *string `json:"runtimeVersion"` - StorageURI string `json:"storageUri"` - ResourceRequests *MachineResources - ResourceLimits *MachineResources - NodeSelector *string + Name string `json:"-"` + RuntimeVersion string `json:"runtimeVersion,omitempty"` + StorageURI string `json:"storageUri"` + Resources *Resources `json:"resources,omitempty"` + NodeSelector map[string]string `json:"nodeSelector,omitempty"` +} + +// SetResources will set the cpu/memory requests/limits for the predictor. Empty strings are ignored +func (p *Predictor) SetResources(minCPU, maxCPU, minMemory, maxMemory string) { + if minCPU == "" && maxCPU == "" && minMemory == "" && maxMemory == "" { + return + } + + p.Resources = &Resources{} + if minCPU != "" || minMemory != "" { + p.Resources.Requests = &MachineResources{ + CPU: minCPU, + Memory: minMemory, + } + } + + if maxCPU != "" || maxMemory != "" { + p.Resources.Limits = &MachineResources{ + CPU: maxCPU, + Memory: maxMemory, + } + } +} + +// SetNodeSelector will set the node selector to the input label: selector value +func (p *Predictor) SetNodeSelector(label, selector string) { + p.NodeSelector = map[string]string{ + label: selector, + } } // Env is a name/value environment variable @@ -55,7 +73,7 @@ type TransformerContainer struct { // Transformer is a unit that can convert model input and output to different formats in json type Transformer struct { - Containers []TransformerContainer + Containers []TransformerContainer `json:"containers"` } // InferenceService represents the information necessary to deploy an inference service @@ -107,50 +125,21 @@ type k8sModel struct { Status inferenceServiceStatus `json:"status,omitempty"` } +// DeepCopyObject is a stub to support the interface func (k k8sModel) DeepCopyObject() runtime.Object { panic("implement me") } // ToResource converts the InferenceService into a KFServing spec -func (m *InferenceService) ToResource(nodeSelector string) interface{} { +func (m *InferenceService) ToResource() interface{} { spec := map[string]interface{}{ "predictor": map[string]interface{}{ - m.Predictor.Name: map[string]interface{}{ - "storageUri": m.Predictor.StorageURI, - }, + m.Predictor.Name: m.Predictor, }, } - predictor := spec["predictor"].(map[string]interface{}) - predictorServer := predictor[m.Predictor.Name].(map[string]interface{}) - - if m.Predictor.RuntimeVersion != nil { - predictorServer["runtimeVersion"] = m.Predictor.RuntimeVersion - } - - if m.Predictor.NodeSelector != nil { - predictor["nodeSelector"] = map[string]string{ - nodeSelector: *m.Predictor.NodeSelector, - } - } - - if m.Predictor.ResourceLimits != nil || m.Predictor.ResourceRequests != nil { - resources := map[string]interface{}{} - - if m.Predictor.ResourceLimits != nil { - resources["limits"] = m.Predictor.ResourceLimits.ToResource() - } - if m.Predictor.ResourceRequests != nil { - resources["requests"] = m.Predictor.ResourceRequests.ToResource() - } - - predictorServer["resources"] = resources - } - if m.Transformer != nil { - spec["transformer"] = map[string]interface{}{ - "containers": m.Transformer.Containers, - } + spec["transformer"] = m.Transformer } resource := map[string]interface{}{ diff --git a/server/inferenceservice_server.go b/server/inferenceservice_server.go index 92491cc..e6f1d0c 100644 --- a/server/inferenceservice_server.go +++ b/server/inferenceservice_server.go @@ -51,32 +51,18 @@ func (s *InferenceServiceServer) CreateInferenceService(ctx context.Context, req }, } - if req.Predictor.RuntimeVersion != "" { - model.Predictor.RuntimeVersion = &req.Predictor.RuntimeVersion - } - - if req.Predictor.MinCpu != "" || req.Predictor.MinMemory != "" { - model.Predictor.ResourceLimits = &v1.MachineResources{} - if req.Predictor.MinCpu != "" { - model.Predictor.ResourceLimits.CPU = req.Predictor.MinCpu - } - if req.Predictor.MinMemory != "" { - model.Predictor.ResourceLimits.Memory = req.Predictor.MinMemory - } - } - - if req.Predictor.MaxCpu != "" || req.Predictor.MaxMemory != "" { - model.Predictor.ResourceRequests = &v1.MachineResources{} - if req.Predictor.MaxCpu != "" { - model.Predictor.ResourceRequests.CPU = req.Predictor.MaxCpu - } - if req.Predictor.MaxMemory != "" { - model.Predictor.ResourceRequests.Memory = req.Predictor.MaxMemory - } - } - + model.Predictor.RuntimeVersion = req.Predictor.RuntimeVersion + model.Predictor.SetResources(req.Predictor.MinCpu, req.Predictor.MaxCpu, req.Predictor.MinMemory, req.Predictor.MaxMemory) if req.Predictor.NodeSelector != "" { - model.Predictor.NodeSelector = &req.Predictor.NodeSelector + sysConfig, err := client.GetSystemConfig() + if err != nil { + return nil, err + } + nodePoolLabel := sysConfig.NodePoolLabel() + if nodePoolLabel == nil { + return nil, fmt.Errorf("applicationNodePoolLabel not set") + } + model.Predictor.SetNodeSelector(*nodePoolLabel, req.Predictor.NodeSelector) } if req.Transformer != nil { From 69006309b4af4f64b84ff0a3b20c061a5d1d3c7b Mon Sep 17 00:00:00 2001 From: Andrey Melnikov Date: Wed, 11 Aug 2021 16:29:37 -0700 Subject: [PATCH 7/9] feat: allow onepanel-access-token in addition to the onepanel-auth-token --- main.go | 2 ++ server/auth/auth.go | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/main.go b/main.go index d36a068..d022d0c 100644 --- a/main.go +++ b/main.go @@ -288,6 +288,8 @@ func customHeaderMatcher(key string) (string, bool) { switch lowerCaseKey { case "onepanel-auth-token": return lowerCaseKey, true + case "onepanel-access-token": + return lowerCaseKey, true case "cookie": return lowerCaseKey, true default: diff --git a/server/auth/auth.go b/server/auth/auth.go index 0e0ca21..9ca33ac 100644 --- a/server/auth/auth.go +++ b/server/auth/auth.go @@ -66,6 +66,10 @@ func getBearerToken(ctx context.Context) (*string, bool) { return &t, true } + for _, t := range md.Get("onepanel-access-token") { + return &t, true + } + log.WithFields(log.Fields{ "Method": "getBearerToken", }).Error("Unable to get BearerToken:", md) From a8985a78788c0750b06face4a6bdc9d88cf910a4 Mon Sep 17 00:00:00 2001 From: Andrey Melnikov Date: Wed, 11 Aug 2021 17:08:24 -0700 Subject: [PATCH 8/9] chore: codacy docs --- pkg/inference_service_types.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/inference_service_types.go b/pkg/inference_service_types.go index 99a8a21..0dbcf06 100644 --- a/pkg/inference_service_types.go +++ b/pkg/inference_service_types.go @@ -14,6 +14,7 @@ type MachineResources struct { Memory string `json:"memory,omitempty"` } +// Resources represent the machine resource requests/limits type Resources struct { Limits *MachineResources `json:"limits,omitempty"` Requests *MachineResources `json:"requests,omitempty"` From 44a78effedd21a26971c6e217219dd8acadc2e62 Mon Sep 17 00:00:00 2001 From: Andrey Melnikov Date: Thu, 12 Aug 2021 10:05:04 -0700 Subject: [PATCH 9/9] feat: Create response for inference service now returns information about the status --- api/api.swagger.json | 52 ++++---- api/gen/inference_service.pb.go | 192 ++++++++++++++------------- api/gen/inference_service_grpc.pb.go | 10 +- api/proto/inference_service.proto | 8 +- server/inferenceservice_server.go | 29 +++- 5 files changed, 157 insertions(+), 134 deletions(-) diff --git a/api/api.swagger.json b/api/api.swagger.json index d28b102..b4e19b5 100644 --- a/api/api.swagger.json +++ b/api/api.swagger.json @@ -770,7 +770,7 @@ "200": { "description": "A successful response.", "schema": { - "properties": {} + "$ref": "#/definitions/GetInferenceServiceResponse" } }, "default": { @@ -3394,14 +3394,14 @@ "name": { "type": "string" }, - "transformerImage": { + "defaultTransformerImage": { "type": "string" }, "predictor": { "$ref": "#/definitions/InferenceServicePredictor" }, "transformer": { - "$ref": "#/definitions/Transformer" + "$ref": "#/definitions/InferenceServiceTransformer" } } }, @@ -3713,6 +3713,29 @@ } } }, + "InferenceServiceTransformer": { + "type": "object", + "properties": { + "containers": { + "type": "array", + "items": { + "$ref": "#/definitions/Container" + } + }, + "minCpu": { + "type": "string" + }, + "minMemory": { + "type": "string" + }, + "maxCpu": { + "type": "string" + }, + "maxMemory": { + "type": "string" + } + } + }, "IsAuthorized": { "type": "object", "properties": { @@ -4277,29 +4300,6 @@ } } }, - "Transformer": { - "type": "object", - "properties": { - "containers": { - "type": "array", - "items": { - "$ref": "#/definitions/Container" - } - }, - "minCpu": { - "type": "string" - }, - "minMemory": { - "type": "string" - }, - "maxCpu": { - "type": "string" - }, - "maxMemory": { - "type": "string" - } - } - }, "UpdateSecretKeyValueResponse": { "type": "object", "properties": { diff --git a/api/gen/inference_service.pb.go b/api/gen/inference_service.pb.go index e690589..f366359 100644 --- a/api/gen/inference_service.pb.go +++ b/api/gen/inference_service.pb.go @@ -200,7 +200,7 @@ func (x *Container) GetEnv() []*Env { return nil } -type Transformer struct { +type InferenceServiceTransformer struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -212,8 +212,8 @@ type Transformer struct { MaxMemory string `protobuf:"bytes,5,opt,name=maxMemory,proto3" json:"maxMemory,omitempty"` } -func (x *Transformer) Reset() { - *x = Transformer{} +func (x *InferenceServiceTransformer) Reset() { + *x = InferenceServiceTransformer{} if protoimpl.UnsafeEnabled { mi := &file_inference_service_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -221,13 +221,13 @@ func (x *Transformer) Reset() { } } -func (x *Transformer) String() string { +func (x *InferenceServiceTransformer) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Transformer) ProtoMessage() {} +func (*InferenceServiceTransformer) ProtoMessage() {} -func (x *Transformer) ProtoReflect() protoreflect.Message { +func (x *InferenceServiceTransformer) ProtoReflect() protoreflect.Message { mi := &file_inference_service_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -239,40 +239,40 @@ func (x *Transformer) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Transformer.ProtoReflect.Descriptor instead. -func (*Transformer) Descriptor() ([]byte, []int) { +// Deprecated: Use InferenceServiceTransformer.ProtoReflect.Descriptor instead. +func (*InferenceServiceTransformer) Descriptor() ([]byte, []int) { return file_inference_service_proto_rawDescGZIP(), []int{3} } -func (x *Transformer) GetContainers() []*Container { +func (x *InferenceServiceTransformer) GetContainers() []*Container { if x != nil { return x.Containers } return nil } -func (x *Transformer) GetMinCpu() string { +func (x *InferenceServiceTransformer) GetMinCpu() string { if x != nil { return x.MinCpu } return "" } -func (x *Transformer) GetMinMemory() string { +func (x *InferenceServiceTransformer) GetMinMemory() string { if x != nil { return x.MinMemory } return "" } -func (x *Transformer) GetMaxCpu() string { +func (x *InferenceServiceTransformer) GetMaxCpu() string { if x != nil { return x.MaxCpu } return "" } -func (x *Transformer) GetMaxMemory() string { +func (x *InferenceServiceTransformer) GetMaxMemory() string { if x != nil { return x.MaxMemory } @@ -387,11 +387,11 @@ type CreateInferenceServiceRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - TransformerImage string `protobuf:"bytes,3,opt,name=transformerImage,proto3" json:"transformerImage,omitempty"` - Predictor *InferenceServicePredictor `protobuf:"bytes,4,opt,name=predictor,proto3" json:"predictor,omitempty"` - Transformer *Transformer `protobuf:"bytes,5,opt,name=transformer,proto3" json:"transformer,omitempty"` + Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + DefaultTransformerImage string `protobuf:"bytes,3,opt,name=defaultTransformerImage,proto3" json:"defaultTransformerImage,omitempty"` + Predictor *InferenceServicePredictor `protobuf:"bytes,4,opt,name=predictor,proto3" json:"predictor,omitempty"` + Transformer *InferenceServiceTransformer `protobuf:"bytes,5,opt,name=transformer,proto3" json:"transformer,omitempty"` } func (x *CreateInferenceServiceRequest) Reset() { @@ -440,9 +440,9 @@ func (x *CreateInferenceServiceRequest) GetName() string { return "" } -func (x *CreateInferenceServiceRequest) GetTransformerImage() string { +func (x *CreateInferenceServiceRequest) GetDefaultTransformerImage() string { if x != nil { - return x.TransformerImage + return x.DefaultTransformerImage } return "" } @@ -454,7 +454,7 @@ func (x *CreateInferenceServiceRequest) GetPredictor() *InferenceServicePredicto return nil } -func (x *CreateInferenceServiceRequest) GetTransformer() *Transformer { +func (x *CreateInferenceServiceRequest) GetTransformer() *InferenceServiceTransformer { if x != nil { return x.Transformer } @@ -702,8 +702,9 @@ var file_inference_service_proto_rawDesc = []byte{ 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x45, 0x6e, 0x76, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x22, 0xa9, 0x01, - 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x12, 0x2e, 0x0a, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x45, 0x6e, 0x76, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x22, 0xb9, 0x01, + 0x0a, 0x1b, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x12, 0x2e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x16, 0x0a, @@ -730,76 +731,79 @@ var file_inference_service_proto_rawDesc = []byte{ 0x06, 0x6d, 0x61, 0x78, 0x43, 0x70, 0x75, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x61, 0x78, 0x43, 0x70, 0x75, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4d, 0x65, 0x6d, - 0x6f, 0x72, 0x79, 0x22, 0xef, 0x01, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, + 0x6f, 0x72, 0x79, 0x22, 0x8d, 0x02, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, - 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x49, 0x6d, - 0x61, 0x67, 0x65, 0x12, 0x3c, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, 0x72, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x65, - 0x64, 0x69, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x09, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, - 0x72, 0x12, 0x32, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x54, 0x72, 0x61, - 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, - 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x22, 0x2d, 0x0a, 0x13, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4d, - 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x22, 0x77, 0x0a, 0x19, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, - 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x2e, 0x0a, 0x12, 0x6c, 0x61, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x6c, - 0x61, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, - 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x93, 0x01, - 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, - 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x72, 0x65, - 0x61, 0x64, 0x79, 0x12, 0x3e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, - 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, - 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x55, 0x72, - 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, - 0x55, 0x72, 0x6c, 0x22, 0x35, 0x0a, 0x19, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, - 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x32, 0xc5, 0x03, 0x0a, 0x10, 0x49, - 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x8b, 0x01, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x22, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x22, 0x2a, - 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, - 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x69, 0x6e, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x01, 0x2a, 0x12, 0x93, 0x01, - 0x0a, 0x13, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x66, 0x65, - 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x1a, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, - 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, - 0x12, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, - 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x69, 0x6e, 0x66, 0x65, - 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, - 0x6d, 0x65, 0x7d, 0x12, 0x8c, 0x01, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x6e, - 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1f, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x1a, - 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x39, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x2a, - 0x31, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, - 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x69, 0x6e, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, - 0x65, 0x7d, 0x42, 0x24, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x6f, 0x6e, 0x65, 0x70, 0x61, 0x6e, 0x65, 0x6c, 0x69, 0x6f, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x38, 0x0a, 0x17, 0x64, 0x65, 0x66, 0x61, 0x75, + 0x6c, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x49, 0x6d, 0x61, + 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x49, 0x6d, 0x61, 0x67, + 0x65, 0x12, 0x3c, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x66, 0x65, 0x72, + 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x65, 0x64, 0x69, + 0x63, 0x74, 0x6f, 0x72, 0x52, 0x09, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x6f, 0x72, 0x12, + 0x42, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x66, 0x65, 0x72, + 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, + 0x6d, 0x65, 0x72, 0x22, 0x2d, 0x0a, 0x13, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x4d, 0x6f, 0x64, + 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x22, 0x77, 0x0a, 0x19, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x2e, 0x0a, 0x12, 0x6c, 0x61, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x6c, 0x61, 0x73, + 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x93, 0x01, 0x0a, 0x1b, + 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x72, + 0x65, 0x61, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x72, 0x65, 0x61, 0x64, + 0x79, 0x12, 0x3e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x66, 0x65, + 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x64, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x55, 0x72, 0x6c, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x55, 0x72, + 0x6c, 0x22, 0x35, 0x0a, 0x19, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x18, + 0x0a, 0x07, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x74, 0x32, 0xcf, 0x03, 0x0a, 0x10, 0x49, 0x6e, 0x66, + 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x95, 0x01, + 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, + 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x22, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x35, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x22, 0x2a, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x7d, 0x2f, 0x69, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x3a, 0x01, 0x2a, 0x12, 0x93, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, + 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1f, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x1a, 0x20, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, + 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x39, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x12, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x7d, 0x2f, 0x69, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x12, 0x8c, 0x01, 0x0a, 0x16, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x66, + 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, + 0x39, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x2a, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x7d, 0x2f, 0x69, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x42, 0x24, 0x5a, 0x22, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x65, 0x70, 0x61, 0x6e, 0x65, + 0x6c, 0x69, 0x6f, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -819,7 +823,7 @@ var file_inference_service_proto_goTypes = []interface{}{ (*InferenceServiceIdentifier)(nil), // 0: api.InferenceServiceIdentifier (*Env)(nil), // 1: api.Env (*Container)(nil), // 2: api.Container - (*Transformer)(nil), // 3: api.Transformer + (*InferenceServiceTransformer)(nil), // 3: api.InferenceServiceTransformer (*InferenceServicePredictor)(nil), // 4: api.InferenceServicePredictor (*CreateInferenceServiceRequest)(nil), // 5: api.CreateInferenceServiceRequest (*DeployModelResponse)(nil), // 6: api.DeployModelResponse @@ -830,14 +834,14 @@ var file_inference_service_proto_goTypes = []interface{}{ } var file_inference_service_proto_depIdxs = []int32{ 1, // 0: api.Container.env:type_name -> api.Env - 2, // 1: api.Transformer.containers:type_name -> api.Container + 2, // 1: api.InferenceServiceTransformer.containers:type_name -> api.Container 4, // 2: api.CreateInferenceServiceRequest.predictor:type_name -> api.InferenceServicePredictor - 3, // 3: api.CreateInferenceServiceRequest.transformer:type_name -> api.Transformer + 3, // 3: api.CreateInferenceServiceRequest.transformer:type_name -> api.InferenceServiceTransformer 7, // 4: api.GetInferenceServiceResponse.conditions:type_name -> api.InferenceServiceCondition 5, // 5: api.InferenceService.CreateInferenceService:input_type -> api.CreateInferenceServiceRequest 0, // 6: api.InferenceService.GetInferenceService:input_type -> api.InferenceServiceIdentifier 0, // 7: api.InferenceService.DeleteInferenceService:input_type -> api.InferenceServiceIdentifier - 10, // 8: api.InferenceService.CreateInferenceService:output_type -> google.protobuf.Empty + 8, // 8: api.InferenceService.CreateInferenceService:output_type -> api.GetInferenceServiceResponse 8, // 9: api.InferenceService.GetInferenceService:output_type -> api.GetInferenceServiceResponse 10, // 10: api.InferenceService.DeleteInferenceService:output_type -> google.protobuf.Empty 8, // [8:11] is the sub-list for method output_type @@ -890,7 +894,7 @@ func file_inference_service_proto_init() { } } file_inference_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Transformer); i { + switch v := v.(*InferenceServiceTransformer); i { case 0: return &v.state case 1: diff --git a/api/gen/inference_service_grpc.pb.go b/api/gen/inference_service_grpc.pb.go index 98eae24..f14460c 100644 --- a/api/gen/inference_service_grpc.pb.go +++ b/api/gen/inference_service_grpc.pb.go @@ -18,7 +18,7 @@ const _ = grpc.SupportPackageIsVersion7 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type InferenceServiceClient interface { - CreateInferenceService(ctx context.Context, in *CreateInferenceServiceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + CreateInferenceService(ctx context.Context, in *CreateInferenceServiceRequest, opts ...grpc.CallOption) (*GetInferenceServiceResponse, error) GetInferenceService(ctx context.Context, in *InferenceServiceIdentifier, opts ...grpc.CallOption) (*GetInferenceServiceResponse, error) DeleteInferenceService(ctx context.Context, in *InferenceServiceIdentifier, opts ...grpc.CallOption) (*emptypb.Empty, error) } @@ -31,8 +31,8 @@ func NewInferenceServiceClient(cc grpc.ClientConnInterface) InferenceServiceClie return &inferenceServiceClient{cc} } -func (c *inferenceServiceClient) CreateInferenceService(ctx context.Context, in *CreateInferenceServiceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) +func (c *inferenceServiceClient) CreateInferenceService(ctx context.Context, in *CreateInferenceServiceRequest, opts ...grpc.CallOption) (*GetInferenceServiceResponse, error) { + out := new(GetInferenceServiceResponse) err := c.cc.Invoke(ctx, "/api.InferenceService/CreateInferenceService", in, out, opts...) if err != nil { return nil, err @@ -62,7 +62,7 @@ func (c *inferenceServiceClient) DeleteInferenceService(ctx context.Context, in // All implementations must embed UnimplementedInferenceServiceServer // for forward compatibility type InferenceServiceServer interface { - CreateInferenceService(context.Context, *CreateInferenceServiceRequest) (*emptypb.Empty, error) + CreateInferenceService(context.Context, *CreateInferenceServiceRequest) (*GetInferenceServiceResponse, error) GetInferenceService(context.Context, *InferenceServiceIdentifier) (*GetInferenceServiceResponse, error) DeleteInferenceService(context.Context, *InferenceServiceIdentifier) (*emptypb.Empty, error) mustEmbedUnimplementedInferenceServiceServer() @@ -72,7 +72,7 @@ type InferenceServiceServer interface { type UnimplementedInferenceServiceServer struct { } -func (UnimplementedInferenceServiceServer) CreateInferenceService(context.Context, *CreateInferenceServiceRequest) (*emptypb.Empty, error) { +func (UnimplementedInferenceServiceServer) CreateInferenceService(context.Context, *CreateInferenceServiceRequest) (*GetInferenceServiceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateInferenceService not implemented") } func (UnimplementedInferenceServiceServer) GetInferenceService(context.Context, *InferenceServiceIdentifier) (*GetInferenceServiceResponse, error) { diff --git a/api/proto/inference_service.proto b/api/proto/inference_service.proto index 642a5b6..4accfae 100644 --- a/api/proto/inference_service.proto +++ b/api/proto/inference_service.proto @@ -7,7 +7,7 @@ import "google/api/annotations.proto"; import "google/protobuf/empty.proto"; service InferenceService { - rpc CreateInferenceService (CreateInferenceServiceRequest) returns (google.protobuf.Empty) { + rpc CreateInferenceService (CreateInferenceServiceRequest) returns (GetInferenceServiceResponse) { option (google.api.http) = { post: "/apis/v1beta1/{namespace}/inferenceservice" body: "*" @@ -43,7 +43,7 @@ message Container { repeated Env env = 3; } -message Transformer { +message InferenceServiceTransformer { repeated Container containers = 1; string minCpu = 2; string minMemory = 3; @@ -65,10 +65,10 @@ message InferenceServicePredictor { message CreateInferenceServiceRequest { string namespace = 1; string name = 2; - string transformerImage = 3; + string defaultTransformerImage = 3; InferenceServicePredictor predictor = 4; - Transformer transformer = 5; + InferenceServiceTransformer transformer = 5; } message DeployModelResponse { diff --git a/server/inferenceservice_server.go b/server/inferenceservice_server.go index e6f1d0c..efff1ea 100644 --- a/server/inferenceservice_server.go +++ b/server/inferenceservice_server.go @@ -23,7 +23,7 @@ func NewInferenceService() *InferenceServiceServer { } // CreateInferenceService deploys an inference service -func (s *InferenceServiceServer) CreateInferenceService(ctx context.Context, req *api.CreateInferenceServiceRequest) (*empty.Empty, error) { +func (s *InferenceServiceServer) CreateInferenceService(ctx context.Context, req *api.CreateInferenceServiceRequest) (*api.GetInferenceServiceResponse, error) { client := getClient(ctx) allowed, err := auth.IsAuthorized(client, req.Namespace, "create", "serving.kubeflow.org", "inferenceservices", "") if err != nil || !allowed { @@ -38,7 +38,7 @@ func (s *InferenceServiceServer) CreateInferenceService(ctx context.Context, req return nil, util.NewUserError(codes.InvalidArgument, "missing key 'predictor.storageUri'") } - if req.TransformerImage != "" && req.Transformer != nil { + if req.DefaultTransformerImage != "" && req.Transformer != nil { return nil, util.NewUserError(codes.InvalidArgument, "must set either transformerImage or transformer, but not both") } @@ -112,11 +112,11 @@ func (s *InferenceServiceServer) CreateInferenceService(ctx context.Context, req model.Transformer.Containers = append(model.Transformer.Containers, modelContainer) } - } else if req.TransformerImage != "" { + } else if req.DefaultTransformerImage != "" { model.Transformer = &v1.Transformer{ Containers: []v1.TransformerContainer{ { - Image: req.TransformerImage, + Image: req.DefaultTransformerImage, Name: "kfserving-container", Env: []v1.Env{ { @@ -138,7 +138,26 @@ func (s *InferenceServiceServer) CreateInferenceService(ctx context.Context, req return nil, err } - return &empty.Empty{}, nil + status, err := client.GetModelStatus(req.Namespace, req.Name) + if err != nil { + return nil, err + } + + apiConditions := make([]*api.InferenceServiceCondition, len(status.Conditions)) + for i := range status.Conditions { + condition := status.Conditions[i] + apiConditions[i] = &api.InferenceServiceCondition{ + LastTransitionTime: condition.LastTransitionTime.Format(time.RFC3339), + Status: condition.Status, + Type: condition.Type, + } + } + + return &api.GetInferenceServiceResponse{ + Ready: status.Ready, + Conditions: apiConditions, + PredictUrl: status.PredictURL, + }, nil } // GetInferenceService returns the status of an inferenceservice