From 8aeda7bb4639da6123b4733ba4e769ea33692f34 Mon Sep 17 00:00:00 2001 From: Anders Roxell Date: Thu, 7 May 2026 10:22:35 +0200 Subject: [PATCH] runtimes: fix path translation when using --device-dict In device-dict mode the bind uses dispatcher_download_dir on both the host and the container. The docker wrapper rewrote mount sources to tmpdir/dispatcher/tmp instead. This sent the wrong path to the host docker daemon. The bind failed with: bind source path does not exist: ... Set _device_dict_volume to dispatcher_download_dir so the wrapper rewrite becomes a no-op in this mode. Also create the dispatcher_download_dir on the host before binding it. Signed-off-by: Anders Roxell --- tuxrun/__main__.py | 2 ++ tuxrun/runtimes.py | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tuxrun/__main__.py b/tuxrun/__main__.py index 6ce970e..b71a0c2 100644 --- a/tuxrun/__main__.py +++ b/tuxrun/__main__.py @@ -355,10 +355,12 @@ def handler(*_): if job.device.flag_use_pre_run_cmd or job.qemu_image or options.device_dict: LOG.debug("Pre run command") if options.device_dict: + options.dispatcher_download_dir.mkdir(parents=True, exist_ok=True) runtime.bind(options.dispatcher_download_dir, Path("/srv/tftp")) runtime.bind( options.dispatcher_download_dir, options.dispatcher_download_dir ) + runtime._device_dict_volume = str(options.dispatcher_download_dir) else: runtime.bind(tmpdir / "dispatcher" / "tmp", options.dispatcher_download_dir) (tmpdir / "dispatcher" / "tmp").mkdir() diff --git a/tuxrun/runtimes.py b/tuxrun/runtimes.py index e52418d..2321a82 100644 --- a/tuxrun/runtimes.py +++ b/tuxrun/runtimes.py @@ -174,13 +174,15 @@ class DockerRuntime(ContainerRuntime): prefix = ["docker", "run", "--rm", "--hostname", "tuxrun"] def pre_run(self, tmpdir): - # Render and bind the docker wrapper + volume = getattr(self, "_device_dict_volume", None) or str( + tmpdir / "dispatcher" / "tmp" + ) wrap = ( wrappers() .get_template("docker.jinja2") .render( runtime="docker", - volume=str(tmpdir / "dispatcher" / "tmp"), + volume=volume, dispatcher_download_dir=self.dispatcher_download_dir, ) )