diff --git a/doc/source/index.rst b/doc/source/index.rst index e277c249ea..da8dd735c0 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -94,6 +94,7 @@ Documentation Index MLflow Server SKLearn Server Triton Inference Server + Tempo Server Tensorflow Serving XGBoost Server diff --git a/doc/source/python/api/seldon_core.rst b/doc/source/python/api/seldon_core.rst index 7211fd01ff..9e4bdc1b57 100644 --- a/doc/source/python/api/seldon_core.rst +++ b/doc/source/python/api/seldon_core.rst @@ -97,14 +97,6 @@ seldon\_core.mlmd\_utils module :undoc-members: :show-inheritance: -seldon\_core.persistence module -------------------------------- - -.. automodule:: seldon_core.persistence - :members: - :undoc-members: - :show-inheritance: - seldon\_core.seldon\_client module ---------------------------------- diff --git a/doc/source/servers/tempo.md b/doc/source/servers/tempo.md new file mode 100644 index 0000000000..10b85d0190 --- /dev/null +++ b/doc/source/servers/tempo.md @@ -0,0 +1,42 @@ +# Tempo Server + +[Tempo](https://github.com/SeldonIO/tempo) is a MLOps python SDK that allows packaging custom python servers and orchestration of multiple models from python. The Tempo python SDK allows packaging of the custom code as a conda-pack environment tar ball and Cloudpickle artifacts. It has a Seldon Core runtime which allows Tempo artifacts to be run under Seldon Core. + +For more details see the [Tempo documentation](https://tempo.readthedocs.io/en/latest/). + +An example Tempo model yaml for Seldon Core is shown below: + +```python +apiVersion: machinelearning.seldon.io/v1 +kind: SeldonDeployment +metadata: + annotations: + seldon.io/tempo-description: '' + seldon.io/tempo-model: '{"model_details": {"name": "numpyro-divorce", "local_folder": + "/home/clive/work/mlops/fork-tempo/docs/examples/custom-model/artifacts", "uri": + "s3://tempo/divorce", "platform": "custom", "inputs": {"args": [{"ty": "numpy.ndarray", + "name": "marriage"}, {"ty": "numpy.ndarray", "name": "age"}]}, "outputs": {"args": + [{"ty": "numpy.ndarray", "name": null}]}, "description": ""}, "protocol": "tempo.kfserving.protocol.KFServingV2Protocol", + "runtime_options": {"runtime": "tempo.seldon.SeldonKubernetesRuntime", "docker_options": + {"defaultRuntime": "tempo.seldon.SeldonDockerRuntime"}, "k8s_options": {"replicas": + 1, "minReplicas": null, "maxReplicas": null, "authSecretName": "minio-secret", + "serviceAccountName": null, "defaultRuntime": "tempo.seldon.SeldonKubernetesRuntime", + "namespace": "production"}, "ingress_options": {"ingress": "tempo.ingress.istio.IstioIngress", + "ssl": false, "verify_ssl": true}}}' + labels: + seldon.io/tempo: 'true' + name: numpyro-divorce + namespace: production +spec: + predictors: + - graph: + envSecretRefName: minio-secret + implementation: TEMPO_SERVER + modelUri: s3://tempo/divorce + name: numpyro-divorce + serviceAccountName: tempo-pipeline + type: MODEL + name: default + replicas: 1 + protocol: kfserving +``` diff --git a/helm-charts/seldon-core-operator/templates/customresourcedefinition_seldondeployments.machinelearning.seldon.io.yaml b/helm-charts/seldon-core-operator/templates/customresourcedefinition_seldondeployments.machinelearning.seldon.io.yaml index badb1c97a9..15550cc48a 100644 --- a/helm-charts/seldon-core-operator/templates/customresourcedefinition_seldondeployments.machinelearning.seldon.io.yaml +++ b/helm-charts/seldon-core-operator/templates/customresourcedefinition_seldondeployments.machinelearning.seldon.io.yaml @@ -6,7 +6,6 @@ metadata: annotations: cert-manager.io/inject-ca-from: '{{ include "seldon.namespace" . }}/seldon-serving-cert' controller-gen.kubebuilder.io/version: v0.4.1 - creationTimestamp: null labels: app: seldon app.kubernetes.io/instance: '{{ .Release.Name }}' diff --git a/helm-charts/seldon-core-operator/templates/customresourcedefinition_v1_seldondeployments.machinelearning.seldon.io.yaml b/helm-charts/seldon-core-operator/templates/customresourcedefinition_v1_seldondeployments.machinelearning.seldon.io.yaml index 523993ae1b..2b1059431e 100644 --- a/helm-charts/seldon-core-operator/templates/customresourcedefinition_v1_seldondeployments.machinelearning.seldon.io.yaml +++ b/helm-charts/seldon-core-operator/templates/customresourcedefinition_v1_seldondeployments.machinelearning.seldon.io.yaml @@ -6,7 +6,6 @@ metadata: annotations: cert-manager.io/inject-ca-from: '{{ include "seldon.namespace" . }}/seldon-serving-cert' controller-gen.kubebuilder.io/version: v0.4.1 - creationTimestamp: null name: seldondeployments.machinelearning.seldon.io spec: group: machinelearning.seldon.io diff --git a/helm-charts/seldon-core-operator/templates/webhook.yaml b/helm-charts/seldon-core-operator/templates/webhook.yaml index 28209e44bc..0a1a67a52e 100644 --- a/helm-charts/seldon-core-operator/templates/webhook.yaml +++ b/helm-charts/seldon-core-operator/templates/webhook.yaml @@ -9,7 +9,6 @@ kind: ValidatingWebhookConfiguration metadata: annotations: cert-manager.io/inject-ca-from: '{{ include "seldon.namespace" . }}/seldon-serving-cert' - creationTimestamp: null labels: app: seldon app.kubernetes.io/instance: '{{ .Release.Name }}' diff --git a/helm-charts/seldon-core-operator/values.yaml b/helm-charts/seldon-core-operator/values.yaml index 109453e59e..f1a2fe8d13 100644 --- a/helm-charts/seldon-core-operator/values.yaml +++ b/helm-charts/seldon-core-operator/values.yaml @@ -118,7 +118,7 @@ predictor_servers: defaultImageVersion: "1.8.0-dev" image: seldonio/sklearnserver kfserving: - defaultImageVersion: "0.1.1" + defaultImageVersion: "0.3.2" image: seldonio/mlserver TENSORFLOW_SERVER: protocols: @@ -134,13 +134,18 @@ predictor_servers: defaultImageVersion: "1.8.0-dev" image: seldonio/xgboostserver kfserving: - defaultImageVersion: "0.1.1" + defaultImageVersion: "0.3.2" image: seldonio/mlserver TRITON_SERVER: protocols: kfserving: defaultImageVersion: "20.08-py3" image: nvcr.io/nvidia/tritonserver + TEMPO_SERVER: + protocols: + kfserving: + defaultImageVersion: "0.3.2" + image: seldonio/mlserver # ## Other # You can choose the crds to not be installed if you already installed them diff --git a/notebooks/resources/iris-sklearn-v2.yaml b/notebooks/resources/iris-sklearn-v2.yaml index b78a1266b4..d8cc36b228 100644 --- a/notebooks/resources/iris-sklearn-v2.yaml +++ b/notebooks/resources/iris-sklearn-v2.yaml @@ -9,7 +9,7 @@ spec: - graph: children: [] implementation: SKLEARN_SERVER - modelUri: gs://seldon-models/sklearn/iris + modelUri: gs://seldon-models/sklearn/iris-0.23.2/lr_model name: classifier name: default replicas: 1 diff --git a/notebooks/server_examples.ipynb b/notebooks/server_examples.ipynb index 3b796419d9..3f6ce6cba0 100644 --- a/notebooks/server_examples.ipynb +++ b/notebooks/server_examples.ipynb @@ -13,41 +13,25 @@ }, { "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Error from server (AlreadyExists): namespaces \"seldon\" already exists\r\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "!kubectl create namespace seldon" ] }, { "cell_type": "code", - "execution_count": 16, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Context \"kind-kind\" modified.\r\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "!kubectl config set-context $(kubectl config current-context) --namespace=seldon" ] }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -80,17 +64,9 @@ }, { "cell_type": "code", - "execution_count": 25, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Overwriting ../servers/sklearnserver/samples/iris.yaml\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "%%writefile ../servers/sklearnserver/samples/iris.yaml\n", "apiVersion: machinelearning.seldon.io/v1alpha2\n", @@ -122,34 +98,18 @@ }, { "cell_type": "code", - "execution_count": 26, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "seldondeployment.machinelearning.seldon.io/sklearn created\r\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "!kubectl apply -f ../servers/sklearnserver/samples/iris.yaml" ] }, { "cell_type": "code", - "execution_count": 27, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "deployment \"sklearn-default-0-classifier\" successfully rolled out\r\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "!kubectl rollout status deploy/$(kubectl get deploy -l seldon-deployment-id=sklearn -o jsonpath='{.items[0].metadata.name}')" ] @@ -170,17 +130,9 @@ }, { "cell_type": "code", - "execution_count": 28, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{'data': {'names': ['t:0', 't:1', 't:2'], 'ndarray': [[9.912315378486718e-07, 0.0007015931307743852, 0.9992974156376878]]}, 'meta': {}}\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "X=!curl -s -d '{\"data\": {\"ndarray\":[[1.0, 2.0, 5.0, 6.0]]}}' \\\n", " -X POST http://localhost:8003/seldon/seldon/sklearn/api/v1.0/predictions \\\n", @@ -191,7 +143,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -201,33 +153,9 @@ }, { "cell_type": "code", - "execution_count": 30, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Success:True message:\n", - "Request:\n", - "meta {\n", - "}\n", - "data {\n", - " tensor {\n", - " shape: 1\n", - " shape: 4\n", - " values: 0.6806334106409295\n", - " values: 0.28830360482888695\n", - " values: 0.8975654688578534\n", - " values: 0.24493223527153596\n", - " }\n", - "}\n", - "\n", - "Response:\n", - "{'data': {'names': ['t:0', 't:1', 't:2'], 'tensor': {'shape': [1, 3], 'values': [0.14449927217770223, 0.5104835080299303, 0.34501721979236755]}}, 'meta': {}}\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "r = sc.predict(gateway=\"ambassador\",transport=\"rest\",shape=(1,4))\n", "print(r)\n", @@ -243,21 +171,9 @@ }, { "cell_type": "code", - "execution_count": 31, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Success:True message:\n", - "Request:\n", - "{'meta': {}, 'data': {'tensor': {'shape': [1, 4], 'values': [0.22157381246204433, 0.020827790786912548, 0.7633031884959527, 0.19217598516001178]}}}\n", - "Response:\n", - "{'meta': {}, 'data': {'names': ['t:0', 't:1', 't:2'], 'tensor': {'shape': [1, 3], 'values': [0.10758420949891327, 0.4796849750770796, 0.4127308154240072]}}}\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "r = sc.predict(gateway=\"ambassador\",transport=\"grpc\",shape=(1,4))\n", "print(r)\n", @@ -266,19 +182,11 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": null, "metadata": { "scrolled": true }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{'meta': {}, 'data': {'names': ['t:0', 't:1', 't:2'], 'ndarray': [[9.912315378486718e-07, 0.0007015931307743852, 0.9992974156376878]]}}\n" - ] - } - ], + "outputs": [], "source": [ "X=!cd ../executor/proto && grpcurl -d '{\"data\":{\"ndarray\":[[1.0,2.0,5.0,6.0]]}}' \\\n", " -rpc-header seldon:sklearn -rpc-header namespace:seldon \\\n", @@ -297,17 +205,9 @@ }, { "cell_type": "code", - "execution_count": 33, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "seldondeployment.machinelearning.seldon.io \"sklearn\" deleted\r\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "!kubectl delete -f ../servers/sklearnserver/samples/iris.yaml" ] @@ -324,17 +224,9 @@ }, { "cell_type": "code", - "execution_count": 6, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Overwriting ./resources/iris-sklearn-v2.yaml\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "%%writefile ./resources/iris-sklearn-v2.yaml\n", "apiVersion: machinelearning.seldon.io/v1\n", @@ -348,7 +240,7 @@ " - graph:\n", " children: []\n", " implementation: SKLEARN_SERVER\n", - " modelUri: gs://seldon-models/sklearn/iris\n", + " modelUri: gs://seldon-models/sklearn/iris-0.23.2/lr_model\n", " name: classifier\n", " name: default\n", " replicas: 1" @@ -363,35 +255,18 @@ }, { "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "seldondeployment.machinelearning.seldon.io/sklearn created\r\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "!kubectl apply -f resources/iris-sklearn-v2.yaml" ] }, { "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Waiting for deployment \"sklearn-default-0-classifier\" rollout to finish: 0 of 1 updated replicas are available...\n", - "deployment \"sklearn-default-0-classifier\" successfully rolled out\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "!kubectl rollout status deploy/$(kubectl get deploy -l seldon-deployment-id=sklearn -o jsonpath='{.items[0].metadata.name}')" ] @@ -406,35 +281,9 @@ }, { "cell_type": "code", - "execution_count": 4, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{\n", - " \"model_name\": \"classifier\",\n", - " \"model_version\": \"v1\",\n", - " \"id\": \"5a0bce13-98e8-4588-9fc5-7c8b11140174\",\n", - " \"parameters\": null,\n", - " \"outputs\": [\n", - " {\n", - " \"name\": \"predict\",\n", - " \"shape\": [\n", - " 1\n", - " ],\n", - " \"datatype\": \"FP32\",\n", - " \"parameters\": null,\n", - " \"data\": [\n", - " 2\n", - " ]\n", - " }\n", - " ]\n", - "}\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "import requests\n", "import json\n", @@ -466,17 +315,9 @@ }, { "cell_type": "code", - "execution_count": 5, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "seldondeployment.machinelearning.seldon.io \"sklearn\" deleted\r\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "!kubectl delete -f resources/iris-sklearn-v2.yaml" ] @@ -507,17 +348,9 @@ }, { "cell_type": "code", - "execution_count": 7, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Writing resources/iris.yaml\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "%%writefile resources/iris.yaml\n", "apiVersion: machinelearning.seldon.io/v1\n", @@ -545,35 +378,18 @@ }, { "cell_type": "code", - "execution_count": 8, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "seldondeployment.machinelearning.seldon.io/xgboost created\r\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "!kubectl apply -f resources/iris.yaml" ] }, { "cell_type": "code", - "execution_count": 9, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Waiting for deployment \"xgboost-default-0-classifier\" rollout to finish: 0 of 1 updated replicas are available...\n", - "deployment \"xgboost-default-0-classifier\" successfully rolled out\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "!kubectl rollout status deploy/$(kubectl get deploy -l seldon-deployment-id=xgboost -o jsonpath='{.items[0].metadata.name}')" ] @@ -587,17 +403,9 @@ }, { "cell_type": "code", - "execution_count": 10, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{'data': {'names': [], 'ndarray': [2.0]}, 'meta': {}}\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "X=!curl -s -d '{\"data\": {\"ndarray\":[[1.0, 2.0, 5.0, 6.0]]}}' \\\n", " -X POST http://localhost:8003/seldon/seldon/xgboost/api/v1.0/predictions \\\n", @@ -608,7 +416,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -618,33 +426,9 @@ }, { "cell_type": "code", - "execution_count": 12, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Success:True message:\n", - "Request:\n", - "meta {\n", - "}\n", - "data {\n", - " tensor {\n", - " shape: 1\n", - " shape: 4\n", - " values: 0.617330874549778\n", - " values: 0.4955768380888388\n", - " values: 0.8325074250157055\n", - " values: 0.29623988728724804\n", - " }\n", - "}\n", - "\n", - "Response:\n", - "{'data': {'names': [], 'tensor': {'shape': [1], 'values': [0.0]}}, 'meta': {}}\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "r = sc.predict(gateway=\"ambassador\",transport=\"rest\",shape=(1,4))\n", "print(r)\n", @@ -660,21 +444,9 @@ }, { "cell_type": "code", - "execution_count": 13, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Success:True message:\n", - "Request:\n", - "{'meta': {}, 'data': {'tensor': {'shape': [1, 4], 'values': [0.7029137333313852, 0.9422923262038959, 0.7271094013077166, 0.18443703566724434]}}}\n", - "Response:\n", - "{'meta': {}, 'data': {'tensor': {'shape': [1], 'values': [0.0]}}}\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "r = sc.predict(gateway=\"ambassador\",transport=\"grpc\",shape=(1,4))\n", "print(r)\n", @@ -683,19 +455,11 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": null, "metadata": { "scrolled": true }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{'meta': {}, 'data': {'ndarray': [2]}}\n" - ] - } - ], + "outputs": [], "source": [ "X=!cd ../executor/proto && grpcurl -d '{\"data\":{\"ndarray\":[[1.0,2.0,5.0,6.0]]}}' \\\n", " -rpc-header seldon:xgboost -rpc-header namespace:seldon \\\n", @@ -714,17 +478,9 @@ }, { "cell_type": "code", - "execution_count": 15, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "seldondeployment.machinelearning.seldon.io \"xgboost\" deleted\r\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "!kubectl delete -f resources/iris.yaml" ] @@ -741,17 +497,9 @@ }, { "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Overwriting ./resources/iris-xgboost-v2.yaml\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "%%writefile ./resources/iris-xgboost-v2.yaml\n", "apiVersion: machinelearning.seldon.io/v1\n", @@ -780,35 +528,18 @@ }, { "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "seldondeployment.machinelearning.seldon.io/xgboost created\r\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "!kubectl apply -f ./resources/iris-xgboost-v2.yaml" ] }, { "cell_type": "code", - "execution_count": 4, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Waiting for deployment \"xgboost-default-0-classifier\" rollout to finish: 0 of 1 updated replicas are available...\n", - "deployment \"xgboost-default-0-classifier\" successfully rolled out\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "!kubectl rollout status deploy/$(kubectl get deploy -l seldon-deployment-id=xgboost -o jsonpath='{.items[0].metadata.name}')" ] @@ -823,35 +554,9 @@ }, { "cell_type": "code", - "execution_count": 5, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{\n", - " \"model_name\": \"classifier\",\n", - " \"model_version\": \"v1\",\n", - " \"id\": \"d1887e45-e8c3-4644-b72b-5a3148463917\",\n", - " \"parameters\": null,\n", - " \"outputs\": [\n", - " {\n", - " \"name\": \"predict\",\n", - " \"shape\": [\n", - " 1\n", - " ],\n", - " \"datatype\": \"FP32\",\n", - " \"parameters\": null,\n", - " \"data\": [\n", - " 2.0\n", - " ]\n", - " }\n", - " ]\n", - "}\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "import requests\n", "import json\n", @@ -883,17 +588,9 @@ }, { "cell_type": "code", - "execution_count": 6, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "seldondeployment.machinelearning.seldon.io \"xgboost\" deleted\r\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "!kubectl delete -f ./resources/iris-xgboost-v2.yaml" ] @@ -924,17 +621,9 @@ }, { "cell_type": "code", - "execution_count": 7, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Overwriting ./resources/mnist_rest.yaml\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "%%writefile ./resources/mnist_rest.yaml\n", "apiVersion: machinelearning.seldon.io/v1alpha2\n", @@ -968,42 +657,25 @@ }, { "cell_type": "code", - "execution_count": 8, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "seldondeployment.machinelearning.seldon.io/tfserving created\r\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "!kubectl apply -f ./resources/mnist_rest.yaml" ] }, { "cell_type": "code", - "execution_count": 9, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Waiting for deployment \"tfserving-default-0-mnist-model\" rollout to finish: 0 of 1 updated replicas are available...\n", - "deployment \"tfserving-default-0-mnist-model\" successfully rolled out\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "!kubectl rollout status deploy/$(kubectl get deploy -l seldon-deployment-id=tfserving -o jsonpath='{.items[0].metadata.name}')" ] }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -1020,813 +692,9 @@ }, { "cell_type": "code", - "execution_count": 11, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Success:True message:\n", - "Request:\n", - "meta {\n", - "}\n", - "data {\n", - " tensor {\n", - " shape: 1\n", - " shape: 784\n", - " values: 0.5360208678294703\n", - " values: 0.5063574371425368\n", - " values: 0.9443243610713166\n", - " values: 0.0011084051211286416\n", - " values: 0.20099891756759192\n", - " values: 0.30071217406011774\n", - " values: 0.15622672261211623\n", - " values: 0.032474907686516064\n", - " values: 0.7440398045429419\n", - " values: 0.7108256047143693\n", - " values: 0.7645229494651484\n", - " values: 0.457444409411902\n", - " values: 0.316314894432161\n", - " values: 0.7350234986133874\n", - " values: 0.6847025510931343\n", - " values: 0.3124896535821692\n", - " values: 0.5023732148295806\n", - " values: 0.7766729114301516\n", - " values: 0.31117856330829097\n", - " values: 0.145499075089073\n", - " values: 0.9955898498586168\n", - " values: 0.04865057935951689\n", - " values: 0.2557675256095512\n", - " values: 0.3312323613365653\n", - " values: 0.5179019306893689\n", - " values: 0.2909692479700965\n", - " values: 0.6482350619102406\n", - " values: 0.23776475362315974\n", - " values: 0.9684044714121269\n", - " values: 0.3946100097962236\n", - " values: 0.6735207815070934\n", - " values: 0.4898909692131146\n", - " values: 0.7554495042153699\n", - " values: 0.9323323200773203\n", - " values: 0.8252476428579795\n", - " values: 0.22463738461912197\n", - " values: 0.8516178728688074\n", - " values: 0.828740934139463\n", - " values: 0.923362928072387\n", - " values: 0.2714093376678782\n", - " values: 0.9054254676779065\n", - " values: 0.13043825073432547\n", - " values: 0.6652904285620423\n", - " values: 0.6868063268085522\n", - " values: 0.5238440260046521\n", - " values: 0.6220355519313966\n", - " values: 0.94549067747297\n", - " values: 0.37350607942680747\n", - " values: 0.5940961179246904\n", - " values: 0.9875444499853954\n", - " values: 0.8441678775402586\n", - " values: 0.11603782952161557\n", - " values: 0.37060645993619024\n", - " values: 0.5223202975793629\n", - " values: 0.811955792147166\n", - " values: 0.3435665722918425\n", - " values: 0.6008945947691681\n", - " values: 0.7369476957371978\n", - " values: 0.42091588878275954\n", - " values: 0.7657478466544629\n", - " values: 0.7701005025913801\n", - " values: 0.7374120251216275\n", - " values: 0.040805007022627904\n", - " values: 0.8584078709275651\n", - " values: 0.4423009671290504\n", - " values: 0.463903678216087\n", - " values: 0.512994097178021\n", - " values: 0.21951215945925662\n", - " values: 0.39961265703661286\n", - " values: 0.3740776385162834\n", - " values: 0.8533328271293943\n", - " values: 0.6189058705460576\n", - " values: 0.7065177099136564\n", - " values: 0.7242754580877176\n", - " values: 0.4849158210968818\n", - " values: 0.7814732453001029\n", - " values: 0.8578162974062509\n", - " values: 0.14444494780372197\n", - " values: 0.20601734865077448\n", - " values: 0.31146170009259744\n", - " values: 0.02548904815923836\n", - " values: 0.03206555155558377\n", - " values: 0.06961913601940051\n", - " values: 0.5836905987975214\n", - " values: 0.6164841160182376\n", - " values: 0.18932462791453508\n", - " values: 0.7640015155876169\n", - " values: 0.5070826654549139\n", - " values: 0.09628169062880776\n", - " values: 0.19382869540563252\n", - " values: 0.9412062339456596\n", - " values: 0.5966486866762393\n", - " values: 0.6206143916246194\n", - " values: 0.19628479152988265\n", - " values: 0.1707854491649463\n", - " values: 0.8825761502582269\n", - " values: 0.9808711531596559\n", - " values: 0.08009655223214474\n", - " values: 0.1701636661745568\n", - " values: 0.11406709402446225\n", - " values: 0.053396793006944\n", - " values: 0.09360205809605349\n", - " values: 0.4293152516177\n", - " values: 0.8096761824364951\n", - " values: 0.45331815671809395\n", - " values: 0.0028687829212518112\n", - " values: 0.5383002126233998\n", - " values: 0.8374588688774007\n", - " values: 0.9065778173249387\n", - " values: 0.6928498685521003\n", - " values: 0.8287977470411556\n", - " values: 0.24420517062946456\n", - " values: 0.7087713010840551\n", - " values: 0.5597533577586793\n", - " values: 0.8340435101340461\n", - " values: 0.2834350433264451\n", - " values: 0.43389553731337505\n", - " values: 0.10779407741501923\n", - " values: 0.6810241672979269\n", - " values: 0.23028774938902108\n", - " values: 0.5338486723691872\n", - " values: 0.4476058035980687\n", - " values: 0.9769456277119264\n", - " values: 0.769714449533957\n", - " values: 0.8542344400369551\n", - " values: 0.3955913030396866\n", - " values: 0.6048931767815328\n", - " values: 0.3950530370957115\n", - " values: 0.3097862997602735\n", - " values: 0.6932151492719949\n", - " values: 0.045388147129425405\n", - " values: 0.3547049416354636\n", - " values: 0.2841549434007644\n", - " values: 0.5662212925051878\n", - " values: 0.11093317271366854\n", - " values: 0.705020697930456\n", - " values: 0.7701571220581236\n", - " values: 0.37401247234766277\n", - " values: 0.1649242055093013\n", - " values: 0.9522789591359156\n", - " values: 0.8298189406272996\n", - " values: 0.508548667739561\n", - " values: 0.5964131984844762\n", - " values: 0.6662052512807753\n", - " values: 0.18822217394822516\n", - " values: 0.1014283639141419\n", - " values: 0.2727041959497004\n", - " values: 0.13195607979659518\n", - " values: 0.654358242653656\n", - " values: 0.010816820290051932\n", - " values: 0.3246004560914473\n", - " values: 0.18662535569944738\n", - " values: 0.9969794986052404\n", - " values: 0.8179132942771283\n", - " values: 0.41450015472170887\n", - " values: 0.7057910168766867\n", - " values: 0.2899871260679674\n", - " values: 0.3831315267402442\n", - " values: 0.6964699607754848\n", - " values: 0.6902136692430094\n", - " values: 0.06504699984184215\n", - " values: 0.2212401546585464\n", - " values: 0.5098525158853898\n", - " values: 0.6542913471191273\n", - " values: 0.5305648126211812\n", - " values: 0.5261761585451143\n", - " values: 0.08846718053044222\n", - " values: 0.5449922096065108\n", - " values: 0.450353963044702\n", - " values: 0.736257854300933\n", - " values: 0.8772451907530697\n", - " values: 0.27841102672226525\n", - " values: 0.3033740515060188\n", - " values: 0.6171396233233576\n", - " values: 0.6951649288619974\n", - " values: 0.8182446576595515\n", - " values: 0.253567955939659\n", - " values: 0.12296965314136521\n", - " values: 0.6876519958686744\n", - " values: 0.5084038381279407\n", - " values: 0.3162575542640982\n", - " values: 0.4756606086109816\n", - " values: 0.43825582762402704\n", - " values: 0.6520559128506422\n", - " values: 0.2158293236314267\n", - " values: 0.31308462396962444\n", - " values: 0.6440740562434655\n", - " values: 0.4009300295558108\n", - " values: 0.6978264213104906\n", - " values: 0.6616370709891428\n", - " values: 0.6367887648607818\n", - " values: 0.31540480702480955\n", - " values: 0.3193423487030481\n", - " values: 0.6365777067910425\n", - " values: 0.31303332464825295\n", - " values: 0.6435042020660738\n", - " values: 0.08208548622076128\n", - " values: 0.7319588884879634\n", - " values: 0.13465892702216542\n", - " values: 0.9251573225160918\n", - " values: 0.345573001143858\n", - " values: 0.9559961076064103\n", - " values: 0.8823235599425719\n", - " values: 0.733970597324987\n", - " values: 0.5696271754971727\n", - " values: 0.8350173497452276\n", - " values: 0.9302611112741331\n", - " values: 0.085730512951118\n", - " values: 0.3260059956477296\n", - " values: 0.9599402637813182\n", - " values: 0.17161133880228752\n", - " values: 0.5602601381442434\n", - " values: 0.6723815023775268\n", - " values: 0.7078626873859801\n", - " values: 0.7496493694017511\n", - " values: 0.5677968849211822\n", - " values: 0.9603337925981938\n", - " values: 0.25382929789896536\n", - " values: 0.4385898470949069\n", - " values: 0.3138678435894573\n", - " values: 0.014716958785869316\n", - " values: 0.8328494171577923\n", - " values: 0.5258691205199649\n", - " values: 0.9834458233457017\n", - " values: 0.8299393874252645\n", - " values: 0.9479573125486154\n", - " values: 0.5243863173442517\n", - " values: 0.6362091138797941\n", - " values: 0.5331937898727952\n", - " values: 0.11332070887964063\n", - " values: 0.7487479278612228\n", - " values: 0.9928224639029607\n", - " values: 0.8502747017784754\n", - " values: 0.0321492211390938\n", - " values: 0.34307485934605775\n", - " values: 0.8787030807910386\n", - " values: 0.9319853617653254\n", - " values: 0.48388167639980806\n", - " values: 0.7705939507093756\n", - " values: 0.41580560999962324\n", - " values: 0.7163837582563678\n", - " values: 0.9146320183508799\n", - " values: 0.6971199681031134\n", - " values: 0.5539744623288142\n", - " values: 0.25995074498950166\n", - " values: 0.9494048850887903\n", - " values: 0.9000981143723509\n", - " values: 0.008773296862421343\n", - " values: 0.7096514746184078\n", - " values: 0.02064151322069885\n", - " values: 0.5775845783029481\n", - " values: 0.19856229453824958\n", - " values: 0.24536839099750452\n", - " values: 0.3795205620190526\n", - " values: 0.4566006281824123\n", - " values: 0.27488251204081726\n", - " values: 0.5230736920721154\n", - " values: 0.944786925908848\n", - " values: 0.40578249769908437\n", - " values: 0.7030616018485285\n", - " values: 0.1840656119435634\n", - " values: 0.30121888994181156\n", - " values: 0.19815642221456198\n", - " values: 0.49897954392454935\n", - " values: 0.5367149427022465\n", - " values: 0.9138835741389495\n", - " values: 0.5667413688454215\n", - " values: 0.6953082201603188\n", - " values: 0.5707191680455059\n", - " values: 0.112579217486654\n", - " values: 0.7935170856924955\n", - " values: 0.04482086979683375\n", - " values: 0.13114584183372735\n", - " values: 0.5591425594559639\n", - " values: 0.419359076001929\n", - " values: 0.2902845471556895\n", - " values: 0.7933085568467363\n", - " values: 0.19502077327703005\n", - " values: 0.7252628320221692\n", - " values: 0.49568307297056735\n", - " values: 0.026721004773544332\n", - " values: 0.2012609186244132\n", - " values: 0.21566624700097836\n", - " values: 0.11319887296239373\n", - " values: 0.05322925310391857\n", - " values: 0.9061548739680476\n", - " values: 0.5489280987735055\n", - " values: 0.542982362073632\n", - " values: 0.08366846681967754\n", - " values: 0.2572692705243168\n", - " values: 0.49416904551079566\n", - " values: 0.32230111011811136\n", - " values: 0.7591235832328593\n", - " values: 0.22041583463594616\n", - " values: 0.9170683383323374\n", - " values: 0.5344754610086917\n", - " values: 0.564590851997434\n", - " values: 0.12815992080600713\n", - " values: 0.8719111483012745\n", - " values: 0.035840622603644734\n", - " values: 0.6760823684252939\n", - " values: 0.8501341063860512\n", - " values: 0.7341254275366301\n", - " values: 0.9090459841266889\n", - " values: 0.07242515674522643\n", - " values: 0.9536426693629991\n", - " values: 0.7350260813438712\n", - " values: 0.6288298247965987\n", - " values: 0.7931915805484405\n", - " values: 0.17024771017234186\n", - " values: 0.953252686301089\n", - " values: 0.7540189984426959\n", - " values: 0.7532987512070413\n", - " values: 0.9929276810306974\n", - " values: 0.5713769353402813\n", - " values: 0.8249831085323256\n", - " values: 0.08069521883648301\n", - " values: 0.5695828449612735\n", - " values: 0.3620309940389933\n", - " values: 0.932151964546219\n", - " values: 0.14000218826010258\n", - " values: 0.2565483179525061\n", - " values: 0.12472709333907672\n", - " values: 0.8783578053336435\n", - " values: 0.8498249761122714\n", - " values: 0.43682317822049754\n", - " values: 0.17018463173500065\n", - " values: 0.3926843519548764\n", - " values: 0.302441440408318\n", - " values: 0.7363589688121549\n", - " values: 0.45900581547840913\n", - " values: 0.2236886879049732\n", - " values: 0.6273578319298534\n", - " values: 0.6294505669649296\n", - " values: 0.49730292070432236\n", - " values: 0.009527472486263622\n", - " values: 0.27833314596730263\n", - " values: 0.7149960197384322\n", - " values: 0.9732186795495434\n", - " values: 0.4448929993535524\n", - " values: 0.538517439034856\n", - " values: 0.08173441497780032\n", - " values: 0.9864220830735781\n", - " values: 0.273003929918351\n", - " values: 0.09591969149079482\n", - " values: 0.850005546063552\n", - " values: 0.35179177338337897\n", - " values: 0.8640085165206244\n", - " values: 0.5233229508243511\n", - " values: 0.9003830249424318\n", - " values: 0.9183543156670848\n", - " values: 0.42028752080260257\n", - " values: 0.668557111849264\n", - " values: 0.9993036693900328\n", - " values: 0.5789869826427709\n", - " values: 0.778659399146549\n", - " values: 0.1552856832480649\n", - " values: 0.403152439838838\n", - " values: 0.9706977970836598\n", - " values: 0.17918312695083116\n", - " values: 0.7622577911849607\n", - " values: 0.7919950174725843\n", - " values: 0.5857861816580721\n", - " values: 0.25197663376295276\n", - " values: 0.5412053051748058\n", - " values: 0.09858777854079204\n", - " values: 0.6150346708058114\n", - " values: 0.9328979768920286\n", - " values: 0.9044363189250925\n", - " values: 0.559176995740771\n", - " values: 0.1494730291537517\n", - " values: 0.6888998931163487\n", - " values: 0.2975138608576282\n", - " values: 0.9389664151771026\n", - " values: 0.8285814027545962\n", - " values: 0.8464201527440463\n", - " values: 0.04546503717293271\n", - " values: 0.37853901600330364\n", - " values: 0.2797125426563424\n", - " values: 0.3209557534350721\n", - " values: 0.01226286876314131\n", - " values: 0.5134745626594431\n", - " values: 0.34564719406384126\n", - " values: 0.5481530262116232\n", - " values: 0.276811016700345\n", - " values: 0.4534978552924782\n", - " values: 0.6255281920097239\n", - " values: 0.2413858038446035\n", - " values: 0.3076962791723832\n", - " values: 0.40603124182377315\n", - " values: 0.3086621982490061\n", - " values: 0.1437331233994702\n", - " values: 0.1255991648072735\n", - " values: 0.9271479436232434\n", - " values: 0.32338121280380927\n", - " values: 0.5806125138393727\n", - " values: 0.4466621712821769\n", - " values: 0.7966711518075326\n", - " values: 0.27877216289455853\n", - " values: 0.7932192259052537\n", - " values: 0.16739908835122053\n", - " values: 0.3896623336313255\n", - " values: 0.44152757454411873\n", - " values: 0.9609342343030184\n", - " values: 0.4300305574891332\n", - " values: 0.03772930218876691\n", - " values: 0.10900720423108778\n", - " values: 0.1574385720583351\n", - " values: 0.5116762708239543\n", - " values: 0.3998389439060407\n", - " values: 0.03338422468319402\n", - " values: 0.3990138778909599\n", - " values: 0.210985165243171\n", - " values: 0.7063235960084482\n", - " values: 0.35818005531503994\n", - " values: 0.19875977937493017\n", - " values: 0.09954845660572298\n", - " values: 0.969049376647686\n", - " values: 0.8404252755939952\n", - " values: 0.8701935122100497\n", - " values: 0.12698995075507324\n", - " values: 0.3687442759603681\n", - " values: 0.9347781458087433\n", - " values: 0.7667640427586535\n", - " values: 0.07629811846914081\n", - " values: 0.20970740776529218\n", - " values: 0.2685408167480068\n", - " values: 0.5076886141183455\n", - " values: 0.6011676038953925\n", - " values: 0.12091280816746264\n", - " values: 0.8091541559771682\n", - " values: 0.8995615527810743\n", - " values: 0.06929060965454181\n", - " values: 0.17753071167227785\n", - " values: 0.8133260883044017\n", - " values: 0.8589720175195685\n", - " values: 0.9336864659890087\n", - " values: 0.6768455889044129\n", - " values: 0.2638655191001119\n", - " values: 0.9507694756291761\n", - " values: 0.24690415797640852\n", - " values: 0.7832166085385622\n", - " values: 0.8731473079215657\n", - " values: 0.29236725593755364\n", - " values: 0.6765269724417613\n", - " values: 0.8169304642588561\n", - " values: 0.2526842624685981\n", - " values: 0.2994039873765125\n", - " values: 0.4197211357689281\n", - " values: 0.411687236443233\n", - " values: 0.05944284012558332\n", - " values: 0.7603469257491514\n", - " values: 0.37863125453254187\n", - " values: 0.1430736568345673\n", - " values: 0.9509137166407023\n", - " values: 0.6789831094676481\n", - " values: 0.2543115547281979\n", - " values: 0.7285781373868861\n", - " values: 0.8224295468229845\n", - " values: 0.11807445663216187\n", - " values: 0.8015447555088723\n", - " values: 0.2573733836316786\n", - " values: 0.24585026623080364\n", - " values: 0.24076836622223896\n", - " values: 0.9729463624245652\n", - " values: 0.4548457530914721\n", - " values: 0.4706016801697369\n", - " values: 0.12923173456874426\n", - " values: 0.5503704712987648\n", - " values: 0.25388420395153743\n", - " values: 0.7580523814652274\n", - " values: 0.13126194925037526\n", - " values: 0.4037522209819333\n", - " values: 0.3714636961466423\n", - " values: 0.9346183399968756\n", - " values: 0.41742734070362886\n", - " values: 0.15409673026375892\n", - " values: 0.6021763830491289\n", - " values: 0.846672082658356\n", - " values: 0.12423825248053977\n", - " values: 0.6868477069420822\n", - " values: 0.0759550512481525\n", - " values: 0.5067646660361566\n", - " values: 0.7856327708459713\n", - " values: 0.3631801570285813\n", - " values: 0.25703694531748844\n", - " values: 0.12943974691818727\n", - " values: 0.8714725804319144\n", - " values: 0.421640733731833\n", - " values: 0.026442101268956297\n", - " values: 0.13616254036264086\n", - " values: 0.4032943006647307\n", - " values: 0.8377019859641086\n", - " values: 0.5797136730312334\n", - " values: 0.46748579413587255\n", - " values: 0.047817981296037315\n", - " values: 0.3742264697609722\n", - " values: 0.9260596735871129\n", - " values: 0.9168240583346488\n", - " values: 0.026712191380598105\n", - " values: 0.858602547884268\n", - " values: 0.4482814102365975\n", - " values: 0.491917511718446\n", - " values: 0.29463091802129937\n", - " values: 0.8358501503690211\n", - " values: 0.8503235456924544\n", - " values: 0.40391688613790955\n", - " values: 0.0701343040305088\n", - " values: 0.4745823520941944\n", - " values: 0.9029320859449049\n", - " values: 0.4503531083546918\n", - " values: 0.24635242652824607\n", - " values: 0.9379058309791022\n", - " values: 0.3987017084261504\n", - " values: 0.12215298971897803\n", - " values: 0.40341739296019163\n", - " values: 0.4967405901301486\n", - " values: 0.7610197742613506\n", - " values: 0.7360065464236473\n", - " values: 0.251974801937636\n", - " values: 0.9671917696069435\n", - " values: 0.10456468432260813\n", - " values: 0.6614612311553544\n", - " values: 0.8687510717037961\n", - " values: 0.05868205353576994\n", - " values: 0.5329304736613242\n", - " values: 0.2863842640000569\n", - " values: 0.7180643725465106\n", - " values: 0.12754145991850885\n", - " values: 0.2897552735151431\n", - " values: 0.10304121398593247\n", - " values: 0.09318368358363638\n", - " values: 0.36525961573507093\n", - " values: 0.003011313936758575\n", - " values: 0.7596195244911024\n", - " values: 0.5451693156647526\n", - " values: 0.6358854779051621\n", - " values: 0.2725727860091439\n", - " values: 0.12988115942365364\n", - " values: 0.4392426474375739\n", - " values: 0.8605539045993147\n", - " values: 0.13609102664816464\n", - " values: 0.751828337067231\n", - " values: 0.3344234856497711\n", - " values: 0.17651451228995296\n", - " values: 0.4560547813327971\n", - " values: 0.8411605235157206\n", - " values: 0.5385277879408291\n", - " values: 0.2711168710176214\n", - " values: 0.6912197035883472\n", - " values: 0.9346325117337705\n", - " values: 0.7808561250712892\n", - " values: 0.6335569708239671\n", - " values: 0.26499619542150754\n", - " values: 0.20949712253438735\n", - " values: 0.2684525540688789\n", - " values: 0.35390862682236324\n", - " values: 0.6463373911790108\n", - " values: 0.7866178467130873\n", - " values: 0.08516742519947895\n", - " values: 0.2241413818967387\n", - " values: 0.14430747570541047\n", - " values: 0.5611145233899633\n", - " values: 0.31271661151347874\n", - " values: 0.5990164605536633\n", - " values: 0.9092589659087726\n", - " values: 0.30880076800872247\n", - " values: 0.9532213078962992\n", - " values: 0.7835929639488887\n", - " values: 0.4399492468694832\n", - " values: 0.13015117862073378\n", - " values: 0.9872450750763808\n", - " values: 0.9955715196049365\n", - " values: 0.111619561700122\n", - " values: 0.8601859617989108\n", - " values: 0.12256895905002796\n", - " values: 0.3768730160527528\n", - " values: 0.8325151286888005\n", - " values: 0.2963666837965908\n", - " values: 0.11105890943463692\n", - " values: 0.4174293055087349\n", - " values: 0.4783949994336353\n", - " values: 0.20665456715907438\n", - " values: 0.03774481978849786\n", - " values: 0.8996315532454533\n", - " values: 0.9297944483662742\n", - " values: 0.393784257827529\n", - " values: 0.6678005089923453\n", - " values: 0.04011207645732329\n", - " values: 0.509632230242221\n", - " values: 0.2569122760130199\n", - " values: 0.40342736206781404\n", - " values: 0.8246619667884595\n", - " values: 0.8496489919433845\n", - " values: 0.08582446297128599\n", - " values: 0.33939438015737333\n", - " values: 0.09319400646900222\n", - " values: 0.02663915870064215\n", - " values: 0.9788174759544884\n", - " values: 0.6097687931300745\n", - " values: 0.9532361105070625\n", - " values: 0.0015798867987968368\n", - " values: 0.8882840572040731\n", - " values: 0.5322430312923632\n", - " values: 0.1738081658937669\n", - " values: 0.40878404844834026\n", - " values: 0.774837385057174\n", - " values: 0.6483242913820617\n", - " values: 0.53374185513516\n", - " values: 0.11059486089591986\n", - " values: 0.34912679754213105\n", - " values: 0.28183821905862516\n", - " values: 0.23333213467323555\n", - " values: 0.7112757818053341\n", - " values: 0.238558069642419\n", - " values: 0.3706436886737656\n", - " values: 0.06523055282784507\n", - " values: 0.21961186071143068\n", - " values: 0.5923917111823842\n", - " values: 0.439367831611718\n", - " values: 0.32517125920671475\n", - " values: 0.7377119867571327\n", - " values: 0.3743469783612958\n", - " values: 0.6050554776678365\n", - " values: 0.5635606797546017\n", - " values: 0.703353620401727\n", - " values: 0.8139659306699663\n", - " values: 0.061567129859247616\n", - " values: 0.3105298484121516\n", - " values: 0.8298542068206634\n", - " values: 0.3096386293383021\n", - " values: 0.2689431716091151\n", - " values: 0.28842728430722975\n", - " values: 0.21124434864873542\n", - " values: 0.14708622835540763\n", - " values: 0.48644381443092954\n", - " values: 0.19684129634435676\n", - " values: 0.08270150814922528\n", - " values: 0.9516970403641595\n", - " values: 0.950825780064431\n", - " values: 0.21581181385533732\n", - " values: 0.7788293836347402\n", - " values: 0.026129742574298787\n", - " values: 0.7146848568512404\n", - " values: 0.31655713763416593\n", - " values: 0.3400160812659132\n", - " values: 0.24619366736061887\n", - " values: 0.9345567992529578\n", - " values: 0.7207843263800611\n", - " values: 0.4802938852560793\n", - " values: 0.5882251478244057\n", - " values: 0.597376370492188\n", - " values: 0.047389556086804396\n", - " values: 0.2691252825103355\n", - " values: 0.06039961422913909\n", - " values: 0.6561738024461861\n", - " values: 0.6217700407519451\n", - " values: 0.7611077408132957\n", - " values: 0.9602815302513494\n", - " values: 0.1822575667892845\n", - " values: 0.5664221020248803\n", - " values: 0.8366560443511608\n", - " values: 0.7448274487999165\n", - " values: 0.4414716514983362\n", - " values: 0.37008913215800576\n", - " values: 0.5223847001257356\n", - " values: 0.039718144281731704\n", - " values: 0.07003672560834573\n", - " values: 0.42547166795304014\n", - " values: 0.4435013803058856\n", - " values: 0.1624962637269236\n", - " values: 0.6853128550753754\n", - " values: 0.7557098279363763\n", - " values: 0.7589232058107265\n", - " values: 0.8686713841601104\n", - " values: 0.41887751952933205\n", - " values: 0.5024352752601032\n", - " values: 0.7409763245812273\n", - " values: 0.1790214520585407\n", - " values: 0.4867550326305259\n", - " values: 0.5528404260521127\n", - " values: 0.03979410619482093\n", - " values: 0.5090184134734697\n", - " values: 0.2504015119608278\n", - " values: 0.6684089819713986\n", - " values: 0.6604954416316245\n", - " values: 0.15705298937359147\n", - " values: 0.3318305009338641\n", - " values: 0.9722486604898151\n", - " values: 0.5005235821058707\n", - " values: 0.7982253235671071\n", - " values: 0.5490609051552953\n", - " values: 0.47287251000745145\n", - " values: 0.613227252187827\n", - " values: 0.7920239276743556\n", - " values: 0.03954996384701914\n", - " values: 0.7666887466321749\n", - " values: 0.735092086378898\n", - " values: 0.5312634811871918\n", - " values: 0.43230376548852034\n", - " values: 0.5312358403012936\n", - " values: 0.6770071555479892\n", - " values: 0.345503304869635\n", - " values: 0.37078434252413395\n", - " values: 0.3377350535534914\n", - " values: 0.3500488657191112\n", - " values: 0.9698692426520431\n", - " values: 0.7736231723042446\n", - " values: 0.10789461429300018\n", - " values: 0.38082233459342196\n", - " values: 0.984838687638348\n", - " values: 0.9683082164201839\n", - " values: 0.6569659568769912\n", - " values: 0.674349634286518\n", - " values: 0.09560396731679122\n", - " values: 0.854815490288653\n", - " values: 0.7084915013066769\n", - " values: 0.8986435021083526\n", - " values: 0.7358256453909476\n", - " values: 0.46491719664706355\n", - " values: 0.7515300853592601\n", - " values: 0.38370141817820325\n", - " values: 0.16001364360598058\n", - " values: 0.7694804594191055\n", - " values: 0.6796671925567934\n", - " values: 0.22712144277232027\n", - " values: 0.4437395244106861\n", - " values: 0.296328720399331\n", - " values: 0.6190527024484993\n", - " values: 0.4332062790598099\n", - " values: 0.8939576498027775\n", - " values: 0.5593274338206903\n", - " values: 0.4653369936054328\n", - " values: 0.042741042529305884\n", - " values: 0.3771371715828278\n", - " values: 0.396307160231545\n", - " values: 0.5490910317081658\n", - " values: 0.7164393199005844\n", - " values: 0.7101149804135912\n", - " values: 0.3340930466059656\n", - " values: 0.451592835540773\n", - " values: 0.20314419135672113\n", - " values: 0.4199307446114321\n", - " values: 0.4516435543118411\n", - " values: 0.31852359896664506\n", - " values: 0.18951603364347958\n", - " values: 0.886769898060098\n", - " values: 0.6188339287024962\n", - " values: 0.16144570806476022\n", - " values: 0.16345201174416824\n", - " values: 0.1742034834311299\n", - " values: 0.5567121794180873\n", - " values: 0.8965890704589345\n", - " values: 0.34283945755516976\n", - " values: 0.9394261281044933\n", - " values: 0.20235446302342863\n", - " values: 0.28679783387001956\n", - " values: 0.52862959458994\n", - " values: 0.038847159278550536\n", - " values: 0.6142707527677586\n", - " values: 0.15042934463288282\n", - " values: 0.5777053657975023\n", - " values: 0.7054292993326041\n", - " values: 0.9091213599169915\n", - " values: 0.6524798644836082\n", - " values: 0.8012867563617284\n", - " values: 0.9611337407318353\n", - " values: 0.06253041973517492\n", - " values: 0.273785686273178\n", - " values: 0.5997565342975181\n", - " values: 0.5758718298752356\n", - " values: 0.960330073752839\n", - " values: 0.7904602624316882\n", - " values: 0.9142698108991233\n", - " values: 0.04248413170435006\n", - " values: 0.8914884341643144\n", - " values: 0.7228223588980498\n", - " values: 0.3837908997748416\n", - " values: 0.48018490613682197\n", - " values: 0.026673821506872253\n", - " values: 0.8956279671167092\n", - " values: 0.8758779463188948\n", - " values: 0.20139213249231736\n", - " values: 0.5127573005832172\n", - " }\n", - "}\n", - "\n", - "Response:\n", - "{'data': {'names': ['t:0', 't:1', 't:2', 't:3', 't:4', 't:5', 't:6', 't:7', 't:8', 't:9'], 'tensor': {'shape': [1, 10], 'values': [1.48347365e-17, 2.75936967e-34, 0.966874599, 0.0310300216, 2.9558217e-28, 0.00209478312, 1.02384538e-13, 1.48587807e-13, 5.29912654e-07, 1.38094071e-18]}}, 'meta': {}}\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "r = sc.predict(gateway=\"ambassador\",transport=\"rest\",shape=(1,784))\n", "print(r)\n", @@ -1842,21 +710,9 @@ }, { "cell_type": "code", - "execution_count": 12, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Success:True message:\n", - "Request:\n", - "{'meta': {}, 'data': {'tensor': {'shape': [1, 784], 'values': [0.47209083184647593, 0.8838373150382969, 0.9181145850457837, 0.24859620806264326, 0.23293720880908908, 0.4941481171884624, 0.10725857979635278, 0.5287047511828012, 0.19695290280618072, 0.10247878859133952, 0.9738834180569024, 0.21298312177597456, 0.7460646984755017, 0.7849562914857755, 0.5704135117601201, 0.02792477113467806, 0.7793940787278147, 0.606568611346314, 0.29803598789024754, 0.1326626326173992, 0.32915350266835375, 0.0883570944110672, 0.7607531788790823, 0.1623233904716811, 0.5821722444997973, 0.6970934469577975, 0.35932488456489753, 0.06432456300653788, 0.9265409211003779, 0.38557298397196615, 0.9963670945752263, 0.37694931788140484, 0.16640281034611637, 0.9045008098130327, 0.305694315056507, 0.7073745635364587, 0.23511637628623283, 0.4853187768831849, 0.8487579535826453, 0.9742161341598627, 0.2840885206281021, 0.9946856297748927, 0.20052979354792833, 0.7052308229990519, 0.7816445781358587, 0.9641751912908683, 0.8009730609813319, 0.20525311831057635, 0.17804631307550012, 0.32294296644305454, 0.22608903077216602, 0.6684456585413396, 0.17319867096341646, 0.1359225577596581, 0.19271881055181728, 0.9007234700346303, 0.6036351882523099, 0.37590296271040147, 0.22239192537896624, 0.4902561773551054, 0.5152205571873875, 0.27018092125292825, 0.5428585446231049, 0.9505027222941741, 0.31436977354273665, 0.5363975522028566, 0.6973076187350311, 0.5385679200411694, 0.3046181780524051, 0.9795945243622183, 0.6688625475855863, 0.27797121684342874, 0.7698168684612438, 0.6405064896531694, 0.741136641010486, 0.4422756346986155, 0.5020037498161358, 0.45267571835522624, 0.6987439551430717, 0.07023790256343765, 0.06538735896120074, 0.8447674465772355, 0.6834811377368004, 0.026655828948662252, 0.628407066460694, 0.7569493959847295, 0.5277510788613616, 0.9515171094715688, 0.0422695830276012, 0.7843265416837605, 0.46317391631367033, 0.583661958205498, 0.3644196723211566, 0.26096235874249907, 0.3948508616615424, 0.0023061899186325174, 0.45307204390142086, 0.8516423964629364, 0.03707642073067863, 0.9271640937902405, 0.409206302378464, 0.661599798590934, 0.027983004135873735, 0.588005676007795, 0.2828618373713707, 0.7877912809062873, 0.343145658281636, 0.07377717295125297, 0.6071652489063395, 0.6007041775493313, 0.23223753649321188, 0.7612948390663158, 0.44447266321239565, 0.9273598123195708, 0.282978441929136, 0.2128351693570546, 0.1429002965300663, 0.7439925843340691, 0.7167155918625596, 0.724251714444177, 0.8725660162835415, 0.7424029115069352, 0.9916136416330926, 0.8482468061429691, 0.7436136762568578, 0.3679970021888629, 0.5046901155711218, 0.45718301949304396, 0.8602511895942554, 0.26069535790710174, 0.6957808747450142, 0.12463938278567599, 0.49036698498767084, 0.9166202047688227, 0.9589055767319941, 0.5197770404503094, 0.10754965761372348, 0.30627239870310063, 0.9939793276058694, 0.6872347042768607, 0.598788096267154, 0.5565468005777939, 0.08563594120260676, 0.7519502681021503, 0.644847542639883, 0.027710472980757905, 0.14069045123233948, 0.7810300575219142, 0.4795574487611761, 0.30901153601434916, 0.9581244787569426, 0.03214852586373984, 0.29481851385874014, 0.797765241930748, 0.19345404846072112, 0.5286088784173252, 0.5883122340074208, 0.04195058450608091, 0.06812170861295319, 0.15536689368634182, 0.7908763541239359, 0.07913898022548893, 0.1405428597409839, 0.7178766992095842, 0.2201986029432006, 0.3444018253089439, 0.6590924926281457, 0.027922953628436775, 0.6229219392541856, 0.7942818701382509, 0.08641977471547879, 0.4292054462303935, 0.7971997103423022, 0.7799101458336517, 0.4134929471507769, 0.28154573972838737, 0.8501706069059192, 0.06684091159580718, 0.40661794048439004, 0.1218763457740969, 0.9645344066460255, 0.05521652568124946, 0.7343069369873275, 0.5658627483379838, 0.4678796722196298, 0.863310136820279, 0.5238952155905634, 0.5065908081612522, 0.8294390661468148, 0.37451807408930027, 0.48477800757953404, 0.6953102725753888, 0.3405941116011548, 0.9030593326629215, 0.627887410950056, 0.16175630415580455, 0.2243601258247344, 0.3867521046378264, 0.22379942072598824, 0.4672441342611249, 0.32023905668140473, 0.4281673649020987, 0.035325685079042546, 0.15052927926842696, 0.3261764676491624, 0.8754562200858411, 0.740298727265006, 0.8493116011785045, 0.8463625535751811, 0.9362019934714408, 0.6405404218633977, 0.20887994136306554, 0.5507118599414694, 0.42999328670310766, 0.878822876952522, 0.9237888711710195, 0.21240648069290158, 0.9519785205771032, 0.02488214966365554, 0.03137960908790016, 0.7735585549553864, 0.8816583369145903, 0.0343463916468264, 0.30414554854446596, 0.003463422658347759, 0.928870680878914, 0.4717206133485732, 0.492056523484678, 0.8177266349964164, 0.3687465976380361, 0.3365510245139989, 0.6791977410609507, 0.6023662735170212, 0.35347157840834176, 0.9927939329493394, 0.20929105648466795, 0.302123303331166, 0.4914889551685664, 0.5400037187498605, 0.9830929767399018, 0.22714530615050754, 0.5789590661583232, 0.6897981142287198, 0.10889691271550894, 0.4384196300591371, 0.5228435516331674, 0.4969421216198292, 0.8020903072873768, 0.46635386929247746, 0.7696579472858122, 0.23824577875570807, 0.35125022203987966, 0.6359415865736422, 0.3485456913357483, 0.7336629849891037, 0.3838575696675358, 0.6505575293374803, 0.9275884825202618, 0.7306400550700054, 0.3058299729225683, 0.2668252081663548, 0.09898795146480266, 0.9378669095406443, 0.6264911589377825, 0.0803887329166918, 0.871824757436611, 0.3115981971110533, 0.3552258703702187, 0.12219804034887849, 0.0730451300088304, 0.9501148063114484, 0.11421157046467201, 0.236780210006315, 0.3333738056400689, 0.408002673850983, 0.19708856276958064, 0.4035926356056353, 0.9108541896638964, 0.328496423547042, 0.7591337908099229, 0.040319480766025095, 0.4138100395090991, 0.2718520074516634, 0.5078152310846948, 0.9045921508298108, 0.2167820508550541, 0.33347100044084166, 0.5691623649172347, 0.059086512190570484, 0.8243671033660146, 0.07204175512754307, 0.12000607619533055, 0.5286832752621596, 0.8610537903075214, 0.8481749440406554, 0.6973637822533374, 0.6475937624876916, 0.4085898069490911, 0.7992534786573317, 0.20882979595089513, 0.34581762307733177, 0.5003232822347654, 0.3843766061038987, 0.8411500761248792, 0.18018689081677175, 0.5253280752693897, 0.5724702778732659, 0.9806680534270276, 0.3847449420524539, 0.9430258811514864, 0.8603329386940549, 0.7929652560414097, 0.266828373449958, 0.03952941375940333, 0.6549656093830053, 0.14152709113787532, 0.787167929129303, 0.259619280311448, 0.4533151745029852, 0.454118004461032, 0.8345408782817395, 0.8221526863643673, 0.3481590895146328, 0.5367162452404466, 0.4294252467999541, 0.3889998554079842, 0.3418332127406666, 0.5709287224375224, 0.17035806778661966, 0.6764058068098342, 0.44872194319684133, 0.7950615571819444, 0.4646533693305245, 0.9725239680094071, 0.005476824262743318, 0.19914431292621704, 0.4925242682269947, 0.48260992546534165, 0.2909949297110176, 0.6566314968415025, 0.44440408686108934, 0.3967527076640256, 0.5101739312203654, 0.6768335643056183, 0.18581916702243795, 0.44935273789152186, 0.13863215244214333, 0.7380405681194989, 0.863159014140691, 0.7934827490975779, 0.6247756031028584, 0.5286525682943479, 0.4447449074956633, 0.2624615617293766, 0.5804750089816443, 0.5032150461794586, 0.2929708813668864, 0.739082405614764, 0.5257210368061717, 0.04581074257934703, 0.552344127982606, 0.973586868366023, 0.36545859799316516, 0.370268863583197, 0.8876758840952345, 0.7913075686633906, 0.8317001946992272, 0.986314295068825, 0.8834812342998419, 0.316017224999796, 0.7277287069082552, 0.3420587315387572, 0.054810008370773766, 0.3815081063219917, 0.16672760047661872, 0.7760106435710138, 0.9935306111577131, 0.19517100091548711, 0.2868603953529657, 0.5743120318167182, 0.7901441139022825, 0.5157002827851968, 0.43361141475413434, 0.04533569350178357, 0.00908661666738253, 0.3178585490523962, 0.2686980125322316, 0.07423104248835954, 0.3279763742202987, 0.9601626795685374, 0.752670971985685, 0.43883230417832, 0.9579146263336628, 0.07939534717623775, 0.06594083665462158, 0.9685016794028203, 0.8653914995337819, 0.5991712614990325, 0.6892340494270582, 0.1941142722853184, 0.9863768196189449, 0.2705681966933374, 0.7744808190449916, 0.1399563285915656, 0.212412624788058, 0.98474633716238, 0.6796894522020704, 0.9872514875238475, 0.921756150184594, 0.6583964448611601, 0.9605781392491913, 0.2709662432358748, 0.32265219915294274, 0.7658751429377155, 0.872963927439459, 0.41740803900503276, 0.199142773064663, 0.9431075794580247, 0.7456597313362159, 0.8020654452549147, 0.12175916436925183, 0.6052463634204198, 0.48748291217729256, 0.6514744546160767, 0.9943668103729445, 0.06562262082862658, 0.05985862081952009, 0.5412436299424798, 0.19110446460812447, 0.928732316553108, 0.8426617355500626, 0.9358134713441078, 0.747663047686213, 0.8702098190212978, 0.9145815358251143, 0.9623111255921901, 0.556191330369937, 0.5350011038388929, 0.890621150696471, 0.8527520705572819, 0.8010988183368555, 0.7236127713773604, 0.47054721890933726, 0.7587369070033196, 0.5107816139808784, 0.4190674412194352, 0.21784018602324484, 0.44017796025360756, 0.7872618242426632, 0.20794907993486256, 0.9916174667571579, 0.9051880668359634, 0.9318957509917497, 0.12647160035260907, 0.18141186639132834, 0.48650416851409706, 0.2894128000876053, 0.29722710544030173, 0.5456459387795368, 0.8704900448288221, 0.12638773513156676, 0.20600578910526168, 0.21465930941187839, 0.23415059978453479, 0.4491197828099335, 0.9488254533290725, 0.2398170749597831, 0.06169514929465225, 0.7097961939357247, 0.9131333468327416, 0.2247982882691204, 0.18085980533832313, 0.6742144643351851, 0.7393985087526693, 0.21075831841962778, 0.4103042820619752, 0.5787298531829382, 0.9210908371084175, 0.16987392107321508, 0.10616995448509925, 0.9401242382685034, 0.5583922752182234, 0.8512953150296644, 0.2850720850183087, 0.5699407464417716, 0.4847977039421052, 0.9999004876102908, 0.7503777935611753, 0.6276940933714206, 0.05775246886565255, 0.2061187779307565, 0.8806765197889713, 0.8357234606936236, 0.8323059225482385, 0.9117119199161854, 0.49528636540220816, 0.5911604280420939, 0.17704028461894838, 0.3408194156046882, 0.5225949000059471, 0.5362220451842812, 0.526713261399165, 0.2545149027349616, 0.05539012865974735, 0.7587760815150464, 0.3023564316837012, 0.24277990302764485, 0.6962196654100498, 0.8714104753129002, 0.046796667499896194, 0.1778938097405629, 0.4520325850141438, 0.62163655482298, 0.34740914105934817, 0.7617603551540251, 0.38619097891649334, 0.07063659858805016, 0.29426329792823736, 0.8003076024166746, 0.6433975932470543, 0.5081624965007524, 0.4780812449022942, 0.2534272428340729, 0.5897953038862579, 0.9137940947104325, 0.20151455810577334, 0.774686031272745, 0.4033970915903179, 0.3920828568544067, 0.36604031717644026, 0.854630601552637, 0.4340196373604053, 0.6823003154088585, 0.7406035154438139, 0.38602533429167485, 0.17498923179336956, 0.03615909274010065, 0.545774542186746, 0.7314767326563041, 0.34660725303834294, 0.06737982385278662, 0.9663717207036022, 0.9126674052779989, 0.614318540821783, 0.9030793373833906, 0.006774701170043085, 0.3039757609453946, 0.08661087098902953, 0.36708084090586857, 0.8527955038132641, 0.29272922240428856, 0.9315010543427967, 0.7603074953854699, 0.0802440245051762, 0.804556035822707, 0.12267222660158572, 0.013704541489903965, 0.6184138426201897, 0.4936428452152388, 0.2796373259782361, 0.16221820329693304, 0.06471396767111204, 0.37411062348111757, 0.3683644473804464, 0.789498982112438, 0.5329042139794582, 0.371874026122785, 0.46248842322494543, 0.8528788057278847, 0.5137063454739463, 0.002880682484862729, 0.6026710639391195, 0.14122397375377105, 0.6638464713457064, 0.5519026452007485, 0.5680532990876237, 0.17772571394449344, 0.7282227395003659, 0.9742711112240345, 0.4391460561696493, 0.35982030395367814, 0.8306029123532283, 0.7651408216248665, 0.43829866405872775, 0.18321170537315812, 0.7150178140695751, 0.04967403908115409, 0.8770917664871549, 0.2442421001453452, 0.9448888515682335, 0.5017848067826373, 0.5786406259169061, 0.6339141345026164, 0.21622418217897932, 0.7585553034343241, 0.7594212811877421, 0.045296642330073134, 0.7236382120343704, 0.30377687106618745, 0.22263316779007947, 0.8267810936061025, 0.47605027832286384, 0.4942255148628497, 0.27782216517813485, 0.3915023197075903, 0.3451778751043656, 0.651591544418787, 0.2867266203578416, 0.5806507596218992, 0.06829690606298144, 0.8275549501248533, 0.4297662965824457, 0.42949854036793766, 0.8636185763520072, 0.41067083827001905, 0.3800757646296382, 0.14691996704533594, 0.674385199096699, 0.09125225915877777, 0.9740388495259313, 0.20529471568173674, 0.7084783202103114, 0.4395144292221105, 0.5622739086204741, 0.972973647870242, 0.8525168791852975, 0.28904650749857186, 0.7609456388078955, 0.2897710368195845, 0.8829515370002321, 0.7822996730486097, 0.7675537462595611, 0.6359266835947512, 0.7317268327880497, 0.49727960546730743, 0.19236916397247716, 0.0002702198960089497, 0.6238910904344986, 0.48350657854443313, 0.22571574673330608, 0.20790641396673515, 0.5640847224538025, 0.2558227549847921, 0.682218862802099, 0.7933319859472042, 0.8176632984334289, 0.8590344581637116, 0.6051886263065774, 0.33484859749340246, 0.7253407201724044, 0.42317687803511317, 0.34201609216513595, 0.3222628683413714, 0.15376665348998786, 0.7888501628064104, 0.6008189290434037, 0.4276812295254413, 0.9877971397828393, 0.8362650287984462, 0.9479745429961567, 0.12289541589821673, 0.6593181582485729, 0.7134528227614213, 0.3073027128479674, 0.8240949294110582, 0.8960613735624486, 0.164951359539809, 0.6924044230384172, 0.30422364197216933, 0.8327068565273399, 0.9682620873453123, 0.39393221021793845, 0.6207768674562115, 0.7791602081346949, 0.6216425826880323, 0.5439309269012221, 0.399998883320941, 0.07008036444511045, 0.515655828376216, 0.2651820532086483, 0.2964690910631955, 0.8447312496717595, 0.267121657531443, 0.6757253807687433, 0.11990988163601923, 0.4791330059470148, 0.6857602019275719, 0.9136114244868613, 0.752855793519951, 0.747355630404103, 0.9276317915603618, 0.11642204972437564, 0.12692966796061833, 0.8514924247719169, 0.6972453659310377, 0.8697480762965908, 0.9314845579127051, 0.5728648636049015, 0.47161829258450216, 0.6794977015997933, 0.4929959386227105, 0.40595497583144424, 0.5741549508839735, 0.6412266003150837, 0.9918475532667549, 0.7451254570769575, 0.8726792789562513, 0.7123901649894392, 0.6304908656434686, 0.8192107775801503, 0.49867700538826343, 0.6367937285610142, 0.6087872825506192, 0.5430037804062361, 0.019482531480218612, 0.7762026748139628, 0.28181259893928734, 0.31825670710315224, 0.3482541692130835, 0.03889069034238479, 0.8148277051166162, 0.6045201338979536, 0.1687491467110962, 0.7840527404628816, 0.4341346125000545, 0.0744630334251869, 0.2614636970141073, 0.222806257020164, 0.6816907608473006, 0.6185998964064066, 0.9868774332729169, 0.822558657243309, 0.39241556810124756, 0.79763427342774, 0.6884445863469614, 0.09068776855280614, 0.7926436663695322, 0.6888672287163125, 0.31804983906196094, 0.877099090705907, 0.3907487340360998, 0.34157038742159185, 0.6260515147824817, 0.259730159689165, 0.61490894679174, 0.8465254470950556, 0.25421113043379595, 0.44142208684190887, 0.6133519644397994, 0.7991549321881197, 0.9599874938132772, 0.9623559384867231, 0.03620324039653888, 0.3194553087206853, 0.22650975576328458, 0.48711261632804015, 0.3580418522906287, 0.4329273397882162, 0.9822700676187989, 0.1617745352021036, 0.08226001301979025, 0.9130352351843993, 0.8641031818608453, 0.8435256842312339, 0.4124937198331623, 0.37819116101082906, 0.4484359302463572, 0.824376797366782, 0.27002473137847705, 0.8351297333417245, 0.10014708403086359, 0.4973306861301242, 0.2800750161748923, 0.5926455132915689, 0.6648935288637702, 0.33363023024041993, 0.15108029183468608, 0.534828082621992, 0.8596342876640728, 0.6997591340903839, 0.9665523282670481, 0.16438456502272758, 0.7958694234133213, 0.6635013395295192]}}}\n", - "Response:\n", - "{'data': {'tftensor': {'dtype': 'DT_FLOAT', 'tensorShape': {'dim': [{'size': '1'}, {'size': '10'}]}, 'floatVal': [3.673101e-19, 8.99173e-31, 0.010555523, 0.7877868, 1.0459939e-33, 0.20165771, 2.191654e-14, 1.8198068e-21, 2.565744e-08, 3.1694407e-21]}}}\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "r = sc.predict(gateway=\"ambassador\",transport=\"grpc\",shape=(1,784))\n", "print(r)\n", @@ -1872,17 +728,9 @@ }, { "cell_type": "code", - "execution_count": 13, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "seldondeployment.machinelearning.seldon.io \"tfserving\" deleted\r\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "!kubectl delete -f ./resources/mnist_rest.yaml" ] @@ -1899,17 +747,9 @@ }, { "cell_type": "code", - "execution_count": 14, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Overwriting ./resources/halfplustwo_rest.yaml\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "%%writefile ./resources/halfplustwo_rest.yaml\n", "apiVersion: machinelearning.seldon.io/v1alpha2\n", @@ -1936,52 +776,27 @@ }, { "cell_type": "code", - "execution_count": 15, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "seldondeployment.machinelearning.seldon.io/hpt created\r\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "!kubectl apply -f ./resources/halfplustwo_rest.yaml" ] }, { "cell_type": "code", - "execution_count": 16, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Waiting for deployment \"hpt-default-0-halfplustwo\" rollout to finish: 0 of 1 updated replicas are available...\n", - "deployment \"hpt-default-0-halfplustwo\" successfully rolled out\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "!kubectl rollout status deploy/$(kubectl get deploy -l seldon-deployment-id=hpt -o jsonpath='{.items[0].metadata.name}')" ] }, { "cell_type": "code", - "execution_count": 17, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{'predictions': [2.5, 3.0, 4.5]}\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "import json\n", "X=!curl -s -d '{\"instances\": [1.0, 2.0, 5.0]}' \\\n", @@ -1994,17 +809,9 @@ }, { "cell_type": "code", - "execution_count": 18, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{'outputs': {'x': {'dtype': 'DT_FLOAT', 'tensorShape': {'dim': [{'size': '3'}]}, 'floatVal': [2.5, 3, 3.5]}}, 'modelSpec': {'name': 'halfplustwo', 'version': '123', 'signatureName': 'serving_default'}}\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "X=!cd ../executor/proto && grpcurl \\\n", " -d '{\"model_spec\":{\"name\":\"halfplustwo\"},\"inputs\":{\"x\":{\"dtype\": 1, \"tensor_shape\": {\"dim\":[{\"size\": 3}]}, \"floatVal\" : [1.0, 2.0, 3.0]}}}' \\\n", @@ -2018,17 +825,9 @@ }, { "cell_type": "code", - "execution_count": 19, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "seldondeployment.machinelearning.seldon.io \"hpt\" deleted\r\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "!kubectl delete -f ./resources/halfplustwo_rest.yaml" ] @@ -2044,17 +843,9 @@ }, { "cell_type": "code", - "execution_count": 20, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Overwriting ./resources/elasticnet_wine.yaml\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "%%writefile ./resources/elasticnet_wine.yaml\n", "apiVersion: machinelearning.seldon.io/v1alpha2\n", @@ -2099,35 +890,18 @@ }, { "cell_type": "code", - "execution_count": 21, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "seldondeployment.machinelearning.seldon.io/mlflow created\r\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "!kubectl apply -f ./resources/elasticnet_wine.yaml" ] }, { "cell_type": "code", - "execution_count": 22, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Waiting for deployment \"mlflow-default-0-classifier\" rollout to finish: 0 of 1 updated replicas are available...\n", - "deployment \"mlflow-default-0-classifier\" successfully rolled out\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "!kubectl rollout status deploy/$(kubectl get deploy -l seldon-deployment-id=mlflow -o jsonpath='{.items[0].metadata.name}')" ] @@ -2141,17 +915,9 @@ }, { "cell_type": "code", - "execution_count": 24, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{'data': {'names': [], 'ndarray': [5.275558760255382]}, 'meta': {}}\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "X=!curl -s -d '{\"data\": {\"ndarray\":[[0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,1.1]]}}' \\\n", " -X POST http://localhost:8003/seldon/seldon/mlflow/api/v1.0/predictions \\\n", @@ -2162,7 +928,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -2172,40 +938,9 @@ }, { "cell_type": "code", - "execution_count": 26, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Success:True message:\n", - "Request:\n", - "meta {\n", - "}\n", - "data {\n", - " tensor {\n", - " shape: 1\n", - " shape: 11\n", - " values: 0.358817295772466\n", - " values: 0.42774982123748906\n", - " values: 0.7525229974243451\n", - " values: 0.4837952054509831\n", - " values: 0.03971051054852981\n", - " values: 0.7977411786519535\n", - " values: 0.843901872160243\n", - " values: 0.5876114963145197\n", - " values: 0.6716037188345559\n", - " values: 0.8544908465852457\n", - " values: 0.3759460042213313\n", - " }\n", - "}\n", - "\n", - "Response:\n", - "{'data': {'names': [], 'tensor': {'shape': [1], 'values': [5.2069715754680725]}}, 'meta': {}}\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "r = sc.predict(gateway=\"ambassador\",transport=\"rest\",shape=(1,11))\n", "print(r)\n", @@ -2221,17 +956,9 @@ }, { "cell_type": "code", - "execution_count": 27, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{'meta': {}, 'data': {'ndarray': [5.275558760255382]}}\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "X=!cd ../executor/proto && grpcurl -d '{\"data\":{\"ndarray\":[[0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,1.1]]}}' \\\n", " -rpc-header seldon:mlflow -rpc-header namespace:seldon \\\n", @@ -2243,21 +970,9 @@ }, { "cell_type": "code", - "execution_count": 28, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Success:True message:\n", - "Request:\n", - "{'meta': {}, 'data': {'tensor': {'shape': [1, 11], 'values': [0.35040541408334647, 0.9104661327491711, 0.4362897953086141, 0.07252654389819702, 0.5452850097930405, 0.8161583853649494, 0.9842675249693481, 0.6805591646597872, 0.6430042482083499, 0.7862682374046126, 0.5803183012135262]}}}\n", - "Response:\n", - "{'meta': {}, 'data': {'tensor': {'shape': [1], 'values': [5.226165754389033]}}}\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "r = sc.predict(gateway=\"ambassador\",transport=\"grpc\",shape=(1,11))\n", "print(r)\n", @@ -2266,17 +981,9 @@ }, { "cell_type": "code", - "execution_count": 29, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "seldondeployment.machinelearning.seldon.io \"mlflow\" deleted\r\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "!kubectl delete -f ./resources/elasticnet_wine.yaml" ] diff --git a/operator/apis/machinelearning.seldon.io/v1/prepack.go b/operator/apis/machinelearning.seldon.io/v1/prepack.go index aeec4055b2..714bc1b2d6 100644 --- a/operator/apis/machinelearning.seldon.io/v1/prepack.go +++ b/operator/apis/machinelearning.seldon.io/v1/prepack.go @@ -20,6 +20,7 @@ const ( PrepackXgboostName = "XGBOOST_SERVER" PrepackMlflowName = "MLFLOW_SERVER" PrepackTritonName = "TRITON_SERVER" + PrepackTempoName = "TEMPO_SERVER" ) const PredictorServerConfigMapKeyName = "predictor_servers" diff --git a/operator/config/manager/configmap.yaml b/operator/config/manager/configmap.yaml index 0acc92abb9..4ce506be9e 100644 --- a/operator/config/manager/configmap.yaml +++ b/operator/config/manager/configmap.yaml @@ -37,7 +37,7 @@ data: }, "kfserving": { "image": "seldonio/mlserver", - "defaultImageVersion": "0.1.0" + "defaultImageVersion": "0.3.2" } } }, @@ -49,7 +49,7 @@ data: }, "kfserving": { "image": "seldonio/mlserver", - "defaultImageVersion": "0.1.0" + "defaultImageVersion": "0.3.2" } } }, @@ -61,7 +61,7 @@ data: }, "kfserving": { "image": "seldonio/mlserver", - "defaultImageVersion": "0.1.0" + "defaultImageVersion": "0.3.2" } } }, @@ -72,7 +72,16 @@ data: "defaultImageVersion": "20.08-py3" } } - } + }, + "TEMPO_SERVER": { + "protocols" : { + "kfserving": { + "image": "seldonio/mlserver", + "defaultImageVersion": "0.3.2" + } + } + }, + } storageInitializer: |- { diff --git a/operator/controllers/mlserver.go b/operator/controllers/mlserver.go index ae86108eec..58f2777dd3 100644 --- a/operator/controllers/mlserver.go +++ b/operator/controllers/mlserver.go @@ -12,14 +12,16 @@ import ( ) const ( - MLServerSKLearnImplementation = "mlserver.models.SKLearnModel" - MLServerXGBoostImplementation = "mlserver.models.XGBoostModel" + MLServerSKLearnImplementation = "mlserver_sklearn.SKLearnModel" + MLServerXGBoostImplementation = "mlserver_xgboost.XGBoostModel" + MLServerTempoImplementation = "tempo.mlserver.InferenceRuntime" MLServerHTTPPortEnv = "MLSERVER_HTTP_PORT" MLServerGRPCPortEnv = "MLSERVER_GRPC_PORT" MLServerModelNameEnv = "MLSERVER_MODEL_NAME" MLServerModelImplementationEnv = "MLSERVER_MODEL_IMPLEMENTATION" MLServerModelURIEnv = "MLSERVER_MODEL_URI" + MLServerTempoRuntimeEnv = "TEMPO_RUNTIME_OPTIONS" ) func mergeMLServerContainer(existing *v1.Container, mlServer *v1.Container) *v1.Container { @@ -34,11 +36,7 @@ func mergeMLServerContainer(existing *v1.Container, mlServer *v1.Container) *v1. if existing.Image == "" { existing.Image = mlServer.Image } - - if existing.Args == nil { - existing.Args = mlServer.Args - } - + if existing.Env == nil { existing.Env = []v1.EnvVar{} } @@ -65,7 +63,7 @@ func mergeMLServerContainer(existing *v1.Container, mlServer *v1.Container) *v1. return existing } -func getMLServerContainer(pu *machinelearningv1.PredictiveUnit) (*v1.Container, error) { +func getMLServerContainer(pu *machinelearningv1.PredictiveUnit, namespace string) (*v1.Container, error) { if pu == nil { return nil, errors.New("received nil predictive unit") } @@ -74,7 +72,7 @@ func getMLServerContainer(pu *machinelearningv1.PredictiveUnit) (*v1.Container, return nil, err } - envVars, err := getMLServerEnvVars(pu) + envVars, err := getMLServerEnvVars(pu, namespace) if err != nil { return nil, err } @@ -85,12 +83,7 @@ func getMLServerContainer(pu *machinelearningv1.PredictiveUnit) (*v1.Container, cServer := &v1.Container{ Name: pu.Name, Image: image, - Args: []string{ - "mlserver", - "start", - DefaultModelLocalMountPath, - }, - Env: envVars, + Env: envVars, Ports: []v1.ContainerPort{ { Name: "grpc", @@ -159,7 +152,7 @@ func getMLServerImage(pu *machinelearningv1.PredictiveUnit) (string, error) { } } -func getMLServerEnvVars(pu *machinelearningv1.PredictiveUnit) ([]v1.EnvVar, error) { +func getMLServerEnvVars(pu *machinelearningv1.PredictiveUnit, namespace string) ([]v1.EnvVar, error) { if pu == nil { return nil, errors.New("received nil predictive unit") } @@ -197,6 +190,10 @@ func getMLServerEnvVars(pu *machinelearningv1.PredictiveUnit) ([]v1.EnvVar, erro Name: MLServerModelURIEnv, Value: DefaultModelLocalMountPath, }, + { + Name: MLServerTempoRuntimeEnv, + Value: fmt.Sprintf("{\"k8s_options\": {\"defaultRuntime\": \"tempo.seldon.SeldonKubernetesRuntime\", \"namespace\": \"%s\"}}", namespace), + }, }, nil } @@ -209,6 +206,8 @@ func getMLServerModelImplementation(pu *machinelearningv1.PredictiveUnit) (strin return MLServerSKLearnImplementation, nil case machinelearningv1.PrepackXgboostName: return MLServerXGBoostImplementation, nil + case machinelearningv1.PrepackTempoName: + return MLServerTempoImplementation, nil } err := fmt.Errorf("invalid implementation: %s", *pu.Implementation) diff --git a/operator/controllers/mlserver_test.go b/operator/controllers/mlserver_test.go index d4f71b5e37..e4ef596aa7 100644 --- a/operator/controllers/mlserver_test.go +++ b/operator/controllers/mlserver_test.go @@ -41,7 +41,7 @@ var _ = Describe("MLServer helpers", func() { }, } - mlServer, _ = getMLServerContainer(pu) + mlServer, _ = getMLServerContainer(pu, "default") }) It("should merge containers adding extra env", func() { @@ -58,7 +58,7 @@ var _ = Describe("MLServer helpers", func() { var cServer *v1.Container BeforeEach(func() { - cServer, _ = getMLServerContainer(pu) + cServer, _ = getMLServerContainer(pu, "default") }) It("creates container with image", func() { @@ -91,7 +91,7 @@ var _ = Describe("MLServer helpers", func() { var envs []v1.EnvVar BeforeEach(func() { - envs, _ = getMLServerEnvVars(pu) + envs, _ = getMLServerEnvVars(pu, "default") }) It("adds the right ports", func() { @@ -158,6 +158,7 @@ var _ = Describe("MLServer helpers", func() { }, Entry("sklearn", machinelearningv1.PrepackSklearnName, MLServerSKLearnImplementation), Entry("xgboost", machinelearningv1.PrepackXgboostName, MLServerXGBoostImplementation), + Entry("tempo", machinelearningv1.PrepackTempoName, MLServerTempoImplementation), Entry("unknown", "foo", ""), ) }) diff --git a/operator/controllers/seldondeployment_prepackaged_servers.go b/operator/controllers/seldondeployment_prepackaged_servers.go index dcdcc73a1c..98a8e9ef13 100644 --- a/operator/controllers/seldondeployment_prepackaged_servers.go +++ b/operator/controllers/seldondeployment_prepackaged_servers.go @@ -238,7 +238,7 @@ func (pi *PrePackedInitialiser) addTritonServer(mlDepSpec *machinelearningv1.Sel } func (pi *PrePackedInitialiser) addMLServerDefault(pu *machinelearningv1.PredictiveUnit, deploy *appsv1.Deployment) error { - c, err := getMLServerContainer(pu) + c, err := getMLServerContainer(pu, deploy.Namespace) if err != nil { return err } diff --git a/testing/scripts/test_prepackaged_servers.py b/testing/scripts/test_prepackaged_servers.py index 20f48181ba..6440c0b2bc 100644 --- a/testing/scripts/test_prepackaged_servers.py +++ b/testing/scripts/test_prepackaged_servers.py @@ -58,7 +58,7 @@ def test_sklearn_v2(self, namespace): namespace=namespace, protocol="kfserving", model_implementation="SKLEARN_SERVER", - model_uri="gs://seldon-models/sklearn/iris", + model_uri="gs://seldon-models/sklearn/iris-0.23.2/lr_model", ) wait_for_status("sklearn", namespace) wait_for_rollout("sklearn", namespace)