Skip to content

Commit

Permalink
Dataflow updates (#140)
Browse files Browse the repository at this point in the history
* fix dataflow bugs

* lint

* small updates for docker compose tests

* update install doc at top of notebook

* Typo fix

Co-authored-by: Andrei Paleyes <[email protected]>
  • Loading branch information
ukclivecox and apaleyes authored Apr 7, 2022
1 parent 97cc652 commit ff900dd
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 17 deletions.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ deploy-local:
undeploy-local:
make -C scheduler stop-all

.PHONY: deploy-local-triton
deploy-local-triton:
make -C scheduler start-all-triton

.PHONY: undeploy-local-triton
undeploy-local-triton:
make -C scheduler stop-all-triton

.PHONY: deploy-k8s
deploy-k8s:
kubectl create -f k8s/seldon-v2-crds.yaml
Expand Down
70 changes: 62 additions & 8 deletions samples/local-examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"id": "modular-digest",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"/home/clive/work/scv2/seldon-core-v2/operator/bin/seldon\r\n"
]
}
],
"source": [
"!which seldon"
]
Expand All @@ -32,20 +40,58 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"id": "8b4be911",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"apiVersion: mlops.seldon.io/v1alpha1\r\n",
"kind: Model\r\n",
"metadata:\r\n",
" name: iris\r\n",
" namespace: seldon-mesh\r\n",
"spec:\r\n",
" storageUri: \"gs://seldon-models/mlserver/iris\"\r\n",
" requirements:\r\n",
" - sklearn\r\n"
]
}
],
"source": [
"!cat ./models/sklearn-iris-gs.yaml"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"id": "checked-cream",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Error: rpc error: code = FailedPrecondition desc = failed to schedule model iris\r\n",
"Usage:\r\n",
" app model load [flags]\r\n",
"\r\n",
"Flags:\r\n",
" -f, --file-path string model file to load\r\n",
" -h, --help help for load\r\n",
" --scheduler-host string seldon scheduler host (default \"0.0.0.0\")\r\n",
" --scheduler-port int seldon scheduler port (default 9004)\r\n",
"\r\n",
"Global Flags:\r\n",
" -r, --show-request show request\r\n",
" -s, --show-response show response (default true)\r\n",
"\r\n",
"rpc error: code = FailedPrecondition desc = failed to schedule model iris\r\n"
]
}
],
"source": [
"!seldon model load -f ./models/sklearn-iris-gs.yaml"
]
Expand Down Expand Up @@ -84,10 +130,18 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"id": "ceramic-illness",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{}\r\n"
]
}
],
"source": [
"!seldon model unload --model-name iris"
]
Expand Down
16 changes: 8 additions & 8 deletions samples/pipeline-examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"\n",
"\n",
" * Build if needed and place `seldon` binary in your path\n",
" * Install seldon locally \n",
" * Start triton"
" * run `make build-seldon` from operator folder and add bin folder to PATH\n",
" * Run Seldon V2 `make deploy-local-triton` from top level folder"
]
},
{
Expand Down Expand Up @@ -108,12 +108,12 @@
{
"cell_type": "code",
"execution_count": null,
"id": "1f5fb4bd",
"id": "5c33133e",
"metadata": {},
"outputs": [],
"source": [
"!seldon pipeline infer -p tfsimples \\\n",
" '{\"inputs\":[{\"name\":\"INPUT0\",\"data\": [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],\"datatype\":\"INT32\",\"shape\":[1,16]},{\"name\":\"INPUT1\",\"data\":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],\"datatype\":\"INT32\",\"shape\":[1,16]}]}' "
"!seldon pipeline infer -p tfsimples --inference-mode grpc \\\n",
" '{\"model_name\":\"simple\",\"inputs\":[{\"name\":\"INPUT0\",\"contents\":{\"int_contents\":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]},\"datatype\":\"INT32\",\"shape\":[1,16]},{\"name\":\"INPUT1\",\"contents\":{\"int_contents\":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]},\"datatype\":\"INT32\",\"shape\":[1,16]}]}' | jq ."
]
},
{
Expand Down Expand Up @@ -214,12 +214,12 @@
{
"cell_type": "code",
"execution_count": null,
"id": "a5b541d5",
"id": "2151ee4c",
"metadata": {},
"outputs": [],
"source": [
"!seldon pipeline infer -p join \\\n",
" '{\"inputs\":[{\"name\":\"INPUT0\",\"data\": [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],\"datatype\":\"INT32\",\"shape\":[1,16]},{\"name\":\"INPUT1\",\"data\":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],\"datatype\":\"INT32\",\"shape\":[1,16]}]}' "
"!seldon pipeline infer -p join --inference-mode grpc \\\n",
" '{\"model_name\":\"simple\",\"inputs\":[{\"name\":\"INPUT0\",\"contents\":{\"int_contents\":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]},\"datatype\":\"INT32\",\"shape\":[1,16]},{\"name\":\"INPUT1\",\"contents\":{\"int_contents\":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]},\"datatype\":\"INT32\",\"shape\":[1,16]}]}' | jq ."
]
},
{
Expand Down
3 changes: 2 additions & 1 deletion scheduler/config/agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ rclone:
- '{"type":"google cloud storage","name":"gs","parameters":{"anonymous":true}}'
kafka:
active: true
broker: "0.0.0.0:9092"
broker: "kafka:29092"
#broker: "0.0.0.0:9092"

0 comments on commit ff900dd

Please sign in to comment.