Move QE conda install into separate stage#783
Conversation
When building the QEApp Docker container,
the Quantum Espresso installation into a conda environment
is a step that's completely independent from the others.
By putting it into a separate Docker build stage,
it can be build in parallel (when using buildkit), as:
DOCKER_BUILDKIT=1 docker build .
| # 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 |
There was a problem hiding this comment.
This is needed so that the variables are passed from the top level.
There was a problem hiding this comment.
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.
Yeah, it's definitely not obvious, took me a while to figure out.
| # 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.
This is not needed since the uv pip install --system does not touch the home directory.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #783 +/- ##
=======================================
Coverage 68.28% 68.28%
=======================================
Files 45 45
Lines 4143 4143
=======================================
Hits 2829 2829
Misses 1314 1314
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
| # 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 |
There was a problem hiding this comment.
Cool, learned. I was always defined in the stage and don't know how to move all ARGs to the front of file.
When building the QEApp Docker container, the Quantum Espresso installation into a conda environment is a step that's completely independent from the others. By putting it into a separate Docker build stage, it can be build in parallel (when using buildkit), as:
Also added a
.dockerignorefile. This is important since we're copying the whole directory into the container and we don't want to copy junk inside. Even if we later rungit clean, once the files are copied, that stay in the fs layers.Extracted from #781