From 41bfb23b5af3a2da945c123c6102d70800c469ec Mon Sep 17 00:00:00 2001 From: Tasko Olevski Date: Tue, 21 Jan 2025 13:38:58 +0100 Subject: [PATCH] fix: enable running image on Renku --- Dockerfile | 4 +++- before-notebook.d/00_untar-home.sh | 9 +++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1616cc716..ab50ab485 100644 --- a/Dockerfile +++ b/Dockerfile @@ -90,7 +90,9 @@ RUN --mount=from=qe_conda_env,source=${QE_DIR},target=${QE_DIR} \ verdi daemon stop && \ mamba run -n aiida-core-services pg_ctl stop && \ touch /home/${NB_USER}/.FLAG_HOME_INITIALIZED && \ - cd /home/${NB_USER} && tar -cf /opt/conda/home.tar . + # NOTE: The work folder is empty but if included clashes with the work folder in a Renku + # session whose permissions cannot be changed. + cd /home/${NB_USER} && tar -cf /opt/conda/home.tar --exclude work . # STAGE 3 - Final stage # - Install python dependencies diff --git a/before-notebook.d/00_untar-home.sh b/before-notebook.d/00_untar-home.sh index d55902280..75a3b2782 100644 --- a/before-notebook.d/00_untar-home.sh +++ b/before-notebook.d/00_untar-home.sh @@ -15,10 +15,11 @@ if [ ! -e $home/.FLAG_HOME_INITIALIZED ]; then fi echo "Extracting $HOME_TAR to $home" - # NOTE: a tar error when deployed to k8s but at the momment not cause any issue - # tar: .: Cannot utime: Operation not permitted - # tar: .: Cannot change mode to rwxr-s---: Operation not permitted - tar -xf $HOME_TAR -C "$home" + # NOTE: the added flags to tar are to address some errors that occur in k8s + # tar: .: Cannot utime: Operation not permitted -> --touch solves this problem + # tar: .: Cannot change mode to rwxr-s---: Operation not permitted -> --no-overwrite-dir solves this problem + # this only refers to the metadata and permissions of existing directories, not their contents + tar -xf $HOME_TAR -C "$home" --no-overwrite-dir --touch else echo "$home folder is not empty!" ls -lrta "$home"