-
Notifications
You must be signed in to change notification settings - Fork 15
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
Move QE conda install into separate stage #783
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
**/*.egg-info | ||
**/__pycache__ | ||
**/.*_cache | ||
**/*.pyc | ||
**/*.tar.gz | ||
*.code-workspace | ||
**/.*.ipynb | ||
**/.ipynb* | ||
.venv/ | ||
build/ | ||
export/ | ||
.do-not-setup-on-localhost | ||
|
||
# Sphinx documentation | ||
docs/html | ||
screenshots/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,26 @@ | ||
# syntax=docker/dockerfile:1 | ||
FROM ghcr.io/astral-sh/uv:0.2.18 AS uv | ||
FROM ghcr.io/aiidalab/full-stack:2024.1019 | ||
ARG FULL_STACK_VER=2024.1021 | ||
ARG UV_VER=0.2.27 | ||
ARG QE_VER=7.2 | ||
ARG QE_DIR=/opt/conda/envs/quantum-espresso-${QE_VER} | ||
|
||
FROM ghcr.io/astral-sh/uv:0.2.27 AS uv | ||
|
||
# STAGE 1 | ||
# Install QE into conda environment in /opt/conda | ||
# This step is independent from the others and can be run in parallel. | ||
FROM ghcr.io/aiidalab/full-stack:${FULL_STACK_VER} AS qe_conda_env | ||
ARG QE_VER | ||
ARG QE_DIR | ||
RUN mamba create -p "${QE_DIR}" --yes qe="${QE_VER}" && \ | ||
mamba clean --all -f -y && \ | ||
fix-permissions "${CONDA_DIR}" | ||
|
||
|
||
# STAGE 2 | ||
FROM ghcr.io/aiidalab/full-stack:${FULL_STACK_VER} | ||
ARG QE_VER | ||
ARG QE_DIR | ||
# Copy whole repo and pre-install the dependencies and app to the tmp folder. | ||
# In the before notebook scripts the app will be re-installed by moving it to the app folder. | ||
ENV PREINSTALL_APP_FOLDER=${CONDA_DIR}/aiidalab-qe | ||
|
@@ -17,26 +36,12 @@ RUN --mount=from=uv,source=/uv,target=/bin/uv \ | |
cd ${PREINSTALL_APP_FOLDER} && \ | ||
# Remove all untracked files and directories. For example the setup lock flag file. | ||
git clean -fx && \ | ||
# It is important to install from `aiidalab install` to mimic the exact installation operation as | ||
# from the app store. | ||
# The command wil first install the dependencies from list by parsing setup config files, | ||
# (for `aiidalab/aiidalab<23.03.2` the `setup.py` should be in the root folder of the app https://github.com/aiidalab/aiidalab/pull/382). | ||
# and then the app and restart the daemon in the end. | ||
# But since the aiida profile not yet exists, the daemon restart will fail but it is not a problem. | ||
# Because we only need the dependencies to be installed. | ||
# aiidalab install --yes --python ${CONDA_DIR}/bin/python "quantum-espresso@file://${PREINSTALL_APP_FOLDER}" && \ | ||
# However, have to use `pip install` explicitly because `aiidalab install` call `pip install --user` which will install the app to `/home/${NB_USER}/.local`. | ||
# It won't cause issue for docker but for k8s deployment the home folder is not bind mounted to the pod and the dependencies won't be found. (see issue in `jupyter/docker-stacks` https://github.com/jupyter/docker-stacks/issues/815) | ||
uv pip install --system --no-cache . && \ | ||
fix-permissions "${CONDA_DIR}" && \ | ||
fix-permissions "/home/${NB_USER}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not needed since the |
||
|
||
ENV QE_VERSION="7.2" | ||
RUN mamba create -p /opt/conda/envs/quantum-espresso --yes \ | ||
qe=${QE_VERSION} \ | ||
&& mamba clean --all -f -y && \ | ||
fix-permissions "${CONDA_DIR}" && \ | ||
fix-permissions "/home/${NB_USER}" | ||
fix-permissions "${CONDA_DIR}" | ||
|
||
COPY --from=qe_conda_env "${QE_DIR}" "${QE_DIR}" | ||
# TODO: Remove this once we get rid of 70_prepare-qe-executable.sh | ||
ENV QE_VERSION="$QE_VER" | ||
|
||
# Download the QE pseudopotentials to the folder for afterware installation. | ||
ENV PSEUDO_FOLDER=${CONDA_DIR}/pseudo | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed so that the variables are passed from the top level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, learned. I was always defined in the stage and don't know how to move all ARGs to the front of file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's definitely not obvious, took me a while to figure out.