* Intial process of moving dependency management to poetry Signed-off-by: Andrews Arokiam <[email protected]> update test dependencies Signed-off-by: Andrews Arokiam <[email protected]> Add strict dependency versions Signed-off-by: Andrews Arokiam <[email protected]> Remove setup.py and requirements.txt in python sdk Signed-off-by: Andrews Arokiam <[email protected]> * Add toml and lock file and remove setup.py for aiffairness Signed-off-by: Andrews Arokiam <[email protected]> Add toml and lock file and remove setup.py for aixexplainer Signed-off-by: Andrews Arokiam <[email protected]> Update readme of kserve sdk Signed-off-by: Andrews Arokiam <[email protected]> Add toml and lock file and remove setup.py for alibiexplainer Signed-off-by: Andrews Arokiam <[email protected]> Add packages in toml file for alibi and aix explainers Signed-off-by: Andrews Arokiam <[email protected]> Add toml and lock file and remove setup.py for artexplainer Signed-off-by: Andrews Arokiam <[email protected]> Add toml and lock file and remove setup.py for lgbserver Signed-off-by: Andrews Arokiam <[email protected]> * Add toml and lock file and remove setup.py for paddleserver Signed-off-by: Andrews Arokiam <[email protected]> Add toml and lock file and remove setup.py for pmmlserver Signed-off-by: Andrews Arokiam <[email protected]> Add toml and lock file and remove setup.py for sklearn server Signed-off-by: Andrews Arokiam <[email protected]> Add toml and lock file and remove setup.py for xgbserver Signed-off-by: Andrews Arokiam <[email protected]> update author name in aliibi explainer Signed-off-by: Andrews Arokiam <[email protected]> loosen pinned dependencies to allow patch level updates Signed-off-by: Andrews Arokiam <[email protected]> Add toml and lock file for custom model Signed-off-by: Andrews Arokiam <[email protected]> Add toml and lock file and remove setup.py for custom transformer Signed-off-by: Andrews Arokiam <[email protected]> Update readme Signed-off-by: Andrews Arokiam <[email protected]> * Bump joblib version to 1.0.0 in sklearn server Signed-off-by: Andrews Arokiam <[email protected]> Add constraint for numpy <1.24.0 Signed-off-by: Andrews Arokiam <[email protected]> Update python constraint >=3.7 for aixexplainer Signed-off-by: Andrews Arokiam <[email protected]> Bump joblib version to 1.2 in alibi Signed-off-by: Andrews Arokiam <[email protected]> Add docker build and push rules in makefile for art explainer and aiffairness Signed-off-by: Andrews Arokiam <[email protected]> Add missing dependency pillow to art explainer Signed-off-by: Andrews Arokiam <[email protected]> Update python Dockerfiles to use poetry Signed-off-by: Andrews Arokiam <[email protected]> Bump kserve version to 0.10.0 Signed-off-by: Andrews Arokiam <[email protected]> Update python unit test workflow Signed-off-by: Andrews Arokiam <[email protected]> Update python sdk publish workflow Signed-off-by: Andrews Arokiam <[email protected]> Update e2e test gh-actions Signed-off-by: Andrews Arokiam <[email protected]> fix e2e test workflow Signed-off-by: Andrews Arokiam <[email protected]> revert kserve version to 0.10.0rc1 Signed-off-by: Andrews Arokiam <[email protected]> update qpext e2e test script Signed-off-by: Andrews Arokiam <[email protected]> fix sklearn workflow step name Signed-off-by: Andrews Arokiam <[email protected]> update authors for kserve sdk Signed-off-by: Andrews Arokiam <[email protected]> update custom transformer description Signed-off-by: Andrews Arokiam <[email protected]> update helm test workflow to use poetry Signed-off-by: Andrews Arokiam <[email protected]> add constraint fastapi <=0.88.0 Signed-off-by: Andrews Arokiam <[email protected]> Add script for updating release version in toml files Signed-off-by: Andrews Arokiam <[email protected]> Add separate job for py 3.7 build unit test Signed-off-by: Andrews Arokiam <[email protected]> Add pytest-cov dependency Signed-off-by: Andrews Arokiam <[email protected]> * Fix missing dependency and update lock file Signed-off-by: Andrews Arokiam <[email protected]> Fix alibi explainer dependency errors Signed-off-by: Andrews Arokiam <[email protected]> Update version of kserve in all packages Signed-off-by: Andrews Arokiam <[email protected]> Add missing triton client Signed-off-by: Andrews Arokiam <[email protected]> Loosen protobuf and numpy dependency and replace table logger with tabulate Signed-off-by: Andrews Arokiam <[email protected]> Bump pillow from 9.0.1 to 9.3.0 in /python/custom_transformer Signed-off-by: Andrews Arokiam <[email protected]> * update release version to 0.10.1 Signed-off-by: Andrews Arokiam <[email protected]> upgrade poetry to 1.4.0 Signed-off-by: Andrews Arokiam <[email protected]> fix custom model Signed-off-by: Andrews Arokiam <[email protected]> resolve conflicts with making storage as optional dependency Signed-off-by: Andrews Arokiam <[email protected]> fix kserve sdk unit test Signed-off-by: Andrews Arokiam <[email protected]> fix alibi explainer build failure Signed-off-by: Andrews Arokiam <[email protected]> improve dockerfiles by introducing parameters Signed-off-by: Andrews Arokiam <[email protected]> Remove obsolete requirements and setup.py Signed-off-by: Andrews Arokiam <[email protected]> fix python test workflow Signed-off-by: Andrews Arokiam <[email protected]> fix aixexplainer build failure Signed-off-by: Andrews Arokiam <[email protected]> fix paddle server test failure Signed-off-by: Andrews Arokiam <[email protected]> upgrade torchvision to 0.15.1 in custom model Signed-off-by: Andrews Arokiam <[email protected]> Prune explainer dangling explainer images to free up space Signed-off-by: Andrews Arokiam <[email protected]> * Increase timeout for test-fast and test-slow test-fast and test-slow were failing with timeout and the timeout has been increased Signed-off-by: Andrews Arokiam <[email protected]> * Remove numpy in art explainer Remove numpy dependency in art explainer as kserve already specifies the dependency Signed-off-by: Andrews Arokiam <[email protected]> * Rebase 'Implement v2/open inference endpoints for OOTB python model servers' changes Signed-off-by: Andrews Arokiam <[email protected]> * Update pyproject and poetry.lock for pandas and fastapi changes Signed-off-by: Andrews Arokiam <[email protected]> * Added poetry version with poetry install Signed-off-by: Andrews Arokiam <[email protected]> * Fix storage initializer Remove alibi test for python 3.7 Signed-off-by: Andrews Arokiam <[email protected]> * Updated python base image Signed-off-by: Andrews Arokiam <[email protected]> --------- Signed-off-by: Andrews Arokiam <[email protected]>
2.3 KiB
Scikit-Learn Server
Scikit-Learn server is an implementation for serving Scikit-learn models, and provides a Scikit-learn model implementation for prediction, pre and post processing.
To start the server locally for development needs, run the following command under this folder in your github repository.
make dev_install
Once Scikit-learn server is up and running, you can check for successful installation by running the following command
python3 -m sklearnserver
usage: __main__.py [-h] [--http_port HTTP_PORT] [--grpc_port GRPC_PORT]
--model_dir MODEL_DIR [--model_name MODEL_NAME]
__main__.py: error: the following arguments are required: --model_dir
You can now point to your joblib or pkl model file and use the server to load the model and test for prediction. Models can be on local filesystem, S3 compatible object storage, Azure Blob Storage, or Google Cloud Storage. If both joblib and pickle formats are presented, joblib model will get loaded. Please follow this sample to test your server by generating your own model.
Development
Install the development dependencies with:
make dev_install
To run tests, please change the test file to point to your model.joblib file. Then run the following command:
make test
To run static type checks:
mypy --ignore-missing-imports sklearnserver
An empty result will indicate success.
Building your own Scikit-Learn Server Docker Image
You can build and publish your own image for development needs. Please ensure that you modify the inferenceservice files for Scikit-Learn in the api directory to point to your own image.
To build your own image, navigate up one directory level to the python directory and run:
docker build -t docker_user_name/sklearnserver -f sklearn.Dockerfile .
Sometimes you may want to build the SKLearnServer image with a different version of SKLearn, you can modify the version "scikit-learn == X.X.X" in setup.py and build the image with
tag like docker_user_name/sklearnserver:0.24.
To push your image to your dockerhub repo,
docker push docker_user_name/sklearnserver:latest