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.
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.
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.
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.
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.
Index ¶
- Constants
- func CreatePredictorAndWaitAndExpectFailed(predictorManifest *unstructured.Unstructured) *unstructured.Unstructured
- func CreatePredictorAndWaitAndExpectInvalidSpec(predictorManifest *unstructured.Unstructured) *unstructured.Unstructured
- func CreatePredictorAndWaitAndExpectLoaded(predictorManifest *unstructured.Unstructured) *unstructured.Unstructured
- func DecodeResourceFromFile(resourcePath string) *unstructured.Unstructured
- func ExpectPredictorFailureInfo(obj *unstructured.Unstructured, reason string, hasLocation bool, hasTime bool, ...)
- func ExpectPredictorState(obj *unstructured.Unstructured, available bool, ...)
- func ExpectSuccessfulInference_lightgbmMushroom(predictorName string)
- func ExpectSuccessfulInference_onnxMnist(predictorName string)
- func ExpectSuccessfulInference_pytorchCifar(predictorName string)
- func ExpectSuccessfulInference_sklearnMnistSvm(predictorName string)
- func ExpectSuccessfulInference_tensorflowMnist(predictorName string)
- func ExpectSuccessfulInference_xgboostMushroom(predictorName string)
- func GetBool(obj *unstructured.Unstructured, fieldPath ...string) bool
- func GetInt64(obj *unstructured.Unstructured, fieldPath ...string) int64
- func GetMap(obj *unstructured.Unstructured, fieldPath ...string) map[string]interface{}
- func GetString(obj *unstructured.Unstructured, fieldPath ...string) string
- func LoadCifarImage(index int) []float32
- func LoadMnistImage(index int) []float32
- func MakeUniquePredictorName(base string) string
- func NewPredictorForFVT(filename string) *unstructured.Unstructured
- func SetString(obj *unstructured.Unstructured, value string, fieldPath ...string)
- func UpdatePredictorAndWaitAndExpectFailed(predictorManifest *unstructured.Unstructured) *unstructured.Unstructured
- func UpdatePredictorAndWaitAndExpectLoaded(predictorManifest *unstructured.Unstructured) *unstructured.Unstructured
- func WaitForDeployStatus(watcher watch.Interface, timeToStabilize time.Duration)
- func WaitForLastStateInExpectedList(statusAttribute string, expectedStates []string, watcher watch.Interface) *unstructured.Unstructured
- func WaitForStableActiveDeployState()
- type FVTClient
- func (fvt *FVTClient) ApplyPredictorExpectSuccess(predictor *unstructured.Unstructured) *unstructured.Unstructured
- func (fvt *FVTClient) ApplyUserConfigMap(config map[string]interface{})
- func (fvt *FVTClient) ConnectToModelServing(connectionType ModelServingConnectionType) error
- func (fvt *FVTClient) CreateConfigMapTLS(tlsSecretName string, tlsClientAuth string) *unstructured.Unstructured
- func (fvt *FVTClient) CreatePredictorExpectSuccess(resource *unstructured.Unstructured) *unstructured.Unstructured
- func (fvt *FVTClient) CreateTLSSecrets()
- func (fvt *FVTClient) DeleteAllPredictors()
- func (fvt *FVTClient) DeleteConfigMap(resourceName string) error
- func (fvt *FVTClient) DeletePredictor(resourceName string)
- func (fvt *FVTClient) DeleteSecret(resourceName string) error
- func (fvt FVTClient) DeleteTLSSecrets() error
- func (fvt *FVTClient) DisconnectFromModelServing()
- func (fvt *FVTClient) GetPredictor(name string) *unstructured.Unstructured
- func (fvt *FVTClient) GetServingRuntime(name string) *unstructured.Unstructured
- func (fvt *FVTClient) ListDeploys() appsv1.DeploymentList
- func (fvt *FVTClient) ListPredictors(options metav1.ListOptions) *unstructured.UnstructuredList
- func (fvt *FVTClient) ListServingRuntimes(options metav1.ListOptions) (*unstructured.UnstructuredList, error)
- func (fvt *FVTClient) PrintPredictors()
- func (fvt *FVTClient) RestartDeploys()
- func (fvt *FVTClient) RunKfsInference(req *inference.ModelInferRequest) (*inference.ModelInferResponse, error)
- func (fvt *FVTClient) RunKubectl(args ...string) error
- func (fvt *FVTClient) StartWatchingDeploys() watch.Interface
- func (fvt *FVTClient) StartWatchingPredictors(options metav1.ListOptions, timeoutSeconds int64) watch.Interface
- func (fvt *FVTClient) TailPodLogs(sinceTime string)
- func (fvt *FVTClient) UpdateConfigMapTLS(tlsSecretName string, tlsClientAuth string) *unstructured.Unstructured
- func (fvt *FVTClient) UpdatePredictorExpectSuccess(resource *unstructured.Unstructured) *unstructured.Unstructured
- func (fvt *FVTClient) WatchPredictorsAsync(c chan *unstructured.Unstructured, options metav1.ListOptions, ...)
- type ModelServingConnectionType
Constants ¶
const ( ServingRuntimeKind = "ServingRuntime" PredictorKind = "Predictor" ConfigMapKind = "ConfigMap" SecretKind = "Secret" DefaultTestNamespace = "modelmesh-serving" DefaultTestServiceName = "modelmesh-serving" DefaultControllerNamespace = "modelmesh-serving" )
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 LoadMnistImage ¶
func MakeUniquePredictorName ¶
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 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 ¶
func GetFVTClient ¶
func (*FVTClient) ApplyPredictorExpectSuccess ¶
func (fvt *FVTClient) ApplyPredictorExpectSuccess(predictor *unstructured.Unstructured) *unstructured.Unstructured
func (*FVTClient) ApplyUserConfigMap ¶
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 (*FVTClient) DeletePredictor ¶
func (*FVTClient) DeleteSecret ¶
func (FVTClient) DeleteTLSSecrets ¶
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 (*FVTClient) StartWatchingDeploys ¶
func (*FVTClient) StartWatchingPredictors ¶
func (*FVTClient) TailPodLogs ¶
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 )