Skip to content
Draft
4 changes: 2 additions & 2 deletions 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.11.10"
},
"PGSQL_VERSION": {
"default": "15"
Expand All @@ -16,7 +16,7 @@
"default": "24.09.0"
},
"AIIDALAB_HOME_VERSION": {
"default": "25.02.0"
"default": "update/notebook-7"
}
}
}
2 changes: 1 addition & 1 deletion docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ variable "AIIDALAB_HOME_VERSION" {
}

variable "JUPYTER_BASE_IMAGE" {
default = "jupyter/minimal-notebook:python-${PYTHON_VERSION}"
default = "quay.io/jupyter/minimal-notebook:python-${PYTHON_VERSION}"
}

variable "ORGANIZATION" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ PSQL_LOGFILE="${PGDATA}/logfile"
# -w waits until server is up
PSQL_START_CMD="pg_ctl --timeout=180 -w -l ${PSQL_LOGFILE} start"

MAMBA_RUN="mamba run -n aiida-core-services"
CONDA_RUN="conda run -n aiida-core-services"

# Initialize DB directory if it does not exist
if [[ ! -d ${PGDATA} ]]; then
mkdir "${PGDATA}"
${MAMBA_RUN} initdb
${CONDA_RUN} initdb
echo "unix_socket_directories = '/tmp'" >> "${PGDATA}/postgresql.conf"
else
# Fix problem with kubernetes cluster that adds rws permissions to the group
Expand All @@ -30,4 +30,4 @@ else
fi

# Start the server
${MAMBA_RUN} ${PSQL_START_CMD}
${CONDA_RUN} ${PSQL_START_CMD}
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ chmod 400 "/home/${NB_USER}/.erlang.cookie" || echo "erlang cookie not created y
# NOTE: In arm64 build, rabbitmq is not installed via conda,
# but the following incantation still works since
# rabbitmq-server is available globally.
mamba run -n aiida-core-services rabbitmq-server -detached
conda run -n aiida-core-services rabbitmq-server -detached
2 changes: 1 addition & 1 deletion stack/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ COPY pip.conf "${CONDA_DIR}/pip.conf"
# Update async_generator, certipy to satisfy `pip check`
# https://github.com/aiidalab/aiidalab-docker-stack/issues/490
# Install aiida-core and other shared requirements.
RUN mamba update -y pip async_generator certipy && \
RUN mamba update -y pip zstandard async_generator certipy && \
mamba install --yes \
aiida-core==${AIIDA_VERSION} \
mamba-bash-completion \
Expand Down
44 changes: 19 additions & 25 deletions stack/lab/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ FROM base
LABEL maintainer="AiiDAlab Team <[email protected]>"

# By default, Jupyter Docker image launches the JupyterLab interface.
# Here, we change it to the classic Jupyter Notebook which is used by AiiDAlab.
# In the future, we might want to switch to other options such as `nbclassic` or `retro`,
# but the `nbclassic` is not supported because of appmode.
# see: https://jupyter-docker-stacks.readthedocs.io/en/latest/using/common.html#switching-back-to-the-classic-notebook-or-using-a-different-startup-command
ENV DOCKER_STACKS_JUPYTER_CMD=notebook
# Here, we change it to the nbclassic Jupyter Notebook which is used by AiiDAlab.
# https://jupyter-docker-stacks.readthedocs.io/en/latest/using/common.html#switching-back-to-the-classic-notebook-or-using-a-different-startup-command
ENV DOCKER_STACKS_JUPYTER_CMD=nbclassic

USER root
WORKDIR /opt/
Expand All @@ -17,6 +15,7 @@ WORKDIR /opt/
ARG AIIDALAB_VERSION
RUN mamba install --yes \
aiidalab=${AIIDALAB_VERSION} \
appmode=1.0.0 \
&& mamba clean --all -f -y && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"
Expand All @@ -32,20 +31,15 @@ RUN echo 'eval "$(_AIIDALAB_COMPLETE=bash_source aiidalab)"' >> "${CONDA_DIR}/et
ARG AIIDALAB_HOME_VERSION
RUN git clone https://github.com/aiidalab/aiidalab-home && \
cd aiidalab-home && \
git checkout v"${AIIDALAB_HOME_VERSION}" && \
pip install --no-user --quiet --no-cache-dir "./" && \
git checkout "${AIIDALAB_HOME_VERSION}" && \
pip install --no-user --no-cache-dir "./" && \
fix-permissions "./" && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"

# Install and enable appmode, turning Jupyter notebooks to Apps
RUN pip install appmode==0.8.0 --no-cache-dir --no-user
# Enable appmode extension
RUN jupyter nbextension enable --py --sys-prefix appmode && \
jupyter serverextension enable --py --sys-prefix appmode

# Swap appmode icon for AiiDAlab gears icon, shown during app load
COPY --chown=${NB_UID}:${NB_GID} gears.svg ${CONDA_DIR}/share/jupyter/nbextensions/appmode/gears.svg
# TODO: What is the correct directory for nbclassic?
#COPY --chown=${NB_UID}:${NB_GID} gears.svg ${CONDA_DIR}/share/jupyter/nbextensions/appmode/gears.svg

# Copy start-up scripts for AiiDAlab.
COPY before-notebook.d/* /usr/local/bin/before-notebook.d/
Expand Down Expand Up @@ -75,7 +69,8 @@ USER ${NB_USER}

WORKDIR "/home/${NB_USER}"

RUN mkdir -p /home/${NB_USER}/apps
RUN mkdir -p /home/${NB_USER}/apps
RUN mkdir -p /home/${NB_USER}/.tmp_notebooks

# When a Jupyter notebook server looses a connection to the frontend,
# it keeps the messages in a buffer. If there is a background thread running
Expand All @@ -87,16 +82,15 @@ RUN mkdir -p /home/${NB_USER}/apps
# but that may come with other problems for people with flaky internet connections.
# Instead, here we configure Jupyter to kill all kernels that have been alive for
# more than 12 hours. We also close all inactive terminals after 10 minutes.
ENV NOTEBOOK_ARGS=\
"--NotebookApp.default_url=/apps/apps/home/start.ipynb "\
"--ContentsManager.allow_hidden=True "\
"--MappingKernelManager.buffer_offline_messages=True "\
"--MappingKernelManager.cull_busy=True "\
"--MappingKernelManager.cull_connected=True "\
"--MappingKernelManager.cull_idle_timeout=64800 "\
"--MappingKernelManager.cull_interval=300 "\
"--TerminalManager.cull_inactive_timeout=3600 "\
"--TerminalManager.cull_interval=300"
ENV NOTEBOOK_ARGS \
"--NotebookApp.default_url='/apps/apps/home/start.ipynb'" \
"--MappingKernelManager.buffer_offline_messages=True" \
"--MappingKernelManager.cull_busy=True" \
"--MappingKernelManager.cull_connected=True" \
"--MappingKernelManager.cull_idle_timeout=64800" \
"--MappingKernelManager.cull_interval=300" \
"--TerminalManager.cull_inactive_timeout=3600" \
"--TerminalManager.cull_interval=300"

# Set up the logo of notebook interface
ARG PYTHON_MINOR_VERSION
Expand Down
Loading