Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kubeflow, ksonnet #73

Open
awakia opened this issue Nov 12, 2018 · 4 comments
Open

kubeflow, ksonnet #73

awakia opened this issue Nov 12, 2018 · 4 comments

Comments

@awakia
Copy link
Owner

awakia commented Nov 12, 2018

縣くんがやってくれたもののコピー

Why

Kubeflow setup instructions.

What

Mostly followed the instructions written in https://codelabs.developers.google.com/codelabs/kubeflow-introduction/index.html.

  • Install ksonnet.
  • ks init ksonnet-kubeflow
    • ksonnet application の作成 & 初期化
  • ks registry add kubeflow github.com/kubeflow/kubeflow/tree/v0.3.0/kubeflow
    • kubeflow の提供する ksonnet library を install 可能な状態にする
    • apt-add-repository みたいなもの?
  • ks pkg install kubeflow/core@v0.3.0
    • kubeflow/core という component を使える状態にする
    • vendor/kubeflow/core@... というファイルができる
  • ks prototype list
    • 今使える prototype 一覧が見られる。ここから選んで instantiate する。
  • ks generate jupyterhub jupyterhub
    • components/jupyterhub.jsonnet というファイルができる
    • これが kubernetes の yaml に対応する、manifest の実体(言語が違うだけ...)
    • このファイルをいじることで設定を変更できる
  • ks apply
    • kubectl apply に相当する操作

Currently, the kubeflow cluster is deployed on Kubernetes Engine in Wantedly QA project.
CPU/GPU autoscaling is enabled.

You can see the UI of Kubeflow with a following command: kubectl port-forward $(kubectl get pods --selector=service=ambassador -o jsonpath='{.items[0].metadata.name}') 8080:80 & open http://localhost:8080 .

2018/10/18 時点では

  • ambassador

    • Kubeflow 全体の API Gateway
    • ここにつなぐと central dashboard などが見られる
  • centraldashboard

    • Kubeflow 全体のダッシュボード
    • (現状は各 components へのリンク集)
  • jupyterhub

    • docker image を指定して notebook を spawn できる
    • 1 notebook = 1 pod
    • 一応ユーザの概念が存在する(Github integration とかもあるようにみえるが、今はただのパスワード認証)
      • 最初に適当なユーザ名 + パスワードを入力すると、ユーザが作られる
  • seldon

    • モデルを serving するための component
    • (詳しくはまだ調べていないが、A/B や multi-armed bandit のための routing も提供しているらしい)
  • tf-job

    • tensorflow の学習 job

あたりがデプロイされています。

@awakia
Copy link
Owner Author

awakia commented Nov 12, 2018

localでkubernetesを立てる

brew install minikube
brew install virtualbox
minikube init

この状態で.kubeが書き変わるのでkubectlコマンドがlocalのを変更するようになる

@awakia
Copy link
Owner Author

awakia commented Nov 12, 2018

https://qiita.com/ohtaman/items/05e4e117a81c7393d875

brew install ksonnet/tap/ks

@awakia
Copy link
Owner Author

awakia commented Nov 12, 2018

$ ks init kubeflow
$ ks prototype list
NAME                                  DESCRIPTION
====                                  ===========
io.ksonnet.pkg.configMap              A simple config map with optional user-specified data
io.ksonnet.pkg.deployed-service       A deployment exposed with a service
io.ksonnet.pkg.namespace              Namespace with labels automatically populated from the name
io.ksonnet.pkg.single-port-deployment Replicates a container n times, exposes a single port
io.ksonnet.pkg.single-port-service    Service that exposes a single port
$ ks registry add kubeflow github.com/kubeflow/kubeflow/tree/v0.3.2/kubeflow
$ ks pkg install kubeflow/core
INFO Retrieved 38 files                           
$ ks prototype list
NAME                                     DESCRIPTION
====                                     ===========
io.ksonnet.pkg.ambassador                Ambassador
io.ksonnet.pkg.centraldashboard          centraldashboard
io.ksonnet.pkg.cert-manager              Certificate generation on GKE.
io.ksonnet.pkg.cloud-endpoints           Cloud Endpoint domain creation.
io.ksonnet.pkg.configMap                 A simple config map with optional user-specified data
io.ksonnet.pkg.deployed-service          A deployment exposed with a service
io.ksonnet.pkg.echo-server               A simple echo server.
io.ksonnet.pkg.google-cloud-filestore-pv Creates PV and PVC based on Google Cloud Filestore NFS
io.ksonnet.pkg.iap-ingress               Ingress for IAP on GKE.
io.ksonnet.pkg.jupyterhub                jupyterhub Component
io.ksonnet.pkg.metric-collector          Service monitor for kubeflow on GCP.
io.ksonnet.pkg.namespace                 Namespace with labels automatically populated from the name
io.ksonnet.pkg.prometheus                Prometheus Service.
io.ksonnet.pkg.single-port-deployment    Replicates a container n times, exposes a single port
io.ksonnet.pkg.single-port-service       Service that exposes a single port
io.ksonnet.pkg.spartakus                 spartakus component for usage collection
io.ksonnet.pkg.tf-job-operator           A TensorFlow job operator.
$ ks pkg install kubeflow/tf-serving
INFO Retrieved 9 files                            
$ ks prototype list
NAME                                     DESCRIPTION
====                                     ===========
io.ksonnet.pkg.ambassador                Ambassador
io.ksonnet.pkg.centraldashboard          centraldashboard
io.ksonnet.pkg.cert-manager              Certificate generation on GKE.
io.ksonnet.pkg.cloud-endpoints           Cloud Endpoint domain creation.
io.ksonnet.pkg.configMap                 A simple config map with optional user-specified data
io.ksonnet.pkg.deployed-service          A deployment exposed with a service
io.ksonnet.pkg.echo-server               A simple echo server.
io.ksonnet.pkg.google-cloud-filestore-pv Creates PV and PVC based on Google Cloud Filestore NFS
io.ksonnet.pkg.iap-ingress               Ingress for IAP on GKE.
io.ksonnet.pkg.jupyterhub                jupyterhub Component
io.ksonnet.pkg.metric-collector          Service monitor for kubeflow on GCP.
io.ksonnet.pkg.namespace                 Namespace with labels automatically populated from the name
io.ksonnet.pkg.prometheus                Prometheus Service.
io.ksonnet.pkg.single-port-deployment    Replicates a container n times, exposes a single port
io.ksonnet.pkg.single-port-service       Service that exposes a single port
io.ksonnet.pkg.spartakus                 spartakus component for usage collection
io.ksonnet.pkg.tf-job-operator           A TensorFlow job operator.
io.ksonnet.pkg.tf-serving                A TensorFlow serving deployment
io.ksonnet.pkg.tf-serving-aws            A TensorFlow serving deployment
io.ksonnet.pkg.tf-serving-gcp            A TensorFlow serving deployment
io.ksonnet.pkg.tf-serving-request-log    tf-serving with request logging

@awakia
Copy link
Owner Author

awakia commented Nov 13, 2018

kube apply default
kube get all
kubectl port-forward service/tf-hub-lb 8080:80
open http://localhot:8080

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant