Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update example models to use python package #351

Merged
merged 2 commits into from
Dec 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 34 additions & 24 deletions examples/models/deep_mnist/deep_mnist.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +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 tensorflow\n",
"pip install grpcio-tools\n",
"pip install seldon-core\n",
"```\n",
"\n",
"## Train locally\n",
Expand Down Expand Up @@ -95,15 +94,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": {},
Expand All @@ -117,7 +107,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"
]
},
{
Expand Down Expand Up @@ -224,16 +214,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"
]
Expand Down Expand Up @@ -271,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,
Expand Down
2 changes: 1 addition & 1 deletion examples/models/deep_mnist/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
tensorflow==1.0.1
tensorflow>=1.12.0
57 changes: 34 additions & 23 deletions examples/models/h2o_mojo/h2o_model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
" * 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",
" * [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",
"\n",
"## Train locally\n",
Expand Down Expand Up @@ -89,15 +89,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": {},
Expand All @@ -111,7 +102,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"
]
},
{
Expand Down Expand Up @@ -218,16 +209,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"
]
Expand Down Expand Up @@ -265,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,
Expand Down
57 changes: 34 additions & 23 deletions examples/models/keras_mnist/keras_mnist.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
" * 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 keras\n",
"pip install grpcio-tools\n",
"```\n",
"\n",
"## Train locally\n",
Expand Down Expand Up @@ -263,15 +263,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": {},
Expand All @@ -285,7 +276,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"
]
},
{
Expand Down Expand Up @@ -392,16 +383,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"
]
Expand Down Expand Up @@ -439,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,
Expand Down
2 changes: 1 addition & 1 deletion examples/models/keras_mnist/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Loading