This page was generated from examples/graph_examples/graph-examples.ipynb.

Graph Examples

Port-forward to that ingress on localhost:8003 in a separate terminal either with:

  • Ambassador: kubectl port-forward $(kubectl get pods -n seldon -l app.kubernetes.io/name=ambassador -o jsonpath='{.items[0].metadata.name}') -n seldon 8003:8080

  • Istio: kubectl port-forward $(kubectl get pods -l istio=ingressgateway -n istio-system -o jsonpath='{.items[0].metadata.name}') -n istio-system 8003:8080

[ ]:
!kubectl create namespace seldon
[ ]:
!kubectl config set-context $(kubectl config current-context) --namespace=seldon

Input and output transformer with model in same pod

[ ]:
!cat tin-model-tout.yaml
[ ]:
!kubectl create -f tin-model-tout.yaml
[ ]:
!kubectl wait --for condition=ready --timeout=300s sdep --all -n seldon
[ ]:
!curl -s -d '{"data": {"ndarray":[[1.0, 2.0, 5.0]]}}' \
   -X POST http://localhost:8003/seldon/seldon/test/api/v1.0/predictions \
   -H "Content-Type: application/json"
[ ]:
!kubectl delete -f tin-model-tout.yaml

Input and output transformer with model in separate pods

[ ]:
!cat tin-model-tout-sep-pods.yaml
[ ]:
!kubectl create -f tin-model-tout-sep-pods.yaml
[ ]:
!kubectl wait --for condition=ready --timeout=300s sdep --all -n seldon
[ ]:
!curl -s -d '{"data": {"ndarray":[[1.0, 2.0, 5.0]]}}' \
   -X POST http://localhost:8003/seldon/seldon/test/api/v1.0/predictions \
   -H "Content-Type: application/json"
[ ]:
!kubectl delete -f tin-model-tout-sep-pods.yaml

Input and output transformer with svcOrch in separate pod

[ ]:
!cat tin-model-tout-sep-svcorch.yaml
[ ]:
!kubectl create -f tin-model-tout-sep-svcorch.yaml
[ ]:
!kubectl wait --for condition=ready --timeout=300s sdep --all -n seldon
[ ]:
!curl -s -d '{"data": {"ndarray":[[1.0, 2.0, 5.0]]}}' \
   -X POST http://localhost:8003/seldon/seldon/test/api/v1.0/predictions \
   -H "Content-Type: application/json"
[ ]:
!kubectl delete -f tin-model-tout-sep-svcorch.yaml

Combiner sperate pods

[ ]:
!cat combiner-sep-pods.yaml
[ ]:
!kubectl create -f combiner-sep-pods.yaml
[ ]:
!kubectl wait --for condition=ready --timeout=300s sdep --all -n seldon
[ ]:
!curl -s -d '{"data": {"ndarray":[[1.0, 2.0, 5.0]]}}' \
   -X POST http://localhost:8003/seldon/seldon/test/api/v1.0/predictions \
   -H "Content-Type: application/json"
[ ]:
!kubectl delete -f combiner-sep-pods.yaml

Combiner

[ ]:
!cat combiner.yaml
[ ]:
!kubectl create -f combiner.yaml
[ ]:
!kubectl wait --for condition=ready --timeout=300s sdep --all -n seldon
[ ]:
!curl -s -d '{"data": {"ndarray":[[1.0, 2.0, 5.0]]}}' \
   -X POST http://localhost:8003/seldon/seldon/test/api/v1.0/predictions \
   -H "Content-Type: application/json"
[ ]:
!kubectl delete -f combiner.yaml

Combiner seperate pods prepack server

[ ]:
!cat combiner-prepack-sep-pods.yaml
[ ]:
!kubectl create -f combiner-prepack-sep-pods.yaml
[ ]:
!kubectl wait --for condition=ready --timeout=300s sdep --all -n seldon
[ ]:
!curl -s -d '{"data": {"ndarray":[[1.0, 2.0, 5.0, 1.0]]}}' \
   -X POST http://localhost:8003/seldon/seldon/test/api/v1.0/predictions \
   -H "Content-Type: application/json"
[ ]:
!kubectl delete -f combiner-sep-pods.yaml

Combiner prepack server same pod

[ ]:
!cat combiner-prepack.yaml
[ ]:
!kubectl create -f combiner-prepack.yaml
[ ]:
!kubectl wait --for condition=ready --timeout=300s sdep --all -n seldon
[ ]:
!curl -s -d '{"data": {"ndarray":[[1.0, 2.0, 5.0, 1.0]]}}' \
   -X POST http://localhost:8003/seldon/seldon/test/api/v1.0/predictions \
   -H "Content-Type: application/json"
[ ]:
!kubectl delete -f combiner-sep-pods.yaml
[ ]: