A repository to host extended examples and tutorials
Go to file
Jeremy Lewi cc93a80420
Create a notebook for mnist E2E on GCP (#723)
* A notebook to run the mnist E2E example on GCP.

This fixes a number of issues with the example
* Use ISTIO instead of Ambassador to add reverse proxy routes
* The training job needs to be updated to run in a profile created namespace in order to have the required service accounts
     * See kubeflow/examples#713
     * Running inside a notebook running on Kubeflow should ensure user
       is running inside an appropriately setup namespace
* With ISTIO the default RBAC rules prevent the web UI from sending requests to the model server
     * A short term fix was to not include the ISTIO side car
     * In the future we can add an appropriate ISTIO rbac policy

* Using a notebook allows us to eliminate the use of kustomize
  * This resolves kubeflow/examples#713 which required people to use
    and old version of kustomize

  * Rather than using kustomize we can use python f style strings to
    write the YAML specs and then easily substitute in user specific values

  * This should be more informative; it avoids introducing kustomize and
    users can see the resource specs.

* I've opted to make the notebook GCP specific. I think its less confusing
  to users to have separate notebooks focused on specific platforms rather
  than having one notebook with a lot of caveats about what to do under
  different conditions

* I've deleted the kustomize overlays for GCS since we don't want users to
  use them anymore

* I used fairing and kaniko to eliminate the use of docker to build the images
  so that everything can run from a notebook running inside the cluster.

* k8s_utils.py has some reusable functions to add some details from users
  (e.g. low level calls to K8s APIs.)

* * Change the mnist test to just run the notebook
  * Copy the notebook test infra for xgboost_synthetic to py/kubeflow/examples/notebook_test to make it more reusable

* Fix lint.

* Update for lint.

* A notebook to run the mnist E2E example.

Related to: kubeflow/website#1553

* 1. Use fairing to build the model. 2. Construct the YAML spec directly in the notebook. 3. Use the TFJob python SDK.

* Fix the ISTIO rule.

* Fix UI and serving; need to update TF serving to match version trained on.

* Get the IAP endpoint.

* Start writing some helper python functions for K8s.

* Commit before switching from replace to delete.

* Create a library to bulk create objects.

* Cleanup.

* Add back k8s_util.py

* Delete train.yaml; this shouldn't have been aded.

* update the notebook image.

* Refactor code into k8s_util; print out links.

* Clean up the notebok. Should be working E2E.

* Added section to get logs from stackdriver.

* Add comment about profile.

* Latest.

* Override mnist_gcp.ipynb with mnist.ipynb

I accidentally put my latest changes in mnist.ipynb even though that file
was deleted.

* More fixes.

* Resolve some conflicts from the rebase; override with changes on remote branch.
2020-02-16 19:15:28 -08:00
.github Label bot should alias feature to kind/feature 2020-02-13 06:22:23 -08:00
code_search Minor fixes to the notebook. (#427) 2019-01-15 08:33:19 -08:00
codelab-image Update Ksonnet version, Add Python2 pip (#216) 2018-08-07 22:58:20 -07:00
demos Fix broken url for example file in simple_pipeline demos (#660) 2019-10-16 00:59:39 -07:00
financial_time_series Add kubeflow namespace for kubectl commands in Readme for financial time series example (#706) 2019-12-20 11:07:33 -08:00
github_issue_summarization Bump nltk from 3.2.5 to 3.4.5 in /github_issue_summarization (#698) 2019-12-17 15:54:03 -08:00
mnist Create a notebook for mnist E2E on GCP (#723) 2020-02-16 19:15:28 -08:00
named_entity_recognition added named entity recognition example (#590) 2019-09-18 16:41:00 -07:00
object_detection object_detection: fix typo error in tf-serving.libsonnet (#618) 2019-08-14 18:12:34 -07:00
pipelines add note to indicate that mnist pipeline example does not currently work (#726) 2020-02-11 09:56:14 -08:00
py Create a notebook for mnist E2E on GCP (#723) 2020-02-16 19:15:28 -08:00
pytorch_mnist Lint fixes mnist (#581) 2019-07-24 19:23:52 -07:00
tensorflow-horovod Mpi example (#690) 2019-12-09 17:49:29 -08:00
test Create a notebook for mnist E2E on GCP (#723) 2020-02-16 19:15:28 -08:00
videos Add video show notes (#582) 2019-06-28 18:01:24 -07:00
xgboost_ames_housing Add end2end test for Xgboost housing example (#493) 2019-02-12 06:37:05 -08:00
xgboost_synthetic Create a notebook for mnist E2E on GCP (#723) 2020-02-16 19:15:28 -08:00
.gitignore Add .cache dir to gitignore (#573) 2019-06-15 06:52:10 -07:00
.pylintrc Create a notebook for mnist E2E on GCP (#723) 2020-02-16 19:15:28 -08:00
CONTRIBUTING.md Enable periodic tests for mnist & GH issue examples. (#486) 2019-01-22 16:10:17 -08:00
LICENSE Initial commit 2018-02-01 13:13:10 -08:00
OWNERS update_owner (#550) 2019-05-08 21:04:47 -07:00
README.md added named entity recognition example (#590) 2019-09-18 16:41:00 -07:00
prow_config.yaml Create a notebook for mnist E2E on GCP (#723) 2020-02-16 19:15:28 -08:00

README.md

kubeflow-examples

A repository to share extended Kubeflow examples and tutorials to demonstrate machine learning concepts, data science workflows, and Kubeflow deployments. The examples illustrate the happy path, acting as a starting point for new users and a reference guide for experienced users.

This repository is home to the following types of examples and demos:

End-to-end

Named Entity Recognition

Author: Sascha Heyer

This example covers the following concepts:

  1. Build reusable pipeline components
  2. Run Kubeflow Pipelines with Jupyter notebooks
  3. Train a Named Entity Recognition model on a Kubernetes cluster
  4. Deploy a Keras model to AI Platform
  5. Use Kubeflow metrics
  6. Use Kubeflow visualizations

GitHub issue summarization

Author: Hamel Husain

This example covers the following concepts:

  1. Natural Language Processing (NLP) with Keras and Tensorflow
  2. Connecting to Jupyterhub
  3. Shared persistent storage
  4. Training a Tensorflow model
    1. CPU
    2. GPU
  5. Serving with Seldon Core
  6. Flask front-end

Pachyderm Example - GitHub issue summarization

Author: Nick Harvey & Daniel Whitenack

This example covers the following concepts:

  1. A production pipeline for pre-processing, training, and model export
  2. CI/CD for model binaries, building and deploying a docker image for serving in Seldon
  3. Full tracking of what data produced which model, and what model is being used for inference
  4. Automatic updates of models based on changes to training data or code
  5. Training with single node Tensorflow and distributed TF-jobs

Pytorch MNIST

Author: David Sabater

This example covers the following concepts:

  1. Distributed Data Parallel (DDP) training with Pytorch on CPU and GPU
  2. Shared persistent storage
  3. Training a Pytorch model
    1. CPU
    2. GPU
  4. Serving with Seldon Core
  5. Flask front-end

MNIST

Author: Elson Rodriguez

This example covers the following concepts:

  1. Image recognition of handwritten digits
  2. S3 storage
  3. Training automation with Argo
  4. Monitoring with Argo UI and Tensorboard
  5. Serving with Tensorflow

Distributed Object Detection

Author: Daniel Castellanos

This example covers the following concepts:

  1. Gathering and preparing the data for model training using K8s jobs
  2. Using Kubeflow tf-job and tf-operator to launch a distributed object training job
  3. Serving the model through Kubeflow's tf-serving

Financial Time Series

Author: Sven Degroote

This example covers the following concepts:

  1. Deploying Kubeflow to a GKE cluster
  2. Exploration via JupyterHub (prospect data, preprocess data, develop ML model)
  3. Training several tensorflow models at scale with TF-jobs
  4. Deploy and serve with TF-serving
  5. Iterate training and serving
  6. Training on GPU
  7. Using Kubeflow Pipelines to automate ML workflow

Pipelines

Simple notebook pipeline

Author: Zane Durante

This example covers the following concepts:

  1. How to create pipeline components from python functions in jupyter notebook
  2. How to compile and run a pipeline from jupyter notebook

MNIST Pipelines

Author: Dan Sanche and Jin Chi He

This example covers the following concepts:

  1. Run MNIST Pipelines sample on a Google Cloud Platform (GCP).
  2. Run MNIST Pipelines sample for on premises cluster.

Component-focused

XGBoost - Ames housing price prediction

Author: Puneith Kaul

This example covers the following concepts:

  1. Training an XGBoost model
  2. Shared persistent storage
  3. GCS and GKE
  4. Serving with Seldon Core

Demos

Demos are for showing Kubeflow or one of its components publicly, with the intent of highlighting product vision, not necessarily teaching. In contrast, the goal of the examples is to provide a self-guided walkthrough of Kubeflow or one of its components, for the purpose of teaching you how to install and use the product.

In an example, all commands should be embedded in the process and explained. In a demo, most details should be done behind the scenes, to optimize for on-stage rhythm and limited timing.

You can find the demos in the /demos directory.

Third-party hosted

Source Example Description

Get Involved

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

The Kubeflow community is guided by our Code of Conduct, which we encourage everybody to read before participating.