Documentation ¶
Index ¶
- Variables
- func RegisterModelServiceServer(s *grpc.Server, srv ModelServiceServer)
- type Code
- type GetModelStatusRequest
- func (*GetModelStatusRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetModelStatusRequest) GetModelSpec() *ModelSpec
- func (*GetModelStatusRequest) ProtoMessage()
- func (x *GetModelStatusRequest) ProtoReflect() protoreflect.Message
- func (x *GetModelStatusRequest) Reset()
- func (x *GetModelStatusRequest) String() string
- type GetModelStatusResponse
- func (*GetModelStatusResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetModelStatusResponse) GetModelVersionStatus() []*ModelVersionStatus
- func (*GetModelStatusResponse) ProtoMessage()
- func (x *GetModelStatusResponse) ProtoReflect() protoreflect.Message
- func (x *GetModelStatusResponse) Reset()
- func (x *GetModelStatusResponse) String() string
- type ModelServiceClient
- type ModelServiceServer
- type ModelSpec
- func (*ModelSpec) Descriptor() ([]byte, []int)deprecated
- func (x *ModelSpec) GetName() string
- func (x *ModelSpec) GetSignatureName() string
- func (x *ModelSpec) GetVersion() *wrappers.Int64Value
- func (m *ModelSpec) GetVersionChoice() isModelSpec_VersionChoice
- func (x *ModelSpec) GetVersionLabel() string
- func (*ModelSpec) ProtoMessage()
- func (x *ModelSpec) ProtoReflect() protoreflect.Message
- func (x *ModelSpec) Reset()
- func (x *ModelSpec) String() string
- type ModelSpec_Version
- type ModelSpec_VersionLabel
- type ModelVersionStatus
- func (*ModelVersionStatus) Descriptor() ([]byte, []int)deprecated
- func (x *ModelVersionStatus) GetState() ModelVersionStatus_State
- func (x *ModelVersionStatus) GetStatus() *StatusProto
- func (x *ModelVersionStatus) GetVersion() int64
- func (*ModelVersionStatus) ProtoMessage()
- func (x *ModelVersionStatus) ProtoReflect() protoreflect.Message
- func (x *ModelVersionStatus) Reset()
- func (x *ModelVersionStatus) String() string
- type ModelVersionStatus_State
- func (ModelVersionStatus_State) Descriptor() protoreflect.EnumDescriptor
- func (x ModelVersionStatus_State) Enum() *ModelVersionStatus_State
- func (ModelVersionStatus_State) EnumDescriptor() ([]byte, []int)deprecated
- func (x ModelVersionStatus_State) Number() protoreflect.EnumNumber
- func (x ModelVersionStatus_State) String() string
- func (ModelVersionStatus_State) Type() protoreflect.EnumType
- type StatusProto
- func (*StatusProto) Descriptor() ([]byte, []int)deprecated
- func (x *StatusProto) GetErrorCode() Code
- func (x *StatusProto) GetErrorMessage() string
- func (*StatusProto) ProtoMessage()
- func (x *StatusProto) ProtoReflect() protoreflect.Message
- func (x *StatusProto) Reset()
- func (x *StatusProto) String() string
- type UnimplementedModelServiceServer
Constants ¶
This section is empty.
Variables ¶
var ( Code_name = map[int32]string{ 0: "OK", 1: "CANCELLED", 2: "UNKNOWN", 3: "INVALID_ARGUMENT", 4: "DEADLINE_EXCEEDED", 5: "NOT_FOUND", 6: "ALREADY_EXISTS", 7: "PERMISSION_DENIED", 16: "UNAUTHENTICATED", 8: "RESOURCE_EXHAUSTED", 9: "FAILED_PRECONDITION", 10: "ABORTED", 11: "OUT_OF_RANGE", 12: "UNIMPLEMENTED", 13: "INTERNAL", 14: "UNAVAILABLE", 15: "DATA_LOSS", 20: "DO_NOT_USE_RESERVED_FOR_FUTURE_EXPANSION_USE_DEFAULT_IN_SWITCH_INSTEAD_", } Code_value = map[string]int32{ "OK": 0, "CANCELLED": 1, "UNKNOWN": 2, "INVALID_ARGUMENT": 3, "DEADLINE_EXCEEDED": 4, "NOT_FOUND": 5, "ALREADY_EXISTS": 6, "PERMISSION_DENIED": 7, "UNAUTHENTICATED": 16, "RESOURCE_EXHAUSTED": 8, "FAILED_PRECONDITION": 9, "ABORTED": 10, "OUT_OF_RANGE": 11, "UNIMPLEMENTED": 12, "INTERNAL": 13, "UNAVAILABLE": 14, "DATA_LOSS": 15, "DO_NOT_USE_RESERVED_FOR_FUTURE_EXPANSION_USE_DEFAULT_IN_SWITCH_INSTEAD_": 20, } )
Enum value maps for Code.
var ( ModelVersionStatus_State_name = map[int32]string{ 0: "UNKNOWN", 10: "START", 20: "LOADING", 30: "AVAILABLE", 40: "UNLOADING", 50: "END", } ModelVersionStatus_State_value = map[string]int32{ "UNKNOWN": 0, "START": 10, "LOADING": 20, "AVAILABLE": 30, "UNLOADING": 40, "END": 50, } )
Enum value maps for ModelVersionStatus_State.
var File_error_codes_proto protoreflect.FileDescriptor
var File_get_model_status_proto protoreflect.FileDescriptor
var File_model_proto protoreflect.FileDescriptor
var File_model_service_proto protoreflect.FileDescriptor
var File_status_proto protoreflect.FileDescriptor
Functions ¶
func RegisterModelServiceServer ¶
func RegisterModelServiceServer(s *grpc.Server, srv ModelServiceServer)
Types ¶
type Code ¶
type Code int32
The canonical error codes for TensorFlow APIs.
Warnings:
- Do not change any numeric assignments.
- Changes to this list should only be made if there is a compelling need that can't be satisfied in another way. Such changes must be approved by at least two OWNERS.
- These error codes must match gRPC and protobuf error codes (except for DO_NOT_USE_RESERVED_FOR_FUTURE_EXPANSION_USE_DEFAULT_IN_SWITCH_INSTEAD_).
Sometimes multiple error codes may apply. Services should return the most specific error code that applies. For example, prefer OUT_OF_RANGE over FAILED_PRECONDITION if both codes apply. Similarly prefer NOT_FOUND or ALREADY_EXISTS over FAILED_PRECONDITION.
const ( // Not an error; returned on success Code_OK Code = 0 // The operation was cancelled (typically by the caller). Code_CANCELLED Code = 1 // Unknown error. An example of where this error may be returned is // if a Status value received from another address space belongs to // an error-space that is not known in this address space. Also // errors raised by APIs that do not return enough error information // may be converted to this error. Code_UNKNOWN Code = 2 // Client specified an invalid argument. Note that this differs // from FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments // that are problematic regardless of the state of the system // (e.g., a malformed file name). Code_INVALID_ARGUMENT Code = 3 // Deadline expired before operation could complete. For operations // that change the state of the system, this error may be returned // even if the operation has completed successfully. For example, a // successful response from a server could have been delayed long // enough for the deadline to expire. Code_DEADLINE_EXCEEDED Code = 4 // Some requested entity (e.g., file or directory) was not found. // For privacy reasons, this code *may* be returned when the client // does not have the access right to the entity. Code_NOT_FOUND Code = 5 // Some entity that we attempted to create (e.g., file or directory) // already exists. Code_ALREADY_EXISTS Code = 6 // The caller does not have permission to execute the specified // operation. PERMISSION_DENIED must not be used for rejections // caused by exhausting some resource (use RESOURCE_EXHAUSTED // instead for those errors). PERMISSION_DENIED must not be // used if the caller can not be identified (use UNAUTHENTICATED // instead for those errors). Code_PERMISSION_DENIED Code = 7 // The request does not have valid authentication credentials for the // operation. Code_UNAUTHENTICATED Code = 16 // Some resource has been exhausted, perhaps a per-user quota, or // perhaps the entire file system is out of space. Code_RESOURCE_EXHAUSTED Code = 8 // Operation was rejected because the system is not in a state // required for the operation's execution. For example, directory // to be deleted may be non-empty, an rmdir operation is applied to // a non-directory, etc. // // A litmus test that may help a service implementor in deciding // between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE: // (a) Use UNAVAILABLE if the client can retry just the failing call. // (b) Use ABORTED if the client should retry at a higher-level // (e.g., restarting a read-modify-write sequence). // (c) Use FAILED_PRECONDITION if the client should not retry until // the system state has been explicitly fixed. E.g., if an "rmdir" // fails because the directory is non-empty, FAILED_PRECONDITION // should be returned since the client should not retry unless // they have first fixed up the directory by deleting files from it. // (d) Use FAILED_PRECONDITION if the client performs conditional // REST Get/Update/Delete on a resource and the resource on the // server does not match the condition. E.g., conflicting // read-modify-write on the same resource. Code_FAILED_PRECONDITION Code = 9 // The operation was aborted, typically due to a concurrency issue // like sequencer check failures, transaction aborts, etc. // // See litmus test above for deciding between FAILED_PRECONDITION, // ABORTED, and UNAVAILABLE. Code_ABORTED Code = 10 // Operation tried to iterate past the valid input range. E.g., seeking or // reading past end of file. // // Unlike INVALID_ARGUMENT, this error indicates a problem that may // be fixed if the system state changes. For example, a 32-bit file // system will generate INVALID_ARGUMENT if asked to read at an // offset that is not in the range [0,2^32-1], but it will generate // OUT_OF_RANGE if asked to read from an offset past the current // file size. // // There is a fair bit of overlap between FAILED_PRECONDITION and // OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific // error) when it applies so that callers who are iterating through // a space can easily look for an OUT_OF_RANGE error to detect when // they are done. Code_OUT_OF_RANGE Code = 11 // Operation is not implemented or not supported/enabled in this service. Code_UNIMPLEMENTED Code = 12 // Internal errors. Means some invariant expected by the underlying // system has been broken. If you see one of these errors, // something is very broken. Code_INTERNAL Code = 13 // The service is currently unavailable. This is a most likely a // transient condition and may be corrected by retrying with // a backoff. // // See litmus test above for deciding between FAILED_PRECONDITION, // ABORTED, and UNAVAILABLE. Code_UNAVAILABLE Code = 14 // Unrecoverable data loss or corruption. Code_DATA_LOSS Code = 15 // An extra enum entry to prevent people from writing code that // fails to compile when a new code is added. // // Nobody should ever reference this enumeration entry. In particular, // if you write C++ code that switches on this enumeration, add a default: // case instead of a case that mentions this enumeration entry. // // Nobody should rely on the value (currently 20) listed here. It // may change in the future. Code_DO_NOT_USE_RESERVED_FOR_FUTURE_EXPANSION_USE_DEFAULT_IN_SWITCH_INSTEAD_ Code = 20 )
func (Code) Descriptor ¶
func (Code) Descriptor() protoreflect.EnumDescriptor
func (Code) EnumDescriptor
deprecated
func (Code) Number ¶
func (x Code) Number() protoreflect.EnumNumber
func (Code) Type ¶
func (Code) Type() protoreflect.EnumType
type GetModelStatusRequest ¶
type GetModelStatusRequest struct { // Model Specification. If version is not specified, information about all // versions of the model will be returned. If a version is specified, the // status of only that version will be returned. ModelSpec *ModelSpec `protobuf:"bytes,1,opt,name=model_spec,json=modelSpec,proto3" json:"model_spec,omitempty"` // contains filtered or unexported fields }
GetModelStatusRequest contains a ModelSpec indicating the model for which to get status.
func (*GetModelStatusRequest) Descriptor
deprecated
func (*GetModelStatusRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetModelStatusRequest.ProtoReflect.Descriptor instead.
func (*GetModelStatusRequest) GetModelSpec ¶
func (x *GetModelStatusRequest) GetModelSpec() *ModelSpec
func (*GetModelStatusRequest) ProtoMessage ¶
func (*GetModelStatusRequest) ProtoMessage()
func (*GetModelStatusRequest) ProtoReflect ¶
func (x *GetModelStatusRequest) ProtoReflect() protoreflect.Message
func (*GetModelStatusRequest) Reset ¶
func (x *GetModelStatusRequest) Reset()
func (*GetModelStatusRequest) String ¶
func (x *GetModelStatusRequest) String() string
type GetModelStatusResponse ¶
type GetModelStatusResponse struct { // Version number and status information for applicable model version(s). ModelVersionStatus []*ModelVersionStatus `protobuf:"bytes,1,rep,name=model_version_status,proto3" json:"model_version_status,omitempty"` // contains filtered or unexported fields }
Response for ModelStatusRequest on successful run.
func (*GetModelStatusResponse) Descriptor
deprecated
func (*GetModelStatusResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetModelStatusResponse.ProtoReflect.Descriptor instead.
func (*GetModelStatusResponse) GetModelVersionStatus ¶
func (x *GetModelStatusResponse) GetModelVersionStatus() []*ModelVersionStatus
func (*GetModelStatusResponse) ProtoMessage ¶
func (*GetModelStatusResponse) ProtoMessage()
func (*GetModelStatusResponse) ProtoReflect ¶
func (x *GetModelStatusResponse) ProtoReflect() protoreflect.Message
func (*GetModelStatusResponse) Reset ¶
func (x *GetModelStatusResponse) Reset()
func (*GetModelStatusResponse) String ¶
func (x *GetModelStatusResponse) String() string
type ModelServiceClient ¶
type ModelServiceClient interface { // Gets status of model. If the ModelSpec in the request does not specify // version, information about all versions of the model will be returned. If // the ModelSpec in the request does specify a version, the status of only // that version will be returned. GetModelStatus(ctx context.Context, in *GetModelStatusRequest, opts ...grpc.CallOption) (*GetModelStatusResponse, error) }
ModelServiceClient is the client API for ModelService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewModelServiceClient ¶
func NewModelServiceClient(cc grpc.ClientConnInterface) ModelServiceClient
type ModelServiceServer ¶
type ModelServiceServer interface { // Gets status of model. If the ModelSpec in the request does not specify // version, information about all versions of the model will be returned. If // the ModelSpec in the request does specify a version, the status of only // that version will be returned. GetModelStatus(context.Context, *GetModelStatusRequest) (*GetModelStatusResponse, error) }
ModelServiceServer is the server API for ModelService service.
type ModelSpec ¶
type ModelSpec struct { // Required servable name. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Optional choice of which version of the model to use. // // Recommended to be left unset in the common case. Should be specified only // when there is a strong version consistency requirement. // // When left unspecified, the system will serve the best available version. // This is typically the latest version, though during version transitions, // notably when serving on a fleet of instances, may be either the previous or // new version. // // Types that are assignable to VersionChoice: // *ModelSpec_Version // *ModelSpec_VersionLabel VersionChoice isModelSpec_VersionChoice `protobuf_oneof:"version_choice"` // A named signature to evaluate. If unspecified, the default signature will // be used. SignatureName string `protobuf:"bytes,3,opt,name=signature_name,json=signatureName,proto3" json:"signature_name,omitempty"` // contains filtered or unexported fields }
Metadata for an inference request such as the model name and version.
func (*ModelSpec) Descriptor
deprecated
func (*ModelSpec) GetSignatureName ¶
func (*ModelSpec) GetVersion ¶
func (x *ModelSpec) GetVersion() *wrappers.Int64Value
func (*ModelSpec) GetVersionChoice ¶
func (m *ModelSpec) GetVersionChoice() isModelSpec_VersionChoice
func (*ModelSpec) GetVersionLabel ¶
func (*ModelSpec) ProtoMessage ¶
func (*ModelSpec) ProtoMessage()
func (*ModelSpec) ProtoReflect ¶
func (x *ModelSpec) ProtoReflect() protoreflect.Message
type ModelSpec_Version ¶
type ModelSpec_Version struct { // Use this specific version number. Version *wrappers.Int64Value `protobuf:"bytes,2,opt,name=version,proto3,oneof"` }
type ModelSpec_VersionLabel ¶
type ModelSpec_VersionLabel struct { // Use the version associated with the given label. VersionLabel string `protobuf:"bytes,4,opt,name=version_label,json=versionLabel,proto3,oneof"` }
type ModelVersionStatus ¶
type ModelVersionStatus struct { // Model version. Version int64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` // Model state. State ModelVersionStatus_State `protobuf:"varint,2,opt,name=state,proto3,enum=tensorflow.serving.ModelVersionStatus_State" json:"state,omitempty"` // Model status. Status *StatusProto `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` // contains filtered or unexported fields }
Version number, state, and status for a single version of a model.
func (*ModelVersionStatus) Descriptor
deprecated
func (*ModelVersionStatus) Descriptor() ([]byte, []int)
Deprecated: Use ModelVersionStatus.ProtoReflect.Descriptor instead.
func (*ModelVersionStatus) GetState ¶
func (x *ModelVersionStatus) GetState() ModelVersionStatus_State
func (*ModelVersionStatus) GetStatus ¶
func (x *ModelVersionStatus) GetStatus() *StatusProto
func (*ModelVersionStatus) GetVersion ¶
func (x *ModelVersionStatus) GetVersion() int64
func (*ModelVersionStatus) ProtoMessage ¶
func (*ModelVersionStatus) ProtoMessage()
func (*ModelVersionStatus) ProtoReflect ¶
func (x *ModelVersionStatus) ProtoReflect() protoreflect.Message
func (*ModelVersionStatus) Reset ¶
func (x *ModelVersionStatus) Reset()
func (*ModelVersionStatus) String ¶
func (x *ModelVersionStatus) String() string
type ModelVersionStatus_State ¶
type ModelVersionStatus_State int32
States that map to ManagerState enum in tensorflow_serving/core/servable_state.h
const ( // Default value. ModelVersionStatus_UNKNOWN ModelVersionStatus_State = 0 // The manager is tracking this servable, but has not initiated any action // pertaining to it. ModelVersionStatus_START ModelVersionStatus_State = 10 // The manager has decided to load this servable. In particular, checks // around resource availability and other aspects have passed, and the // manager is about to invoke the loader's Load() method. ModelVersionStatus_LOADING ModelVersionStatus_State = 20 // The manager has successfully loaded this servable and made it available // for serving (i.e. GetServableHandle(id) will succeed). To avoid races, // this state is not reported until *after* the servable is made // available. ModelVersionStatus_AVAILABLE ModelVersionStatus_State = 30 // The manager has decided to make this servable unavailable, and unload // it. To avoid races, this state is reported *before* the servable is // made unavailable. ModelVersionStatus_UNLOADING ModelVersionStatus_State = 40 // This servable has reached the end of its journey in the manager. Either // it loaded and ultimately unloaded successfully, or it hit an error at // some point in its lifecycle. ModelVersionStatus_END ModelVersionStatus_State = 50 )
func (ModelVersionStatus_State) Descriptor ¶
func (ModelVersionStatus_State) Descriptor() protoreflect.EnumDescriptor
func (ModelVersionStatus_State) Enum ¶
func (x ModelVersionStatus_State) Enum() *ModelVersionStatus_State
func (ModelVersionStatus_State) EnumDescriptor
deprecated
func (ModelVersionStatus_State) EnumDescriptor() ([]byte, []int)
Deprecated: Use ModelVersionStatus_State.Descriptor instead.
func (ModelVersionStatus_State) Number ¶
func (x ModelVersionStatus_State) Number() protoreflect.EnumNumber
func (ModelVersionStatus_State) String ¶
func (x ModelVersionStatus_State) String() string
func (ModelVersionStatus_State) Type ¶
func (ModelVersionStatus_State) Type() protoreflect.EnumType
type StatusProto ¶
type StatusProto struct { // Error code. ErrorCode Code `protobuf:"varint,1,opt,name=error_code,proto3,enum=error.Code" json:"error_code,omitempty"` // Error message. Will only be set if an error was encountered. ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,proto3" json:"error_message,omitempty"` // contains filtered or unexported fields }
Status that corresponds to Status in third_party/tensorflow/core/lib/core/status.h.
func (*StatusProto) Descriptor
deprecated
func (*StatusProto) Descriptor() ([]byte, []int)
Deprecated: Use StatusProto.ProtoReflect.Descriptor instead.
func (*StatusProto) GetErrorCode ¶
func (x *StatusProto) GetErrorCode() Code
func (*StatusProto) GetErrorMessage ¶
func (x *StatusProto) GetErrorMessage() string
func (*StatusProto) ProtoMessage ¶
func (*StatusProto) ProtoMessage()
func (*StatusProto) ProtoReflect ¶
func (x *StatusProto) ProtoReflect() protoreflect.Message
func (*StatusProto) Reset ¶
func (x *StatusProto) Reset()
func (*StatusProto) String ¶
func (x *StatusProto) String() string
type UnimplementedModelServiceServer ¶
type UnimplementedModelServiceServer struct { }
UnimplementedModelServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedModelServiceServer) GetModelStatus ¶
func (*UnimplementedModelServiceServer) GetModelStatus(context.Context, *GetModelStatusRequest) (*GetModelStatusResponse, error)