constants

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AgentContainerName    = "agent"
	AgentConfigMapKeyName = "agent"
	AgentEnableFlag       = "--enable-puller"
	AgentConfigDirArgName = "--config-dir"
	AgentModelDirArgName  = "--model-dir"
)

Model agent Constants

View Source
const (
	CustomSpecStorageUriEnvVarKey       = "STORAGE_URI"
	CustomSpecProtocolEnvVarKey         = "PROTOCOL"
	CustomSpecMultiModelServerEnvVarKey = "MULTI_MODEL_SERVER"
)

InferenceService Environment Variables

View Source
const (
	KnativeLocalGateway   = "knative-serving/knative-local-gateway"
	KnativeIngressGateway = "knative-serving/knative-ingress-gateway"
	VisibilityLabel       = "serving.knative.dev/visibility"
)

Knative constants

View Source
const (
	InferenceServiceDefaultHttpPort    = "8080"
	InferenceServiceDefaultAgentPort   = "9081"
	InferenceServiceDefaultBatcherPort = "9082"
	CommonDefaultHttpPort              = 80
)

InferenceService Endpoint Ports

View Source
const (
	KServiceComponentLabel = "component"
	KServiceModelLabel     = "model"
	KServiceEndpointLabel  = "endpoint"
)

Labels to put on kservice

View Source
const (
	ParentInferenceServiceLabel = "inferenceservice"
	InferenceServiceLabel       = "serving.kubeflow.org/inferenceservice"
)

Labels for TrainedModel

View Source
const (
	InferenceServiceDefault = "default"
	InferenceServiceCanary  = "canary"
)

InferenceService default/canary constants

View Source
const (
	ArgumentModelName      = "--model_name"
	ArgumentModelDir       = "--model_dir"
	ArgumentModelClassName = "--model_class_name"
	ArgumentPredictorHost  = "--predictor_host"
	ArgumentHttpPort       = "--http_port"
	ArgumentWorkers        = "--workers"
)

InferenceService model server args

View Source
const (
	ModelConfigVolumeName = "model-config"
	ModelDirVolumeName    = "model-dir"
	ModelConfigDir        = "/mnt/configs"
	ModelDir              = DefaultModelLocalMountPath
)

Multi-model InferenceService

View Source
const (
	MLServerHTTPPortEnv            = "MLSERVER_HTTP_PORT"
	MLServerGRPCPortEnv            = "MLSERVER_GRPC_PORT"
	MLServerLoadModelsStartupEnv   = "MLSERVER_LOAD_MODELS_AT_STARTUP"
	MLServerModelsDirEnv           = "MODELS_DIR"
	MLServerModelImplementationEnv = "MLSERVER_MODEL_IMPLEMENTATION"
	MLServerModelNameEnv           = "MLSERVER_MODEL_NAME"
	MLServerModelURIEnv            = "MLSERVER_MODEL_URI"

	MLServerSKLearnImplementation = "mlserver_sklearn.SKLearnModel"
	MLServerXGBoostImplementation = "mlserver_xgboost.XGBoostModel"
)
View Source
const DefaultModelLocalMountPath = "/mnt/models"

DefaultModelLocalMountPath is where models will be mounted by the storage-initializer

View Source
const (
	InferenceServiceContainerName = "kfserving-container"
)

InferenceService container name

View Source
const (
	NvidiaGPUResourceType = "nvidia.com/gpu"
)

GPU Constants

Variables

View Source
var (
	KFServingName           = "kfserving"
	KFServingAPIGroupName   = "serving.kubeflow.org"
	KFServingNamespace      = getEnvOrDefault("POD_NAMESPACE", "kfserving-system")
	KFServingDefaultVersion = "v0.5.0"
)

KFServing Constants

View Source
var (
	InferenceServiceName          = "inferenceservice"
	InferenceServiceAPIName       = "inferenceservices"
	InferenceServicePodLabelKey   = KFServingAPIGroupName + "/" + InferenceServiceName
	InferenceServiceConfigMapName = "inferenceservice-config"
)

InferenceService Constants

View Source
var (
	InferenceServiceGKEAcceleratorAnnotationKey = KFServingAPIGroupName + "/gke-accelerator"
	RawDeploymentAnnotationKey                  = KFServingAPIGroupName + "/raw"
	EnableRoutingTagAnnotationKey               = KFServingAPIGroupName + "/enable-tag-routing"
)

InferenceService Annotations

View Source
var (
	InferenceServiceInternalAnnotationsPrefix        = "internal." + KFServingAPIGroupName
	StorageInitializerSourceUriInternalAnnotationKey = InferenceServiceInternalAnnotationsPrefix + "/storage-initializer-sourceuri"
	LoggerInternalAnnotationKey                      = InferenceServiceInternalAnnotationsPrefix + "/logger"
	LoggerSinkUrlInternalAnnotationKey               = InferenceServiceInternalAnnotationsPrefix + "/logger-sink-url"
	LoggerModeInternalAnnotationKey                  = InferenceServiceInternalAnnotationsPrefix + "/logger-mode"
	BatcherInternalAnnotationKey                     = InferenceServiceInternalAnnotationsPrefix + "/batcher"
	BatcherMaxBatchSizeInternalAnnotationKey         = InferenceServiceInternalAnnotationsPrefix + "/batcher-max-batchsize"
	BatcherMaxLatencyInternalAnnotationKey           = InferenceServiceInternalAnnotationsPrefix + "/batcher-max-latency"
	BatcherTimeoutInternalAnnotationKey              = InferenceServiceInternalAnnotationsPrefix + "/batcher-timeout"
	AgentShouldInjectAnnotationKey                   = InferenceServiceInternalAnnotationsPrefix + "/agent"
	AgentModelConfigVolumeNameAnnotationKey          = InferenceServiceInternalAnnotationsPrefix + "/configVolumeName"
	AgentModelConfigMountPathAnnotationKey           = InferenceServiceInternalAnnotationsPrefix + "/configMountPath"
	AgentModelDirAnnotationKey                       = InferenceServiceInternalAnnotationsPrefix + "/modelDir"
)

InferenceService Internal Annotations

View Source
var (
	ControllerLabelName             = KFServingName + "-controller-manager"
	DefaultPredictorTimeout   int64 = 60
	DefaultTransformerTimeout int64 = 120
	DefaultExplainerTimeout   int64 = 300
	DefaultReadinessTimeout   int32 = 600
	DefaultScalingTarget            = "1"
	DefaultMinReplicas        int   = 1
)

Controller Constants

View Source
var (
	EnableKFServingMutatingWebhook         = "enabled"
	EnableWebhookNamespaceSelectorEnvName  = "ENABLE_WEBHOOK_NAMESPACE_SELECTOR"
	EnableWebhookNamespaceSelectorEnvValue = "enabled"
	IsEnableWebhookNamespaceSelector       = isEnvVarMatched(EnableWebhookNamespaceSelectorEnvName, EnableWebhookNamespaceSelectorEnvValue)
	PodMutatorWebhookName                  = KFServingName + "-pod-mutator-webhook"
)

Webhook Constants

View Source
var (
	ServiceAnnotationDisallowedList = []string{
		autoscaling.MinScaleAnnotationKey,
		autoscaling.MaxScaleAnnotationKey,
		StorageInitializerSourceUriInternalAnnotationKey,
		"kubectl.kubernetes.io/last-applied-configuration",
	}

	RevisionTemplateLabelDisallowedList = []string{
		VisibilityLabel,
	}
)
View Source
var (
	MLServerISGRPCPort = int32(9000)
	MLServerISRestPort = int32(8080)
)
View Source
var (
	LocalGatewayHost = "knative-local-gateway.istio-system.svc." + network.GetClusterDomainName()
)
View Source
var (
	ModelConfigFileName = "models.json"
)

InferenceService MultiModel Constants

View Source
var (
	TrainedModelAllocated = KFServingAPIGroupName + "/" + "trainedmodel-allocated"
)

TrainedModel Constants

Functions

func CanaryExplainerServiceName added in v0.1.3

func CanaryExplainerServiceName(name string) string

func CanaryPredictorServiceName added in v0.1.3

func CanaryPredictorServiceName(name string) string

func CanaryServiceName added in v0.1.3

func CanaryServiceName(name string, component InferenceServiceComponent) string

func CanaryTransformerServiceName added in v0.1.3

func CanaryTransformerServiceName(name string) string

func DefaultExplainerServiceName added in v0.1.3

func DefaultExplainerServiceName(name string) string

func DefaultPredictorServiceName added in v0.1.3

func DefaultPredictorServiceName(name string) string

func DefaultServiceName added in v0.1.3

func DefaultServiceName(name string, component InferenceServiceComponent) string

func DefaultTransformerServiceName added in v0.1.3

func DefaultTransformerServiceName(name string) string

func ExplainPath added in v0.4.0

func ExplainPath(name string) string

func ExplainPrefix added in v0.3.0

func ExplainPrefix() string

func HostRegExp added in v0.3.0

func HostRegExp(host string) string

hostRegExp returns an ECMAScript regular expression to match either host or host:<any port> for clusterLocalHost, we will also match the prefixes.

func InferenceServiceHostName added in v0.3.0

func InferenceServiceHostName(name string, namespace string, domain string) string

func InferenceServicePrefix added in v0.3.0

func InferenceServicePrefix(name string) string

func InferenceServiceURL added in v0.3.0

func InferenceServiceURL(scheme, name, namespace, domain string) string

func ModelConfigName added in v0.5.0

func ModelConfigName(inferenceserviceName string, shardId int) string

func PredictPath added in v0.4.0

func PredictPath(name string, protocol InferenceServiceProtocol) string

func PredictPrefix added in v0.3.0

func PredictPrefix() string

func PredictorURL added in v0.3.0

func PredictorURL(metadata v1.ObjectMeta, isCanary bool) string

func TransformerURL added in v0.3.0

func TransformerURL(metadata v1.ObjectMeta, isCanary bool) string

func VirtualServiceHostname added in v0.4.0

func VirtualServiceHostname(name string, predictorHostName string) string

Types

type InferenceServiceComponent added in v0.3.0

type InferenceServiceComponent string
const (
	Predictor   InferenceServiceComponent = "predictor"
	Explainer   InferenceServiceComponent = "explainer"
	Transformer InferenceServiceComponent = "transformer"
)

InferenceService Component enums

func (InferenceServiceComponent) String added in v0.3.0

func (e InferenceServiceComponent) String() string

type InferenceServiceProtocol added in v0.5.0

type InferenceServiceProtocol string
const (
	ProtocolV1 InferenceServiceProtocol = "v1"
	ProtocolV2 InferenceServiceProtocol = "v2"
)

InferenceService protocol enums

type InferenceServiceVerb added in v0.3.0

type InferenceServiceVerb string
const (
	Predict InferenceServiceVerb = "predict"
	Explain InferenceServiceVerb = "explain"
)

InferenceService verb enums

func (InferenceServiceVerb) String added in v0.3.0

func (v InferenceServiceVerb) String() string

Jump to

Keyboard shortcuts

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