Skip to content

Commit 0673c83

Browse files
authored
Fix binder configuration (#3139)
* Rename default user instead of attempting to create a new user with pre-existing ID. Fixes #3138 * skip installing libatlas which is not necessary anymore. * install jax extras * use venv instead of the system env (no longer supported) * install correct sympy / pysb versions
1 parent e381371 commit 0673c83

File tree

1 file changed

+24
-14
lines changed

1 file changed

+24
-14
lines changed

binder/Dockerfile

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ FROM ubuntu:24.04
55
RUN apt-get update && apt-get install -y \
66
g++ \
77
git \
8-
libatlas-base-dev \
98
libboost-serialization-dev \
109
libboost-chrono-dev \
1110
libhdf5-serial-dev \
@@ -19,17 +18,26 @@ RUN apt-get update && apt-get install -y \
1918
# BEGIN BINDER
2019
ARG NB_USER=jovyan
2120
ARG NB_UID=1000
22-
ENV USER ${NB_USER}
23-
ENV NB_UID ${NB_UID}
24-
ENV HOME /home/${NB_USER}
25-
ENV PATH="${PATH}:$HOME/.local/bin"
26-
RUN adduser --disabled-password \
27-
--gecos "Default user" \
28-
--uid ${NB_UID} \
29-
${NB_USER}
21+
ENV USER=${NB_USER}
22+
ENV NB_UID=${NB_UID}
23+
ENV HOME=/home/${NB_USER}
24+
ENV VENV_PATH=${HOME}/venv
25+
ENV PATH="${VENV_PATH}/bin:${PATH}"
26+
# If there is no default 1000 user:
27+
#RUN adduser --disabled-password \
28+
# --gecos "Default user" \
29+
# --uid ${NB_UID} \
30+
# ${NB_USER}
31+
# On ubuntu>=24.04 images there is ubuntu(1000)
32+
# see https://bugs.launchpad.net/cloud-images/+bug/2005129
33+
RUN usermod -l ${NB_USER} ubuntu && \
34+
mv /home/ubuntu ${HOME} && \
35+
usermod -d ${HOME} ${NB_USER} && \
36+
chown -R ${NB_UID}:${NB_UID} ${HOME}
3037
USER ${NB_USER}
31-
RUN python3 -m pip install --upgrade build wheel setuptools pip && \
32-
python3 -m pip install --no-cache-dir notebook jupyterlab jupyterhub jax[cpu] antimony
38+
RUN python3 -m venv ${VENV_PATH} && \
39+
${VENV_PATH}/bin/pip install --upgrade build wheel setuptools pip && \
40+
${VENV_PATH}/bin/pip install --no-cache-dir notebook jupyterlab jupyterhub jax[cpu] antimony
3341
# END BINDER
3442

3543
# BEGIN BINDER
@@ -41,9 +49,11 @@ USER ${NB_USER}
4149
# END BINDER
4250

4351
WORKDIR ${HOME}
44-
RUN . ./.profile && python3 -m build --sdist python/sdist && \
45-
python3 -m pip install -v $(ls -t python/sdist/dist/amici-*.tar.gz | head -1)[petab,pysb,vis] && \
46-
python3 -m pip install "git+https://github.com/Benchmarking-Initiative/Benchmark-Models-PEtab.git@master#subdirectory=src/python&egg=benchmark_models_petab" && \
52+
RUN . ./.profile && ${VENV_PATH}/bin/python3 -m build --sdist python/sdist && \
53+
${VENV_PATH}/bin/pip install git+https://github.com/pysb/pysb@master && \
54+
${VENV_PATH}/bin/pip install -U sympy && \
55+
${VENV_PATH}/bin/pip install -v $(ls -t python/sdist/dist/amici-*.tar.gz | head -1)[petab,vis,jax,sciml] && \
56+
${VENV_PATH}/bin/pip install "git+https://github.com/Benchmarking-Initiative/Benchmark-Models-PEtab.git@master#subdirectory=src/python&egg=benchmark_models_petab" && \
4757
scripts/buildBNGL.sh
4858

4959
ENV BNGPATH="${HOME}/ThirdParty/BioNetGen-2.7.0"

0 commit comments

Comments
 (0)