Skip to content

Commit

Permalink
Updated CPP example to use latest 3.8 base image (#4026)
Browse files Browse the repository at this point in the history
  • Loading branch information
axsaucedo authored Apr 5, 2022
1 parent aeb76ef commit 5b91084
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 39 deletions.
6 changes: 3 additions & 3 deletions examples/models/cpp/buildsystem-override/README.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
}
],
"source": [
"!docker run --name \"advanced_cpp\" -d --rm -p 5000:5000 seldonio/advanced-cpp:0.1"
"!docker run --name \"advanced_cpp\" -d --rm -p 9000:9000 seldonio/advanced-cpp:0.1"
]
},
{
Expand All @@ -272,7 +272,7 @@
"source": [
"!curl -X POST -H 'Content-Type: application/json' \\\n",
" -d '{\"strData\":\"hello\"}' \\\n",
" http://localhost:5000/api/v1.0/predictions"
" http://localhost:9000/api/v1.0/predictions"
]
},
{
Expand Down Expand Up @@ -402,7 +402,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.8"
"version": "3.7.10"
}
},
"nbformat": 4,
Expand Down
14 changes: 7 additions & 7 deletions examples/models/cpp/buildsystem-override/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

In this example we will show how we can wrap a complex CPP project by extending the buildsystem defaults provided, which will give us flexibility to configure the required bindings.

If you are looking for a basic implementation of the C++ wrapper, you can get started with the ["Single file C++ Example"](../simple-cpp/README.ipynb).
If you are looking for a basic implementation of the C++ wrapper, you can get started with the ["Single file C++ Example"](https://docs.seldon.io/projects/seldon-core/en/latest/examples/cpp_simple.html).

You can read about how to configure your environment in the [CPP Wrapper documentation page](https://docs.seldon.io/projects/seldon-core/en/latest/cpp/README.html).

Expand Down Expand Up @@ -106,7 +106,7 @@ In our case it is `CustomSeldonPackage.MyModelClass` as follows:

```python
%writefile .s2i/environment
MODEL_NAME=CustomSeldonPackage.MyModelClass
MODEL_NAME = CustomSeldonPackage.MyModelClass
```

UsageError: Line magic function `%writefile` not found (But cell magic `%%writefile` exists, did you mean that instead?).
Expand Down Expand Up @@ -153,10 +153,10 @@ We can now build our seldon microservice using `s2i`:


```python
!docker run --name "advanced_cpp" -d --rm -p 5000:5000 seldonio/advanced-cpp:0.1
!docker run --name "advanced_cpp" -d --rm -p 9000:9000 seldonio/advanced-cpp:0.1
```

aaa5795779f2e605f7ead2772e912c8dd7de04002457eb4b3966b2b2182c63f4
aaa5795779f2e605f7ead2772e912c8dd7de04002457eb4b3966b2b2182c63f4


### Send request (which should return the same value)
Expand All @@ -165,7 +165,7 @@ We can now build our seldon microservice using `s2i`:
```python
!curl -X POST -H 'Content-Type: application/json' \
-d '{"strData":"hello"}' \
http://localhost:5000/api/v1.0/predictions
http://localhost:9000/api/v1.0/predictions
```

{"strData":"hello"}
Expand All @@ -177,7 +177,7 @@ We can now build our seldon microservice using `s2i`:
!docker rm -f "advanced_cpp"
```

advanced_cpp
advanced_cpp


## Deploy to seldon
Expand Down Expand Up @@ -223,7 +223,7 @@ END
!kubectl delete sdep advanced-cpp
```

seldondeployment.machinelearning.seldon.io "advanced-cpp" deleted
seldondeployment.machinelearning.seldon.io "advanced-cpp" deleted



Expand Down
37 changes: 21 additions & 16 deletions examples/models/cpp/simple-cpp/README.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -77,7 +77,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 2,
"metadata": {},
"outputs": [
{
Expand All @@ -91,18 +91,23 @@
"Installing collected packages: SeldonPackage\n",
"Running setup.py develop for SeldonPackage\n",
"Successfully installed SeldonPackage\n",
"WARNING: Url '/whl' is ignored. It is either a non-existing path or lacks a specific scheme.\n",
"WARNING: You are using pip version 20.2; however, version 22.0.4 is available.\n",
"You should consider upgrading via the '/opt/conda/bin/python -m pip install --upgrade pip' command.\n",
"Collecting pip-licenses\n",
"Downloading https://files.pythonhosted.org/packages/08/b4/6e53ab4e82e2b9f8356dd17d7b9e30cba57ba0460186c92cc05e8a1a7f97/pip_licenses-3.0.0-py3-none-any.whl\n",
"Collecting PTable (from pip-licenses)\n",
"Downloading https://files.pythonhosted.org/packages/ab/b3/b54301811173ca94119eb474634f120a49cd370f257d1aae5a4abaf12729/PTable-0.9.2.tar.gz\n",
"Downloading pip_licenses-3.5.3-py3-none-any.whl (17 kB)\n",
"Collecting PTable\n",
"Downloading PTable-0.9.2.tar.gz (31 kB)\n",
"Building wheels for collected packages: PTable\n",
"Building wheel for PTable (setup.py): started\n",
"Building wheel for PTable (setup.py): finished with status 'done'\n",
"Created wheel for PTable: filename=PTable-0.9.2-cp37-none-any.whl size=22906 sha256=f8ceb5d135fae9aad1de576924d11560c8a004a59c489b980412a974eeffd694\n",
"Stored in directory: /root/.cache/pip/wheels/22/cc/2e/55980bfe86393df3e9896146a01f6802978d09d7ebcba5ea56\n",
"Created wheel for PTable: filename=PTable-0.9.2-py3-none-any.whl size=22908 sha256=3957aaca98c08e334c02711f973964454d089ed7ec1d25760986f01af67dde69\n",
"Stored in directory: /root/.cache/pip/wheels/1b/3a/02/8d8da2bca2223dda2f827949c88b2d82dc85dccbc2bb6265e5\n",
"Successfully built PTable\n",
"Installing collected packages: PTable, pip-licenses\n",
"Successfully installed PTable-0.9.2 pip-licenses-3.0.0\n",
"Successfully installed PTable-0.9.2 pip-licenses-3.5.3\n",
"WARNING: You are using pip version 20.2; however, version 22.0.4 is available.\n",
"You should consider upgrading via the '/opt/conda/bin/python -m pip install --upgrade pip' command.\n",
"created path: ./licenses/license_info.csv\n",
"created path: ./licenses/license.txt\n",
"Build completed successfully\n"
Expand All @@ -122,19 +127,19 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 16,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"19f989a0ae389e041c4daf915067016a6ab8dc569873948a1099442a249ec502\n"
"8027cd995ae3012286abfccaa0cb12be0688997f2d156d0d415e118b06a3a60f\r\n"
]
}
],
"source": [
"!docker run --name \"simple_cpp\" -d --rm -p 5000:5000 seldonio/simple-cpp:0.1"
"!docker run --name \"simple_cpp\" -d --rm -p 9000:9000 seldonio/simple-cpp:0.1"
]
},
{
Expand All @@ -146,7 +151,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 18,
"metadata": {},
"outputs": [
{
Expand All @@ -160,7 +165,7 @@
"source": [
"!curl -X POST -H 'Content-Type: application/json' \\\n",
" -d '{\"strData\":\"hello\"}' \\\n",
" http://localhost:5000/api/v1.0/predictions"
" http://localhost:9000/api/v1.0/predictions"
]
},
{
Expand All @@ -172,14 +177,14 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 15,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"simple_cpp\n"
"simple_cpp\r\n"
]
}
],
Expand Down Expand Up @@ -290,7 +295,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.8"
"version": "3.7.10"
}
},
"nbformat": 4,
Expand Down
27 changes: 16 additions & 11 deletions examples/models/cpp/simple-cpp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

In this example we will show how we can wrap a simple CPP project with the default parameters, which will enable us to just provide a single CPP file.

If you want to wrap an existing library, or you have more complex requirements please refer to the ["Build system override CPP Wrapper example"](../buildsystem-override/README.ipynb).
If you want to wrap an existing library, or you have more complex requirements please refer to the ["Build system override CPP Wrapper example"](https://docs.seldon.io/projects/seldon-core/en/latest/examples/cpp_advanced.html).

You can read about how to configure your environment in the [CPP Wrapper page](https://docs.seldon.io/projects/seldon-core/en/latest/cpp/README.html).

Expand Down Expand Up @@ -57,18 +57,23 @@ We can now build our seldon microservice using `s2i`:
Installing collected packages: SeldonPackage
Running setup.py develop for SeldonPackage
Successfully installed SeldonPackage
WARNING: Url '/whl' is ignored. It is either a non-existing path or lacks a specific scheme.
WARNING: You are using pip version 20.2; however, version 22.0.4 is available.
You should consider upgrading via the '/opt/conda/bin/python -m pip install --upgrade pip' command.
Collecting pip-licenses
Downloading https://files.pythonhosted.org/packages/08/b4/6e53ab4e82e2b9f8356dd17d7b9e30cba57ba0460186c92cc05e8a1a7f97/pip_licenses-3.0.0-py3-none-any.whl
Collecting PTable (from pip-licenses)
Downloading https://files.pythonhosted.org/packages/ab/b3/b54301811173ca94119eb474634f120a49cd370f257d1aae5a4abaf12729/PTable-0.9.2.tar.gz
Downloading pip_licenses-3.5.3-py3-none-any.whl (17 kB)
Collecting PTable
Downloading PTable-0.9.2.tar.gz (31 kB)
Building wheels for collected packages: PTable
Building wheel for PTable (setup.py): started
Building wheel for PTable (setup.py): finished with status 'done'
Created wheel for PTable: filename=PTable-0.9.2-cp37-none-any.whl size=22906 sha256=f8ceb5d135fae9aad1de576924d11560c8a004a59c489b980412a974eeffd694
Stored in directory: /root/.cache/pip/wheels/22/cc/2e/55980bfe86393df3e9896146a01f6802978d09d7ebcba5ea56
Created wheel for PTable: filename=PTable-0.9.2-py3-none-any.whl size=22908 sha256=3957aaca98c08e334c02711f973964454d089ed7ec1d25760986f01af67dde69
Stored in directory: /root/.cache/pip/wheels/1b/3a/02/8d8da2bca2223dda2f827949c88b2d82dc85dccbc2bb6265e5
Successfully built PTable
Installing collected packages: PTable, pip-licenses
Successfully installed PTable-0.9.2 pip-licenses-3.0.0
Successfully installed PTable-0.9.2 pip-licenses-3.5.3
WARNING: You are using pip version 20.2; however, version 22.0.4 is available.
You should consider upgrading via the '/opt/conda/bin/python -m pip install --upgrade pip' command.
created path: ./licenses/license_info.csv
created path: ./licenses/license.txt
Build completed successfully
Expand All @@ -78,10 +83,10 @@ We can now build our seldon microservice using `s2i`:


```python
!docker run --name "simple_cpp" -d --rm -p 5000:5000 seldonio/simple-cpp:0.1
!docker run --name "simple_cpp" -d --rm -p 9000:9000 seldonio/simple-cpp:0.1
```

19f989a0ae389e041c4daf915067016a6ab8dc569873948a1099442a249ec502
8027cd995ae3012286abfccaa0cb12be0688997f2d156d0d415e118b06a3a60f


### Send request (which should return the same value)
Expand All @@ -90,7 +95,7 @@ We can now build our seldon microservice using `s2i`:
```python
!curl -X POST -H 'Content-Type: application/json' \
-d '{"strData":"hello"}' \
http://localhost:5000/api/v1.0/predictions
http://localhost:9000/api/v1.0/predictions
```

{"strData":"hello"}
Expand Down Expand Up @@ -148,7 +153,7 @@ END
!kubectl delete sdep simple-cpp
```

seldondeployment.machinelearning.seldon.io "simple-cpp" deleted
seldondeployment.machinelearning.seldon.io "simple-cpp" deleted



Expand Down
4 changes: 2 additions & 2 deletions incubating/wrappers/s2i/cpp/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
BASE_IMAGE_TAG := 1.5.0-dev
BASE_IMAGE_NAME := docker.io/seldonio/seldon-core-s2i-python37-ubi8
BASE_IMAGE_TAG := 1.14.0-dev
BASE_IMAGE_NAME := docker.io/seldonio/seldon-core-s2i-python38
SHELL := /bin/bash
SELDON_CORE_DIR = ../../../../
VERSION := 0.0.1
Expand Down

0 comments on commit 5b91084

Please sign in to comment.