All Projects → kubeflow → Example Seldon

kubeflow / Example Seldon

Licence: apache-2.0
Example for end-to-end machine learning on Kubernetes using Kubeflow and Seldon Core

Projects that are alternatives of or similar to Example Seldon

Py Rfcn Priv
code for py-R-FCN-multiGPU maintained by bupt-priv
Stars: ✭ 153 (-0.65%)
Mutual labels:  jupyter-notebook
Pytorch Question Answering
Important paper implementations for Question Answering using PyTorch
Stars: ✭ 154 (+0%)
Mutual labels:  jupyter-notebook
Raster Vision Examples
Examples of using Raster Vision on open datasets
Stars: ✭ 154 (+0%)
Mutual labels:  jupyter-notebook
Oreilly Captions
Stars: ✭ 153 (-0.65%)
Mutual labels:  jupyter-notebook
Hdbscan
A high performance implementation of HDBSCAN clustering.
Stars: ✭ 2,032 (+1219.48%)
Mutual labels:  jupyter-notebook
Self Learning
Books Papers, Courses & more I have to learn soon
Stars: ✭ 146 (-5.19%)
Mutual labels:  jupyter-notebook
Python Clustering Exercises
Jupyter Notebook exercises for k-means clustering with Python 3 and scikit-learn
Stars: ✭ 153 (-0.65%)
Mutual labels:  jupyter-notebook
Automatic Generation Of Text Summaries
使用两种方法(抽取式Textrank和概要式seq2seq)自动提取文本摘要
Stars: ✭ 155 (+0.65%)
Mutual labels:  jupyter-notebook
Natural Language Processing Specialization
This repo contains my coursework, assignments, and Slides for Natural Language Processing Specialization by deeplearning.ai on Coursera
Stars: ✭ 151 (-1.95%)
Mutual labels:  jupyter-notebook
Robuststl
Unofficial Implementation of RobustSTL: A Robust Seasonal-Trend Decomposition Algorithm for Long Time Series (AAAI 2019)
Stars: ✭ 154 (+0%)
Mutual labels:  jupyter-notebook
Oreilly Intro To Predictive Clv
Repo that contains the supporting material for O'Reilly Webinar "An Intro to Predictive Modeling for Customer Lifetime Value" on Feb 28, 2017
Stars: ✭ 153 (-0.65%)
Mutual labels:  jupyter-notebook
Python Data Visualization Course
Course materials for teaching data visualization in Python.
Stars: ✭ 153 (-0.65%)
Mutual labels:  jupyter-notebook
Python For Probability Statistics And Machine Learning 2e
Second edition of Springer Book Python for Probability, Statistics, and Machine Learning
Stars: ✭ 154 (+0%)
Mutual labels:  jupyter-notebook
Datasciencevm
Tools and Docs on the Azure Data Science Virtual Machine (http://aka.ms/dsvm)
Stars: ✭ 153 (-0.65%)
Mutual labels:  jupyter-notebook
Daguan Classify 2018
2018达观杯长文本分类智能处理挑战赛 18解决方案
Stars: ✭ 154 (+0%)
Mutual labels:  jupyter-notebook
Ios Coreml Yolo
Almost Real-time Object Detection using Apple's CoreML and YOLO v1 -
Stars: ✭ 153 (-0.65%)
Mutual labels:  jupyter-notebook
Hamiltorch
PyTorch-based library for Riemannian Manifold Hamiltonian Monte Carlo (RMHMC) and inference in Bayesian neural networks
Stars: ✭ 153 (-0.65%)
Mutual labels:  jupyter-notebook
Data Science Stack Cookiecutter
🐳📊🤓Cookiecutter template to launch an awesome dockerized Data Science toolstack (incl. Jupyster, Superset, Postgres, Minio, AirFlow & API Star)
Stars: ✭ 153 (-0.65%)
Mutual labels:  jupyter-notebook
Nlp Interview Notes
📚 专门为自然语言处理(NLP)面试准备的学习笔记与资料
Stars: ✭ 154 (+0%)
Mutual labels:  jupyter-notebook
Mastering Python For Finance Second Edition
Mastering Python for Finance – Second Edition, published by Packt
Stars: ✭ 153 (-0.65%)
Mutual labels:  jupyter-notebook

Train and Deploy Machine Learning Models on Kubernetes with Kubeflow and Seldon-Core

MNIST

Using:

The example will be the MNIST handwritten digit classification task. We will train 3 different models to solve this task:

  • A TensorFlow neural network model.
  • A scikit-learn random forest model.
  • An R least squares model.

We will then show various rolling deployments

  1. Deploy the single Tensorflow model.
  2. Do a rolling update to an AB test of the Tensorflow model and the sklearn model.
  3. Do a rolling update to a Multi-armed Bandit over all 3 models to direct traffic in real time to the best model.

In the follow we will:

  1. Install kubeflow and seldon-core on a kubernetes cluster
  2. Train the models
  3. Serve the models

Requirements

  • gcloud
  • kubectl
  • ksonnet
  • argo

Setup

There is a consolidated script to create the demo which can be found here. For a step by step guide do the following:

  1. Install kubeflow on GKE. This should create kubeflow in a namespace kubeflow. We suggest you use the command line install so you can easily modify your Ksonnet installation. Ensure you have the environment variables KUBEFLOW_SRC and KFAPP set. OAUTH is preferred as with basic auth port-forwarding to ambassador is insufficient

  2. Install seldon. Go to your Ksonnet application folder setup in the previous step and run

    cd ${KUBEFLOW_SRC}/${KFAPP}/ks_app
    
    ks pkg install kubeflow/seldon
    ks generate seldon seldon
    ks apply default -c seldon
    
  3. Install Helm

    kubectl -n kube-system create sa tiller
    kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
    helm init --service-account tiller
    kubectl rollout status deploy/tiller-deploy -n kube-system
    
  4. Create an NFS disk and persistent volume claim called nfs-1. You can follow one guide on create an NFS volume using Google Filestore here. A consolidated set of steps is shown here

  5. Add Cluster Roles so Argo can start jobs successfully

    kubectl create clusterrolebinding my-cluster-admin-binding --clusterrole=cluster-admin --user=$(gcloud info --format="value(config.account)")
    kubectl create clusterrolebinding default-admin2 --clusterrole=cluster-admin --serviceaccount=kubeflow:default
    
  6. Install Seldon Analytics Dashboard

    helm install seldon-core-analytics --name seldon-core-analytics --set grafana_prom_admin_password=password --set persistence.enabled=false --repo https://storage.googleapis.com/seldon-charts --namespace kubeflow
    
  7. Port forward the dashboard when running

    kubectl port-forward $(kubectl get pods -n kubeflow -l app=grafana-prom-server -o jsonpath='{.items[0].metadata.name}') -n kubeflow 3000:3000
    
  8. Visit http://localhost:3000/dashboard/db/prediction-analytics?refresh=5s&orgId=1 and login using "admin" and the password you set above when launching with helm.

MNIST models

Tensorflow Model

SKLearn Model

R Model

Train the Models

Follow the steps in ./notebooks/training.ipynb to:

  • Run Argo Jobs for each model to:
    • Creating training images and push to repo
    • Run training
    • Create runtime prediction images and push to repo
    • Deploy individual runtime model

To push to your own repo the Docker images you will need to setup your docker credentials as a Kubernetes secret containing a config.json. To do this you can find your docker home (typically ~/.docker) and run kubectl create secret generic docker-config --from-file=config.json=${DOCKERHOME}/config.json --type=kubernetes.io/config to create a secret.

Serve the Models

Follow the steps in ./notebooks/serving.ipynb to:

  1. Deploy the single Tensorflow model.
  2. Do a rolling update to an AB test of the Tensorflow model and the sklearn model.
  3. Do a rolling update to a Multi-armed Bandit over all 3 models to direct traffic in real time to the best model.

To ensure the notebook can run successfully install the python dependencies:

pip install -r notebooks/requirements.txt

If you have installed the Seldon-Core analytics you can view them on the grafana dashboard:

Grafana

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].