v1alpha1

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package v1alpha1 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

Package v1alpha1 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 (
	// ExactlyOneModelSpecViolatedError is a known error message
	ExactlyOneModelSpecViolatedError = "Exactly one of [Custom, Tensorflow, SKLearn, XGBoost] must be specified in ModelSpec"
	// AtLeastOneModelSpecViolatedError is a known error message
	AtLeastOneModelSpecViolatedError = "At least one of [Custom, Tensorflow, SKLearn, XGBoost] must be specified in ModelSpec"
)
View Source
const (
	SKLearnServingGRPCPort  = "9000"
	SKLearnServingRestPort  = "8080"
	SKLearnServingImageName = "animeshsingh/sklearnserver"

	DefaultSKLearnServingVersion = "latest"
)
View Source
const (
	TensorflowEntrypointCommand = "/usr/bin/tensorflow_model_server"
	TensorflowServingGRPCPort   = "9000"
	TensorflowServingRestPort   = "8080"
	TensorflowServingImageName  = "tensorflow/serving"

	DefaultTensorflowServingVersion = "1.13.0"
)
View Source
const (
	XGBoostServingGRPCPort  = "9000"
	XGBoostServingRestPort  = "8080"
	XGBoostServingImageName = "animeshsingh/xgbserver"

	DefaultXGBoostServingVersion = "latest"
)
View Source
const (
	// ServiceConditionRoutesReady is set when the service's underlying
	// routes have reported readiness.
	ServiceConditionRoutesReady duckv1alpha1.ConditionType = "RoutesReady"
	// ServiceConditionDefaultConfigurationsReady is set when the service's underlying
	// default configuration have reported readiness.
	ServiceConditionDefaultConfigurationsReady duckv1alpha1.ConditionType = "DefaultConfigurationReady"
	// ServiceConditionCanaryConfigurationsReady is set when the service's underlying
	// canary configuration have reported readiness.
	ServiceConditionCanaryConfigurationsReady duckv1alpha1.ConditionType = "CanaryConfigurationReady"
)

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."
	TrafficBoundsExceededError          = "TrafficPercent must be between [0, 100]."
	TrafficProvidedWithoutCanaryError   = "Canary must be specified when CanaryTrafficPercent > 0."
)

Known error messages

Variables

View Source
var (
	DefaultMemoryRequests = resource.MustParse("2Gi")
	DefaultCPURequests    = resource.MustParse("1")
)
View Source
var (
	// APIVersion is the current API version used to register these objects
	APIVersion = "v1alpha1"

	// 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 TFExampleKFService = &KFService{
	ObjectMeta: metav1.ObjectMeta{
		Name:      "foo",
		Namespace: "default",
	},
	Spec: KFServiceSpec{
		Default: ModelSpec{
			Tensorflow: &TensorflowSpec{ModelURI: "gs://testbucket/testmodel"},
		},
	},
}

TFExampleKFService provides an example to the reader and may also be used by tests

Functions

func Resource

func Resource(resource string) schema.GroupResource

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

Types

type Condition

type Condition struct {
	Type   ConditionType      `json:"type"`
	Status v1.ConditionStatus `json:"status"`

	// Last time the condition was probed.
	LastProbeTime metav1.Time `json:"lastProbeTime,omitempty" protobuf:"bytes,3,opt,name=lastProbeTime"`
	// Last time the condition transitioned from one status to another.
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,4,opt,name=lastTransitionTime"`
	// Unique, one-word, CamelCase reason for the condition's last transition.
	Reason string `json:"reason,omitempty"`
	// Human-readable message indicating details about last transition.
	Message string `json:"message,omitempty"`
}

Condition is a generic definition for Status Conditions of the resource.

func (*Condition) DeepCopy

func (in *Condition) DeepCopy() *Condition

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

func (*Condition) DeepCopyInto

func (in *Condition) DeepCopyInto(out *Condition)

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

type ConditionType

type ConditionType string

ConditionType is the of status conditions.

const (
	Ready              ConditionType = "Ready"
	RoutingReady       ConditionType = "RoutingReady"
	ResourcesAvailable ConditionType = "ResourcesAvailable"
	ContainerHealthy   ConditionType = "ContainerHealthy"
	RevisionReady      ConditionType = "RevisionReady"
)

These are valid conditions of a service.

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

func (*CustomSpec) CreateModelServingContainer

func (c *CustomSpec) CreateModelServingContainer(modelName string) *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) Validate

func (c *CustomSpec) Validate() error

type FrameworkHandler

type FrameworkHandler interface {
	CreateModelServingContainer(modelName string) *v1.Container
	ApplyDefaults()
	Validate() error
}

type KFService

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

	Spec   KFServiceSpec   `json:"spec,omitempty"`
	Status KFServiceStatus `json:"status,omitempty"`
}

KFService is the Schema for the services API +k8s:openapi-gen=true

func (*KFService) DeepCopy

func (in *KFService) DeepCopy() *KFService

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

func (*KFService) DeepCopyInto

func (in *KFService) DeepCopyInto(out *KFService)

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

func (*KFService) DeepCopyObject

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

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

func (*KFService) Default

func (kfsvc *KFService) Default()

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

func (*KFService) ValidateCreate

func (kfsvc *KFService) ValidateCreate() error

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

func (*KFService) ValidateUpdate

func (kfsvc *KFService) ValidateUpdate(old runtime.Object) error

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

type KFServiceList

type KFServiceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []KFService `json:"items"`
}

KFServiceList contains a list of Service

func (*KFServiceList) DeepCopy

func (in *KFServiceList) DeepCopy() *KFServiceList

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

func (*KFServiceList) DeepCopyInto

func (in *KFServiceList) DeepCopyInto(out *KFServiceList)

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

func (*KFServiceList) DeepCopyObject

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

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

type KFServiceSpec

type KFServiceSpec struct {
	Default ModelSpec `json:"default"`
	// Canary defines an alternate configuration to route a percentage of traffic.
	Canary               *ModelSpec `json:"canary,omitempty"`
	CanaryTrafficPercent int        `json:"canaryTrafficPercent,omitempty"`
}

KFServiceSpec defines the desired state of KFService

func (*KFServiceSpec) DeepCopy

func (in *KFServiceSpec) DeepCopy() *KFServiceSpec

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

func (*KFServiceSpec) DeepCopyInto

func (in *KFServiceSpec) DeepCopyInto(out *KFServiceSpec)

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

type KFServiceStatus

type KFServiceStatus struct {
	Conditions StatusConditionsSpec    `json:"conditions,omitempty"`
	URI        URISpec                 `json:"uri,omitempty"`
	Default    StatusConfigurationSpec `json:"default,omitempty"`
	Canary     StatusConfigurationSpec `json:"canary,omitempty"`
}

KFServiceStatus defines the observed state of KFService

func (*KFServiceStatus) DeepCopy

func (in *KFServiceStatus) DeepCopy() *KFServiceStatus

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

func (*KFServiceStatus) DeepCopyInto

func (in *KFServiceStatus) DeepCopyInto(out *KFServiceStatus)

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

func (*KFServiceStatus) PropagateCanaryConfigurationStatus

func (ss *KFServiceStatus) PropagateCanaryConfigurationStatus(ccs *knservingv1alpha1.ConfigurationStatus)

PropagateCanaryConfigurationStatus propagates the canary Configuration status and applies its values to the Service status.

func (*KFServiceStatus) PropagateDefaultConfigurationStatus

func (ss *KFServiceStatus) PropagateDefaultConfigurationStatus(dcs *knservingv1alpha1.ConfigurationStatus)

PropagateDefaultConfigurationStatus propagates the default Configuration status and applies its values to the Service status.

func (*KFServiceStatus) PropagateRouteStatus

func (ss *KFServiceStatus) PropagateRouteStatus(rs *knservingv1alpha1.RouteStatus)

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

type ModelSpec

type ModelSpec struct {
	// Service Account Name
	ServiceAccountName string `json:"serviceAccountName,omitempty"`
	// Minimum number of replicas, pods won't scale down to 0 in case of no traffic
	MinReplicas int `json:"minReplicas,omitempty"`
	// This is the up bound for autoscaler to scale to
	MaxReplicas int `json:"maxReplicas,omitempty"`
	// The following fields follow a "1-of" semantic. Users must specify exactly one spec.
	Custom     *CustomSpec     `json:"custom,omitempty"`
	Tensorflow *TensorflowSpec `json:"tensorflow,omitempty"`
	XGBoost    *XGBoostSpec    `json:"xgboost,omitempty"`
	SKLearn    *SKLearnSpec    `json:"sklearn,omitempty"`
}

ModelSpec defines the default configuration to route traffic.

func (*ModelSpec) ApplyDefaults

func (m *ModelSpec) ApplyDefaults()

func (*ModelSpec) CreateModelServingContainer

func (m *ModelSpec) CreateModelServingContainer(modelName string) *v1.Container

func (*ModelSpec) DeepCopy

func (in *ModelSpec) DeepCopy() *ModelSpec

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

func (*ModelSpec) DeepCopyInto

func (in *ModelSpec) DeepCopyInto(out *ModelSpec)

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

func (*ModelSpec) Validate

func (m *ModelSpec) Validate() error

type SKLearnSpec

type SKLearnSpec struct {
	ModelURI string `json:"modelUri"`
	// Defaults to latest SKLearn Version.
	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()

func (*SKLearnSpec) CreateModelServingContainer

func (s *SKLearnSpec) CreateModelServingContainer(modelName string) *v1.Container

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

func (s *SKLearnSpec) Validate() error

type StatusConditionsSpec

type StatusConditionsSpec struct {
	// Conditions the latest available observations of a resource's current state.
	// +optional
	// +patchMergeKey=type
	// +patchStrategy=merge
	Conditions []Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
}

StatusConditionsSpec displays the current conditions of the resource.

func (*StatusConditionsSpec) DeepCopy

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

func (*StatusConditionsSpec) DeepCopyInto

func (in *StatusConditionsSpec) DeepCopyInto(out *StatusConditionsSpec)

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

type StatusConfigurationSpec

type StatusConfigurationSpec struct {
	Name     string `json:"name,omitempty"`
	Replicas int    `json:"replicas,omitempty"`
	Traffic  int    `json:"traffic,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 TensorflowSpec

type TensorflowSpec struct {
	ModelURI string `json:"modelUri"`
	// Defaults to latest TF Version.
	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()

func (*TensorflowSpec) CreateModelServingContainer

func (t *TensorflowSpec) CreateModelServingContainer(modelName string) *v1.Container

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

func (t *TensorflowSpec) Validate() error

type URISpec

type URISpec struct {
	Internal string `json:"internal,omitempty"`
	External string `json:"external,omitempty"`
}

URISpec describes the available network endpoints for the service.

func (*URISpec) DeepCopy

func (in *URISpec) DeepCopy() *URISpec

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

func (*URISpec) DeepCopyInto

func (in *URISpec) DeepCopyInto(out *URISpec)

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

type XGBoostSpec

type XGBoostSpec struct {
	ModelURI string `json:"modelUri"`
	// Defaults to latest XGBoost Version.
	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()

func (*XGBoostSpec) CreateModelServingContainer

func (x *XGBoostSpec) CreateModelServingContainer(modelName string) *v1.Container

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

func (x *XGBoostSpec) Validate() error

Jump to

Keyboard shortcuts

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