common

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

The common package contains API types used by both Predictors and InferenceServices. Having a separate package avoids circular dependencies. +kubebuilder:object:generate=true

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FailureInfo

type FailureInfo struct {
	// Name of component to which the failure relates (usually Pod name)
	//+optional
	Location string `json:"location,omitempty"`
	// High level class of failure
	//+optional
	Reason FailureReason `json:"reason,omitempty"`
	// Detailed error message
	//+optional
	Message string `json:"message,omitempty"`
	// Internal ID of model, tied to specific Spec contents
	//+optional
	ModelId string `json:"modelId,omitempty"`
	// Time failure occurred or was discovered
	//+optional
	Time *metav1.Time `json:"time,omitempty"`
}

func (*FailureInfo) DeepCopy

func (in *FailureInfo) DeepCopy() *FailureInfo

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FailureInfo.

func (*FailureInfo) DeepCopyInto

func (in *FailureInfo) DeepCopyInto(out *FailureInfo)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type FailureReason

type FailureReason string

FailureReason enum +kubebuilder:validation:Enum=ModelLoadFailed;RuntimeUnhealthy;NoSupportingRuntime;RuntimeNotRecognized;InvalidPredictorSpec

const (
	// The model failed to load within a ServingRuntime container
	ModelLoadFailed FailureReason = "ModelLoadFailed"
	// Corresponding ServingRuntime containers failed to start or are unhealthy
	RuntimeUnhealthy FailureReason = "RuntimeUnhealthy"
	// There are no ServingRuntime which support the specified model type
	NoSupportingRuntime FailureReason = "NoSupportingRuntime"
	// There is no ServingRuntime defined with the specified runtime name
	RuntimeNotRecognized FailureReason = "RuntimeNotRecognized"
	// The current Predictor Spec is invalid or unsupported
	InvalidPredictorSpec FailureReason = "InvalidPredictorSpec"
)

FailureReason enum values

type ModelState

type ModelState string

ModelState enum +kubebuilder:validation:Enum="";Pending;Standby;Loading;Loaded;FailedToLoad

const (
	// Model is not yet registered
	Pending ModelState = "Pending"
	// Model is available but not loaded (will load when used)
	Standby ModelState = "Standby"
	// Model is loading
	Loading ModelState = "Loading"
	// At least one copy of the model is loaded
	Loaded ModelState = "Loaded"
	// All copies of the model failed to load
	FailedToLoad ModelState = "FailedToLoad"
)

ModelState Enum values

type PredictorStatus

type PredictorStatus struct {

	// Whether the predictor endpoint is available
	Available bool `json:"available"`
	// Whether the available predictor endpoint reflects the current Spec or is in transition
	// +kubebuilder:default=UpToDate
	TransitionStatus TransitionStatus `json:"transitionStatus"`

	// High level state string: Pending, Standby, Loading, Loaded, FailedToLoad
	// +kubebuilder:default=Pending
	ActiveModelState ModelState `json:"activeModelState"`
	// +kubebuilder:default=""
	TargetModelState ModelState `json:"targetModelState"`

	// Details of last failure, when load of target model is failed or blocked
	//+optional
	LastFailureInfo *FailureInfo `json:"lastFailureInfo,omitempty"`

	// Addressable endpoint for the deployed trained model
	// This will be "static" and will not change when the model is mutated
	// +optional
	HTTPEndpoint string `json:"httpEndpoint"`
	// +optional
	GrpcEndpoint string `json:"grpcEndpoint"`

	// How many copies of this predictor's models failed to load recently
	// +kubebuilder:default=0
	FailedCopies int `json:"failedCopies"`
}

PredictorStatus defines the observed state of Predictor

func (*PredictorStatus) DeepCopy

func (in *PredictorStatus) DeepCopy() *PredictorStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PredictorStatus.

func (*PredictorStatus) DeepCopyInto

func (in *PredictorStatus) DeepCopyInto(out *PredictorStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PredictorStatus) WaitingForRuntime

func (s *PredictorStatus) WaitingForRuntime() bool

type StorageSpec

type StorageSpec struct {
	// The path to the model object in the storage. It cannot co-exist
	// with the storageURI.
	// +optional
	Path *string `json:"path,omitempty"`
	// The path to the model schema file in the storage.
	// +optional
	SchemaPath *string `json:"schemaPath,omitempty"`
	// Parameters to override the default storage credentials and config.
	// +optional
	Parameters *map[string]string `json:"parameters,omitempty"`
	// The Storage Key in the secret for this model.
	// +optional
	StorageKey *string `json:"key,omitempty"`
}

func (*StorageSpec) DeepCopy

func (in *StorageSpec) DeepCopy() *StorageSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageSpec.

func (*StorageSpec) DeepCopyInto

func (in *StorageSpec) DeepCopyInto(out *StorageSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TransitionStatus

type TransitionStatus string

TransitionStatus enum +kubebuilder:validation:Enum=UpToDate;InProgress;BlockedByFailedLoad;InvalidSpec

const (
	// Predictor is up-to-date (reflects current spec)
	UpToDate TransitionStatus = "UpToDate"
	// Waiting for target model to reach state of active model
	InProgress TransitionStatus = "InProgress"
	// Target model failed to load
	BlockedByFailedLoad TransitionStatus = "BlockedByFailedLoad"
	// TBD
	InvalidSpec TransitionStatus = "InvalidSpec"
)

TransitionStatus Enum values

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL