Skip to content

Commit

Permalink
update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ukclivecox committed Mar 27, 2020
1 parent 1a36cd4 commit 23deaa3
Show file tree
Hide file tree
Showing 33 changed files with 122 additions and 4,138 deletions.
3 changes: 0 additions & 3 deletions doc/source/examples/keras_mnist.nblink

This file was deleted.

1 change: 0 additions & 1 deletion doc/source/examples/notebooks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Python Language Wrapper Examples
:titlesonly:

Scikit-learn Spacy Reddit Text Classification Tutorial <sklearn_spacy_text_classifier_example>
Keras MNIST <keras_mnist>
SKLearn Iris Classifier <iris>
SKLearn MNIST <sklearn_mnist>
Sagemaker SKLearn Example <sagemaker_sklearn>
Expand Down
19 changes: 14 additions & 5 deletions examples/ambassador/canary/ambassador_canary.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"metadata": {},
"outputs": [],
"source": [
"!kubectl rollout status deploy/example-main-0"
"!kubectl rollout status deploy/$(kubectl get deploy -l seldon-deployment-id=example -o jsonpath='{.items[0].metadata.name}')"
]
},
{
Expand Down Expand Up @@ -138,8 +138,8 @@
"metadata": {},
"outputs": [],
"source": [
"!kubectl rollout status deploy/example-main-0\n",
"!kubectl rollout status deploy/example-canary-0"
"!kubectl rollout status deploy/$(kubectl get deploy -l seldon-deployment-id=example -o jsonpath='{.items[0].metadata.name}')\n",
"!kubectl rollout status deploy/$(kubectl get deploy -l seldon-deployment-id=example -o jsonpath='{.items[1].metadata.name}')"
]
},
{
Expand All @@ -149,6 +149,15 @@
"Show our REST requests are now split with roughly 25% going to the canary."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"sc.predict(gateway=\"ambassador\",transport=\"rest\")"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -168,7 +177,7 @@
"metadata": {},
"outputs": [],
"source": [
"default_count=!kubectl logs $(kubectl get pod -lapp=example-main-0 -o jsonpath='{.items[0].metadata.name}') classifier | grep \"/predict\" | wc -l "
"default_count=!kubectl logs $(kubectl get pod -lseldon-app=example-main -o jsonpath='{.items[0].metadata.name}') classifier | grep \"/predict\" | wc -l "
]
},
{
Expand All @@ -177,7 +186,7 @@
"metadata": {},
"outputs": [],
"source": [
"canary_count=!kubectl logs $(kubectl get pod -lapp=example-canary-0 -o jsonpath='{.items[0].metadata.name}') classifier | grep \"/predict\" | wc -l"
"canary_count=!kubectl logs $(kubectl get pod -lseldon-app=example-canary -o jsonpath='{.items[0].metadata.name}') classifier | grep \"/predict\" | wc -l"
]
},
{
Expand Down
9 changes: 8 additions & 1 deletion examples/ambassador/custom/ambassador_custom.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"metadata": {},
"outputs": [],
"source": [
"!kubectl rollout status deploy/example-single-0"
"!kubectl rollout status deploy/$(kubectl get deploy -l seldon-deployment-id=example -o jsonpath='{.items[0].metadata.name}')"
]
},
{
Expand Down Expand Up @@ -116,6 +116,13 @@
"source": [
"!kubectl delete -f model_custom_ambassador.json"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
15 changes: 11 additions & 4 deletions examples/ambassador/headers/ambassador_headers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"metadata": {},
"outputs": [],
"source": [
"!kubectl rollout status deploy/example-single-0"
"!kubectl rollout status deploy/$(kubectl get deploy -l seldon-deployment-id=example -o jsonpath='{.items[0].metadata.name}')"
]
},
{
Expand Down Expand Up @@ -149,7 +149,7 @@
"metadata": {},
"outputs": [],
"source": [
"!kubectl rollout status deploy/example-header-single-0"
"!kubectl rollout status deploy/$(kubectl get deploy -l seldon-deployment-id=example-header -o jsonpath='{.items[0].metadata.name}')"
]
},
{
Expand All @@ -175,7 +175,7 @@
"metadata": {},
"outputs": [],
"source": [
"default_count=!kubectl logs $(kubectl get pod -lapp=example-single-0 -o jsonpath='{.items[0].metadata.name}') classifier | grep \"/predict\" | wc -l "
"default_count=!kubectl logs $(kubectl get pod -lseldon-app=example-single -o jsonpath='{.items[0].metadata.name}') classifier | grep \"/predict\" | wc -l "
]
},
{
Expand Down Expand Up @@ -211,7 +211,7 @@
"metadata": {},
"outputs": [],
"source": [
"header_count=!kubectl logs $(kubectl get pod -lapp=example-header-single-0 -o jsonpath='{.items[0].metadata.name}') classifier | grep \"/predict\" | wc -l "
"header_count=!kubectl logs $(kubectl get pod -lseldon-app=example-header-single -o jsonpath='{.items[0].metadata.name}') classifier | grep \"/predict\" | wc -l "
]
},
{
Expand Down Expand Up @@ -241,6 +241,13 @@
"source": [
"!kubectl delete -f model_with_header.json"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
20 changes: 15 additions & 5 deletions examples/ambassador/shadow/ambassador_shadow.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"metadata": {},
"outputs": [],
"source": [
"!kubectl rollout status deploy/example-default-0"
"!kubectl rollout status deploy/$(kubectl get deploy -l seldon-deployment-id=example -o jsonpath='{.items[0].metadata.name}')"
]
},
{
Expand Down Expand Up @@ -141,7 +141,8 @@
"metadata": {},
"outputs": [],
"source": [
"!kubectl rollout status deploy/example-shadow-0"
"!kubectl rollout status deploy/$(kubectl get deploy -l seldon-deployment-id=example -o jsonpath='{.items[0].metadata.name}')\n",
"!kubectl rollout status deploy/$(kubectl get deploy -l seldon-deployment-id=example -o jsonpath='{.items[1].metadata.name}')"
]
},
{
Expand All @@ -167,7 +168,7 @@
"metadata": {},
"outputs": [],
"source": [
"default_count=!kubectl logs $(kubectl get pod -lapp=example-default-0 -o jsonpath='{.items[0].metadata.name}') classifier | grep \"/predict\" | wc -l "
"default_count=!kubectl logs $(kubectl get pod -lseldon-app=example-default -o jsonpath='{.items[0].metadata.name}') classifier | grep \"/predict\" | wc -l "
]
},
{
Expand All @@ -176,7 +177,7 @@
"metadata": {},
"outputs": [],
"source": [
"shadow_count=!kubectl logs $(kubectl get pod -lapp=example-shadow-0 -o jsonpath='{.items[0].metadata.name}') classifier | grep \"/predict\" | wc -l "
"shadow_count=!kubectl logs $(kubectl get pod -lseldon-app=example-shadow -o jsonpath='{.items[0].metadata.name}') classifier | grep \"/predict\" | wc -l "
]
},
{
Expand All @@ -186,7 +187,9 @@
"outputs": [],
"source": [
"print(shadow_count)\n",
"assert(int(shadow_count[0])==10)"
"print(default_count)\n",
"assert(int(shadow_count[0])==10)\n",
"assert(int(default_count[0])==11)"
]
},
{
Expand All @@ -197,6 +200,13 @@
"source": [
"!kubectl delete -f shadow.json"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
Binary file removed examples/combiners/.DS_Store
Binary file not shown.
12 changes: 0 additions & 12 deletions examples/combiners/mnist_combiner/MnistCombiner.py

This file was deleted.

4 changes: 0 additions & 4 deletions examples/combiners/mnist_combiner/environment_grpc

This file was deleted.

4 changes: 0 additions & 4 deletions examples/combiners/mnist_combiner/environment_rest

This file was deleted.

Loading

0 comments on commit 23deaa3

Please sign in to comment.