feat: updated endpoint to get the status to include predictor url

This commit is contained in:
Andrey Melnikov
2021-08-11 11:40:18 -07:00
parent edf7a30f64
commit 4528927463
8 changed files with 315 additions and 212 deletions

View File

@@ -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": {

View File

@@ -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,
},

View File

@@ -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
)

View File

@@ -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",

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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 {

View File

@@ -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
}