Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Juju + KubernetesでGPU の活用

249 views

Published on

Slideshare上のプレビューでは文字かけ、文字化けが発生します。ダウンロードしてご覧ください。

Published in: Engineering
  • Be the first to comment

  • Be the first to like this

Juju + KubernetesでGPU の活用

  1. 1. Juju + Kubernetes GPU (VirtualTech.jp)
  2. 2. Juju Ubuntu Canonical (AWS/GCE/Azure/MAAS/OpenStack etc...) ( &Linux ) (KVM) OS !2
  3. 3. MAAS Ubuntu Canonical (Linux KVM)/ Linux(Ubuntu/CentOS) RHEL/SUSE/Windows Juju Cloud !3
  4. 4. Kubernetes Google & !4
  5. 5. Juju + Kubernetes Juju Kubernetes Charm Bundle jujucharms.com Flannel Calico OVN etc ... !5
  6. 6. CDK Canonical Distribution Of Kubernetes juju deploy canonical-kubernetes YAML NVIDIA GPU ( ) !6
  7. 7. Juju Kubernetes % juju add-model k8s % juju switch k8s % juju deploy canonical-kubernetes .. % juju deploy ./deploy.yml !7
  8. 8. Juju GUI % juju gui GUI 2.12.1 for model "admin/k8s" is enabled at: https://172.17.28.160:17070/gui/u/admin/k8s Your login credential is: username: admin password: XXXXXXXXXX !8
  9. 9. kubectl (for Ubuntu) % sudo snap install kubectl --classic kubectl % mkdir ~/.kube && touch ~/.kube/config % juju scp kubernetes-master/0:config ~/.kube/config コマンドを実行してみる % kubectl get node NAME STATUS ROLES AGE VERSION node1 Ready <none> 19d v1.10.2 !9
  10. 10. Kubernetes Pod Pod NIC Kubernetes Pod !10 DB Pod
  11. 11. Hello World % vi hello.yml apiVersion: v1 kind: Pod metadata: name: hello-world spec: containers: - name: busybox image: busybox tty: true % kubectl create -f hello.yml % kubectl exec -it hello-world -- hostname hello-world !11
  12. 12. K8s YAML apiVersion: v1 kind: Pod metadata: name: multiapp-pod spec: containers: - name: 1st image: nginx:latest ports: - containerPort: 80 - name: 2nd image: postgres:latest ports: - containerPort: 5432 !12
  13. 13. Pod % kubectl create -f multiapp-pod.yml !13
  14. 14. Pod % kubectl create -f multiapp-pod.yml pod "multiapp-pod" created !14
  15. 15. Pod % kubectl get -f multiapp-pod.yml !15
  16. 16. Pod % kubectl get -f multiapp-pod.yml NAME READY STATUS RESTARTS AGE multiapp-pod 2/2 Running 0 12s Pod kubectl get pod kubectl get pod -o wide -w get describe describe !16
  17. 17. Pod Pod % kubectl exec -it app-pod bash #/ Pod ID % kubectl exec -it multiapp-pod -c 1st bash % kubectl exec -it multiapp-pod -c 2nd bash % kubectl exec -it multiapp-pod -c 1st apt update % kubectl exec -it multiapp-pod -c 1st apt install net-tools !17
  18. 18. Pod % kubectl delete -f multiapp-pod.yml !18
  19. 19. Pod % kubectl delete -f multiapp-pod.yml pod "multiapp-pod" deleted !19
  20. 20. K8s GPU GPU Python + Tensol ow-GPU Chainer GPU Pod GPU Pod !20
  21. 21. GPU YAML apiVersion: v1 kind: Pod metadata: name: testpod-noncuda spec: restartPolicy: OnFailure containers: - name: testpod-noncuda image: ubuntu:latest tty: true resources: limits: nvidia.com/gpu: 1 !21 K8s Schedule GPU
  22. 22. GPU Pod % kubectl create -f first-gpupod.yml !22
  23. 23. GPU Pod % kubectl create -f first-gpupod.yml pod "testpod-noncuda" created % kubectl exec -it testpod-noncuda nvidia-smi +-----------------------------------------------------------------------------+ | NVIDIA-SMI 390.30 Driver Version: 390.30 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | |===============================+======================+======================| | 0 Tesla P40 Off | 00000000:03:00.0 Off | 0 | | N/A 25C P8 11W / 250W | 0MiB / 22919MiB | 0% Default | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=============================================================================| | No running processes found | +-----------------------------------------------------------------------------+ !23
  24. 24. Chainer YAML apiVersion: v1 kind: Pod metadata: name: chainerpod spec: restartPolicy: OnFailure containers: - name: chainer #image: chainer/chainer:latest-python3 #Py3 image: chainer/chainer:latest-python2 #Py2 tty: true resources: limits: nvidia.com/gpu: 1 !24 【参考】 image
  25. 25. Tensor ow YAML apiVersion: v1 kind: Pod metadata: name: tfpod spec: restartPolicy: OnFailure containers: - name: tensorflow image: tensorflow/tensorflow:1.5.1-gpu tty: true resources: limits: nvidia.com/gpu: 1 !25 【参考】 image

×