Coder Social home page Coder Social logo

kops-nvidia-docker-installer's Introduction

Nvidia Docker Install Hook for KOPS

Docker version

Docker, nvidia-docker and nvidia-container-runtime has to agree on a docker version.

The version of nvidia-docker and nvidia-container-runtime installed by nvidia-docker-installer.sh is expecting the Kubernetes cluster to run docker version 17.03.2.

Lets go ahead and change the docker version used by the cluster

kops edit cluster

You need to add the following under spec.

docker:
  logDriver: json-file
  version: 17.03.2

Perform a rolling update and verify that nodes are now running the correct version of docker.

kops rolling-update cluster --yes
kubectl get nodes -o wide
kops create ig gpu-nodes
apiVersion: kops/v1alpha2
kind: InstanceGroup
metadata:
  creationTimestamp: null
  name: gpu-nodes
spec:
  image: kope.io/k8s-1.8-debian-stretch-amd64-hvm-ebs-2018-02-08
  machineType: p2.xlarge
  taints:
  - nvidia.com/gpu=:NoSchedule
  hooks:
  - before:
    - docker.service
    manifest: |
      Type=oneshot
      ExecStart=/bin/bash -c '/usr/bin/curl -L -S -f https://raw.githubusercontent.com/brunsgaard/kops-nvidia-docker-installer/master/nvidia-docker-installer.sh | /bin/bash'
    name: nvidia-docker-install.service
  maxSize: 2
  minSize: 2
  nodeLabels:
    kops.k8s.io/instancegroup: gpu-nodes
  role: Node
  subnets:
  - eu-central-1a
  - eu-central-1b

Update the cluster to start the nodes

kops update cluster --yes

Apply the nvidia device plugin

kubectl apply -f nvidia-device-plugin.yml

Run a testjob

apiVersion: v1
kind: Pod
metadata:
  name: cuda-vector-add
spec:
  restartPolicy: OnFailure
  nodeSelector:
    beta.kubernetes.io/instance-type: p2.xlarge
  tolerations:
  - key: nvidia.com/gpu
    effect: NoSchedule
  containers:
    - name: cuda-vector-add
      # https://github.com/kubernetes/kubernetes/blob/v1.7.11/test/images/nvidia-cuda/Dockerfile
      image: "k8s.gcr.io/cuda-vector-add:v0.1"
      resources:
        limits:
          nvidia.com/gpu: 1

kops-nvidia-docker-installer's People

Contributors

brunsgaard avatar frederikns avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.