From 7fae6ca6c37e4b88acfe8360e893b86595b68b1e Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Thu, 26 Feb 2026 12:01:31 +0100 Subject: [PATCH 1/8] Fix binder image default user Rename default user instead of attempting to create a new user with pre-existing ID. Also skip installing libatlas which is not necessary anymore. Fixes #3138 --- binder/Dockerfile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/binder/Dockerfile b/binder/Dockerfile index 5fc48a83df..5744f87e46 100644 --- a/binder/Dockerfile +++ b/binder/Dockerfile @@ -5,7 +5,6 @@ FROM ubuntu:24.04 RUN apt-get update && apt-get install -y \ g++ \ git \ - libatlas-base-dev \ libboost-serialization-dev \ libboost-chrono-dev \ libhdf5-serial-dev \ @@ -23,10 +22,14 @@ ENV USER ${NB_USER} ENV NB_UID ${NB_UID} ENV HOME /home/${NB_USER} ENV PATH="${PATH}:$HOME/.local/bin" -RUN adduser --disabled-password \ - --gecos "Default user" \ - --uid ${NB_UID} \ - ${NB_USER} +# If there is no default 1000 user: +#RUN adduser --disabled-password \ +# --gecos "Default user" \ +# --uid ${NB_UID} \ +# ${NB_USER} +# On ubuntu>=24.04 images there is ubuntu(1000) +# see https://bugs.launchpad.net/cloud-images/+bug/2005129 +RUN usermod -l ${NB_USER} ubuntu USER ${NB_USER} RUN python3 -m pip install --upgrade build wheel setuptools pip && \ python3 -m pip install --no-cache-dir notebook jupyterlab jupyterhub jax[cpu] antimony From 5d3c518ccf764429e8827b93cc645a7c13e92275 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Thu, 26 Feb 2026 12:49:51 +0100 Subject: [PATCH 2/8] venv --- binder/Dockerfile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/binder/Dockerfile b/binder/Dockerfile index 5744f87e46..9161a556b9 100644 --- a/binder/Dockerfile +++ b/binder/Dockerfile @@ -21,7 +21,8 @@ ARG NB_UID=1000 ENV USER ${NB_USER} ENV NB_UID ${NB_UID} ENV HOME /home/${NB_USER} -ENV PATH="${PATH}:$HOME/.local/bin" +ENV VENV_PATH=${HOME}/venv +ENV PATH="${VENV_PATH}/bin:${PATH}" # If there is no default 1000 user: #RUN adduser --disabled-password \ # --gecos "Default user" \ @@ -31,8 +32,9 @@ ENV PATH="${PATH}:$HOME/.local/bin" # see https://bugs.launchpad.net/cloud-images/+bug/2005129 RUN usermod -l ${NB_USER} ubuntu USER ${NB_USER} -RUN python3 -m pip install --upgrade build wheel setuptools pip && \ - python3 -m pip install --no-cache-dir notebook jupyterlab jupyterhub jax[cpu] antimony +RUN python3 -m venv ${VENV_PATH} && \ + ${VENV_PATH}/bin/pip install --upgrade build wheel setuptools pip && \ + ${VENV_PATH}/bin/pip install --no-cache-dir notebook jupyterlab jupyterhub jax[cpu] antimony # END BINDER # BEGIN BINDER @@ -44,9 +46,8 @@ USER ${NB_USER} # END BINDER WORKDIR ${HOME} -RUN . ./.profile && python3 -m build --sdist python/sdist && \ - python3 -m pip install -v $(ls -t python/sdist/dist/amici-*.tar.gz | head -1)[petab,pysb,vis] && \ - python3 -m pip install "git+https://github.com/Benchmarking-Initiative/Benchmark-Models-PEtab.git@master#subdirectory=src/python&egg=benchmark_models_petab" && \ +RUN . ./.profile && ${VENV_PATH}/bin/pip install -v $(ls -t python/sdist/dist/amici-*.tar.gz | head -1)[petab,pysb,vis] && \ + ${VENV_PATH}/bin/pip install "git+https://github.com/Benchmarking-Initiative/Benchmark-Models-PEtab.git@master#subdirectory=src/python&egg=benchmark_models_petab" && \ scripts/buildBNGL.sh ENV BNGPATH="${HOME}/ThirdParty/BioNetGen-2.7.0" From 2927ffe86e3981adb8e044bf6e340d4ff3d11595 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Thu, 26 Feb 2026 12:51:27 +0100 Subject: [PATCH 3/8] LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format --- binder/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/binder/Dockerfile b/binder/Dockerfile index 9161a556b9..e2daea6f40 100644 --- a/binder/Dockerfile +++ b/binder/Dockerfile @@ -18,9 +18,9 @@ RUN apt-get update && apt-get install -y \ # BEGIN BINDER ARG NB_USER=jovyan ARG NB_UID=1000 -ENV USER ${NB_USER} -ENV NB_UID ${NB_UID} -ENV HOME /home/${NB_USER} +ENV USER=${NB_USER} +ENV NB_UID=${NB_UID} +ENV HOME=/home/${NB_USER} ENV VENV_PATH=${HOME}/venv ENV PATH="${VENV_PATH}/bin:${PATH}" # If there is no default 1000 user: From 9198dccf76c3880eb98facdb14156c8ed237f382 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Thu, 26 Feb 2026 13:40:22 +0100 Subject: [PATCH 4/8] home --- binder/Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/binder/Dockerfile b/binder/Dockerfile index e2daea6f40..c5074c94af 100644 --- a/binder/Dockerfile +++ b/binder/Dockerfile @@ -30,7 +30,10 @@ ENV PATH="${VENV_PATH}/bin:${PATH}" # ${NB_USER} # On ubuntu>=24.04 images there is ubuntu(1000) # see https://bugs.launchpad.net/cloud-images/+bug/2005129 -RUN usermod -l ${NB_USER} ubuntu +RUN usermod -l ${NB_USER} ubuntu && \ + mv /home/ubuntu ${HOME} && \ + usermod -d ${HOME} ${NB_USER} && \ + chown -R ${NB_UID}:${NB_UID} ${HOME} USER ${NB_USER} RUN python3 -m venv ${VENV_PATH} && \ ${VENV_PATH}/bin/pip install --upgrade build wheel setuptools pip && \ From ba99da3cd74b86a02aabd8f26c645d25d686f373 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Thu, 26 Feb 2026 14:50:24 +0100 Subject: [PATCH 5/8] build --- binder/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/binder/Dockerfile b/binder/Dockerfile index c5074c94af..e74d5b431d 100644 --- a/binder/Dockerfile +++ b/binder/Dockerfile @@ -49,7 +49,8 @@ USER ${NB_USER} # END BINDER WORKDIR ${HOME} -RUN . ./.profile && ${VENV_PATH}/bin/pip install -v $(ls -t python/sdist/dist/amici-*.tar.gz | head -1)[petab,pysb,vis] && \ +RUN . ./.profile && ${VENV_PATH}/bin/python3 -m build --sdist python/sdist && \ + ${VENV_PATH}/bin/pip install -v $(ls -t python/sdist/dist/amici-*.tar.gz | head -1)[petab,pysb,vis] && \ ${VENV_PATH}/bin/pip install "git+https://github.com/Benchmarking-Initiative/Benchmark-Models-PEtab.git@master#subdirectory=src/python&egg=benchmark_models_petab" && \ scripts/buildBNGL.sh From 00052fbc193e02b4a974df51066f58bbf390dd39 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Thu, 26 Feb 2026 15:45:34 +0100 Subject: [PATCH 6/8] pysb mess --- binder/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/binder/Dockerfile b/binder/Dockerfile index e74d5b431d..3a5b4c60de 100644 --- a/binder/Dockerfile +++ b/binder/Dockerfile @@ -50,7 +50,9 @@ USER ${NB_USER} WORKDIR ${HOME} RUN . ./.profile && ${VENV_PATH}/bin/python3 -m build --sdist python/sdist && \ - ${VENV_PATH}/bin/pip install -v $(ls -t python/sdist/dist/amici-*.tar.gz | head -1)[petab,pysb,vis] && \ + ${VENV_PATH}/bin/pip install git+https://github.com/pysb/pysb@master && \ + ${VENV_PATH}/bin/pip install -U sympy && \ + ${VENV_PATH}/bin/pip install -v $(ls -t python/sdist/dist/amici-*.tar.gz | head -1)[petab,vis] && \ ${VENV_PATH}/bin/pip install "git+https://github.com/Benchmarking-Initiative/Benchmark-Models-PEtab.git@master#subdirectory=src/python&egg=benchmark_models_petab" && \ scripts/buildBNGL.sh From d135e9c9cfba75cb60ed52b73aa11a041a6f9eb3 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Fri, 27 Feb 2026 09:53:18 +0100 Subject: [PATCH 7/8] jax extra --- binder/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/binder/Dockerfile b/binder/Dockerfile index 3a5b4c60de..eead56ecb2 100644 --- a/binder/Dockerfile +++ b/binder/Dockerfile @@ -52,7 +52,7 @@ WORKDIR ${HOME} RUN . ./.profile && ${VENV_PATH}/bin/python3 -m build --sdist python/sdist && \ ${VENV_PATH}/bin/pip install git+https://github.com/pysb/pysb@master && \ ${VENV_PATH}/bin/pip install -U sympy && \ - ${VENV_PATH}/bin/pip install -v $(ls -t python/sdist/dist/amici-*.tar.gz | head -1)[petab,vis] && \ + ${VENV_PATH}/bin/pip install -v $(ls -t python/sdist/dist/amici-*.tar.gz | head -1)[petab,vis,jax] && \ ${VENV_PATH}/bin/pip install "git+https://github.com/Benchmarking-Initiative/Benchmark-Models-PEtab.git@master#subdirectory=src/python&egg=benchmark_models_petab" && \ scripts/buildBNGL.sh From 25328720e5e0eae1473097c4b917842a2451b5b9 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Fri, 27 Feb 2026 10:09:55 +0100 Subject: [PATCH 8/8] sciml extras --- binder/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/binder/Dockerfile b/binder/Dockerfile index eead56ecb2..4e2e83b131 100644 --- a/binder/Dockerfile +++ b/binder/Dockerfile @@ -52,7 +52,7 @@ WORKDIR ${HOME} RUN . ./.profile && ${VENV_PATH}/bin/python3 -m build --sdist python/sdist && \ ${VENV_PATH}/bin/pip install git+https://github.com/pysb/pysb@master && \ ${VENV_PATH}/bin/pip install -U sympy && \ - ${VENV_PATH}/bin/pip install -v $(ls -t python/sdist/dist/amici-*.tar.gz | head -1)[petab,vis,jax] && \ + ${VENV_PATH}/bin/pip install -v $(ls -t python/sdist/dist/amici-*.tar.gz | head -1)[petab,vis,jax,sciml] && \ ${VENV_PATH}/bin/pip install "git+https://github.com/Benchmarking-Initiative/Benchmark-Models-PEtab.git@master#subdirectory=src/python&egg=benchmark_models_petab" && \ scripts/buildBNGL.sh