utils

package
v0.8.100 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDeploymentMode

func GetDeploymentMode(annotations map[string]string, deployConfig *v1beta1api.DeployConfig) constants.DeploymentModeType

GetDeploymentMode returns the current deployment mode, supports Serverless and RawDeployment case 1: no serving.kserve.org/deploymentMode annotation

return config.deploy.defaultDeploymentMode

case 2: serving.kserve.org/deploymentMode is set

        if the mode is "RawDeployment", "Serverless" or "ModelMesh", return it.
		else return config.deploy.defaultDeploymentMode

func GetServingRuntime

func GetServingRuntime(cl client.Client, name string, namespace string) (*v1alpha1.ServingRuntimeSpec, error)

GetServingRuntime Get a ServingRuntime by name. First, ServingRuntimes in the given namespace will be checked. If a resource of the specified name is not found, then ClusterServingRuntimes will be checked.

func IsMMSPredictor

func IsMMSPredictor(predictor *v1beta1api.PredictorSpec, isvcConfig *v1beta1api.InferenceServicesConfig) bool

IsMMSPredictor Only enable MMS predictor when predictor config sets MMS to true and storage uri is not set

func IsMemoryResourceAvailable

func IsMemoryResourceAvailable(isvc *v1beta1api.InferenceService, totalReqMemory resource.Quantity, isvcConfig *v1beta1api.InferenceServicesConfig) bool

func MergePodSpec

func MergePodSpec(runtimePodSpec *v1alpha1.ServingRuntimePodSpec, predictorPodSpec *v1beta1.PodSpec) (*v1.PodSpec, error)

MergePodSpec Merge the predictor PodSpec struct with the runtime PodSpec struct, allowing users to override runtime PodSpec settings from the predictor spec.

func MergeRuntimeContainers

func MergeRuntimeContainers(runtimeContainer *v1alpha1.Container, predictorContainer *v1.Container) (*v1.Container, error)

MergeRuntimeContainers Merge the predictor Container struct with the runtime Container struct, allowing users to override runtime container settings from the predictor spec.

func ReplacePlaceholders

func ReplacePlaceholders(container *v1.Container, meta metav1.ObjectMeta) error

ReplacePlaceholders Replace placeholders in runtime container by values from inferenceservice metadata

func UpdateImageTag

func UpdateImageTag(container *v1.Container, runtimeVersion *string, isvcConfig *v1beta1.InferenceServicesConfig)

UpdateImageTag Update image tag if GPU is enabled or runtime version is provided

Types

This section is empty.

Jump to

Keyboard shortcuts

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