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
- Variables
- func Resource(resource string) schema.GroupResource
- type Condition
- type ConditionType
- type CustomSpec
- type FrameworkHandler
- type KFService
- type KFServiceList
- type KFServiceSpec
- type KFServiceStatus
- func (in *KFServiceStatus) DeepCopy() *KFServiceStatus
- func (in *KFServiceStatus) DeepCopyInto(out *KFServiceStatus)
- func (ss *KFServiceStatus) PropagateCanaryConfigurationStatus(ccs *knservingv1alpha1.ConfigurationStatus)
- func (ss *KFServiceStatus) PropagateDefaultConfigurationStatus(dcs *knservingv1alpha1.ConfigurationStatus)
- func (ss *KFServiceStatus) PropagateRouteStatus(rs *knservingv1alpha1.RouteStatus)
- type ModelSpec
- type SKLearnSpec
- type StatusConditionsSpec
- type StatusConfigurationSpec
- type TensorflowSpec
- type URISpec
- type XGBoostSpec
Constants ¶
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" )
const ( SKLearnServingGRPCPort = "9000" SKLearnServingRestPort = "8080" SKLearnServingImageName = "animeshsingh/sklearnserver" DefaultSKLearnServingVersion = "latest" )
const ( TensorflowEntrypointCommand = "/usr/bin/tensorflow_model_server" TensorflowServingGRPCPort = "9000" TensorflowServingRestPort = "8080" TensorflowServingImageName = "tensorflow/serving" DefaultTensorflowServingVersion = "1.13.0" )
const ( XGBoostServingGRPCPort = "9000" XGBoostServingRestPort = "8080" XGBoostServingImageName = "animeshsingh/xgbserver" DefaultXGBoostServingVersion = "latest" )
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
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 ¶
var ( DefaultMemoryRequests = resource.MustParse("2Gi") DefaultCPURequests = resource.MustParse("1") )
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 )
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition.
func (*Condition) DeepCopyInto ¶
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 ¶
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 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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KFService.
func (*KFService) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*KFService) DeepCopyObject ¶
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 ¶
ValidateCreate implements https://godoc.org/sigs.k8s.io/controller-runtime/pkg/webhook/admission#Validator
func (*KFService) ValidateUpdate ¶
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 (*ModelSpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ModelSpec.
func (*ModelSpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
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 ¶
func (in *StatusConditionsSpec) DeepCopy() *StatusConditionsSpec
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 ¶
func (in *StatusConfigurationSpec) DeepCopy() *StatusConfigurationSpec
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new URISpec.
func (*URISpec) DeepCopyInto ¶
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