controllers

package
v1.0.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ANNOTATION_REST_TIMEOUT            = "seldon.io/rest-timeout"
	ANNOTATION_GRPC_TIMEOUT            = "seldon.io/grpc-timeout"
	ANNOTATION_AMBASSADOR_CUSTOM       = "seldon.io/ambassador-config"
	ANNOTATION_AMBASSADOR_SERVICE      = "seldon.io/ambassador-service-name"
	ANNOTATION_AMBASSADOR_HEADER       = "seldon.io/ambassador-header"
	ANNOTATION_AMBASSADOR_REGEX_HEADER = "seldon.io/ambassador-regex-header"
	ANNOTATION_AMBASSADOR_ID           = "seldon.io/ambassador-id"
	ANNOTATION_AMBASSADOR_RETRIES      = "seldon.io/ambassador-retries"

	YAML_SEP = "---\n"

	AMBASSADOR_IDLE_TIMEOUT    = 300000
	AMBASSADOR_DEFAULT_RETRIES = "0"
)
View Source
const (
	ENV_ISTIO_ENABLED                = "ISTIO_ENABLED"
	ENV_ISTIO_GATEWAY                = "ISTIO_GATEWAY"
	ENV_ISTIO_TLS_MODE               = "ISTIO_TLS_MODE"
	ANNOTATION_ISTIO_GATEWAY         = "seldon.io/istio-gateway"
	ANNOTATION_ISTIO_RETRIES         = "seldon.io/istio-retries"
	ANNOTATION_ISTIO_RETRIES_TIMEOUT = "seldon.io/istio-retries-timeout"
)
View Source
const (
	DefaultModelLocalMountPath         = "/mnt/models"
	StorageInitializerConfigMapKeyName = "storageInitializer"
	ModelInitializerContainerImage     = "gcr.io/kfserving/model-initializer"
	ModelInitializerContainerVersion   = "latest"
	PvcURIPrefix                       = "pvc://"
	PvcSourceMountName                 = "kfserving-pvc-source"
	PvcSourceMountPath                 = "/mnt/pvc"
	ModelInitializerVolumeSuffix       = "provision-location"
	ModelInitializerContainerSuffix    = "model-initializer"
)

TODO: change image to seldon? is at least configurable by configmap now (with fixed version there) TODO: check PVC

View Source
const (
	ENV_DEFAULT_ENGINE_SERVER_PORT      = "ENGINE_SERVER_PORT"
	ENV_DEFAULT_ENGINE_SERVER_GRPC_PORT = "ENGINE_SERVER_GRPC_PORT"
	ENV_CONTROLLER_ID                   = "CONTROLLER_ID"

	DEFAULT_ENGINE_CONTAINER_PORT = 8000
	DEFAULT_ENGINE_GRPC_PORT      = 5001

	AMBASSADOR_ANNOTATION = "getambassador.io/config"
	LABEL_CONTROLLER_ID   = "seldon.io/controller-id"
)
View Source
const (
	ENV_DEFAULT_EXECUTOR_SERVER_PORT      = "EXECUTOR_SERVER_PORT"
	ENV_DEFAULT_EXECUTOR_SERVER_GRPC_PORT = "EXECUTOR_SERVER_GRPC_PORT"
	ENV_EXECUTOR_PROMETHEUS_PATH          = "EXECUTOR_PROMETHEUS_PATH"
	ENV_ENGINE_PROMETHEUS_PATH            = "ENGINE_PROMETHEUS_PATH"

	DEFAULT_EXECUTOR_CONTAINER_PORT = 8000
	DEFAULT_EXECUTOR_GRPC_PORT      = 5001
)
View Source
const (
	ENV_PREDICTIVE_UNIT_DEFAULT_ENV_SECRET_REF_NAME = "PREDICTIVE_UNIT_DEFAULT_ENV_SECRET_REF_NAME"
)

Variables

View Source
var (
	ControllerNamespace     = GetEnv("POD_NAMESPACE", "seldon-system")
	ControllerConfigMapName = "seldon-config"
)
View Source
var (
	EngineContainerName = "seldon-container-engine"
)
View Source
var (
	PredictiveUnitDefaultEnvSecretRefName = GetEnv(ENV_PREDICTIVE_UNIT_DEFAULT_ENV_SECRET_REF_NAME, "")
)

Functions

func GetEnv

func GetEnv(key, fallback string) string

Get an environment variable given by key or return the fallback.

func InjectModelInitializer

func InjectModelInitializer(deployment *appsv1.Deployment, containerName string, srcURI string, serviceAccountName string, envSecretRefName string, Client client.Client) (deploy *appsv1.Deployment, err error)

InjectModelInitializer injects an init container to provision model data

func SetUriParamsForTFServingProxyContainer

func SetUriParamsForTFServingProxyContainer(pu *machinelearningv1.PredictiveUnit, c *v1.Container)

Types

type AmbassadorConfig

type AmbassadorConfig struct {
	ApiVersion    string                 `yaml:"apiVersion"`
	Kind          string                 `yaml:"kind"`
	Name          string                 `yaml:"name"`
	Grpc          *bool                  `yaml:"grpc,omitempty"`
	Prefix        string                 `yaml:"prefix"`
	PrefixRegex   *bool                  `yaml:"prefix_regex,omitempty"`
	Rewrite       string                 `yaml:"rewrite"`
	Service       string                 `yaml:"service"`
	TimeoutMs     int                    `yaml:"timeout_ms"`
	IdleTimeoutMs *int                   `yaml:"idle_timeout_ms,omitempty"`
	Headers       map[string]string      `yaml:"headers,omitempty"`
	RegexHeaders  map[string]string      `yaml:"regex_headers,omitempty"`
	Weight        int32                  `yaml:"weight,omitempty"`
	Shadow        *bool                  `yaml:"shadow,omitempty"`
	RetryPolicy   *AmbassadorRetryPolicy `yaml:"retry_policy,omitempty"`
	InstanceId    string                 `yaml:"ambassador_id,omitempty"`
}

Struct for Ambassador configuration

type AmbassadorRetryPolicy

type AmbassadorRetryPolicy struct {
	RetryOn    string `yaml:"retry_on,omitempty"`
	NumRetries int    `yaml:"num_retries,omitempty"`
}

type SeldonDeploymentReconciler

type SeldonDeploymentReconciler struct {
	client.Client
	Log       logr.Logger
	Scheme    *runtime.Scheme
	Namespace string
}

SeldonDeploymentReconciler reconciles a SeldonDeployment object

func (*SeldonDeploymentReconciler) Reconcile

func (r *SeldonDeploymentReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error)

func (*SeldonDeploymentReconciler) SetupWithManager

func (r *SeldonDeploymentReconciler) SetupWithManager(mgr ctrl.Manager) error

type StorageInitializerConfig

type StorageInitializerConfig struct {
	Image         string `json:"image"`
	CpuRequest    string `json:"cpuRequest"`
	CpuLimit      string `json:"cpuLimit"`
	MemoryRequest string `json:"memoryRequest"`
	MemoryLimit   string `json:"memoryLimit"`
}

Directories

Path Synopsis
resources

Jump to

Keyboard shortcuts

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