Skip to content

Commit

Permalink
fix: enable running image on Renku (#1105)
Browse files Browse the repository at this point in the history
  • Loading branch information
olevski authored Jan 21, 2025
1 parent d5a1aec commit dd54da6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions before-notebook.d/00_untar-home.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit dd54da6

Please sign in to comment.