@@ -10,7 +10,8 @@ USER root
1010# https://pymatgen.org/installation.html#installation-tips-for-optional-libraries
1111# rsync: needed to support the new AiiDA backup command
1212# povray: rendering engine used in aiidalab-widgets-base
13- ENV EXTRA_APT_PACKAGES "curl povray rsync build-essential"
13+ # bc: needed to compute the resources for computer setup
14+ ENV EXTRA_APT_PACKAGES "curl povray rsync build-essential bc"
1415
1516# For ARM64 we need to install erlang as it is not available on conda-forge
1617# (this is needed later as rabbitmq dependency in base-with-services image,
@@ -41,18 +42,31 @@ RUN cat /opt/requirements.txt | xargs -I{} conda config --system --add pinned_pa
4142
4243# Configure pip to use the same requirements file as constraints file.
4344ENV PIP_CONSTRAINT /opt/requirements.txt
44- # Ensure that pip installs packages to ~/.local by default
45- ENV PIP_USER 1
45+ # Ensure that pip installs packages to '~/.local/lib/python3.X/site-packages/' by default
46+ # by implicitly passing the '--user' option to 'pip install'
47+ # Otherwise, pip would install into /opt/conda and such packages would be lost
48+ # when the container exits.
49+ # NOTE: We specifically chose the location '/opt/conda/pip.conf'
50+ # which represents the 'site' config file when VIRTUAL_ENV is not set, per:
51+ # https://pip.pypa.io/en/stable/topics/configuration/#configuration-files
52+ # Other locations such as '~/.config/pip/pip.conf' or '/etc/pip.conf' would interfere with virtual environments,
53+ # for example those used by pre-commit.
54+ # We can't use the PIP_USER env variable for the same reason.
55+ # To better understand this, try running `pip config debug` and see
56+ # https://github.com/aiidalab/aiidalab-docker-stack/issues/501
57+ COPY pip.conf "${CONDA_DIR}/pip.conf"
4658
4759# Upgrade pip and mamba to latest
60+ # Update async_generator, certipy to satisfy `pip check`
61+ # https://github.com/aiidalab/aiidalab-docker-stack/issues/490
4862# Install aiida-core and other shared requirements.
49- RUN mamba update -y pip zstandard && \
63+ RUN mamba update -y pip zstandard async_generator certipy && \
5064 mamba install --yes \
5165 aiida-core==${AIIDA_VERSION} \
5266 mamba-bash-completion \
67+ traitlets=5.9.0 \
5368 && mamba clean --all -f -y && \
54- fix-permissions "${CONDA_DIR}" && \
55- fix-permissions "/home/${NB_USER}"
69+ fix-permissions "${CONDA_DIR}"
5670
5771# Enable verdi autocompletion.
5872RUN mkdir -p "${CONDA_DIR}/etc/conda/activate.d" && \
0 commit comments