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

Docker driver mount device support / documentation #2671

Closed
KamilLelonek opened this issue May 25, 2017 · 15 comments
Closed

Docker driver mount device support / documentation #2671

KamilLelonek opened this issue May 25, 2017 · 15 comments

Comments

@KamilLelonek
Copy link

Nomad does not support (or does not document) how to mount devices on a Docker container.

A use case here being mounting the Nvidia GPUs to a docker container. The Docker syntax to do this is the --device switch. For example:

docker run --device=/dev/nvidia0:/dev/nvidia0 cuda

Can this support please be added, or, if already present, documented?

@dadgar
Copy link
Contributor

dadgar commented May 25, 2017

Do you have use for this outside of GPUs? First class GPU support will come.

@KamilLelonek
Copy link
Author

KamilLelonek commented May 25, 2017 via email

@dadgar
Copy link
Contributor

dadgar commented May 25, 2017

@KamilLelonek Okay I am going to close in favor of: #406.

This is being actively worked on!

@KamilLelonek
Copy link
Author

KamilLelonek commented May 25, 2017 via email

@dadgar
Copy link
Contributor

dadgar commented May 25, 2017

@KamilLelonek Yep that is the best route to take for the time being!

@schmichael
Copy link
Member

Closing as a duplicate of #406

@KamilLelonek
Copy link
Author

Do you think that for such case at the moment job.nomad should contain the following:

task "server" {
  driver = "exec"

  config {
    command = "docker run docker-registry/image-name:tag"
    args    = [
      "--device=/dev/nvidia0:/dev/nvidia0",
      "--device=/dev/nvidia1:/dev/nvidia1",
      "--device=/dev/nvidia2:/dev/nvidia2",
      "--device=/dev/nvidiactl:/dev/nvidiactl",
      "--device=/dev/nvidia-uvm:/dev/nvidia-uvm",
      "--device=/dev/nvidia-uvm-tools:/dev/nvidia-uvm-tools"
    ]
  }
}

?

@dadgar
Copy link
Contributor

dadgar commented May 26, 2017

I would do it with raw_exec but that should work. I would clean up the image afterwords!

@schmichael
Copy link
Member

schmichael commented May 26, 2017 via email

@KamilLelonek
Copy link
Author

KamilLelonek commented May 26, 2017 via email

@schmichael
Copy link
Member

Oops, I misspoke on --rm above. It should have been:

Just add --rm to cleanup the image container on exit. You'll need a script to also cleanup the image if desired.

@jaychris
Copy link

We need "--device" to mount usb devices and other serial control devices for hardware that container based applications are managing.

@pieterbreed
Copy link

I would like to have access to /dev/fuse inside my container that has an instance of riofs running. (An alternative to s3fs). To get this to work, I have to give both privileged and --device /dev/fuse on the docker command line. It would be nice if nomad supported devices in this way, over and above what #406 deals with.

@schmichael
Copy link
Member

schmichael commented Jul 31, 2017 via email

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants