tryolabs / k8s-demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

k8s-demo

Example of a couple of use cases for kubernetes that could be useful in ML.

Demos

  1. First demo shows how to train a pytorch model for MNIST as a Kubernetes Job. See train for more details
  2. Second demo shows how to use canary deployments on a simple API. See api for more details

Local setup

  1. Install docker
  2. Clone this repo
  3. Optionally but recommended:
    1. Install pyenv and run pyenv install
    2. Setup a virtualenv with python -m venv .venv and activate with source .venv/bin/activate
    3. Install dev requirements with pip install -r requirements.txt
  4. Install kubectl

Cluster setup

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.

Minikube setup

  1. Install minikube
  2. Use this script to setup a GPU-enabled cluster or a vanilla cluster.

About


Languages

Language:Python 78.7%Language:Shell 17.7%Language:Dockerfile 3.6%