v1alpha2

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2020 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Overview

Package v1alpha2 contains API Schema definitions for the serving v1alpha2 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=kfserving/pkg/apis/serving +k8s:defaulter-gen=TypeMeta +groupName=serving.kubeflow.org

Package v1alpha2 contains API Schema definitions for the serving v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=kfserving/pkg/apis/serving +k8s:defaulter-gen=TypeMeta +groupName=serving.kubeflow.org

Index

Constants

View Source
const (
	PredictorConfigKeyName   = "predictors"
	TransformerConfigKeyName = "transformers"
	ExplainerConfigKeyName   = "explainers"
)

ConfigMap Keys

View Source
const (
	// RoutesReady is set when network configuration has completed.
	RoutesReady apis.ConditionType = "RoutesReady"
	// DefaultPredictorReady is set when default predictor has reported readiness.
	DefaultPredictorReady apis.ConditionType = "DefaultPredictorReady"
	// CanaryPredictorReady is set when canary predictor has reported readiness.
	CanaryPredictorReady apis.ConditionType = "CanaryPredictorReady"
	// DefaultTransformerReady is set when default transformer has reported readiness.
	DefaultTransformerReady apis.ConditionType = "DefaultTransformerReady"
	// CanaryTransformerReady is set when canary transformer has reported readiness.
	CanaryTransformerReady apis.ConditionType = "CanaryTransformerReady"

	// DefaultExplainerReady is set when default explainer has reported readiness.
	DefaultExplainerReady apis.ConditionType = "DefaultExplainerReady"
	// CanaryExplainerReady is set when canary explainer has reported readiness.
	CanaryExplainerReady apis.ConditionType = "CanaryExplainerReady"
)

ConditionType represents a Service condition value

View Source
const (
	MinReplicasShouldBeLessThanMaxError = "MinReplicas cannot be greater than MaxReplicas."
	MinReplicasLowerBoundExceededError  = "MinReplicas cannot be less than 0."
	MaxReplicasLowerBoundExceededError  = "MaxReplicas cannot be less than 0."
	ParallelismLowerBoundExceededError  = "Parallelism cannot be less than 0."
	TrafficBoundsExceededError          = "TrafficPercent must be between [0, 100]."
	TrafficProvidedWithoutCanaryError   = "Canary must be specified when CanaryTrafficPercent > 0."
	UnsupportedStorageURIFormatError    = "" /* 156-byte string literal not displayed */
)

Known error messages

View Source
const (
	// ExactlyOneExplainerViolatedError is a known error message
	ExactlyOneExplainerViolatedError = "Exactly one of [Custom, Alibi] must be specified in ExplainerSpec"
)
View Source
const (
	// ExactlyOnePredictorViolatedError is a known error message
	ExactlyOnePredictorViolatedError = "Exactly one of [Custom, ONNX, Tensorflow, TensorRT, SKLearn, XGBoost] must be specified in PredictorSpec"
)
View Source
const (
	ExactlyOneTransformerViolatedError = "Exactly one of [Custom, Feast] must be specified in TransformerSpec"
)

Constants

View Source
const (
	InvalidLoggerType = "Invalid logger type"
)

Variables

View Source
var (
	ONNXServingRestPort            = "8080"
	ONNXServingGRPCPort            = "9000"
	ONNXModelFileName              = "model.onnx"
	InvalidONNXRuntimeVersionError = "ONNX RuntimeVersion must be one of %s"
)
View Source
var (
	InvalidPyTorchRuntimeVersionError = "PyTorch RuntimeVersion must be one of %s"
	DefaultPyTorchModelClassName      = "PyTorchModel"
	PyTorchServingGPUSuffix           = "-gpu"
	InvalidPyTorchRuntimeIncludesGPU  = "PyTorch RuntimeVersion is not GPU enabled but GPU resources are requested. " + InvalidPyTorchRuntimeVersionError
	InvalidPyTorchRuntimeExcludesGPU  = "PyTorch RuntimeVersion is GPU enabled but GPU resources are not requested. " + InvalidPyTorchRuntimeVersionError
)
View Source
var (
	TensorflowEntrypointCommand          = "/usr/bin/tensorflow_model_server"
	TensorflowServingGRPCPort            = "9000"
	TensorflowServingRestPort            = "8080"
	TensorflowServingGPUSuffix           = "-gpu"
	InvalidTensorflowRuntimeVersionError = "Tensorflow RuntimeVersion must be one of %s"
	InvalidTensorflowRuntimeIncludesGPU  = "Tensorflow RuntimeVersion is not GPU enabled but GPU resources are requested. " + InvalidTensorflowRuntimeVersionError
	InvalidTensorflowRuntimeExcludesGPU  = "Tensorflow RuntimeVersion is GPU enabled but GPU resources are not requested. " + InvalidTensorflowRuntimeVersionError
)
View Source
var (
	// For versioning see https://github.com/NVIDIA/tensorrt-inference-server/releases
	InvalidTensorRTISRuntimeVersionError = "TensorRTIS RuntimeVersion must be one of %s"
	TensorRTISGRPCPort                   = int32(9000)
	TensorRTISRestPort                   = int32(8080)
)
View Source
var (
	SupportedStorageURIPrefixList = []string{"gs://", "s3://", "pvc://", "file://"}
	AzureBlobURIRegEx             = "https://(.+?).blob.core.windows.net/(.+)"
)
View Source
var (
	// APIVersion is the current API version used to register these objects
	APIVersion = "v1alpha2"

	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: constants.KFServingAPIGroupName, Version: APIVersion}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}

	// AddToScheme is required by pkg/client/...
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var (
	InvalidAlibiRuntimeVersionError = "Alibi RuntimeVersion must be one of %s"
)
View Source
var (
	InvalidSKLearnRuntimeVersionError = "SKLearn RuntimeVersion must be one of %s"
)
View Source
var (
	InvalidXGBoostRuntimeVersionError = "XGBoost RuntimeVersion must be one of %s"
)

Functions

func GetIntReference added in v0.3.0

func GetIntReference(number int) *int

GetIntReference returns the pointer for the integer input

func Resource

func Resource(resource string) schema.GroupResource

Resource is required by pkg/client/listers/...

Types

type AlibiExplainerSpec

type AlibiExplainerSpec struct {
	// The type of Alibi explainer
	Type AlibiExplainerType `json:"type"`
	// The location of a trained explanation model
	StorageURI string `json:"storageUri,omitempty"`
	// Defaults to latest Alibi Version
	RuntimeVersion string `json:"runtimeVersion,omitempty"`
	// Defaults to requests and limits of 1CPU, 2Gb MEM.
	Resources v1.ResourceRequirements `json:"resources,omitempty"`
	// Inline custom parameter settings for explainer
	Config map[string]string `json:"config,omitempty"`
}

AlibiExplainerSpec defines the arguments for configuring an Alibi Explanation Server

func (*AlibiExplainerSpec) ApplyDefaults

func (s *AlibiExplainerSpec) ApplyDefaults(config *InferenceServicesConfig)

func (*AlibiExplainerSpec) CreateExplainerContainer added in v0.3.0

func (s *AlibiExplainerSpec) CreateExplainerContainer(modelName string, parallelism int, predictorHost string, config *InferenceServicesConfig) *v1.Container

func (*AlibiExplainerSpec) DeepCopy

func (in *AlibiExplainerSpec) DeepCopy() *AlibiExplainerSpec

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

func (*AlibiExplainerSpec) DeepCopyInto

func (in *AlibiExplainerSpec) DeepCopyInto(out *AlibiExplainerSpec)

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

func (*AlibiExplainerSpec) GetResourceRequirements added in v0.3.0

func (s *AlibiExplainerSpec) GetResourceRequirements() *v1.ResourceRequirements

func (*AlibiExplainerSpec) GetStorageUri

func (s *AlibiExplainerSpec) GetStorageUri() string

func (*AlibiExplainerSpec) Validate

func (s *AlibiExplainerSpec) Validate(config *InferenceServicesConfig) error

type AlibiExplainerType

type AlibiExplainerType string
const (
	AlibiAnchorsTabularExplainer  AlibiExplainerType = "AnchorTabular"
	AlibiAnchorsImageExplainer    AlibiExplainerType = "AnchorImages"
	AlibiAnchorsTextExplainer     AlibiExplainerType = "AnchorText"
	AlibiCounterfactualsExplainer AlibiExplainerType = "Counterfactuals"
	AlibiContrastiveExplainer     AlibiExplainerType = "Contrastive"
)

type ComponentStatusMap added in v0.3.0

EndpointStatusMap defines the observed state of InferenceService endpoints

func (ComponentStatusMap) DeepCopy added in v0.3.0

func (in ComponentStatusMap) DeepCopy() ComponentStatusMap

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

func (ComponentStatusMap) DeepCopyInto added in v0.3.0

func (in ComponentStatusMap) DeepCopyInto(out *ComponentStatusMap)

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

type CustomSpec

type CustomSpec struct {
	Container v1.Container `json:"container"`
}

CustomSpec provides a hook for arbitrary container configuration.

func (*CustomSpec) ApplyDefaults

func (c *CustomSpec) ApplyDefaults(config *InferenceServicesConfig)

func (*CustomSpec) CreateExplainerContainer added in v0.3.0

func (c *CustomSpec) CreateExplainerContainer(modelName string, parallelism int, predictUrl string, config *InferenceServicesConfig) *v1.Container

func (*CustomSpec) DeepCopy

func (in *CustomSpec) DeepCopy() *CustomSpec

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

func (*CustomSpec) DeepCopyInto

func (in *CustomSpec) DeepCopyInto(out *CustomSpec)

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

func (*CustomSpec) GetContainer added in v0.3.0

func (c *CustomSpec) GetContainer(modelName string, parallelism int, config *InferenceServicesConfig) *v1.Container

func (*CustomSpec) GetContainerSpec added in v0.3.0

func (c *CustomSpec) GetContainerSpec() *v1.Container

GetContainerSpec for the CustomSpec

func (*CustomSpec) GetResourceRequirements added in v0.3.0

func (c *CustomSpec) GetResourceRequirements() *v1.ResourceRequirements

func (*CustomSpec) GetStorageUri

func (c *CustomSpec) GetStorageUri() string

func (*CustomSpec) Validate

func (c *CustomSpec) Validate(config *InferenceServicesConfig) error

type DeploymentSpec

type DeploymentSpec struct {
	// ServiceAccountName is the name of the ServiceAccount to use to run the service
	// +optional
	ServiceAccountName string `json:"serviceAccountName,omitempty"`
	// Minimum number of replicas, pods won't scale down to 0 in case of no traffic
	// +optional
	MinReplicas *int `json:"minReplicas,omitempty"`
	// This is the up bound for autoscaler to scale to
	// +optional
	MaxReplicas int `json:"maxReplicas,omitempty"`
	// Parallelism specifies how many requests can be processed concurrently, this sets the target
	// concurrency for Autoscaling(KPA). For model servers that support tuning parallelism will use this value,
	// by default the parallelism is the number of the CPU cores for most of the model servers.
	// +optional
	Parallelism int `json:"parallelism,omitempty"`
	// Activate request/response logging
	// +optional
	Logger *Logger `json:"logger,omitempty"`
}

DeploymentSpec defines the configuration for a given InferenceService service component

func (*DeploymentSpec) DeepCopy

func (in *DeploymentSpec) DeepCopy() *DeploymentSpec

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

func (*DeploymentSpec) DeepCopyInto

func (in *DeploymentSpec) DeepCopyInto(out *DeploymentSpec)

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

type EndpointSpec

type EndpointSpec struct {
	// Predictor defines the model serving spec
	// +required
	Predictor PredictorSpec `json:"predictor"`

	// Explainer defines the model explanation service spec,
	// explainer service calls to predictor or transformer if it is specified.
	// +optional
	Explainer *ExplainerSpec `json:"explainer,omitempty"`

	// Transformer defines the pre/post processing before and after the predictor call,
	// transformer service calls to predictor service.
	// +optional
	Transformer *TransformerSpec `json:"transformer,omitempty"`
}

func (*EndpointSpec) DeepCopy

func (in *EndpointSpec) DeepCopy() *EndpointSpec

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

func (*EndpointSpec) DeepCopyInto

func (in *EndpointSpec) DeepCopyInto(out *EndpointSpec)

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

type Explainer added in v0.3.0

type Explainer interface {
	GetResourceRequirements() *v1.ResourceRequirements
	GetStorageUri() string
	CreateExplainerContainer(modelName string, parallelism int, predictorHost string, config *InferenceServicesConfig) *v1.Container
	ApplyDefaults(config *InferenceServicesConfig)
	Validate(config *InferenceServicesConfig) error
}

type ExplainerConfig

type ExplainerConfig struct {
	ContainerImage string `json:"image"`

	DefaultImageVersion  string   `json:"defaultImageVersion"`
	AllowedImageVersions []string `json:"allowedImageVersions"`
}

+k8s:openapi-gen=false

func (*ExplainerConfig) DeepCopy

func (in *ExplainerConfig) DeepCopy() *ExplainerConfig

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

func (*ExplainerConfig) DeepCopyInto

func (in *ExplainerConfig) DeepCopyInto(out *ExplainerConfig)

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

type ExplainerSpec

type ExplainerSpec struct {
	// Spec for alibi explainer
	Alibi *AlibiExplainerSpec `json:"alibi,omitempty"`
	// Spec for a custom explainer
	Custom *CustomSpec `json:"custom,omitempty"`

	DeploymentSpec `json:",inline"`
}

ExplainerSpec defines the arguments for a model explanation server, The following fields follow a "1-of" semantic. Users must specify exactly one spec.

func (*ExplainerSpec) ApplyDefaults

func (e *ExplainerSpec) ApplyDefaults(config *InferenceServicesConfig)

func (*ExplainerSpec) CreateExplainerContainer added in v0.3.0

func (e *ExplainerSpec) CreateExplainerContainer(modelName string, parallelism int, predictorHost string, config *InferenceServicesConfig) *v1.Container

func (*ExplainerSpec) DeepCopy

func (in *ExplainerSpec) DeepCopy() *ExplainerSpec

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

func (*ExplainerSpec) DeepCopyInto

func (in *ExplainerSpec) DeepCopyInto(out *ExplainerSpec)

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

func (*ExplainerSpec) GetStorageUri

func (e *ExplainerSpec) GetStorageUri() string

Returns a URI to the explainer. This URI is passed to the model-initializer via the ModelInitializerSourceUriInternalAnnotationKey

func (*ExplainerSpec) Validate

func (e *ExplainerSpec) Validate(config *InferenceServicesConfig) error

type ExplainersConfig

type ExplainersConfig struct {
	AlibiExplainer ExplainerConfig `json:"alibi,omitempty"`
}

+k8s:openapi-gen=false

func (*ExplainersConfig) DeepCopy

func (in *ExplainersConfig) DeepCopy() *ExplainersConfig

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

func (*ExplainersConfig) DeepCopyInto

func (in *ExplainersConfig) DeepCopyInto(out *ExplainersConfig)

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

type InferenceService added in v0.3.0

type InferenceService struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   InferenceServiceSpec   `json:"spec,omitempty"`
	Status InferenceServiceStatus `json:"status,omitempty"`
}

InferenceService is the Schema for the services API +k8s:openapi-gen=true +kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:printcolumn:name="URL",type="string",JSONPath=".status.url" +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +kubebuilder:printcolumn:name="Default Traffic",type="integer",JSONPath=".status.traffic" +kubebuilder:printcolumn:name="Canary Traffic",type="integer",JSONPath=".status.canaryTraffic" +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +kubebuilder:resource:path=inferenceservices,shortName=inferenceservice

func (*InferenceService) DeepCopy added in v0.3.0

func (in *InferenceService) DeepCopy() *InferenceService

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

func (*InferenceService) DeepCopyInto added in v0.3.0

func (in *InferenceService) DeepCopyInto(out *InferenceService)

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

func (*InferenceService) DeepCopyObject added in v0.3.0

func (in *InferenceService) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*InferenceService) Default added in v0.3.0

func (isvc *InferenceService) Default(client client.Client)

func (*InferenceService) ValidateCreate added in v0.3.0

func (isvc *InferenceService) ValidateCreate(client client.Client) error

ValidateCreate implements https://godoc.org/sigs.k8s.io/controller-runtime/pkg/webhook/admission#Validator

func (*InferenceService) ValidateUpdate added in v0.3.0

func (isvc *InferenceService) ValidateUpdate(old runtime.Object, client client.Client) error

ValidateUpdate implements https://godoc.org/sigs.k8s.io/controller-runtime/pkg/webhook/admission#Validator

type InferenceServiceList added in v0.3.0

type InferenceServiceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	// +listType=set
	Items []InferenceService `json:"items"`
}

+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +kubebuilder:object:root=true InferenceServiceList contains a list of Service

func (*InferenceServiceList) DeepCopy added in v0.3.0

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

func (*InferenceServiceList) DeepCopyInto added in v0.3.0

func (in *InferenceServiceList) DeepCopyInto(out *InferenceServiceList)

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

func (*InferenceServiceList) DeepCopyObject added in v0.3.0

func (in *InferenceServiceList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type InferenceServiceSpec added in v0.3.0

type InferenceServiceSpec struct {
	// Default defines default InferenceService endpoints
	// +required
	Default EndpointSpec `json:"default"`
	// Canary defines an alternate endpoints to route a percentage of traffic.
	// +optional
	Canary *EndpointSpec `json:"canary,omitempty"`
	// CanaryTrafficPercent defines the percentage of traffic going to canary InferenceService endpoints
	// +optional
	CanaryTrafficPercent int `json:"canaryTrafficPercent,omitempty"`
}

InferenceServiceSpec defines the desired state of InferenceService

func (*InferenceServiceSpec) DeepCopy added in v0.3.0

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

func (*InferenceServiceSpec) DeepCopyInto added in v0.3.0

func (in *InferenceServiceSpec) DeepCopyInto(out *InferenceServiceSpec)

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

type InferenceServiceStatus added in v0.3.0

type InferenceServiceStatus struct {
	duckv1beta1.Status `json:",inline"`
	// URL of the InferenceService
	URL string `json:"url,omitempty"`
	// Traffic percentage that goes to default services
	Traffic int `json:"traffic,omitempty"`
	// Traffic percentage that goes to canary services
	CanaryTraffic int `json:"canaryTraffic,omitempty"`
	// Statuses for the default endpoints of the InferenceService
	Default *ComponentStatusMap `json:"default,omitempty"`
	// Statuses for the canary endpoints of the InferenceService
	Canary *ComponentStatusMap `json:"canary,omitempty"`
	// Ducktype for addressable
	Address *duckv1beta1.Addressable `json:"address,omitempty"`
}

InferenceServiceStatus defines the observed state of InferenceService

func (*InferenceServiceStatus) DeepCopy added in v0.3.0

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

func (*InferenceServiceStatus) DeepCopyInto added in v0.3.0

func (in *InferenceServiceStatus) DeepCopyInto(out *InferenceServiceStatus)

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

func (*InferenceServiceStatus) GetCondition added in v0.3.0

GetCondition returns the condition by name.

func (*InferenceServiceStatus) InitializeConditions added in v0.3.0

func (ss *InferenceServiceStatus) InitializeConditions()

func (*InferenceServiceStatus) IsReady added in v0.3.0

func (ss *InferenceServiceStatus) IsReady() bool

IsReady returns if the service is ready to serve the requested configuration.

func (*InferenceServiceStatus) PropagateCanaryStatus added in v0.3.0

func (ss *InferenceServiceStatus) PropagateCanaryStatus(component constants.InferenceServiceComponent, canaryStatus *knservingv1.ServiceStatus)

PropagateCanaryStatus propagates the status for the canary spec

func (*InferenceServiceStatus) PropagateDefaultStatus added in v0.3.0

func (ss *InferenceServiceStatus) PropagateDefaultStatus(component constants.InferenceServiceComponent, defaultStatus *knservingv1.ServiceStatus)

PropagateDefaultStatus propagates the status for the default spec

func (*InferenceServiceStatus) PropagateRouteStatus added in v0.3.0

func (ss *InferenceServiceStatus) PropagateRouteStatus(vs *VirtualServiceStatus)

PropagateRouteStatus propagates route's status to the service's status.

type InferenceServicesConfig added in v0.3.0

type InferenceServicesConfig struct {
	Transformers *TransformersConfig `json:"transformers"`
	Predictors   *PredictorsConfig   `json:"predictors"`
	Explainers   *ExplainersConfig   `json:"explainers"`
}

+k8s:openapi-gen=false

func GetInferenceServicesConfig added in v0.3.0

func GetInferenceServicesConfig(client client.Client) (*InferenceServicesConfig, error)

func NewInferenceServicesConfig added in v0.3.0

func NewInferenceServicesConfig(configMap *v1.ConfigMap) (*InferenceServicesConfig, error)

func (*InferenceServicesConfig) DeepCopy added in v0.3.0

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

func (*InferenceServicesConfig) DeepCopyInto added in v0.3.0

func (in *InferenceServicesConfig) DeepCopyInto(out *InferenceServicesConfig)

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

type Logger added in v0.3.0

type Logger struct {
	// URL to send request logging CloudEvents
	// +optional
	Url *string `json:"url,omitempty"`
	// What payloads to log
	Mode LoggerMode `json:"mode,omitempty"`
}

Logger provides optional payload logging for all endpoints +experimental

func (*Logger) DeepCopy added in v0.3.0

func (in *Logger) DeepCopy() *Logger

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

func (*Logger) DeepCopyInto added in v0.3.0

func (in *Logger) DeepCopyInto(out *Logger)

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

type LoggerMode added in v0.3.0

type LoggerMode string
const (
	LogAll      LoggerMode = "all"
	LogRequest  LoggerMode = "request"
	LogResponse LoggerMode = "response"
)

type ONNXSpec

type ONNXSpec struct {
	// The location of the trained model
	StorageURI string `json:"storageUri"`
	// Allowed runtime versions are specified in the inferenceservice config map
	RuntimeVersion string `json:"runtimeVersion,omitempty"`
	// Defaults to requests and limits of 1CPU, 2Gb MEM.
	Resources v1.ResourceRequirements `json:"resources,omitempty"`
}

ONNXSpec defines arguments for configuring ONNX model serving.

func (*ONNXSpec) ApplyDefaults

func (s *ONNXSpec) ApplyDefaults(config *InferenceServicesConfig)

func (*ONNXSpec) DeepCopy

func (in *ONNXSpec) DeepCopy() *ONNXSpec

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

func (*ONNXSpec) DeepCopyInto

func (in *ONNXSpec) DeepCopyInto(out *ONNXSpec)

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

func (*ONNXSpec) GetContainer added in v0.3.0

func (s *ONNXSpec) GetContainer(modelName string, parallelism int, config *InferenceServicesConfig) *v1.Container

func (*ONNXSpec) GetResourceRequirements added in v0.3.0

func (s *ONNXSpec) GetResourceRequirements() *v1.ResourceRequirements

func (*ONNXSpec) GetStorageUri

func (s *ONNXSpec) GetStorageUri() string

func (*ONNXSpec) Validate

func (s *ONNXSpec) Validate(config *InferenceServicesConfig) error

type Predictor added in v0.3.0

type Predictor interface {
	GetResourceRequirements() *v1.ResourceRequirements
	GetStorageUri() string
	GetContainer(modelName string, parallelism int, config *InferenceServicesConfig) *v1.Container
	ApplyDefaults(config *InferenceServicesConfig)
	Validate(config *InferenceServicesConfig) error
}

type PredictorConfig added in v0.3.0

type PredictorConfig struct {
	ContainerImage string `json:"image"`

	DefaultImageVersion    string   `json:"defaultImageVersion"`
	DefaultGpuImageVersion string   `json:"defaultGpuImageVersion"`
	AllowedImageVersions   []string `json:"allowedImageVersions"`
}

+k8s:openapi-gen=false

func (*PredictorConfig) DeepCopy added in v0.3.0

func (in *PredictorConfig) DeepCopy() *PredictorConfig

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

func (*PredictorConfig) DeepCopyInto added in v0.3.0

func (in *PredictorConfig) DeepCopyInto(out *PredictorConfig)

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

type PredictorSpec

type PredictorSpec struct {
	// Spec for a custom predictor
	Custom *CustomSpec `json:"custom,omitempty"`
	// Spec for Tensorflow Serving (https://github.com/tensorflow/serving)
	Tensorflow *TensorflowSpec `json:"tensorflow,omitempty"`
	// Spec for TensorRT Inference Server (https://github.com/NVIDIA/tensorrt-inference-server)
	TensorRT *TensorRTSpec `json:"tensorrt,omitempty"`
	// Spec for XGBoost predictor
	XGBoost *XGBoostSpec `json:"xgboost,omitempty"`
	// Spec for SKLearn predictor
	SKLearn *SKLearnSpec `json:"sklearn,omitempty"`
	// Spec for ONNX runtime (https://github.com/microsoft/onnxruntime)
	ONNX *ONNXSpec `json:"onnx,omitempty"`
	// Spec for PyTorch predictor
	PyTorch *PyTorchSpec `json:"pytorch,omitempty"`

	DeploymentSpec `json:",inline"`
}

PredictorSpec defines the configuration for a predictor, The following fields follow a "1-of" semantic. Users must specify exactly one spec.

func (*PredictorSpec) ApplyDefaults

func (p *PredictorSpec) ApplyDefaults(config *InferenceServicesConfig)

func (*PredictorSpec) DeepCopy

func (in *PredictorSpec) DeepCopy() *PredictorSpec

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

func (*PredictorSpec) DeepCopyInto

func (in *PredictorSpec) DeepCopyInto(out *PredictorSpec)

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

func (*PredictorSpec) GetContainer added in v0.3.0

func (p *PredictorSpec) GetContainer(modelName string, parallelism int, config *InferenceServicesConfig) *v1.Container

func (*PredictorSpec) GetStorageUri

func (p *PredictorSpec) GetStorageUri() string

Returns a URI to the model. This URI is passed to the storage-initializer via the StorageInitializerSourceUriInternalAnnotationKey

func (*PredictorSpec) Validate

func (p *PredictorSpec) Validate(config *InferenceServicesConfig) error

type PredictorsConfig added in v0.3.0

type PredictorsConfig struct {
	Tensorflow PredictorConfig `json:"tensorflow,omitempty"`
	TensorRT   PredictorConfig `json:"tensorrt,omitempty"`
	Xgboost    PredictorConfig `json:"xgboost,omitempty"`
	SKlearn    PredictorConfig `json:"sklearn,omitempty"`
	PyTorch    PredictorConfig `json:"pytorch,omitempty"`
	ONNX       PredictorConfig `json:"onnx,omitempty"`
}

+k8s:openapi-gen=false

func (*PredictorsConfig) DeepCopy added in v0.3.0

func (in *PredictorsConfig) DeepCopy() *PredictorsConfig

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

func (*PredictorsConfig) DeepCopyInto added in v0.3.0

func (in *PredictorsConfig) DeepCopyInto(out *PredictorsConfig)

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

type PyTorchSpec

type PyTorchSpec struct {
	// The location of the trained model
	StorageURI string `json:"storageUri"`
	// Defaults PyTorch model class name to 'PyTorchModel'
	ModelClassName string `json:"modelClassName,omitempty"`
	// Allowed runtime versions are specified in the inferenceservice config map
	RuntimeVersion string `json:"runtimeVersion,omitempty"`
	// Defaults to requests and limits of 1CPU, 2Gb MEM.
	Resources v1.ResourceRequirements `json:"resources,omitempty"`
}

PyTorchSpec defines arguments for configuring PyTorch model serving.

func (*PyTorchSpec) ApplyDefaults

func (p *PyTorchSpec) ApplyDefaults(config *InferenceServicesConfig)

func (*PyTorchSpec) DeepCopy

func (in *PyTorchSpec) DeepCopy() *PyTorchSpec

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

func (*PyTorchSpec) DeepCopyInto

func (in *PyTorchSpec) DeepCopyInto(out *PyTorchSpec)

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

func (*PyTorchSpec) GetContainer added in v0.3.0

func (p *PyTorchSpec) GetContainer(modelName string, parallelism int, config *InferenceServicesConfig) *v1.Container

func (*PyTorchSpec) GetResourceRequirements added in v0.3.0

func (p *PyTorchSpec) GetResourceRequirements() *v1.ResourceRequirements

func (*PyTorchSpec) GetStorageUri

func (p *PyTorchSpec) GetStorageUri() string

func (*PyTorchSpec) Validate

func (p *PyTorchSpec) Validate(config *InferenceServicesConfig) error

type SKLearnSpec

type SKLearnSpec struct {
	// The location of the trained model
	StorageURI string `json:"storageUri"`
	// Allowed runtime versions are specified in the inferenceservice config map
	RuntimeVersion string `json:"runtimeVersion,omitempty"`
	// Defaults to requests and limits of 1CPU, 2Gb MEM.
	Resources v1.ResourceRequirements `json:"resources,omitempty"`
}

SKLearnSpec defines arguments for configuring SKLearn model serving.

func (*SKLearnSpec) ApplyDefaults

func (s *SKLearnSpec) ApplyDefaults(config *InferenceServicesConfig)

func (*SKLearnSpec) DeepCopy

func (in *SKLearnSpec) DeepCopy() *SKLearnSpec

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

func (*SKLearnSpec) DeepCopyInto

func (in *SKLearnSpec) DeepCopyInto(out *SKLearnSpec)

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

func (*SKLearnSpec) GetContainer added in v0.3.0

func (s *SKLearnSpec) GetContainer(modelName string, parallelism int, config *InferenceServicesConfig) *v1.Container

func (*SKLearnSpec) GetResourceRequirements added in v0.3.0

func (s *SKLearnSpec) GetResourceRequirements() *v1.ResourceRequirements

func (*SKLearnSpec) GetStorageUri

func (s *SKLearnSpec) GetStorageUri() string

func (*SKLearnSpec) Validate

func (s *SKLearnSpec) Validate(config *InferenceServicesConfig) error

type StatusConfigurationSpec

type StatusConfigurationSpec struct {
	// Latest revision name that is in ready state
	Name string `json:"name,omitempty"`
	// Host name of the service
	Hostname string `json:"host,omitempty"`
	Replicas int    `json:"replicas,omitempty"`
}

StatusConfigurationSpec describes the state of the configuration receiving traffic.

func (*StatusConfigurationSpec) DeepCopy

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

func (*StatusConfigurationSpec) DeepCopyInto

func (in *StatusConfigurationSpec) DeepCopyInto(out *StatusConfigurationSpec)

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

type TensorRTSpec

type TensorRTSpec struct {
	// The location of the trained model
	StorageURI string `json:"storageUri"`
	// Allowed runtime versions are specified in the inferenceservice config map
	RuntimeVersion string `json:"runtimeVersion,omitempty"`
	// Defaults to requests and limits of 1CPU, 2Gb MEM.
	Resources v1.ResourceRequirements `json:"resources,omitempty"`
}

TensorRTSpec defines arguments for configuring TensorRT model serving.

func (*TensorRTSpec) ApplyDefaults

func (t *TensorRTSpec) ApplyDefaults(config *InferenceServicesConfig)

func (*TensorRTSpec) DeepCopy

func (in *TensorRTSpec) DeepCopy() *TensorRTSpec

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

func (*TensorRTSpec) DeepCopyInto

func (in *TensorRTSpec) DeepCopyInto(out *TensorRTSpec)

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

func (*TensorRTSpec) GetContainer added in v0.3.0

func (t *TensorRTSpec) GetContainer(modelName string, parallelism int, config *InferenceServicesConfig) *v1.Container

func (*TensorRTSpec) GetResourceRequirements added in v0.3.0

func (t *TensorRTSpec) GetResourceRequirements() *v1.ResourceRequirements

func (*TensorRTSpec) GetStorageUri

func (t *TensorRTSpec) GetStorageUri() string

func (*TensorRTSpec) Validate

func (t *TensorRTSpec) Validate(config *InferenceServicesConfig) error

type TensorflowSpec

type TensorflowSpec struct {
	// The location of the trained model
	StorageURI string `json:"storageUri"`
	// Allowed runtime versions are specified in the inferenceservice config map.
	RuntimeVersion string `json:"runtimeVersion,omitempty"`
	// Defaults to requests and limits of 1CPU, 2Gb MEM.
	Resources v1.ResourceRequirements `json:"resources,omitempty"`
}

TensorflowSpec defines arguments for configuring Tensorflow model serving.

func (*TensorflowSpec) ApplyDefaults

func (t *TensorflowSpec) ApplyDefaults(config *InferenceServicesConfig)

func (*TensorflowSpec) DeepCopy

func (in *TensorflowSpec) DeepCopy() *TensorflowSpec

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

func (*TensorflowSpec) DeepCopyInto

func (in *TensorflowSpec) DeepCopyInto(out *TensorflowSpec)

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

func (*TensorflowSpec) GetContainer added in v0.3.0

func (t *TensorflowSpec) GetContainer(modelName string, parallelism int, config *InferenceServicesConfig) *v1.Container

func (*TensorflowSpec) GetResourceRequirements added in v0.3.0

func (t *TensorflowSpec) GetResourceRequirements() *v1.ResourceRequirements

func (*TensorflowSpec) GetStorageUri

func (t *TensorflowSpec) GetStorageUri() string

func (*TensorflowSpec) Validate

func (t *TensorflowSpec) Validate(config *InferenceServicesConfig) error

type Transformer added in v0.3.0

type Transformer interface {
	GetContainerSpec() *v1.Container
	GetStorageUri() string
	ApplyDefaults(config *InferenceServicesConfig)
	Validate(config *InferenceServicesConfig) error
}

Transformer interface is implemented by all Transformers

type TransformerConfig added in v0.3.0

type TransformerConfig struct {
	ContainerImage string `json:"image"`

	DefaultImageVersion  string   `json:"defaultImageVersion"`
	AllowedImageVersions []string `json:"allowedImageVersions"`
}

+k8s:openapi-gen=false

func (*TransformerConfig) DeepCopy added in v0.3.0

func (in *TransformerConfig) DeepCopy() *TransformerConfig

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

func (*TransformerConfig) DeepCopyInto added in v0.3.0

func (in *TransformerConfig) DeepCopyInto(out *TransformerConfig)

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

type TransformerSpec

type TransformerSpec struct {
	// Spec for a custom transformer
	Custom *CustomSpec `json:"custom,omitempty"`

	DeploymentSpec `json:",inline"`
}

TransformerSpec defines transformer service for pre/post processing

func (*TransformerSpec) ApplyDefaults added in v0.3.0

func (t *TransformerSpec) ApplyDefaults(config *InferenceServicesConfig)

ApplyDefaults to the TransformerSpec

func (*TransformerSpec) DeepCopy

func (in *TransformerSpec) DeepCopy() *TransformerSpec

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

func (*TransformerSpec) DeepCopyInto

func (in *TransformerSpec) DeepCopyInto(out *TransformerSpec)

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

func (*TransformerSpec) GetContainerSpec added in v0.3.0

func (t *TransformerSpec) GetContainerSpec(metadata metav1.ObjectMeta, isCanary bool) *v1.Container

GetContainerSpec for the transformer

func (*TransformerSpec) GetStorageUri added in v0.3.0

func (t *TransformerSpec) GetStorageUri() string

Returns a URI to the model. This URI is passed to the storage-initializer via the StorageInitializerSourceUriInternalAnnotationKey

func (*TransformerSpec) Validate added in v0.3.0

func (t *TransformerSpec) Validate(config *InferenceServicesConfig) error

Validate the TransformerSpec

type TransformersConfig added in v0.3.0

type TransformersConfig struct {
	Feast TransformerConfig `json:"feast,omitempty"`
}

+k8s:openapi-gen=false

func (*TransformersConfig) DeepCopy added in v0.3.0

func (in *TransformersConfig) DeepCopy() *TransformersConfig

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

func (*TransformersConfig) DeepCopyInto added in v0.3.0

func (in *TransformersConfig) DeepCopyInto(out *TransformersConfig)

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

type VirtualServiceStatus added in v0.3.0

type VirtualServiceStatus struct {
	URL           string
	CanaryWeight  int
	DefaultWeight int
	// Address holds the information needed for a Route to be the target of an event.
	// +optional
	Address *duckv1beta1.Addressable `json:"address,omitempty"`

	duckv1beta1.Status
}

+k8s:openapi-gen=false

VirtualServiceStatus captures the status of the virtual service

func (*VirtualServiceStatus) DeepCopy added in v0.3.0

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

func (*VirtualServiceStatus) DeepCopyInto added in v0.3.0

func (in *VirtualServiceStatus) DeepCopyInto(out *VirtualServiceStatus)

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

type XGBoostSpec

type XGBoostSpec struct {
	// The location of the trained model
	StorageURI string `json:"storageUri"`
	// Number of thread to be used by XGBoost
	NThread int `json:"nthread,omitempty"`
	// Allowed runtime versions are specified in the inferenceservice config map
	RuntimeVersion string `json:"runtimeVersion,omitempty"`
	// Defaults to requests and limits of 1CPU, 2Gb MEM.
	Resources v1.ResourceRequirements `json:"resources,omitempty"`
}

XGBoostSpec defines arguments for configuring XGBoost model serving.

func (*XGBoostSpec) ApplyDefaults

func (x *XGBoostSpec) ApplyDefaults(config *InferenceServicesConfig)

func (*XGBoostSpec) DeepCopy

func (in *XGBoostSpec) DeepCopy() *XGBoostSpec

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

func (*XGBoostSpec) DeepCopyInto

func (in *XGBoostSpec) DeepCopyInto(out *XGBoostSpec)

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

func (*XGBoostSpec) GetContainer added in v0.3.0

func (x *XGBoostSpec) GetContainer(modelName string, parallelism int, config *InferenceServicesConfig) *v1.Container

func (*XGBoostSpec) GetResourceRequirements added in v0.3.0

func (x *XGBoostSpec) GetResourceRequirements() *v1.ResourceRequirements

func (*XGBoostSpec) GetStorageUri

func (x *XGBoostSpec) GetStorageUri() string

func (*XGBoostSpec) Validate

func (x *XGBoostSpec) Validate(config *InferenceServicesConfig) error

Jump to

Keyboard shortcuts

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