Mnist vanilla k8s (#737)

* adds mnist example for vanilla k8s

* typo fix

* address review comments; get minio endpoint from k8s client;
This commit is contained in:
Adhita Selvaraj 2020-02-20 06:51:04 -08:00 committed by GitHub
parent 443f4bd2a3
commit 40f6ec8fe7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 1100 additions and 3 deletions

View File

@ -4,6 +4,7 @@
- [MNIST on Kubeflow](#mnist-on-kubeflow) - [MNIST on Kubeflow](#mnist-on-kubeflow)
- [MNIST on Kubeflow on GCP](#mnist-on-kubeflow-on-gcp) - [MNIST on Kubeflow on GCP](#mnist-on-kubeflow-on-gcp)
- [MNIST on Kubeflow on Vanilla k8s](#vanilla)
- [MNIST on other platforms](#mnist-on-other-platforms) - [MNIST on other platforms](#mnist-on-other-platforms)
- [Prerequisites](#prerequisites) - [Prerequisites](#prerequisites)
- [Deploy Kubeflow](#deploy-kubeflow) - [Deploy Kubeflow](#deploy-kubeflow)
@ -38,6 +39,7 @@ This example guides you through the process of taking an example model, modifyin
Follow the version of the guide that is specific to how you have deployed Kubeflow Follow the version of the guide that is specific to how you have deployed Kubeflow
1. [MNIST on Kubeflow on GCP](#gcp) 1. [MNIST on Kubeflow on GCP](#gcp)
1. [MNIST on Kubeflow on vanilla k8s](#vanilla)
1. [MNIST on other platforms](#other) 1. [MNIST on other platforms](#other)
<a id=gcp></a> <a id=gcp></a>
@ -66,6 +68,60 @@ Follow these instructions to run the MNIST tutorial on GCP
1. Follow the notebook to train and deploy MNIST on Kubeflow 1. Follow the notebook to train and deploy MNIST on Kubeflow
<a id=vanilla></a>
# MNIST on Kubeflow on Vanilla k8s
1. Follow these [instructions](https://www.kubeflow.org/docs/started/k8s/kfctl-k8s-istio/) to deploy Kubeflow.
1. [Setup docker credentials](#vanilla-docker).
1. Launch a Jupyter Notebook
* The tutorial is run on Jupyter Tensorflow 1.15 image.
1. Launch a terminal in Jupyter and clone the kubeflow/examples repo
```bash
git clone https://github.com/kubeflow/examples.git git_kubeflow-examples
```
1. Open the notebook `mnist/mnist_vanilla_k8s.ipynb`
1. Follow the notebook to train and deploy on MNIST on Kubeflow
<a id=vanilla-docker></a>
### Prerequisites
### Configure docker credentials
#### Why do we need this?
Kaniko is used by fairing to build the model every time the notebook is run and deploy a fresh model.
The newly built image is pushed into the DOCKER_REGISTRY and pulled from there by subsequent resources.
Get your docker registry user and password encoded in base64 <br>
`echo -n USER:PASSWORD | base64` <br>
Create a config.json file with your Docker registry url and the previous generated base64 string <br>
```json
{
"auths": {
"https://index.docker.io/v1/": {
"auth": "xxxxxxxxxxxxxxx"
}
}
}
```
<br>
### Create a config-map in the namespace you're using with the docker config
`kubectl create --namespace ${NAMESPACE} configmap docker-config --from-file=<path to config.json>`
Source documentation: [Kaniko docs](https://github.com/GoogleContainerTools/kaniko#pushing-to-docker-hub)
<a id=other></a> <a id=other></a>
# MNIST on other platforms # MNIST on other platforms

View File

@ -138,7 +138,7 @@ def get_iap_endpoint():
f"clusterrolebinding by running a command.\n" f"clusterrolebinding by running a command.\n"
f"kubectl create --namespace=istio-system rolebinding " f"kubectl create --namespace=istio-system rolebinding "
"--clusterrole=kubeflow-view " "--clusterrole=kubeflow-view "
"--serviceaccount=$NAMESPACE}:default-editor " "--serviceaccount=${NAMESPACE}:default-editor "
"${NAMESPACE}-istio-view") "${NAMESPACE}-istio-view")
return "" return ""

File diff suppressed because it is too large Load Diff

View File

@ -1,2 +1,3 @@
git+git://github.com/kubeflow/fairing.git@9b0d4ed4796ba349ac6067bbd802ff1d6454d015 # Refer to latest commit in github.com/kubeflow/fairing
retrying==1.3.3 git+git://github.com/kubeflow/fairing.git@7e4c23c47a6b0544a722d04e1f9910c2f283a4f6
retrying==1.3.3