forked from aiidalab/aiidalab-qe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4651f4d
commit 731ee91
Showing
9 changed files
with
67 additions
and
129 deletions.
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
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,47 @@ | ||
# syntax=docker/dockerfile:1 | ||
FROM ghcr.io/astral-sh/uv:0.2.18 as uv | ||
FROM ghcr.io/aiidalab/full-stack:2024.1021 | ||
|
||
USER ${NB_USER} | ||
|
||
ENV QE_VERSION "7.2" | ||
|
||
# 1. Install Quantum Espresso into a conda environment | ||
RUN mamba create -n quantum-espresso --yes qe=${QE_VERSION} && \ | ||
mamba clean --all -f -y | ||
|
||
# 2. Prepare AiiDA profile and localhost computer | ||
# (we do this here for better caching during Docker build) | ||
RUN bash /usr/local/bin/before-notebook.d/20_start-postgresql.sh && \ | ||
bash /usr/local/bin/before-notebook.d/40_prepare-aiida.sh && \ | ||
verdi daemon stop && \ | ||
mamba run -n aiida-core-services pg_ctl stop | ||
|
||
# 3. Copy the whole repo | ||
ENV QE_APP_FOLDER ${AIIDALAB_APPS}/quantum-espresso | ||
COPY --chown=${NB_UID}:${NB_GID} . ${QE_APP_FOLDER} | ||
|
||
WORKDIR ${QE_APP_FOLDER} | ||
# 4.Install python dependencies | ||
# Use uv instead of pip to speed up installation, per docs: | ||
# https://github.com/astral-sh/uv/blob/main/docs/guides/docker.md#using-uv-temporarily | ||
# Use the same constraint file as pip | ||
ENV UV_CONSTRAINT ${PIP_CONSTRAINT} | ||
RUN --mount=from=uv,source=/uv,target=/bin/uv \ | ||
# Remove all untracked files and directories. | ||
git clean -fx && \ | ||
uv pip install --system --no-cache . | ||
|
||
# 5. Install the QE pseudopotentials and codes | ||
RUN bash /usr/local/bin/before-notebook.d/20_start-postgresql.sh && \ | ||
python -m aiidalab_qe install-qe && \ | ||
python -m aiidalab_qe install-pseudos && \ | ||
mamba run -n aiida-core-services pg_ctl stop | ||
|
||
USER root | ||
COPY ./before-notebook.d/* /usr/local/bin/before-notebook.d/ | ||
RUN fix-permissions "${CONDA_DIR}" && \ | ||
fix-permissions "/home/${NB_USER}" | ||
|
||
USER ${NB_USER} | ||
WORKDIR "/home/${NB_USER}" |
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,19 @@ | ||
#!/bin/bash | ||
# | ||
set -euo pipefail | ||
|
||
home="/home/${NB_USER}" | ||
|
||
if [[ ! -d ${home} ]]; then | ||
echo "Directory $home does not exist!" | ||
exit 1 | ||
fi | ||
|
||
# Untar home archive file to restore home directory if it is empty | ||
if [[ $(ls -A ${home} | wc -l) = "0" ]];then | ||
if [ -f /opt/home.tar ]; then | ||
# untar /opt/home.tar to /home/jovyan to restore home directory | ||
echo "Untarring /opt/home.tar to /home/jovyan" | ||
tar -xf /opt/home.tar -C /home/jovyan | ||
fi | ||
fi |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.