From 8abf90aa62f67fea202e33f454e42f021244a95e Mon Sep 17 00:00:00 2001 From: Clive Cox Date: Tue, 18 Dec 2018 15:46:38 +0000 Subject: [PATCH 1/2] update example models to use python package --- examples/models/deep_mnist/deep_mnist.ipynb | 25 +---- examples/models/deep_mnist/requirements.txt | 2 +- examples/models/h2o_mojo/h2o_model.ipynb | 23 +--- examples/models/keras_mnist/keras_mnist.ipynb | 23 +--- examples/models/keras_mnist/requirements.txt | 2 +- .../Makefile | 4 +- ...ean_classifier_with_custom_endpoints.ipynb | 103 ++++-------------- .../requirements.txt | 2 +- .../models/nodejs_mnist/nodejs_mnist.ipynb | 36 +----- .../nodejs_tensorflow/nodejs_tensorflow.ipynb | 36 +----- .../models/onnx_resnet50/onnx_resnet50.ipynb | 23 +--- .../modelWithFeedback.ipynb | 52 ++------- .../modelWithMetrics.ipynb | 50 ++------- 13 files changed, 69 insertions(+), 312 deletions(-) diff --git a/examples/models/deep_mnist/deep_mnist.ipynb b/examples/models/deep_mnist/deep_mnist.ipynb index e1e681c1fc..72af8fbdad 100644 --- a/examples/models/deep_mnist/deep_mnist.ipynb +++ b/examples/models/deep_mnist/deep_mnist.ipynb @@ -10,13 +10,14 @@ " * Run locally on Docker to test\n", " * Deploy on seldon-core running on minikube\n", " \n", - "## Depenencies\n", + "## Dependencies\n", "\n", " * [Helm](https://github.com/kubernetes/helm)\n", " * [Minikube](https://github.com/kubernetes/minikube)\n", " * [S2I](https://github.com/openshift/source-to-image)\n", "\n", "```bash\n", + "pip install seldon-core\n", "pip install tensorflow\n", "pip install grpcio-tools\n", "```\n", @@ -95,15 +96,6 @@ "!docker run --name \"mnist_predictor\" -d --rm -p 5000:5000 deep-mnist:0.1" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!cd ../../../wrappers/testing && make build_protos" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -117,7 +109,7 @@ "metadata": {}, "outputs": [], "source": [ - "!python ../../../wrappers/testing/tester.py contract.json 0.0.0.0 5000 -p" + "!seldon-core-tester contract.json 0.0.0.0 5000 -p" ] }, { @@ -224,16 +216,7 @@ "metadata": {}, "outputs": [], "source": [ - "!cd ../../../util/api_tester && make build_protos " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!python ../../../util/api_tester/api-tester.py contract.json \\\n", + "!seldon-core-api-tester contract.json \\\n", " `minikube ip` `kubectl get svc -l app=seldon-apiserver-container-app -o jsonpath='{.items[0].spec.ports[0].nodePort}'` \\\n", " --oauth-key oauth-key --oauth-secret oauth-secret -p" ] diff --git a/examples/models/deep_mnist/requirements.txt b/examples/models/deep_mnist/requirements.txt index 6985bb18a2..6f9706765e 100644 --- a/examples/models/deep_mnist/requirements.txt +++ b/examples/models/deep_mnist/requirements.txt @@ -1 +1 @@ -tensorflow==1.0.1 \ No newline at end of file +tensorflow>=1.12.0 diff --git a/examples/models/h2o_mojo/h2o_model.ipynb b/examples/models/h2o_mojo/h2o_model.ipynb index 5a6a53a1b7..7101c9c267 100644 --- a/examples/models/h2o_mojo/h2o_model.ipynb +++ b/examples/models/h2o_mojo/h2o_model.ipynb @@ -18,6 +18,7 @@ " * [H2O](https://www.h2o.ai/download/)\n", "\n", "```bash\n", + "pip install seldon-core\n", "pip install sklearn\n", "pip install grpcio-tools\n", "```\n", @@ -89,15 +90,6 @@ "!docker run --name \"h2o_predictor\" -d --rm -p 5000:5000 h2o-test:0.1" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!cd ../../../wrappers/testing && make build_protos" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -111,7 +103,7 @@ "metadata": {}, "outputs": [], "source": [ - "!python ../../../wrappers/testing/tester.py contract.json 0.0.0.0 5000 -p" + "!seldon-core-tester contract.json 0.0.0.0 5000 -p" ] }, { @@ -218,16 +210,7 @@ "metadata": {}, "outputs": [], "source": [ - "!cd ../../../util/api_tester && make build_protos " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!python ../../../util/api_tester/api-tester.py contract.json \\\n", + "!seldon-core-api-tester contract.json \\\n", " `minikube ip` `kubectl get svc -l app=seldon-apiserver-container-app -o jsonpath='{.items[0].spec.ports[0].nodePort}'` \\\n", " --oauth-key oauth-key --oauth-secret oauth-secret -p" ] diff --git a/examples/models/keras_mnist/keras_mnist.ipynb b/examples/models/keras_mnist/keras_mnist.ipynb index 420ab6d4ae..d0252300a5 100644 --- a/examples/models/keras_mnist/keras_mnist.ipynb +++ b/examples/models/keras_mnist/keras_mnist.ipynb @@ -17,6 +17,7 @@ " * [S2I](https://github.com/openshift/source-to-image)\n", "\n", "```bash\n", + "pip install seldon-core\n", "pip install keras\n", "pip install grpcio-tools\n", "```\n", @@ -263,15 +264,6 @@ "!docker run --name \"mnist_predictor\" -d --rm -p 5000:5000 keras-mnist:0.1" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!cd ../../../wrappers/testing && make build_protos" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -285,7 +277,7 @@ "metadata": {}, "outputs": [], "source": [ - "!python ../../../wrappers/testing/tester.py contract.json 0.0.0.0 5000 -p" + "!seldon-core-tester contract.json 0.0.0.0 5000 -p" ] }, { @@ -392,16 +384,7 @@ "metadata": {}, "outputs": [], "source": [ - "!cd ../../../util/api_tester && make build_protos " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!python ../../../util/api_tester/api-tester.py contract.json \\\n", + "!seldon-core-api-tester contract.json \\\n", " `minikube ip` `kubectl get svc -l app=seldon-apiserver-container-app -o jsonpath='{.items[0].spec.ports[0].nodePort}'` \\\n", " --oauth-key oauth-key --oauth-secret oauth-secret -p" ] diff --git a/examples/models/keras_mnist/requirements.txt b/examples/models/keras_mnist/requirements.txt index ed5f325721..95ff4e2c82 100644 --- a/examples/models/keras_mnist/requirements.txt +++ b/examples/models/keras_mnist/requirements.txt @@ -1,5 +1,5 @@ numpy>=1.8.2 scipy>=0.13.3 keras==2.1.3 -tensorflow==1.0.1 +tensorflow>=1.12.0 h5py diff --git a/examples/models/mean_classifier_with_custom_endpoints/Makefile b/examples/models/mean_classifier_with_custom_endpoints/Makefile index bc0e69b5e5..c7c83ce566 100644 --- a/examples/models/mean_classifier_with_custom_endpoints/Makefile +++ b/examples/models/mean_classifier_with_custom_endpoints/Makefile @@ -2,13 +2,13 @@ VERSION=1.0 IMAGE_BASE=seldonio/mock_classifier_with_custom_endpoints build_rest: - s2i build -E environment_rest . seldonio/seldon-core-s2i-python3:0.3 ${IMAGE_BASE}_rest:${VERSION} + s2i build -E environment_rest . seldonio/seldon-core-s2i-python3:0.4 ${IMAGE_BASE}_rest:${VERSION} push_rest: docker push ${IMAGE_BASE}_rest:${VERSION} build_grpc: - s2i build -E environment_grpc . seldonio/seldon-core-s2i-python3:0.3 ${IMAGE_BASE}_grpc:${VERSION} + s2i build -E environment_grpc . seldonio/seldon-core-s2i-python3:0.4 ${IMAGE_BASE}_grpc:${VERSION} push_grpc: docker push ${IMAGE_BASE}_grpc:${VERSION} diff --git a/examples/models/mean_classifier_with_custom_endpoints/mean_classifier_with_custom_endpoints.ipynb b/examples/models/mean_classifier_with_custom_endpoints/mean_classifier_with_custom_endpoints.ipynb index 8f7fc041c0..c6be64660d 100644 --- a/examples/models/mean_classifier_with_custom_endpoints/mean_classifier_with_custom_endpoints.ipynb +++ b/examples/models/mean_classifier_with_custom_endpoints/mean_classifier_with_custom_endpoints.ipynb @@ -20,6 +20,7 @@ " * [S2I](https://github.com/openshift/source-to-image)\n", "\n", "```bash\n", + "pip install seldon-core\n", "pip install grpcio-tools\n", "```\n", " " @@ -42,9 +43,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "!make build_rest" @@ -53,9 +52,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "!docker run --name \"mock_classifier_with_custom_endpoints_rest\" -d --rm \\\n", @@ -66,35 +63,20 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "!cd ../../../wrappers/testing && make build_protos" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "#\n", "# Call the prediction endpoint.\n", "# Send some random features that conform to the contract\n", "#\n", - "!python ../../../wrappers/testing/tester.py contract.json 0.0.0.0 5000 -p" + "!seldon-core-tester contract.json 0.0.0.0 5000 -p" ] }, { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "#\n", @@ -107,9 +89,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "!docker rm -v \"mock_classifier_with_custom_endpoints_rest\" --force" @@ -125,9 +105,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "!make build_grpc" @@ -136,9 +114,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "!docker run --name \"mock_classifier_with_custom_endpoints_rest\" -d --rm \\\n", @@ -149,9 +125,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "#\n", @@ -159,15 +133,13 @@ "# Send some random features that conform to the contract,\n", "# using NDArray.\n", "#\n", - "!python ../../../wrappers/testing/tester.py contract.json 0.0.0.0 5000 -p --grpc" + "!seldon-core-tester contract.json 0.0.0.0 5000 -p --grpc" ] }, { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "#\n", @@ -175,15 +147,13 @@ "# Send some random features that conform to the contract,\n", "# using Tensor.\n", "#\n", - "!python ../../../wrappers/testing/tester.py contract.json 0.0.0.0 5000 -p --grpc --tensor" + "!seldon-core-tester contract.json 0.0.0.0 5000 -p --grpc --tensor" ] }, { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "#\n", @@ -196,9 +166,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "!docker rm -v \"mock_classifier_with_custom_endpoints_rest\" --force" @@ -216,9 +184,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "\n", @@ -228,9 +194,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "#\n", @@ -242,9 +206,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "!helm init" @@ -253,9 +215,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "#\n", @@ -272,9 +232,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "!eval $(minikube docker-env) && make build_rest" @@ -304,17 +262,6 @@ "!kubectl get seldondeployments seldon-deployment-example -o jsonpath='{.status}'" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "!cd ../../../util/api_tester && make build_protos" - ] - }, { "cell_type": "code", "execution_count": null, @@ -324,7 +271,7 @@ "#\n", "# Make prediction request.\n", "#\n", - "!python ../../../util/api_tester/api-tester.py contract.json \\\n", + "!seldon-core-api-tester contract.json \\\n", " `minikube ip` `kubectl get svc -l app=seldon-apiserver-container-app -o jsonpath='{.items[0].spec.ports[0].nodePort}'` \\\n", " --oauth-key oauth-key --oauth-secret oauth-secret -p" ] @@ -350,9 +297,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "#\n", @@ -379,9 +324,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [] } diff --git a/examples/models/mean_classifier_with_custom_endpoints/requirements.txt b/examples/models/mean_classifier_with_custom_endpoints/requirements.txt index 0193419ad2..13e29f57b8 100644 --- a/examples/models/mean_classifier_with_custom_endpoints/requirements.txt +++ b/examples/models/mean_classifier_with_custom_endpoints/requirements.txt @@ -1 +1 @@ -numpy==1.11.2 +numpy>=1.11.2 diff --git a/examples/models/nodejs_mnist/nodejs_mnist.ipynb b/examples/models/nodejs_mnist/nodejs_mnist.ipynb index 63fbde3b85..092e5b9183 100644 --- a/examples/models/nodejs_mnist/nodejs_mnist.ipynb +++ b/examples/models/nodejs_mnist/nodejs_mnist.ipynb @@ -11,10 +11,11 @@ " \n", "## Depenencies\n", "\n", + " * ```pip install seldon-core```\n", " * [Helm](https://github.com/kubernetes/helm)\n", " * [Minikube](https://github.com/kubernetes/minikube)\n", " * [S2I](https://github.com/openshift/source-to-image)\n", - " * pip install grpcio-tools\n", + " * ```pip install grpcio-tools```\n", " * node (version>=8.11.0)\n", " * npm\n", "\n", @@ -63,15 +64,6 @@ "!docker run --name \"nodejs_mnist_predictor\" -d --rm -p 5000:5000 node-s2i-mnist-model:0.1" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!cd ../../../wrappers/testing && make build_protos" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -85,7 +77,7 @@ "metadata": {}, "outputs": [], "source": [ - "!python ../../../wrappers/testing/tester.py contract.json 0.0.0.0 5000 -p -t" + "!seldon-core-tester contract.json 0.0.0.0 5000 -p -t" ] }, { @@ -122,15 +114,6 @@ "!docker run --name \"nodejs_mnist_predictor\" -d --rm -p 5000:5000 node-s2i-mnist-model:0.2" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!cd ../../../wrappers/testing && make build_protos" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -144,7 +127,7 @@ "metadata": {}, "outputs": [], "source": [ - "!python ../../../wrappers/testing/tester.py contract.json 0.0.0.0 5000 -p -t --grpc" + "!seldon-core-tester contract.json 0.0.0.0 5000 -p -t --grpc" ] }, { @@ -251,16 +234,7 @@ "metadata": {}, "outputs": [], "source": [ - "!cd ../../../util/api_tester && make build_protos " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!python ../../../util/api_tester/api-tester.py contract.json \\\n", + "!seldon-core-api-tester contract.json \\\n", " `minikube ip` `kubectl get svc -l app=seldon-apiserver-container-app -o jsonpath='{.items[0].spec.ports[0].nodePort}'` \\\n", " --oauth-key oauth-key --oauth-secret oauth-secret -p" ] diff --git a/examples/models/nodejs_tensorflow/nodejs_tensorflow.ipynb b/examples/models/nodejs_tensorflow/nodejs_tensorflow.ipynb index b85532fee0..5be25a32d1 100644 --- a/examples/models/nodejs_tensorflow/nodejs_tensorflow.ipynb +++ b/examples/models/nodejs_tensorflow/nodejs_tensorflow.ipynb @@ -11,10 +11,11 @@ " \n", "## Depenencies\n", "\n", + " * ```pip install seldon-core```\n", " * [Helm](https://github.com/kubernetes/helm)\n", " * [Minikube](https://github.com/kubernetes/minikube)\n", " * [S2I](https://github.com/openshift/source-to-image)\n", - " * pip install grpcio-tools\n", + " * ```pip install grpcio-tools```\n", " * node (version>=8.11.0)\n", " * npm\n", "\n", @@ -63,15 +64,6 @@ "!docker run --name \"nodejs_tensorflow_predictor\" -d --rm -p 5000:5000 node-s2i-model-image:0.1" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!cd ../../../wrappers/testing && make build_protos" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -85,7 +77,7 @@ "metadata": {}, "outputs": [], "source": [ - "!python ../../../wrappers/testing/tester.py contract.json 0.0.0.0 5000 -p -t" + "!seldon-core-tester contract.json 0.0.0.0 5000 -p -t" ] }, { @@ -122,15 +114,6 @@ "!docker run --name \"nodejs_tensorflow_predictor\" -d --rm -p 5000:5000 node-s2i-model-image:0.2" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!cd ../../../wrappers/testing && make build_protos" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -144,7 +127,7 @@ "metadata": {}, "outputs": [], "source": [ - "!python ../../../wrappers/testing/tester.py contract.json 0.0.0.0 5000 -p -t --grpc" + "!seldon-core-tester contract.json 0.0.0.0 5000 -p -t --grpc" ] }, { @@ -251,16 +234,7 @@ "metadata": {}, "outputs": [], "source": [ - "!cd ../../../util/api_tester && make build_protos " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!python ../../../util/api_tester/api-tester.py contract.json \\\n", + "!seldon-core-api-tester contract.json \\\n", " `minikube ip` `kubectl get svc -l app=seldon-apiserver-container-app -o jsonpath='{.items[0].spec.ports[0].nodePort}'` \\\n", " --oauth-key oauth-key --oauth-secret oauth-secret -p" ] diff --git a/examples/models/onnx_resnet50/onnx_resnet50.ipynb b/examples/models/onnx_resnet50/onnx_resnet50.ipynb index b64658a9da..636d64acb7 100644 --- a/examples/models/onnx_resnet50/onnx_resnet50.ipynb +++ b/examples/models/onnx_resnet50/onnx_resnet50.ipynb @@ -9,6 +9,7 @@ "This example will show inference over an exported [ONNX](https://github.com/onnx/onnx) ResNet model using Seldon Core. We will use the Seldon S2I wrapper for Intel's NGraph. The example follows this [NGraph tutorial](https://ai.intel.com/adaptable-deep-learning-solutions-with-ngraph-compiler-and-onnx/).\n", "\n", " Preequisites:\n", + " * ```pip install seldon-core```\n", " * torch==0.4.0\n", " * torchvision==0.2.1\n", " * protoc > 3.4.0" @@ -136,16 +137,7 @@ "metadata": {}, "outputs": [], "source": [ - "!cd ../../../wrappers/testing && make build_protos" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!python ../../../wrappers/testing/tester.py contract.json 0.0.0.0 5000 -p" + "!seldon-core-tester contract.json 0.0.0.0 5000 -p" ] }, { @@ -262,16 +254,7 @@ "metadata": {}, "outputs": [], "source": [ - "!cd ../../../util/api_tester && make build_protos" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!python ../../../util/api_tester/api-tester.py contract.json \\\n", + "!seldon-core-api-tester contract.json \\\n", " `minikube ip` `kubectl get svc -l app=seldon-apiserver-container-app -o jsonpath='{.items[0].spec.ports[0].nodePort}'` \\\n", " --oauth-key oauth-key --oauth-secret oauth-secret -p" ] diff --git a/examples/models/template_model_with_feedback/modelWithFeedback.ipynb b/examples/models/template_model_with_feedback/modelWithFeedback.ipynb index f730ea9d8f..8e0810dd59 100644 --- a/examples/models/template_model_with_feedback/modelWithFeedback.ipynb +++ b/examples/models/template_model_with_feedback/modelWithFeedback.ipynb @@ -35,15 +35,6 @@ "!docker run --name \"model-with-feedback\" -d --rm -p 5000:5000 model-with-feedback-rest:0.1" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!cd ../../../wrappers/testing && make build_protos" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -57,7 +48,7 @@ "metadata": {}, "outputs": [], "source": [ - "!python ../../../wrappers/testing/tester.py contract.json 0.0.0.0 5000 -p" + "!seldon-core-tester contract.json 0.0.0.0 5000 -p" ] }, { @@ -73,7 +64,7 @@ "metadata": {}, "outputs": [], "source": [ - "!python ../../../wrappers/testing/tester.py contract.json 0.0.0.0 5000 -p --endpoint send-feedback" + "!seldon-core-tester contract.json 0.0.0.0 5000 -p --endpoint send-feedback" ] }, { @@ -110,15 +101,6 @@ "!docker run --name \"model-with-feedback\" -d --rm -p 5000:5000 model-with-feedback-grpc:0.1" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!cd ../../../wrappers/testing && make build_protos" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -132,7 +114,7 @@ "metadata": {}, "outputs": [], "source": [ - "!python ../../../wrappers/testing/tester.py contract.json 0.0.0.0 5000 -p --grpc" + "!seldon-core-tester contract.json 0.0.0.0 5000 -p --grpc" ] }, { @@ -148,7 +130,7 @@ "metadata": {}, "outputs": [], "source": [ - "!python ../../../wrappers/testing/tester.py contract.json 0.0.0.0 5000 -p --endpoint send-feedback --grpc" + "!seldon-core-tester contract.json 0.0.0.0 5000 -p --endpoint send-feedback --grpc" ] }, { @@ -256,15 +238,6 @@ "!kubectl get seldondeployments mymodel -o jsonpath='{.status}' " ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!cd ../../../util/api_tester && make build_protos " - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -278,7 +251,7 @@ "metadata": {}, "outputs": [], "source": [ - "!python ../../../util/api_tester/api-tester.py contract.json \\\n", + "!seldon-core-api-tester contract.json \\\n", " `minikube ip` `kubectl get svc -l app=seldon-apiserver-container-app -o jsonpath='{.items[0].spec.ports[0].nodePort}'` \\\n", " --oauth-key oauth-key --oauth-secret oauth-secret -p" ] @@ -296,7 +269,7 @@ "metadata": {}, "outputs": [], "source": [ - "!python ../../../util/api_tester/api-tester.py contract.json \\\n", + "!seldon-core-api-tester contract.json \\\n", " `minikube ip` `kubectl get svc -l app=seldon-apiserver-container-app -o jsonpath='{.items[0].spec.ports[0].nodePort}'` \\\n", " --oauth-key oauth-key --oauth-secret oauth-secret -p --endpoint send-feedback" ] @@ -351,15 +324,6 @@ "!kubectl get seldondeployments mymodel -o jsonpath='{.status}' " ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!cd ../../../util/api_tester && make build_protos " - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -373,7 +337,7 @@ "metadata": {}, "outputs": [], "source": [ - "!python ../../../util/api_tester/api-tester.py contract.json \\\n", + "!seldon-core-api-tester contract.json \\\n", " `minikube ip` `kubectl get svc -l app=seldon-apiserver-container-app -o jsonpath='{.items[0].spec.ports[1].nodePort}'` \\\n", " --oauth-key oauth-key --oauth-secret oauth-secret -p --grpc --oauth-port `kubectl get svc -l app=seldon-apiserver-container-app -o jsonpath='{.items[0].spec.ports[0].nodePort}'`" ] @@ -391,7 +355,7 @@ "metadata": {}, "outputs": [], "source": [ - "!python ../../../util/api_tester/api-tester.py contract.json \\\n", + "!seldon-core-api-tester contract.json \\\n", " `minikube ip` `kubectl get svc -l app=seldon-apiserver-container-app -o jsonpath='{.items[0].spec.ports[1].nodePort}'` \\\n", " --oauth-key oauth-key --oauth-secret oauth-secret -p --endpoint send-feedback --grpc --oauth-port `kubectl get svc -l app=seldon-apiserver-container-app -o jsonpath='{.items[0].spec.ports[0].nodePort}'`" ] diff --git a/examples/models/template_model_with_metrics/modelWithMetrics.ipynb b/examples/models/template_model_with_metrics/modelWithMetrics.ipynb index 5ad7e2bfda..fef79bc1b1 100644 --- a/examples/models/template_model_with_metrics/modelWithMetrics.ipynb +++ b/examples/models/template_model_with_metrics/modelWithMetrics.ipynb @@ -6,6 +6,12 @@ "source": [ "# Model with Metrics\n", "\n", + "## Dependencies\n", + "\n", + "```pip install seldon-core```\n", + "\n", + "## Background\n", + "\n", "Example testing a model with custom metrics.\n", "\n", "Metrics can be \n", @@ -58,15 +64,6 @@ "!docker run --name \"model-with-metrics\" -d --rm -p 5000:5000 model-with-metrics-rest:0.1" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!cd ../../../wrappers/testing && make build_protos" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -80,7 +77,7 @@ "metadata": {}, "outputs": [], "source": [ - "!python ../../../wrappers/testing/tester.py contract.json 0.0.0.0 5000 -p" + "!seldon-core-tester contract.json 0.0.0.0 5000 -p" ] }, { @@ -117,15 +114,6 @@ "!docker run --name \"model-with-metrics\" -d --rm -p 5000:5000 model-with-metrics-grpc:0.1" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!cd ../../../wrappers/testing && make build_protos" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -139,7 +127,7 @@ "metadata": {}, "outputs": [], "source": [ - "!python ../../../wrappers/testing/tester.py contract.json 0.0.0.0 5000 -p --grpc" + "!seldon-core-tester contract.json 0.0.0.0 5000 -p --grpc" ] }, { @@ -267,15 +255,6 @@ "!kubectl get seldondeployments mymodel -o jsonpath='{.status}' " ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!cd ../../../util/api_tester && make build_protos " - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -289,7 +268,7 @@ "metadata": {}, "outputs": [], "source": [ - "!python ../../../util/api_tester/api-tester.py contract.json \\\n", + "!seldon-core-api-tester contract.json \\\n", " `minikube ip` `kubectl get svc -l app=seldon-apiserver-container-app -o jsonpath='{.items[0].spec.ports[0].nodePort}'` \\\n", " --oauth-key oauth-key --oauth-secret oauth-secret -p" ] @@ -344,15 +323,6 @@ "!kubectl get seldondeployments mymodel -o jsonpath='{.status}' " ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!cd ../../../util/api_tester && make build_protos " - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -379,7 +349,7 @@ "metadata": {}, "outputs": [], "source": [ - "!python ../../../util/api_tester/api-tester.py contract.json \\\n", + "!seldon-core-api-tester contract.json \\\n", " `minikube ip` `kubectl get svc -l app=seldon-apiserver-container-app -o jsonpath='{.items[0].spec.ports[1].nodePort}'` \\\n", " --oauth-key oauth-key --oauth-secret oauth-secret -p --grpc --oauth-port `kubectl get svc -l app=seldon-apiserver-container-app -o jsonpath='{.items[0].spec.ports[0].nodePort}'`" ] From 2dad38c2394f76349b362a05ff9ccc496c25679a Mon Sep 17 00:00:00 2001 From: Janis Klaise Date: Tue, 18 Dec 2018 17:48:31 +0000 Subject: [PATCH 2/2] Spelling and redundant pip packages --- examples/models/deep_mnist/deep_mnist.ipynb | 33 ++++++++++++++++-- examples/models/h2o_mojo/h2o_model.ipynb | 34 +++++++++++++++++-- examples/models/keras_mnist/keras_mnist.ipynb | 34 +++++++++++++++++-- ...ean_classifier_with_custom_endpoints.ipynb | 34 +++++++++++++++++-- .../models/nodejs_mnist/nodejs_mnist.ipynb | 34 +++++++++++++++++-- .../nodejs_tensorflow/nodejs_tensorflow.ipynb | 34 +++++++++++++++++-- 6 files changed, 185 insertions(+), 18 deletions(-) diff --git a/examples/models/deep_mnist/deep_mnist.ipynb b/examples/models/deep_mnist/deep_mnist.ipynb index 72af8fbdad..486788cc7e 100644 --- a/examples/models/deep_mnist/deep_mnist.ipynb +++ b/examples/models/deep_mnist/deep_mnist.ipynb @@ -18,8 +18,6 @@ "\n", "```bash\n", "pip install seldon-core\n", - "pip install tensorflow\n", - "pip install grpcio-tools\n", "```\n", "\n", "## Train locally\n", @@ -254,7 +252,36 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.4" + "version": "3.6.6" + }, + "varInspector": { + "cols": { + "lenName": 16, + "lenType": 16, + "lenVar": 40 + }, + "kernels_config": { + "python": { + "delete_cmd_postfix": "", + "delete_cmd_prefix": "del ", + "library": "var_list.py", + "varRefreshCmd": "print(var_dic_list())" + }, + "r": { + "delete_cmd_postfix": ") ", + "delete_cmd_prefix": "rm(", + "library": "var_list.r", + "varRefreshCmd": "cat(var_dic_list()) " + } + }, + "types_to_exclude": [ + "module", + "function", + "builtin_function_or_method", + "instance", + "_Feature" + ], + "window_display": false } }, "nbformat": 4, diff --git a/examples/models/h2o_mojo/h2o_model.ipynb b/examples/models/h2o_mojo/h2o_model.ipynb index 7101c9c267..fbb2c8ab3d 100644 --- a/examples/models/h2o_mojo/h2o_model.ipynb +++ b/examples/models/h2o_mojo/h2o_model.ipynb @@ -10,7 +10,7 @@ " * Run locally on Docker to test\n", " * Deploy on seldon-core running on minikube\n", " \n", - "## Depenencies\n", + "## Dependencies\n", "\n", " * [Helm](https://github.com/kubernetes/helm)\n", " * [Minikube](https://github.com/kubernetes/minikube)\n", @@ -20,7 +20,6 @@ "```bash\n", "pip install seldon-core\n", "pip install sklearn\n", - "pip install grpcio-tools\n", "```\n", "\n", "## Train locally\n", @@ -248,7 +247,36 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.4" + "version": "3.6.6" + }, + "varInspector": { + "cols": { + "lenName": 16, + "lenType": 16, + "lenVar": 40 + }, + "kernels_config": { + "python": { + "delete_cmd_postfix": "", + "delete_cmd_prefix": "del ", + "library": "var_list.py", + "varRefreshCmd": "print(var_dic_list())" + }, + "r": { + "delete_cmd_postfix": ") ", + "delete_cmd_prefix": "rm(", + "library": "var_list.r", + "varRefreshCmd": "cat(var_dic_list()) " + } + }, + "types_to_exclude": [ + "module", + "function", + "builtin_function_or_method", + "instance", + "_Feature" + ], + "window_display": false } }, "nbformat": 4, diff --git a/examples/models/keras_mnist/keras_mnist.ipynb b/examples/models/keras_mnist/keras_mnist.ipynb index d0252300a5..3d98c79284 100644 --- a/examples/models/keras_mnist/keras_mnist.ipynb +++ b/examples/models/keras_mnist/keras_mnist.ipynb @@ -10,7 +10,7 @@ " * Run locally on Docker to test\n", " * Deploy on seldon-core running on minikube\n", " \n", - "## Depenencies\n", + "## Dependencies\n", "\n", " * [Helm](https://github.com/kubernetes/helm)\n", " * [Minikube](https://github.com/kubernetes/minikube)\n", @@ -19,7 +19,6 @@ "```bash\n", "pip install seldon-core\n", "pip install keras\n", - "pip install grpcio-tools\n", "```\n", "\n", "## Train locally\n", @@ -422,7 +421,36 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.4" + "version": "3.6.6" + }, + "varInspector": { + "cols": { + "lenName": 16, + "lenType": 16, + "lenVar": 40 + }, + "kernels_config": { + "python": { + "delete_cmd_postfix": "", + "delete_cmd_prefix": "del ", + "library": "var_list.py", + "varRefreshCmd": "print(var_dic_list())" + }, + "r": { + "delete_cmd_postfix": ") ", + "delete_cmd_prefix": "rm(", + "library": "var_list.r", + "varRefreshCmd": "cat(var_dic_list()) " + } + }, + "types_to_exclude": [ + "module", + "function", + "builtin_function_or_method", + "instance", + "_Feature" + ], + "window_display": false } }, "nbformat": 4, diff --git a/examples/models/mean_classifier_with_custom_endpoints/mean_classifier_with_custom_endpoints.ipynb b/examples/models/mean_classifier_with_custom_endpoints/mean_classifier_with_custom_endpoints.ipynb index c6be64660d..f186c92d10 100644 --- a/examples/models/mean_classifier_with_custom_endpoints/mean_classifier_with_custom_endpoints.ipynb +++ b/examples/models/mean_classifier_with_custom_endpoints/mean_classifier_with_custom_endpoints.ipynb @@ -13,7 +13,7 @@ " * Deploy on seldon-core running on minikube\n", " * Example of using custom endpoints that are scraped by prometheus\n", " \n", - "## Depenencies\n", + "## Dependencies\n", "\n", " * [Helm](https://github.com/kubernetes/helm)\n", " * [Minikube](https://github.com/kubernetes/minikube)\n", @@ -21,7 +21,6 @@ "\n", "```bash\n", "pip install seldon-core\n", - "pip install grpcio-tools\n", "```\n", " " ] @@ -345,7 +344,36 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.4" + "version": "3.6.6" + }, + "varInspector": { + "cols": { + "lenName": 16, + "lenType": 16, + "lenVar": 40 + }, + "kernels_config": { + "python": { + "delete_cmd_postfix": "", + "delete_cmd_prefix": "del ", + "library": "var_list.py", + "varRefreshCmd": "print(var_dic_list())" + }, + "r": { + "delete_cmd_postfix": ") ", + "delete_cmd_prefix": "rm(", + "library": "var_list.r", + "varRefreshCmd": "cat(var_dic_list()) " + } + }, + "types_to_exclude": [ + "module", + "function", + "builtin_function_or_method", + "instance", + "_Feature" + ], + "window_display": false } }, "nbformat": 4, diff --git a/examples/models/nodejs_mnist/nodejs_mnist.ipynb b/examples/models/nodejs_mnist/nodejs_mnist.ipynb index 092e5b9183..d4cdc77077 100644 --- a/examples/models/nodejs_mnist/nodejs_mnist.ipynb +++ b/examples/models/nodejs_mnist/nodejs_mnist.ipynb @@ -9,13 +9,12 @@ " * Wrap a nodejs tensorflow model for use as a prediction microservice in seldon-core\n", " * Run locally on Docker to test\n", " \n", - "## Depenencies\n", + "## Dependencies\n", "\n", " * ```pip install seldon-core```\n", " * [Helm](https://github.com/kubernetes/helm)\n", " * [Minikube](https://github.com/kubernetes/minikube)\n", " * [S2I](https://github.com/openshift/source-to-image)\n", - " * ```pip install grpcio-tools```\n", " * node (version>=8.11.0)\n", " * npm\n", "\n", @@ -274,7 +273,36 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.4" + "version": "3.6.6" + }, + "varInspector": { + "cols": { + "lenName": 16, + "lenType": 16, + "lenVar": 40 + }, + "kernels_config": { + "python": { + "delete_cmd_postfix": "", + "delete_cmd_prefix": "del ", + "library": "var_list.py", + "varRefreshCmd": "print(var_dic_list())" + }, + "r": { + "delete_cmd_postfix": ") ", + "delete_cmd_prefix": "rm(", + "library": "var_list.r", + "varRefreshCmd": "cat(var_dic_list()) " + } + }, + "types_to_exclude": [ + "module", + "function", + "builtin_function_or_method", + "instance", + "_Feature" + ], + "window_display": false } }, "nbformat": 4, diff --git a/examples/models/nodejs_tensorflow/nodejs_tensorflow.ipynb b/examples/models/nodejs_tensorflow/nodejs_tensorflow.ipynb index 5be25a32d1..bffd28fcf2 100644 --- a/examples/models/nodejs_tensorflow/nodejs_tensorflow.ipynb +++ b/examples/models/nodejs_tensorflow/nodejs_tensorflow.ipynb @@ -9,13 +9,12 @@ " * Wrap a nodejs tensorflow model for use as a prediction microservice in seldon-core\n", " * Run locally on Docker to test\n", " \n", - "## Depenencies\n", + "## Dependencies\n", "\n", " * ```pip install seldon-core```\n", " * [Helm](https://github.com/kubernetes/helm)\n", " * [Minikube](https://github.com/kubernetes/minikube)\n", " * [S2I](https://github.com/openshift/source-to-image)\n", - " * ```pip install grpcio-tools```\n", " * node (version>=8.11.0)\n", " * npm\n", "\n", @@ -274,7 +273,36 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.4" + "version": "3.6.6" + }, + "varInspector": { + "cols": { + "lenName": 16, + "lenType": 16, + "lenVar": 40 + }, + "kernels_config": { + "python": { + "delete_cmd_postfix": "", + "delete_cmd_prefix": "del ", + "library": "var_list.py", + "varRefreshCmd": "print(var_dic_list())" + }, + "r": { + "delete_cmd_postfix": ") ", + "delete_cmd_prefix": "rm(", + "library": "var_list.r", + "varRefreshCmd": "cat(var_dic_list()) " + } + }, + "types_to_exclude": [ + "module", + "function", + "builtin_function_or_method", + "instance", + "_Feature" + ], + "window_display": false } }, "nbformat": 4,