v1beta1

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package v1beta1 provides types and methods for manipulating v1beta1 KFServing InferenceService objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureReadiness

func EnsureReadiness(t *Target) bool

EnsureReadiness ensures that the condition "Ready" has "Status" true in t.infService. It periodically fetches t.infService and checks this condition. Returns true if readiness is reached in 180 sec and false otherwise.

func GetConditions

func GetConditions(t *Target) ([]target.Condition, error)

GetConditions unmarshals conditions from status and returns a slice of conditions.

Types

type Target

type Target struct {
	// contains filtered or unexported fields
}

Target is an enhancement of KFServing v1beta1 InferenceService.

func TargetBuilder

func TargetBuilder() *Target

TargetBuilder returns an initial v1beta1 target struct pointer.

func (*Target) Error

func (t *Target) Error() error

Error returns the error accumulated by target until this point or nil if there is none.

func (*Target) Fetch

func (t *Target) Fetch(targetRef string) target.Target

Fetch fetches the v1beta1 InferenceService object from the Kubernetes cluster and populates the target struct with it. InferenceService may be unavailable at the start of this call. So, Fetch periodically attempts to fetch the InferenceService object for 180 sec. Upon success, it returns the fetched object; if it does not succeed in 180 secs, it returns an error.

func (*Target) GetVersionInfo

func (t *Target) GetVersionInfo() (*etc3.VersionInfo, error)

GetVersionInfo constructs the VersionInfo object based on the target and returns it.

func (*Target) InitializeTrafficSplit

func (t *Target) InitializeTrafficSplit() target.Target

InitializeTrafficSplit initializes traffic split for the target. The value of the field spec.predictor.canaryTrafficPercent is set to 1 (i.e., 1%). After this step, the handler waits for (<=) 180 sec to ensure InferenceService object is ready. If any of the above steps fail, the method returns after setting an error.

func (*Target) SetCanaryTrafficPercent

func (t *Target) SetCanaryTrafficPercent(p int64) target.Target

SetCanaryTrafficPercent sets spec.predictor.canaryTrafficPercent field to the given value. After this step, the handler waits for (<=) 180 sec to ensure InferenceService object is ready. If any of the above steps fail, the method returns after setting an error.

func (*Target) SetExperiment

func (t *Target) SetExperiment(exp *experiment.Experiment) target.Target

SetExperiment sets a pointer to an experiment object within the target.

func (*Target) SetK8sClient

func (t *Target) SetK8sClient(c client.Client) target.Target

SetK8sClient sets a k8s client within the target struct.

func (*Target) SetNewBaseline

func (t *Target) SetNewBaseline() target.Target

SetNewBaseline sets a new baseline (i.e., 'default' version) within the target

func (*Target) SetVersionInfoInExperiment

func (t *Target) SetVersionInfoInExperiment() target.Target

SetVersionInfoInExperiment sets version info in the experiment associated with this target.

Jump to

Keyboard shortcuts

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