Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aiida-core installed by pip and bump python version 3.10 #316

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"variable": {
"PYTHON_VERSION": {
"default": "3.9.13"
"default": "3.10.6"
},
"AIIDA_VERSION": {
"default": "2.1.2"
Expand Down
7 changes: 2 additions & 5 deletions stack/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@ ARG AIIDA_VERSION

# Install the shared requirements.
COPY requirements.txt .
RUN mamba install --yes \
aiida-core=${AIIDA_VERSION} \
--file requirements.txt \
&& mamba clean --all -f -y && \
RUN pip install --no-cache-dir aiida-core==${AIIDA_VERSION} \
-r requirements.txt && \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also means that things in requirement.txt will be installed by pip. Is that what you wanted?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. To be honest, I have no idea why this requirements.txt is needed, it has aiida-core and pip included, but aiida-core is already installed with specifying the version.

Copy link
Contributor

@danielhollas danielhollas Oct 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is used below as a constraint file for conda and pip. But it is indeed strange that aiida-core version is specified in two places. This has already been noted in #311. Perhaps requirements.txt needs to be generated dynamically in the Dockerfile?

cc @csadorf

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, the requirements.txt file serves a double function as constraints file. The aiida-core version is not pinned using this file, but only constraint, as you can see here:


It would need to be updated if and only if the major version is changed.

The only other requirement in that file is the pinned pip version.

fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"


# Pin shared requirements in the base environemnt.
RUN cat requirements.txt | xargs -I{} conda config --system --add pinned_packages {}

Expand Down
2 changes: 1 addition & 1 deletion stack/full-stack/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ COPY --from=base "${CONDA_DIR}/envs/aiida-core-services" "${CONDA_DIR}/envs/aiid
COPY --from=base /usr/local/bin/before-notebook.d /usr/local/bin/before-notebook.d

RUN fix-permissions "${CONDA_DIR}"
RUN fix-permissions "/home/${NB_USER}/.aiida"
RUN fix-permissions "/home/${NB_USER}"

USER ${NB_USER}

Expand Down
4 changes: 1 addition & 3 deletions stack/lab/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ RUN apt-get update --yes && \

# Install aiidalab package
ARG AIIDALAB_VERSION
RUN mamba install --yes \
aiidalab=${AIIDALAB_VERSION} \
&& mamba clean --all -f -y && \
RUN pip install --no-cache-dir aiidalab==${AIIDALAB_VERSION} && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"

Expand Down