dnephin / dobi

A build automation tool for Docker applications
https://dnephin.github.io/dobi/
Apache License 2.0
310 stars 36 forks source link

How to use nvidia-docker-compose? #111

Open fernandocamargoai opened 6 years ago

fernandocamargoai commented 6 years ago

There's the compose task, but I can't find anything about using something like nvidia-docker-compose (necessary to use CUDA).

dnephin commented 6 years ago

I'm not familiar with this tool, but I took a look at https://github.com/eywalker/nvidia-docker-compose/blob/master/bin/nvidia-docker-compose

I think the way to use the tool is with the --generate flag. Something like this should work:

mount=source:
  bind: .
  path: /work

image=nvidia-compose-generator:
  image: nvidia-compose-generator
  context: .
  steps: |
    FROM python:3.6-alpine3.6
    pip install nvidia-docker-compose

job=generate-compose-file:
  use: nvidia-compose-generator
  mounts: [source]
  command: "nvidia-compose-generator --generate"
  sources: [docker-compose.yml]
  artifact: nvidia-docker-compose.yml

compose=dev-env:
  files: [nvidia-docker-compose.yml]
  project: '{project}'
  depends: [generate-compose-file]
fernandocamargoai commented 6 years ago

Thank you, @dnephin. I've just started using your tool, so I couldn't think about that solution.