Example of a couple of use cases for kubernetes that could be useful in ML.
- First demo shows how to train a pytorch model for MNIST as a Kubernetes Job. See train for more details
- Second demo shows how to use canary deployments on a simple API. See api for more details
- Install docker
- Clone this repo
- Optionally but recommended:
- Install pyenv and run
pyenv install
- Setup a virtualenv with
python -m venv .venv
and activate withsource .venv/bin/activate
- Install dev requirements with
pip install -r requirements.txt
- Install pyenv and run
- Install kubectl
I only tested this on minikube, for the first demo I used my local GPU on minikube which requires sudo for alternatives look into train.
- Install minikube
- Use this script to setup a GPU-enabled cluster or a vanilla cluster.