fvt

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2022 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Overview

Copyright 2021 IBM Corporation

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	ServingRuntimeKind         = "ServingRuntime"
	PredictorKind              = "Predictor"
	ConfigMapKind              = "ConfigMap"
	SecretKind                 = "Secret"
	DefaultTestNamespace       = "modelmesh-serving"
	DefaultTestServiceName     = "modelmesh-serving"
	DefaultControllerNamespace = "modelmesh-serving"
)
View Source
const EPSILON float64 = 0.000001

Used for checking if floats are sufficiently close enough.

Variables

This section is empty.

Functions

func CreatePredictorAndWaitAndExpectFailed

func CreatePredictorAndWaitAndExpectFailed(predictorManifest *unstructured.Unstructured) *unstructured.Unstructured

func CreatePredictorAndWaitAndExpectInvalidSpec

func CreatePredictorAndWaitAndExpectInvalidSpec(predictorManifest *unstructured.Unstructured) *unstructured.Unstructured

func CreatePredictorAndWaitAndExpectLoaded

func CreatePredictorAndWaitAndExpectLoaded(predictorManifest *unstructured.Unstructured) *unstructured.Unstructured

func DecodeResourceFromFile

func DecodeResourceFromFile(resourcePath string) *unstructured.Unstructured

func ExpectPredictorFailureInfo

func ExpectPredictorFailureInfo(obj *unstructured.Unstructured, reason string, hasLocation bool, hasTime bool, message string)

func ExpectPredictorState

func ExpectPredictorState(obj *unstructured.Unstructured, available bool, activeModelState, targetModelState, transitionStatus string)

func ExpectSuccessfulInference_lightgbmMushroom

func ExpectSuccessfulInference_lightgbmMushroom(predictorName string)

LightGBM Mushroom COS path: fvt/lightgbm/mushroom

func ExpectSuccessfulInference_onnxMnist

func ExpectSuccessfulInference_onnxMnist(predictorName string)

ONNX MNIST COS path: fvt/onnx/onnx-mnist

func ExpectSuccessfulInference_pytorchCifar

func ExpectSuccessfulInference_pytorchCifar(predictorName string)

PyTorch CIFAR COS path: fvt/pytorch/pytorch-cifar

func ExpectSuccessfulInference_sklearnMnistSvm

func ExpectSuccessfulInference_sklearnMnistSvm(predictorName string)

SKLearn MNIST SVM COS path: fvt/sklearn/mnist-svm

func ExpectSuccessfulInference_tensorflowMnist

func ExpectSuccessfulInference_tensorflowMnist(predictorName string)

Tensorflow MNIST COS path: fvt/tensorflow/mnist.savedmodel

func ExpectSuccessfulInference_xgboostMushroom

func ExpectSuccessfulInference_xgboostMushroom(predictorName string)

XGBoost Mushroom COS path: fvt/xgboost/mushroom

func GetBool

func GetBool(obj *unstructured.Unstructured, fieldPath ...string) bool

func GetInt64

func GetInt64(obj *unstructured.Unstructured, fieldPath ...string) int64

func GetMap

func GetMap(obj *unstructured.Unstructured, fieldPath ...string) map[string]interface{}

func GetString

func GetString(obj *unstructured.Unstructured, fieldPath ...string) string

func LoadCifarImage

func LoadCifarImage(index int) []float32

func LoadMnistImage

func LoadMnistImage(index int) []float32

func MakeUniquePredictorName

func MakeUniquePredictorName(base string) string

to enable tests to run in parallel even when loading from the same Predictor sample

func NewPredictorForFVT

func NewPredictorForFVT(filename string) *unstructured.Unstructured

func SetString

func SetString(obj *unstructured.Unstructured, value string, fieldPath ...string)

func UpdatePredictorAndWaitAndExpectFailed

func UpdatePredictorAndWaitAndExpectFailed(predictorManifest *unstructured.Unstructured) *unstructured.Unstructured

func UpdatePredictorAndWaitAndExpectLoaded

func UpdatePredictorAndWaitAndExpectLoaded(predictorManifest *unstructured.Unstructured) *unstructured.Unstructured

func WaitForDeployStatus

func WaitForDeployStatus(watcher watch.Interface, timeToStabilize time.Duration)

func WaitForLastStateInExpectedList

func WaitForLastStateInExpectedList(statusAttribute string, expectedStates []string, watcher watch.Interface) *unstructured.Unstructured

Waiting for predictor state to reach the last one in the expected list Predictor state is allowed to directly reach the last state in the expected list i.e; Loaded. Also, Predictor state can be one of the earlier states (i.e; Pending or Loading), but state change should happen in the following order: [Pending => Loaded] (or) [Pending => Loading => Loaded] (or) [Loading => Loaded] (or) [Pending => Loading => FailedToLoad]

func WaitForStableActiveDeployState

func WaitForStableActiveDeployState()

Types

type FVTClient

type FVTClient struct {
	dynamic.Interface
	// contains filtered or unexported fields
}

func GetFVTClient

func GetFVTClient(log logr.Logger, namespace, serviceName, controllerNamespace string) (*FVTClient, error)

func (*FVTClient) ApplyPredictorExpectSuccess

func (fvt *FVTClient) ApplyPredictorExpectSuccess(predictor *unstructured.Unstructured) *unstructured.Unstructured

func (*FVTClient) ApplyUserConfigMap

func (fvt *FVTClient) ApplyUserConfigMap(config map[string]interface{})

func (*FVTClient) ConnectToModelServing

func (fvt *FVTClient) ConnectToModelServing(connectionType ModelServingConnectionType) error

func (*FVTClient) CreateConfigMapTLS

func (fvt *FVTClient) CreateConfigMapTLS(tlsSecretName string, tlsClientAuth string) *unstructured.Unstructured

func (*FVTClient) CreatePredictorExpectSuccess

func (fvt *FVTClient) CreatePredictorExpectSuccess(resource *unstructured.Unstructured) *unstructured.Unstructured

func (*FVTClient) CreateTLSSecrets

func (fvt *FVTClient) CreateTLSSecrets()

func (*FVTClient) DeleteAllPredictors

func (fvt *FVTClient) DeleteAllPredictors()

func (*FVTClient) DeleteConfigMap

func (fvt *FVTClient) DeleteConfigMap(resourceName string) error

func (*FVTClient) DeletePredictor

func (fvt *FVTClient) DeletePredictor(resourceName string)

func (*FVTClient) DeleteSecret

func (fvt *FVTClient) DeleteSecret(resourceName string) error

func (FVTClient) DeleteTLSSecrets

func (fvt FVTClient) DeleteTLSSecrets() error

func (*FVTClient) DisconnectFromModelServing

func (fvt *FVTClient) DisconnectFromModelServing()

func (*FVTClient) GetPredictor

func (fvt *FVTClient) GetPredictor(name string) *unstructured.Unstructured

func (*FVTClient) GetServingRuntime

func (fvt *FVTClient) GetServingRuntime(name string) *unstructured.Unstructured

func (*FVTClient) ListDeploys

func (fvt *FVTClient) ListDeploys() appsv1.DeploymentList

func (*FVTClient) ListPredictors

func (fvt *FVTClient) ListPredictors(options metav1.ListOptions) *unstructured.UnstructuredList

func (*FVTClient) ListServingRuntimes

func (fvt *FVTClient) ListServingRuntimes(options metav1.ListOptions) (*unstructured.UnstructuredList, error)

func (*FVTClient) PrintPredictors

func (fvt *FVTClient) PrintPredictors()

func (*FVTClient) RestartDeploys

func (fvt *FVTClient) RestartDeploys()

func (*FVTClient) RunKfsInference

func (fvt *FVTClient) RunKfsInference(req *inference.ModelInferRequest) (*inference.ModelInferResponse, error)

func (*FVTClient) RunKubectl

func (fvt *FVTClient) RunKubectl(args ...string) error

func (*FVTClient) StartWatchingDeploys

func (fvt *FVTClient) StartWatchingDeploys() watch.Interface

func (*FVTClient) StartWatchingPredictors

func (fvt *FVTClient) StartWatchingPredictors(options metav1.ListOptions, timeoutSeconds int64) watch.Interface

func (*FVTClient) TailPodLogs

func (fvt *FVTClient) TailPodLogs(sinceTime string)

func (*FVTClient) UpdateConfigMapTLS

func (fvt *FVTClient) UpdateConfigMapTLS(tlsSecretName string, tlsClientAuth string) *unstructured.Unstructured

func (*FVTClient) UpdatePredictorExpectSuccess

func (fvt *FVTClient) UpdatePredictorExpectSuccess(resource *unstructured.Unstructured) *unstructured.Unstructured

func (*FVTClient) WatchPredictorsAsync

func (fvt *FVTClient) WatchPredictorsAsync(c chan *unstructured.Unstructured, options metav1.ListOptions, timeoutSeconds int64)

type ModelServingConnectionType

type ModelServingConnectionType int
const (
	Insecure ModelServingConnectionType = iota
	TLS
	MutualTLS
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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