From 2eab9d413d2ea0965b914ef0b4a033ed5787a42f Mon Sep 17 00:00:00 2001 From: Yousef Moazzam Date: Fri, 14 Aug 2026 12:19:58 +0100 Subject: [PATCH 1/2] Reduce container image size by removing unnecessary deps Removing the `gcc` dependency that is needed only for building `httomolib`, and the `pluggy` and `pytest` dependencies that aren't needed for production, reduces the container image size by ~1.6GB. Also, the various installation commands for the majority of the dependences were put into a single command due to strange errors regarding overwritten files when certain dependencies were updated multiple times across the different installation commands; if the dependencies exhibiting these issues are installed in the same command, this issue doesn't occur. --- Dockerfile | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index d3b2f2411..6f0a95dde 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,12 @@ FROM mambaorg/micromamba:2.0.8-debian12-slim AS build -RUN micromamba install -y python=3.12 blas[build=mkl] 'numpy=2.4.*' scipy tqdm pyyaml pillow click gcc -RUN micromamba install -y openmpi=4.1.6 mpi -RUN micromamba install -y h5py[build=*openmpi*] hdf5plugin -RUN micromamba install -y mpi4py -RUN micromamba install -y aiofiles graypy imageio loguru pluggy pytest iniconfig -RUN micromamba install -y tomopy=1.15.3 scikit-image -RUN micromamba install -y cuda-version=12.9 cuda-cudart==12.9.* cupy=14.0.* nvtx -RUN micromamba install -y -c astra-toolbox -c conda-forge astra-toolbox::astra-toolbox -RUN micromamba run python -m pip install tomobar -RUN micromamba run python -m pip install --no-deps httomolib httomolibgpu httomo-backends +RUN micromamba install -y -c astra-toolbox -c conda-forge python=3.12 blas[build=mkl] 'numpy=2.4.*' tqdm pyyaml pillow click gcc openmpi=4.1.6 mpi h5py[build=*openmpi*] hdf5plugin mpi4py aiofiles graypy imageio loguru iniconfig tomopy=1.15.3 scikit-image cuda-version=12.9 cuda-cudart==12.9.* cupy=14.0.* nvtx astra-toolbox::astra-toolbox +RUN micromamba run python -m pip install --no-cache-dir --no-deps tomobar httomolib httomolibgpu httomo-backends +RUN micromamba uninstall -n base -y gcc RUN micromamba clean -y --all --force-pkgs-dirs COPY . . -RUN micromamba run python -m pip install --no-deps . +RUN micromamba run python -m pip install --no-cache-dir --no-deps . FROM nvidia/cuda:12.9.1-base-ubuntu24.04 AS deploy From 0acd13fa29cfd918307c44c4fff37866b664f71c Mon Sep 17 00:00:00 2001 From: Yousef Moazzam Date: Fri, 14 Aug 2026 12:21:03 +0100 Subject: [PATCH 2/2] Add OpenMPI env var to Dockerfile This was added due to an issue relating to requiring ssh or rsh to be installed in the container. The feature of OpenMPI requiring remote agents won't be used in the container for running httomo, so this is safe to ignore I think, following the information given in the following GitHub thread: https://github.com/open-mpi/ompi/issues/7330#issuecomment-578260385. --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 6f0a95dde..63db32e05 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,5 +12,6 @@ FROM nvidia/cuda:12.9.1-base-ubuntu24.04 AS deploy COPY --from=build /opt/conda /opt/conda ENV CONDA_PREFIX=/opt/conda +ENV OMPI_MCA_plm_rsh_agent= ENTRYPOINT ["/opt/conda/bin/python", "-m", "httomo", "run"]