-
Download and unzip Kubeflow to a directory e.g.
~/sdk/kubeflow-0.2.7
-
Set the environment variable
export KUBEFLOW_REPO=~/sdk/kubeflow-0.2.7
-
Initialize the
ksonnet
appks init simple_demo_ks
-
Change directory to
cd simple_demo_ks
-
Install kubeflow core components.
i. Add kubeflow registry to
ksonnet
appks registry add kubeflow "${KUBEFLOW_REPO}/kubeflow"
ii.Install components
ks pkg install kubeflow/argo ks pkg install kubeflow/core ks pkg install kubeflow/examples ks pkg install kubeflow/katib ks pkg install kubeflow/mpi-job ks pkg install kubeflow/pytorch-job ks pkg install kubeflow/seldon ks pkg install kubeflow/tf-serving
-
Generate Kubeflow core component
ks generate kubeflow-core kubeflow-core
-
Set Kubeflow core parameters
i.
ks param set kubeflow-core reportUsage false
ii.
ks param set kubeflow-core usageId $(uuidgen)
-
Deploy Kubeflow core component to Kubernetes cluster
ks apply default
-
Generate Seldon core component
ks generate seldon seldon
-
Set the role
kubectl create clusterrolebinding seldon-admin --clusterrole=cluster-admin --serviceaccount=default:default
-
Deploy Seldon core component to Kubernetes cluster
ks apply default
-
Build docker training image
make build
-
Login to your personal docker hub account
make login
-
Push the training image to docker hub repository
make push
-
Create a Persistent Volume Claim to store data and trained model
make createpvc
-
Copy training data to PVC
make copydata
-
Train the model with Kubeflow
make train
reference TfJob
-
Download the model from Persistent Volume Storage to local folder
make download
-
Wrap the model to docker image for serving via Seldon using openshift s2i
make s2i
-
Push the serving image to docker hub repository
make s2ipush
-
Serve the model with Kubeflow
make serve
-
Forward the ambassador port to to local host
make portforward
-
Make predictions from deployed serving image with Kubeflow
make predict
-
make stop
-
make clean
kubectl logs -f $(kubectl get pods -l seldon-app=iris-classification -o=jsonpath='{.items[0].metadata.name}') iris-classification
kubectl logs -f kube-demo-simple-master-0
kubectl port-forward $(kubectl get pods -n default -l service=ambassador -o jsonpath='{.items[0].metadata.name}') -n default 8080:80
kubectl exec -it $(kubectl get pods -l seldon-app=iris-classification -o=jsonpath='{.items[0].metadata.name}') --container iris-classification -- /bin/bash
kubectl exec -it dataaccess -- /bin/bash
kubectl exec -it dataaccess -- ls -l /data
kubectl exec -it dataaccess -- ls -l /model