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 2022 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
- Variables
- func CreateIsvcAndWaitAndExpectReady(isvcManifest *unstructured.Unstructured) *unstructured.Unstructured
- func CreatePredictorAndWaitAndExpectFailed(predictorManifest *unstructured.Unstructured) *unstructured.Unstructured
- func CreatePredictorAndWaitAndExpectInvalidSpec(predictorManifest *unstructured.Unstructured) *unstructured.Unstructured
- func CreatePredictorAndWaitAndExpectLoaded(predictorManifest *unstructured.Unstructured) *unstructured.Unstructured
- func CreateSecret(secret *corev1.Secret, namespace string, fvt *FVTClient)
- 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_kerasMnist(predictorName string)
- func ExpectSuccessfulInference_lightgbmMushroom(predictorName string)
- func ExpectSuccessfulInference_onnxMnist(predictorName string)
- func ExpectSuccessfulInference_openvinoMnistTFSPredict(predictorName string)
- func ExpectSuccessfulInference_pytorchCifar(predictorName string)
- func ExpectSuccessfulInference_sklearnMnistSvm(predictorName string)
- func ExpectSuccessfulInference_tensorflowMnist(predictorName string)
- func ExpectSuccessfulInference_xgboostMushroom(predictorName string)
- func ExpectSuccessfulRESTInference_sklearnMnistSvm(predictorName string)
- func ExpectSuccessfulRESTInference_xgboostMushroom(predictorName string, tls bool)
- 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 GetSlice(obj *unstructured.Unstructured, fieldPath ...string) ([]interface{}, bool)
- func GetString(obj *unstructured.Unstructured, fieldPath ...string) string
- func LoadCifarImage(index int) []float32
- func LoadMnistImage(index int) []float32
- func MakeUniquePredictorName(base string) string
- func NewIsvcForFVT(filename string) *unstructured.Unstructured
- func NewPredictorForFVT(filename string) *unstructured.Unstructured
- func SetString(obj *unstructured.Unstructured, value string, fieldPath ...string)
- func TestDataPath(resourcePathWithinTestData string) string
- func UpdatePredictorAndWaitAndExpectFailed(predictorManifest *unstructured.Unstructured) *unstructured.Unstructured
- func UpdatePredictorAndWaitAndExpectLoaded(predictorManifest *unstructured.Unstructured) *unstructured.Unstructured
- func WaitForDeployStatus(watcher watch.Interface, timeToStabilize time.Duration)
- func WaitForIsvcReady(watcher watch.Interface) *unstructured.Unstructured
- func WaitForLastStateInExpectedList(statusAttribute string, expectedStates []string, watcher watch.Interface) *unstructured.Unstructured
- func WaitForStableActiveDeployState()
- type CertGenerator
- 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) CreateIsvcExpectSuccess(resource *unstructured.Unstructured) *unstructured.Unstructured
- func (fvt *FVTClient) CreatePredictorExpectSuccess(resource *unstructured.Unstructured) *unstructured.Unstructured
- func (fvt *FVTClient) CreateTLSSecrets()
- func (fvt *FVTClient) DeleteAllIsvcs()
- func (fvt *FVTClient) DeleteAllPredictors()
- func (fvt *FVTClient) DeleteConfigMap(resourceName string) error
- func (fvt *FVTClient) DeleteIsvc(resourceName string)
- func (fvt *FVTClient) DeletePredictor(resourceName string)
- func (fvt *FVTClient) DeleteSecret(resourceName string, namespace string) error
- func (fvt FVTClient) DeleteTLSSecrets()
- func (fvt *FVTClient) DisconnectFromModelServing()
- func (fvt *FVTClient) GetPredictor(name string) *unstructured.Unstructured
- func (fvt *FVTClient) GetRandomReadyRuntimePodNameFromEndpoints() string
- func (fvt *FVTClient) GetServingRuntime(name string) *unstructured.Unstructured
- func (fvt *FVTClient) ListClusterServingRuntimes(options metav1.ListOptions) (*unstructured.UnstructuredList, error)
- 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) PrintDescribeNodes()
- func (fvt *FVTClient) PrintEvents()
- func (fvt *FVTClient) PrintIsvcs()
- func (fvt *FVTClient) PrintPods()
- func (fvt *FVTClient) PrintPredictors()
- func (fvt *FVTClient) RestartDeploys()
- func (fvt *FVTClient) RunKfsInference(req *inference.ModelInferRequest) (*inference.ModelInferResponse, error)
- func (fvt *FVTClient) RunKfsModelMetadata(req *inference.ModelMetadataRequest) (*inference.ModelMetadataResponse, error)
- func (fvt *FVTClient) RunKfsRestInference(modelName string, body []byte, tls bool) (string, error)
- func (fvt *FVTClient) RunKubectl(args ...string) error
- func (fvt *FVTClient) RunTfsInference(req *tfsapi.PredictRequest) (*tfsapi.PredictResponse, error)
- func (fvt *FVTClient) SetDefaultUserConfigMap()
- func (fvt *FVTClient) StartWatchingDeploys() watch.Interface
- func (fvt *FVTClient) StartWatchingIsvcs(options metav1.ListOptions, timeoutSeconds int64) watch.Interface
- func (fvt *FVTClient) StartWatchingPredictors(options metav1.ListOptions, timeoutSeconds int64) watch.Interface
- func (fvt *FVTClient) TailPodLogs(sinceTime string)
- func (fvt *FVTClient) UpdateConfigMapTLS(tlsConfig map[string]interface{})
- func (fvt *FVTClient) UpdatePredictorExpectSuccess(resource *unstructured.Unstructured) *unstructured.Unstructured
- func (fvt *FVTClient) WatchPredictorsAsync(c chan *unstructured.Unstructured, options metav1.ListOptions, ...)
- type ModelMeshPortForward
- type ModelServingConnectionType
Constants ¶
const ( ServingRuntimeKind = "ServingRuntime" PredictorKind = "Predictor" IsvcKind = "InferenceService" ConfigMapKind = "ConfigMap" SecretKind = "Secret" DefaultTestNamespace = "modelmesh-serving" DefaultTestServiceName = "modelmesh-serving" DefaultControllerNamespace = "modelmesh-serving" UserConfigMapName = "model-serving-config" SamplesPath = "predictors/" IsvcSamplesPath = "isvcs/" RuntimeSamplesPath = "runtimes/" TLSSecretName = "fvt-tls-secret" )
const EPSILON float64 = 0.000001
Used for checking if floats are sufficiently close enough.
Variables ¶
var BasicTLSConfig = map[string]interface{}{ "tls": map[string]interface{}{ "secretName": TLSSecretName, "clientAuth": "optional", "headlessService": false, }, }
var DefaultConfig = map[string]interface{}{ "podsPerRuntime": 1, "restProxy": map[string]interface{}{ "enabled": true, }, "scaleToZero": map[string]interface{}{ "enabled": false, }, "internalModelMeshEnvVars": []map[string]interface{}{ { "name": "BOOTSTRAP_CLEARANCE_PERIOD_MS", "value": "0", }, }, }
var DefaultTimeout = int64(120)
var Log logr.Logger
var MutualTLSConfig = map[string]interface{}{ "tls": map[string]interface{}{ "secretName": TLSSecretName, "clientAuth": "require", "headlessService": false, }, }
var NameSpaceScopeMode = false
Functions ¶
func CreateIsvcAndWaitAndExpectReady ¶ added in v0.9.0
func CreateIsvcAndWaitAndExpectReady(isvcManifest *unstructured.Unstructured) *unstructured.Unstructured
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 CreateSecret ¶ added in v0.9.0
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_kerasMnist ¶ added in v0.9.0
func ExpectSuccessfulInference_kerasMnist(predictorName string)
Keras MNIST COS path: fvt/tensorflow/keras-mnist
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_openvinoMnistTFSPredict ¶ added in v0.9.0
func ExpectSuccessfulInference_openvinoMnistTFSPredict(predictorName string)
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 ExpectSuccessfulRESTInference_sklearnMnistSvm ¶ added in v0.9.0
func ExpectSuccessfulRESTInference_sklearnMnistSvm(predictorName string)
func ExpectSuccessfulRESTInference_xgboostMushroom ¶ added in v0.9.0
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 GetSlice ¶ added in v0.9.0
func GetSlice(obj *unstructured.Unstructured, fieldPath ...string) ([]interface{}, bool)
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 NewIsvcForFVT ¶ added in v0.9.0
func NewIsvcForFVT(filename string) *unstructured.Unstructured
func NewPredictorForFVT ¶
func NewPredictorForFVT(filename string) *unstructured.Unstructured
func SetString ¶
func SetString(obj *unstructured.Unstructured, value string, fieldPath ...string)
func TestDataPath ¶ added in v0.9.0
Utility function to return the testdata directory
func UpdatePredictorAndWaitAndExpectFailed ¶
func UpdatePredictorAndWaitAndExpectFailed(predictorManifest *unstructured.Unstructured) *unstructured.Unstructured
func UpdatePredictorAndWaitAndExpectLoaded ¶
func UpdatePredictorAndWaitAndExpectLoaded(predictorManifest *unstructured.Unstructured) *unstructured.Unstructured
func WaitForDeployStatus ¶
func WaitForIsvcReady ¶ added in v0.9.0
func WaitForIsvcReady(watcher watch.Interface) *unstructured.Unstructured
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 CertGenerator ¶ added in v0.9.0
type FVTClient ¶
var FVTClientInstance *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) CreateIsvcExpectSuccess ¶ added in v0.9.0
func (fvt *FVTClient) CreateIsvcExpectSuccess(resource *unstructured.Unstructured) *unstructured.Unstructured
func (*FVTClient) CreatePredictorExpectSuccess ¶
func (fvt *FVTClient) CreatePredictorExpectSuccess(resource *unstructured.Unstructured) *unstructured.Unstructured
func (*FVTClient) CreateTLSSecrets ¶
func (fvt *FVTClient) CreateTLSSecrets()
func (*FVTClient) DeleteAllIsvcs ¶ added in v0.9.0
func (fvt *FVTClient) DeleteAllIsvcs()
func (*FVTClient) DeleteAllPredictors ¶
func (fvt *FVTClient) DeleteAllPredictors()
func (*FVTClient) DeleteConfigMap ¶
func (*FVTClient) DeleteIsvc ¶ added in v0.9.0
func (*FVTClient) DeletePredictor ¶
func (*FVTClient) DeleteSecret ¶
func (FVTClient) DeleteTLSSecrets ¶
func (fvt FVTClient) DeleteTLSSecrets()
func (*FVTClient) DisconnectFromModelServing ¶
func (fvt *FVTClient) DisconnectFromModelServing()
func (*FVTClient) GetPredictor ¶
func (fvt *FVTClient) GetPredictor(name string) *unstructured.Unstructured
func (*FVTClient) GetRandomReadyRuntimePodNameFromEndpoints ¶ added in v0.9.0
func (*FVTClient) GetServingRuntime ¶
func (fvt *FVTClient) GetServingRuntime(name string) *unstructured.Unstructured
func (*FVTClient) ListClusterServingRuntimes ¶ added in v0.10.0
func (fvt *FVTClient) ListClusterServingRuntimes(options metav1.ListOptions) (*unstructured.UnstructuredList, error)
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) PrintDescribeNodes ¶ added in v0.9.0
func (fvt *FVTClient) PrintDescribeNodes()
func (*FVTClient) PrintEvents ¶ added in v0.9.0
func (fvt *FVTClient) PrintEvents()
func (*FVTClient) PrintIsvcs ¶ added in v0.9.0
func (fvt *FVTClient) PrintIsvcs()
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) RunKfsModelMetadata ¶ added in v0.9.0
func (fvt *FVTClient) RunKfsModelMetadata(req *inference.ModelMetadataRequest) (*inference.ModelMetadataResponse, error)
func (*FVTClient) RunKfsRestInference ¶ added in v0.9.0
func (*FVTClient) RunKubectl ¶
func (*FVTClient) RunTfsInference ¶ added in v0.9.0
func (fvt *FVTClient) RunTfsInference(req *tfsapi.PredictRequest) (*tfsapi.PredictResponse, error)
func (*FVTClient) SetDefaultUserConfigMap ¶ added in v0.9.0
func (fvt *FVTClient) SetDefaultUserConfigMap()
func (*FVTClient) StartWatchingDeploys ¶
func (*FVTClient) StartWatchingIsvcs ¶ added in v0.9.0
func (*FVTClient) StartWatchingPredictors ¶
func (*FVTClient) TailPodLogs ¶
func (*FVTClient) UpdateConfigMapTLS ¶
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 ModelMeshPortForward ¶ added in v0.9.0
type ModelMeshPortForward struct {
// contains filtered or unexported fields
}
func NewModelMeshPortForward ¶ added in v0.9.0
func (*ModelMeshPortForward) EnsureStarted ¶ added in v0.9.0
func (pf *ModelMeshPortForward) EnsureStarted() error
func (*ModelMeshPortForward) EnsureStopped ¶ added in v0.9.0
func (pf *ModelMeshPortForward) EnsureStopped()
type ModelServingConnectionType ¶
type ModelServingConnectionType int
const ( Insecure ModelServingConnectionType = iota TLS MutualTLS )