Skip to content

A work-in-progress tutorial on how to expose a sklearn model via gRPC and deploy it via kubernetes

License

Notifications You must be signed in to change notification settings

pprett/grpc-kubernetes-skl-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WORK-IN-PROGRESS

Development

Create a virtualenv:

$ mkvirtualenv grpc

Ensure you have pip version 8 or higher:

$ pip install -U pip

Install dependencies:

$ pip install -r requirements.txt

Create the Stubs

Build the server and client stubs from the proto files:

$ python -m grpc.tools.protoc -Iskl --python_out=skl-server --grpc_python_out=skl-server skl/skl.proto
$ python -m grpc.tools.protoc -Iskl --python_out=skl-server --grpc_python_out=skl-server skl/predict.proto
$ python -m grpc.tools.protoc -Iskl --python_out=skl-server --grpc_python_out=skl-server skl/model.proto
$ python -m grpc.tools.protoc -Iskl --python_out=skl-server --grpc_python_out=skl-server skl/dataframe.proto

Testing

Start the server:

$ cd skl-server
$ python skl_server.py

Start the client:

$ cd skl-server
$ python skl_client.py

Build Docker images

Build the skl-server Docker image:

$ docker build -f skl-server/Dockerfile \
  -t pprett/skl-server:0.0.1 \
  skl-server/

About

A work-in-progress tutorial on how to expose a sklearn model via gRPC and deploy it via kubernetes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published