Skip to content
Snippets Groups Projects

Execute docker tasks in RQ

Merged Valentin Rigal requested to merge dummy-tasks into community
All threads resolved!
1 file
+ 5
0
Compare changes
  • Side-by-side
  • Inline
+ 5
0
@@ -100,6 +100,11 @@ def run_docker_task(client, task, artifacts_dir):
"network": "host",
"volumes": {artifacts_dir: {"bind": "/data", "mode": "rw"}},
}
if task.requires_gpu:
# Assign all GPUs to that container
# TODO: Make sure this works
kwargs["environment"] = {"NVIDIA_VISIBLE_DEVICES": "all"}
logger.info("Starting container with GPU support")
if task.command is not None:
kwargs["command"] = task.command
container = client.containers.run(task.image, **kwargs)
Loading