From d3b98346528cf5026a50035471b46eed0241e8c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onur=20=C3=9Clgen?= Date: Mon, 30 Sep 2024 12:38:41 +0100 Subject: [PATCH 1/3] Fix docker build error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Onur Ülgen --- monai/deploy/packager/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monai/deploy/packager/util.py b/monai/deploy/packager/util.py index a2e7a07e..4af52fc3 100644 --- a/monai/deploy/packager/util.py +++ b/monai/deploy/packager/util.py @@ -235,7 +235,7 @@ def build_image(args: dict, temp_dir: str): dockerignore_file.write(docker_ignore_template) # Build dockerfile into an MAP image - docker_build_cmd = f"""docker build -f {docker_file_path!r} -t {tag} {temp_dir!r}""" + docker_build_cmd = f'''docker build -f "{docker_file_path}" -t {tag} "{temp_dir}"''' if sys.platform != "win32": docker_build_cmd += """ --build-arg MONAI_UID=$(id -u) --build-arg MONAI_GID=$(id -g)""" if no_cache: From e9d0d9d962ba32e10d18420442a5f58a33e5d0e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onur=20=C3=9Clgen?= Date: Mon, 30 Sep 2024 12:38:55 +0100 Subject: [PATCH 2/3] Fix docker run error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Onur Ülgen --- monai/deploy/runner/runner.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/monai/deploy/runner/runner.py b/monai/deploy/runner/runner.py index a195ced4..f687818a 100644 --- a/monai/deploy/runner/runner.py +++ b/monai/deploy/runner/runner.py @@ -41,7 +41,7 @@ def fetch_map_manifest(map_name: str) -> Tuple[dict, dict, int]: with tempfile.TemporaryDirectory() as info_dir: if sys.platform == "win32": - cmd = f'docker run --rm -a STDOUT -a STDERR -v " {info_dir}":/var/run/monai/export/config {map_name}' + cmd = f'docker run --rm -a STDOUT -a STDERR -v "{info_dir}":/var/run/monai/export/config {map_name}' else: cmd = f"""docker_id=$(docker create {map_name}) docker cp $docker_id:/etc/monai/app.json "{info_dir}/app.json" @@ -89,7 +89,7 @@ def run_app(map_name: str, input_path: Path, output_path: Path, app_info: dict, requested_gpus = get_requested_gpus(pkg_info) if requested_gpus > 0: if not has_rocm(): - cmd = "nvidia-docker run --rm -a STDERR" + cmd = "docker run --rm --gpus all -a STDERR" if not quiet: cmd += " -a STDOUT" @@ -163,11 +163,11 @@ def pkg_specific_dependency_verification(pkg_info: dict) -> bool: requested_gpus = get_requested_gpus(pkg_info) if requested_gpus > 0: if not has_rocm(): - # check for nvidia-docker - prog = "nvidia-docker" + # check for docker + prog = "docker" logger.info('--> Verifying if "%s" is installed...\n', prog) if not shutil.which(prog): - logger.error('ERROR: "%s" not installed, please install nvidia-docker.', prog) + logger.error('ERROR: "%s" not installed, please install docker.', prog) return False return True From 4d3cf3a7746a24637e6ba069cd01602f1f76ae34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onur=20=C3=9Clgen?= Date: Fri, 4 Oct 2024 21:53:25 +0100 Subject: [PATCH 3/3] Install libssl1 into the docker image since monai-executor depends on it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Docker images based on Ubuntu 22.04 and later lacks libssl1 on which monai-executor depends. Signed-off-by: Onur Ülgen --- monai/deploy/packager/templates.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/monai/deploy/packager/templates.py b/monai/deploy/packager/templates.py index a84bba38..57e5ba22 100644 --- a/monai/deploy/packager/templates.py +++ b/monai/deploy/packager/templates.py @@ -12,6 +12,9 @@ COMMON_FOOTPRINT = """ USER root + RUN curl http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb -o libssl.deb && \\ + dpkg -i libssl.deb && rm libssl.deb + RUN pip install --no-cache-dir --upgrade setuptools==59.5.0 pip==22.3 wheel==0.37.1 numpy>=1.21.6 RUN mkdir -p /etc/monai/ \\