From 5b910848e3008c1e4f4a997e5eee9b3b11f533c5 Mon Sep 17 00:00:00 2001 From: Alejandro Saucedo Date: Tue, 5 Apr 2022 10:17:25 +0100 Subject: [PATCH] Updated CPP example to use latest 3.8 base image (#4026) --- .../cpp/buildsystem-override/README.ipynb | 6 +-- .../models/cpp/buildsystem-override/README.md | 14 +++---- examples/models/cpp/simple-cpp/README.ipynb | 37 +++++++++++-------- examples/models/cpp/simple-cpp/README.md | 27 ++++++++------ incubating/wrappers/s2i/cpp/Makefile | 4 +- 5 files changed, 49 insertions(+), 39 deletions(-) diff --git a/examples/models/cpp/buildsystem-override/README.ipynb b/examples/models/cpp/buildsystem-override/README.ipynb index 19860b0418..d150f0eafa 100644 --- a/examples/models/cpp/buildsystem-override/README.ipynb +++ b/examples/models/cpp/buildsystem-override/README.ipynb @@ -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" ] }, { @@ -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" ] }, { @@ -402,7 +402,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.8" + "version": "3.7.10" } }, "nbformat": 4, diff --git a/examples/models/cpp/buildsystem-override/README.md b/examples/models/cpp/buildsystem-override/README.md index fa069501e2..821f53b721 100644 --- a/examples/models/cpp/buildsystem-override/README.md +++ b/examples/models/cpp/buildsystem-override/README.md @@ -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). @@ -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?). @@ -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) @@ -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"} @@ -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 @@ -223,7 +223,7 @@ END !kubectl delete sdep advanced-cpp ``` - seldondeployment.machinelearning.seldon.io "advanced-cpp" deleted + seldondeployment.machinelearning.seldon.io "advanced-cpp" deleted diff --git a/examples/models/cpp/simple-cpp/README.ipynb b/examples/models/cpp/simple-cpp/README.ipynb index a900d90282..a3e6fdd255 100644 --- a/examples/models/cpp/simple-cpp/README.ipynb +++ b/examples/models/cpp/simple-cpp/README.ipynb @@ -28,7 +28,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 1, "metadata": {}, "outputs": [ { @@ -77,7 +77,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 2, "metadata": {}, "outputs": [ { @@ -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" @@ -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" ] }, { @@ -146,7 +151,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 18, "metadata": {}, "outputs": [ { @@ -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" ] }, { @@ -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" ] } ], @@ -290,7 +295,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.8" + "version": "3.7.10" } }, "nbformat": 4, diff --git a/examples/models/cpp/simple-cpp/README.md b/examples/models/cpp/simple-cpp/README.md index 6e98663909..f909ad3c5f 100644 --- a/examples/models/cpp/simple-cpp/README.md +++ b/examples/models/cpp/simple-cpp/README.md @@ -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). @@ -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 @@ -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) @@ -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"} @@ -148,7 +153,7 @@ END !kubectl delete sdep simple-cpp ``` - seldondeployment.machinelearning.seldon.io "simple-cpp" deleted + seldondeployment.machinelearning.seldon.io "simple-cpp" deleted diff --git a/incubating/wrappers/s2i/cpp/Makefile b/incubating/wrappers/s2i/cpp/Makefile index d5553cdb8d..d392ceb5eb 100644 --- a/incubating/wrappers/s2i/cpp/Makefile +++ b/incubating/wrappers/s2i/cpp/Makefile @@ -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