From 09ba5d908bca8303731bea0afeda6a566bb913bf Mon Sep 17 00:00:00 2001 From: "r.jaepel" Date: Sun, 22 Jun 2025 17:36:05 +0200 Subject: [PATCH] Small minor fixes for the Docker adapter and the container tests --- cadetrdm/container/dockerAdapter.py | 4 ++-- tests/test_container_docker.py | 2 ++ tests/test_container_podman.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cadetrdm/container/dockerAdapter.py b/cadetrdm/container/dockerAdapter.py index 10e9d8c..164da8d 100644 --- a/cadetrdm/container/dockerAdapter.py +++ b/cadetrdm/container/dockerAdapter.py @@ -82,9 +82,9 @@ def _run_command(self, full_command, image, mounts=None): for host_path, container_path in mounts.items(): volumes[host_path.absolute().as_posix()] = {'bind': container_path, 'mode': 'ro'} - container = self.client.containers.run_yml( + container = self.client.containers.run( image=image, - command=full_command, + command=f"bash -c '{full_command}'", volumes=volumes, detach=True, remove=False diff --git a/tests/test_container_docker.py b/tests/test_container_docker.py index 484ca51..ce1773c 100644 --- a/tests/test_container_docker.py +++ b/tests/test_container_docker.py @@ -38,6 +38,7 @@ def test_run_dockered(): case = Case(project_repo=rdm_example, options=options, environment=matching_environment) docker_adapter = DockerAdapter() + docker_adapter.pull_image("ghcr.io/cadet/cadet-suite:Core-v5.0.4-docker02-Python-1.1.0-Process-0.10.1") has_run_study = case.run_study(container_adapter=docker_adapter, force=True) assert has_run_study @@ -50,6 +51,7 @@ def test_run_dockered(): case = Case(project_repo=rdm_example, options=options, environment=matching_environment) docker_adapter = DockerAdapter() + docker_adapter.pull_image("ghcr.io/cadet/cadet-suite:Core-v5.0.4-docker02-Python-1.1.0-Process-0.10.1") has_run_study = case.run_study(container_adapter=docker_adapter, force=True) assert not has_run_study diff --git a/tests/test_container_podman.py b/tests/test_container_podman.py index 65d5c19..09fd8a6 100644 --- a/tests/test_container_podman.py +++ b/tests/test_container_podman.py @@ -5,7 +5,7 @@ from cadetrdm import Options, Environment, Case, ProjectRepo from cadetrdm.container import PodmanAdapter -IMAGE_NAME = "ghcr.io/ronald-jaepel/cadet-rdm-jupyter:latest" +IMAGE_NAME = "ghcr.io/cadet/cadet-suite:Core-v5.0.4-docker02-Python-1.1.0-Process-0.10.1" @pytest.mark.container