Skip to content

Commit

Permalink
Merge pull request #290 from cliveseldon/python_versions
Browse files Browse the repository at this point in the history
WIP: Create python 3.6 and 3.7 wrapper versions
  • Loading branch information
ukclivecox authored Nov 11, 2018
2 parents 52eb749 + ae7e7d9 commit 38f22e5
Show file tree
Hide file tree
Showing 32 changed files with 225 additions and 2,058 deletions.
22 changes: 12 additions & 10 deletions docs/wrappers/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ If you are not familiar with s2i you can read [general instructions on using s2i
To check everything is working you can run

```bash
s2i usage seldonio/seldon-core-s2i-python3:0.2
s2i usage seldonio/seldon-core-s2i-python3:0.3
```


Expand Down Expand Up @@ -83,23 +83,25 @@ These values can also be provided or overridden on the command line when buildin
# Step 3 - Build your image
Use ```s2i build``` to create your Docker image from source code. You will need Docker installed on the machine and optionally git if your source code is in a public git repo. You can choose from three python builder images

* Python 2 : seldonio/seldon-core-s2i-python2:0.2
* Python 3 : seldonio/seldon-core-s2i-python3:0.2
* Python 3 plus ONNX support via [Intel nGraph](https://github.com/NervanaSystems/ngraph) : seldonio/seldon-core-s2i-python3-ngraph-onnx:0.1
* Python 2 : seldonio/seldon-core-s2i-python2:0.3
* Python 3.6 : seldonio/seldon-core-s2i-python36:0.3, seldonio/seldon-core-s2i-python3:0.3
* Python 3.7 : seldonio/seldon-core-s2i-python37:0.3
* Note there are [issues running TensorFlow under Python 3.7](https://github.com/tensorflow/tensorflow/issues/20444) (Nov 2018)
* Python 3.6 plus ONNX support via [Intel nGraph](https://github.com/NervanaSystems/ngraph) : seldonio/seldon-core-s2i-python3-ngraph-onnx:0.1

Using s2i you can build directly from a git repo or from a local source folder. See the [s2i docs](https://github.com/openshift/source-to-image/blob/master/docs/cli.md#s2i-build) for further details. The general format is:

```bash
s2i build <git-repo> seldonio/seldon-core-s2i-python2:0.2 <my-image-name>
s2i build <src-folder> seldonio/seldon-core-s2i-python2:0.2 <my-image-name>
s2i build <git-repo> seldonio/seldon-core-s2i-python2:0.3 <my-image-name>
s2i build <src-folder> seldonio/seldon-core-s2i-python2:0.3 <my-image-name>
```

Change to seldonio/seldon-core-s2i-python3 if using python 3.

An example invocation using the test template model inside seldon-core:

```bash
s2i build https://github.com/seldonio/seldon-core.git --context-dir=wrappers/s2i/python/test/model-template-app seldonio/seldon-core-s2i-python2:0.2 seldon-core-template-model
s2i build https://github.com/seldonio/seldon-core.git --context-dir=wrappers/s2i/python/test/model-template-app seldonio/seldon-core-s2i-python2:0.3 seldon-core-template-model
```

The above s2i build invocation:
Expand All @@ -114,14 +116,14 @@ For building from a local source folder, an example where we clone the seldon-co
```bash
git clone https://github.com/seldonio/seldon-core.git
cd seldon-core
s2i build wrappers/s2i/python/test/model-template-app seldonio/seldon-core-s2i-python2:0.2 seldon-core-template-model
s2i build wrappers/s2i/python/test/model-template-app seldonio/seldon-core-s2i-python2:0.3 seldon-core-template-model
```

For more help see:

```
s2i usage seldonio/seldon-core-s2i-python2:0.2
s2i usage seldonio/seldon-core-s2i-python3:0.2
s2i usage seldonio/seldon-core-s2i-python2:0.3
s2i usage seldonio/seldon-core-s2i-python3:0.3
s2i build --help
```

Expand Down
4 changes: 2 additions & 2 deletions examples/models/deep_mnist/deep_mnist.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"metadata": {},
"outputs": [],
"source": [
"!s2i build . seldonio/seldon-core-s2i-python2:0.2 deep-mnist:0.1"
"!s2i build . seldonio/seldon-core-s2i-python2:0.3 deep-mnist:0.1"
]
},
{
Expand Down Expand Up @@ -190,7 +190,7 @@
"metadata": {},
"outputs": [],
"source": [
"!eval $(minikube docker-env) && s2i build . seldonio/seldon-core-s2i-python2:0.2 deep-mnist:0.1"
"!eval $(minikube docker-env) && s2i build . seldonio/seldon-core-s2i-python2:0.3 deep-mnist:0.1"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions examples/models/keras_mnist/keras_mnist.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
"metadata": {},
"outputs": [],
"source": [
"!s2i build . seldonio/seldon-core-s2i-python3:0.2 keras-mnist:0.1"
"!s2i build . seldonio/seldon-core-s2i-python3:0.3 keras-mnist:0.1"
]
},
{
Expand Down Expand Up @@ -358,7 +358,7 @@
"metadata": {},
"outputs": [],
"source": [
"!eval $(minikube docker-env) && s2i build . seldonio/seldon-core-s2i-python3:0.2 keras-mnist:0.1"
"!eval $(minikube docker-env) && s2i build . seldonio/seldon-core-s2i-python3:0.3 keras-mnist:0.1"
]
},
{
Expand Down
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-SNAPSHOT ${IMAGE_BASE}_rest:${VERSION}
s2i build -E environment_rest . seldonio/seldon-core-s2i-python3:0.3 ${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-SNAPSHOT ${IMAGE_BASE}_grpc:${VERSION}
s2i build -E environment_grpc . seldonio/seldon-core-s2i-python3:0.3 ${IMAGE_BASE}_grpc:${VERSION}

push_grpc:
docker push ${IMAGE_BASE}_grpc:${VERSION}
2 changes: 1 addition & 1 deletion examples/models/nvidia-mnist/nvidia_mnist.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@
}
],
"source": [
"!s2i build . seldonio/seldon-core-s2i-python3:0.2 mnist-caffe2-transformer:0.1"
"!s2i build . seldonio/seldon-core-s2i-python3:0.3 mnist-caffe2-transformer:0.1"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion examples/models/onnx_resnet50/contract.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dtype":"FLOAT",
"ftype":"continuous",
"range":[0,1],
"shape":[100]
"shape":[1000]
}
]
}
Expand Down
4 changes: 2 additions & 2 deletions examples/models/onnx_resnet50/onnx_resnet50.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"metadata": {},
"outputs": [],
"source": [
"!s2i build . seldonio/seldon-core-s2i-python3-ngraph-onnx:0.1 onnx-resnet:0.1"
"!s2i build . seldonio/seldon-core-s2i-python3-ngraph-onnx:0.2 onnx-resnet:0.1"
]
},
{
Expand Down Expand Up @@ -228,7 +228,7 @@
"metadata": {},
"outputs": [],
"source": [
"!eval $(minikube docker-env) && s2i build . seldonio/seldon-core-s2i-python3-ngraph-onnx:0.1 onnx-resnet:0.1"
"!eval $(minikube docker-env) && s2i build . seldonio/seldon-core-s2i-python3-ngraph-onnx:0.2 onnx-resnet:0.1"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions examples/models/sk_mnist/skmnist.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"metadata": {},
"outputs": [],
"source": [
"!s2i build . seldonio/seldon-core-s2i-python3:0.2 sk-mnist:0.1"
"!s2i build . seldonio/seldon-core-s2i-python3:0.3 sk-mnist:0.1"
]
},
{
Expand Down Expand Up @@ -198,7 +198,7 @@
"metadata": {},
"outputs": [],
"source": [
"!eval $(minikube docker-env) && s2i build . seldonio/seldon-core-s2i-python3:0.2 sk-mnist:0.1"
"!eval $(minikube docker-env) && s2i build . seldonio/seldon-core-s2i-python3:0.3 sk-mnist:0.1"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions examples/models/sklearn_iris/sklearn_iris.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"metadata": {},
"outputs": [],
"source": [
"!s2i build . seldonio/seldon-core-s2i-python3:0.2 sklearn-iris:0.1"
"!s2i build . seldonio/seldon-core-s2i-python3:0.3 sklearn-iris:0.1"
]
},
{
Expand Down Expand Up @@ -137,7 +137,7 @@
"metadata": {},
"outputs": [],
"source": [
"!s2i build -E .s2i/environment_grpc . seldonio/seldon-core-s2i-python3:0.2 sklearn-iris:0.1"
"!s2i build -E .s2i/environment_grpc . seldonio/seldon-core-s2i-python3:0.3 sklearn-iris:0.1"
]
},
{
Expand Down Expand Up @@ -251,7 +251,7 @@
"metadata": {},
"outputs": [],
"source": [
"!eval $(minikube docker-env) && s2i build . seldonio/seldon-core-s2i-python3:0.2 sklearn-iris:0.1"
"!eval $(minikube docker-env) && s2i build . seldonio/seldon-core-s2i-python3:0.3 sklearn-iris:0.1"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion examples/models/sklearn_iris_fbs/sklearn_iris.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"metadata": {},
"outputs": [],
"source": [
"!s2i build . seldonio/seldon-core-s2i-python3:0.2 sklearn-iris:0.1"
"!s2i build . seldonio/seldon-core-s2i-python3:0.3 sklearn-iris:0.1"
]
},
{
Expand Down
Loading

0 comments on commit 38f22e5

Please sign in to comment.