From 4267ce09a346ef7455615649ad01d4d9cdfc5271 Mon Sep 17 00:00:00 2001 From: Jean Feydy Date: Tue, 26 Aug 2025 11:05:20 +0200 Subject: [PATCH 1/5] Update to PyTorch 2.8, CUDA 12.8, Python 3.13. --- Dockerfile | 9 ++++----- docker-images.sh | 18 ++++++++++-------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 835e04e7f..078aaa26b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,10 +28,8 @@ ARG CUDA_VERSION # for compatible version numbers: ARG PYTORCH_VERSION -# PyTorch scatter (used by the "survival" environment) -# is a dependency that may lag behind PyTorch releases by a few days. -# Please check https://github.com/rusty1s/pytorch_scatter for compatibility info. -#ARG PYTORCH_SCATTER_VERSION=2.1.1 +# rpy2 to interface R from Python in tests: +ARG RPY2_VERSION # KeOps relies on PyTest, Hypothesis, Beartype and Jaxtyping for unit tests... ARG PYTEST_VERSION @@ -94,6 +92,7 @@ ENV LC_ALL=C.UTF-8 FROM r-env AS conda ARG PYTHON_VERSION +ARG RPY2_VERSION RUN curl -fsSL -v -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ chmod +x ~/miniconda.sh && \ ~/miniconda.sh -b -p /opt/conda && \ @@ -107,7 +106,7 @@ RUN curl -fsSL -v -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Mini ipykernel && \ /opt/conda/bin/conda clean -ya # rpy2 on conda is not supported anymore. We install it with pip: -RUN /opt/conda/bin/pip install rpy2 +RUN /opt/conda/bin/pip install rpy2=${RPY2_VERSION} # Switch default matplotlib backend to avoid issues with Qt: ENV MPLBACKEND=tkagg diff --git a/docker-images.sh b/docker-images.sh index 2a9ea2e94..a0c274511 100755 --- a/docker-images.sh +++ b/docker-images.sh @@ -13,16 +13,17 @@ # Up to date as of Monday, April 17th, 2025: BASE_IMAGE=ubuntu:24.04 -PYTHON_VERSION=3.12 -NUMPY_VERSION=2.2.4 +PYTHON_VERSION=3.13 +NUMPY_VERSION=2.3.2 KEOPS_VERSION=2.3 GEOMLOSS_VERSION=0.2.6 -CUDA_VERSION=12.4.1 -PYTORCH_VERSION=2.6.0 -PYTEST_VERSION=8.3.5 -HYPOTHESIS_VERSION=6.131.1 -JAXTYPING_VERSION=0.3.1 -BEARTYPE_VERSION=0.20.2 +CUDA_VERSION=12.8.1 +PYTORCH_VERSION=2.8.0 +PYTEST_VERSION=8.4.1 +RPY2_VERSION=3.6.2 +HYPOTHESIS_VERSION=6.138.3 +JAXTYPING_VERSION=0.3.2 +BEARTYPE_VERSION=0.21.0 BLACK_VERSION=25.1.0 VERSION_TAG=${KEOPS_VERSION}-geomloss${GEOMLOSS_VERSION}-cuda${CUDA_VERSION}-pytorch${PYTORCH_VERSION}-python${PYTHON_VERSION} @@ -39,6 +40,7 @@ do --build-arg CUDA_VERSION=${CUDA_VERSION} \ --build-arg PYTORCH_VERSION=${PYTORCH_VERSION} \ --build-arg PYTEST_VERSION=${PYTEST_VERSION} \ + --build-arg RPY2_VERSION=${RPY2_VERSION} \ --build-arg HYPOTHESIS_VERSION=${HYPOTHESIS_VERSION} \ --build-arg JAXTYPING_VERSION=${JAXTYPING_VERSION} \ --build-arg BEARTYPE_VERSION=${BEARTYPE_VERSION} \ From fac8c4f92e1bbcf3af3de6bd3eed394add82a3a0 Mon Sep 17 00:00:00 2001 From: Jean Feydy Date: Tue, 26 Aug 2025 11:07:45 +0200 Subject: [PATCH 2/5] Update the date... --- docker-images.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-images.sh b/docker-images.sh index a0c274511..f46a812f6 100755 --- a/docker-images.sh +++ b/docker-images.sh @@ -11,7 +11,7 @@ # to clear the docker cache and make sure that the config works # with the current version of e.g. the Ubuntu repositories. -# Up to date as of Monday, April 17th, 2025: +# Up to date as of Tuesday, August 26th, 2025: BASE_IMAGE=ubuntu:24.04 PYTHON_VERSION=3.13 NUMPY_VERSION=2.3.2 From 2c8c0dfc3a7b71b9edf135c5c2d3e560b743c08b Mon Sep 17 00:00:00 2001 From: Jean Feydy Date: Tue, 26 Aug 2025 11:46:00 +0200 Subject: [PATCH 3/5] Trying to add terms of service commands for conda. --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 078aaa26b..cc3c5538f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -97,6 +97,8 @@ RUN curl -fsSL -v -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Mini chmod +x ~/miniconda.sh && \ ~/miniconda.sh -b -p /opt/conda && \ rm ~/miniconda.sh && \ + /opt/conda/bin/conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main && \ + /opt/conda/bin/conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r && \ /opt/conda/bin/conda install -y python=${PYTHON_VERSION} \ conda-build \ pyyaml \ From 8b7ff763b609a3b77d9e75d43968f14a362de978 Mon Sep 17 00:00:00 2001 From: Jean Feydy Date: Tue, 26 Aug 2025 11:49:25 +0200 Subject: [PATCH 4/5] Fix typo. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index cc3c5538f..0042901ef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -108,7 +108,7 @@ RUN curl -fsSL -v -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Mini ipykernel && \ /opt/conda/bin/conda clean -ya # rpy2 on conda is not supported anymore. We install it with pip: -RUN /opt/conda/bin/pip install rpy2=${RPY2_VERSION} +RUN /opt/conda/bin/pip install rpy2==${RPY2_VERSION} # Switch default matplotlib backend to avoid issues with Qt: ENV MPLBACKEND=tkagg From 23a5992e3ca171d453ec399cf258cb4cc6ba21a0 Mon Sep 17 00:00:00 2001 From: Jean Feydy Date: Tue, 26 Aug 2025 12:00:33 +0200 Subject: [PATCH 5/5] Trying to speed up conda forge resolution... --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0042901ef..ae8b9f249 100644 --- a/Dockerfile +++ b/Dockerfile @@ -116,7 +116,9 @@ ENV MPLBACKEND=tkagg # Full CUDA installation, with the headers, from cuda-forge: FROM conda AS cuda ARG CUDA_VERSION -RUN /opt/conda/bin/conda install cuda=${CUDA_VERSION} -c conda-forge && \ +RUN /opt/conda/bin/conda install -n base conda-libmamba-solver && \ + /opt/conda/bin/conda config --set solver libmamba && \ + /opt/conda/bin/conda install cuda=${CUDA_VERSION} -c conda-forge && \ /opt/conda/bin/conda clean -ya