From 020c2332f98b2c566d3a19bd783a635df586cfab Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Sun, 19 May 2024 16:20:32 +0200 Subject: [PATCH 01/17] use NESSI_SITE_INSTALL when it is set --- EESSI-extend-2023.06-easybuild.eb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/EESSI-extend-2023.06-easybuild.eb b/EESSI-extend-2023.06-easybuild.eb index ed71ee5b53..d514293706 100644 --- a/EESSI-extend-2023.06-easybuild.eb +++ b/EESSI-extend-2023.06-easybuild.eb @@ -95,7 +95,19 @@ elseif (os.getenv("NESSI_SITE_INSTALL") ~= nil) then if ((os.getenv("NESSI_PROJECT_INSTALL") ~= nil) or (os.getenv("NESSI_USER_INSTALL") ~= nil)) then LmodError("You cannot use NESSI_SITE_INSTALL in combination with any other NESSI_*_INSTALL environment variables") end - easybuild_installpath = string.gsub(os.getenv("EESSI_SOFTWARE_PATH"), 'versions', 'host_injections') + site_install = os.getenv("NESSI_SITE_INSTALL") + site_modulepath = nil + if (site_install ~= nil) then + -- Check the folder exists + if not isDir(site_install) then + LmodError("The location of NESSI_SITE_INSTALL (" .. site_install .. ") does not exist or is not a folder") + end + if (mode() == "load") then + LmodMessage("Configuring for use of NESSI_SITE_INSTALL under " .. site_install) + end + easybuild_installpath = string.gsub(os.getenv("EESSI_SOFTWARE_PATH"), os.getenv("EESSI_CVMFS_REPO"), site_install) + site_modulepath = pathJoin(easybuild_installpath, 'modules', 'all') + end else -- Deal with user and project installs project_install = os.getenv("NESSI_PROJECT_INSTALL") From e250652be692576fd6e2b4e348032791f16d2b84 Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Sun, 19 May 2024 16:59:06 +0200 Subject: [PATCH 02/17] rebuild NESSI-extend module --- .../2023.06/rebuilds/20240519-update-NESSI-extend-module.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 easystacks/pilot.nessi.no/2023.06/rebuilds/20240519-update-NESSI-extend-module.yml diff --git a/easystacks/pilot.nessi.no/2023.06/rebuilds/20240519-update-NESSI-extend-module.yml b/easystacks/pilot.nessi.no/2023.06/rebuilds/20240519-update-NESSI-extend-module.yml new file mode 100644 index 0000000000..fbb323ff2e --- /dev/null +++ b/easystacks/pilot.nessi.no/2023.06/rebuilds/20240519-update-NESSI-extend-module.yml @@ -0,0 +1,5 @@ +# 2024-05-19 +# Rebuild NESSI-extend/2023.06-easybuild +# The current version does not handle NESSI_SITE_INSTALL correctly. +easyconfigs: + - EESSI-extend-2023.06-easybuild.eb From 0bd90fa141564d0deabb3af15a0380ffa2656fac Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Sun, 19 May 2024 18:27:42 +0200 Subject: [PATCH 03/17] rename rebuild easystack file --- ...dule.yml => 20240519-eb-4.9.1-rebuild-NESSI-extend-module.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename easystacks/pilot.nessi.no/2023.06/rebuilds/{20240519-update-NESSI-extend-module.yml => 20240519-eb-4.9.1-rebuild-NESSI-extend-module.yml} (100%) diff --git a/easystacks/pilot.nessi.no/2023.06/rebuilds/20240519-update-NESSI-extend-module.yml b/easystacks/pilot.nessi.no/2023.06/rebuilds/20240519-eb-4.9.1-rebuild-NESSI-extend-module.yml similarity index 100% rename from easystacks/pilot.nessi.no/2023.06/rebuilds/20240519-update-NESSI-extend-module.yml rename to easystacks/pilot.nessi.no/2023.06/rebuilds/20240519-eb-4.9.1-rebuild-NESSI-extend-module.yml From a261b4c133ff4eab789a36b7cf824beae57f3dad Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Sun, 19 May 2024 18:51:43 +0200 Subject: [PATCH 04/17] drop extra lowerdir parameter --- eessi_container.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eessi_container.sh b/eessi_container.sh index ad9397318a..962ce2c101 100755 --- a/eessi_container.sh +++ b/eessi_container.sh @@ -625,7 +625,7 @@ if [[ "${ACCESS}" == "rw" ]]; then EESSI_FUSE_MOUNTS+=("--fusemount" "${EESSI_READONLY}") EESSI_WRITABLE_OVERLAY="container:fuse-overlayfs" - EESSI_WRITABLE_OVERLAY+=" -o lowerdir=/cvmfs_ro/${repo_name}" + # EESSI_WRITABLE_OVERLAY+=" -o lowerdir=/cvmfs_ro/${repo_name}" if [[ ! -z ${LOWER_DIRS} ]]; then # need to convert ':' in LOWER_DIRS to ',' because bind mounts use ',' as # separator while the lowerdir overlayfs option uses ':' From 22c5cd4a98baa10a945da8cc9e492d47ceec8a39 Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Sun, 19 May 2024 19:01:08 +0200 Subject: [PATCH 05/17] show contents of extra lowerdir --- bot/build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bot/build.sh b/bot/build.sh index 23f5fd952b..0d9a314a4c 100755 --- a/bot/build.sh +++ b/bot/build.sh @@ -231,6 +231,8 @@ else chmod u+rw ${STORAGE}/lower_dirs/${remove_file} done + ls -lR ${STORAGE}/lower_dirs + # prepare directory to store tarball of tmp for removal and build steps TARBALL_TMP_REMOVAL_STEP_DIR=${PREVIOUS_TMP_DIR}/removal_step mkdir -p ${TARBALL_TMP_REMOVAL_STEP_DIR} From 27ca2fafbde0f3e7e79b0c0a8bbf066c98faa213 Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Sun, 19 May 2024 20:26:09 +0200 Subject: [PATCH 06/17] use lower dirs also for build step --- bot/build.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bot/build.sh b/bot/build.sh index 0d9a314a4c..2a690ecb20 100755 --- a/bot/build.sh +++ b/bot/build.sh @@ -272,6 +272,9 @@ BUILD_STEP_ARGS+=("--nvidia" "all") if [[ ! -z ${SHARED_FS_PATH} ]]; then BUILD_STEP_ARGS+=("--host-injections" "${SHARED_FS_PATH}/host-injections") fi +if [[ ! -z ${LOWER_DIRS} ]]; then + BUILD_STEP_ARGS+=("--lower-dirs" "${LOWER_DIRS}") +fi # create tmp file for output of build step build_outerr=$(mktemp build.outerr.XXXX) From 51671ee5055d75d543c6202127ac2f279c60d42f Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Sun, 19 May 2024 20:48:41 +0200 Subject: [PATCH 07/17] list directory contents --- EESSI-install-software.sh | 2 ++ EESSI-remove-software.sh | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/EESSI-install-software.sh b/EESSI-install-software.sh index d840910516..4c80a2649a 100755 --- a/EESSI-install-software.sh +++ b/EESSI-install-software.sh @@ -245,6 +245,8 @@ else if [ -f ${easystack_file} ]; then echo_green "Feeding easystack file ${easystack_file} to EasyBuild..." + ls -lisaR /cvmfs/pilot.nessi.no/versions/2023.06/software/linux/x86_64/amd/zen2/software/NESSI-extend + ${EB} --easystack ${TOPDIR}/${easystack_file} --robot ec=$? diff --git a/EESSI-remove-software.sh b/EESSI-remove-software.sh index 651a22f311..e464a586c6 100755 --- a/EESSI-remove-software.sh +++ b/EESSI-remove-software.sh @@ -112,9 +112,13 @@ else for app in ${rebuild_apps}; do app_dir=${EASYBUILD_INSTALLPATH}/software/${app} app_module=${EASYBUILD_INSTALLPATH}/modules/all/${app}.lua + ls -lisaR ${app_dir} + ls -lisaR ${app_module} echo_yellow "Removing ${app_dir} and ${app_module}..." rm -rdfv ${app_dir} rm -rdfv ${app_module} + ls -lisaR ${app_dir} + ls -lisaR ${app_module} done else fatal_error "Easystack file ${easystack_file} not found!" From a960a5fecbd76f9330665a6f0f61ab0a564b26cc Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Sun, 19 May 2024 22:02:45 +0200 Subject: [PATCH 08/17] create copy of lower dirs (dirs only) + skip test step --- bot/{test.sh => _test.sh} | 0 bot/build.sh | 15 ++++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) rename bot/{test.sh => _test.sh} (100%) diff --git a/bot/test.sh b/bot/_test.sh similarity index 100% rename from bot/test.sh rename to bot/_test.sh diff --git a/bot/build.sh b/bot/build.sh index 2a690ecb20..c5fc9bb8a5 100755 --- a/bot/build.sh +++ b/bot/build.sh @@ -273,7 +273,20 @@ if [[ ! -z ${SHARED_FS_PATH} ]]; then BUILD_STEP_ARGS+=("--host-injections" "${SHARED_FS_PATH}/host-injections") fi if [[ ! -z ${LOWER_DIRS} ]]; then - BUILD_STEP_ARGS+=("--lower-dirs" "${LOWER_DIRS}") + # make copy of LOWER_DIRS but only retain directories + lower_parent_dir=$(dirname ${LOWER_DIRS}) + the_lower_dir=$(basename ${LOWER_DIRS}) + LOWER_DIRS_ONLY="${lower_parent_dir}/${the_lower_dir}_2" + mkdir -p ${LOWER_DIRS_ONLY} + echo "contents of LOWER_DIRS_ONLY (after mkdir -p)" + ls -lisaR ${LOWER_DIRS_ONLY} + cp -a ${LOWER_DIRS}/ ${LOWER_DIRS_ONLY} + echo "contents of LOWER_DIRS_ONLY (after cp -a)" + ls -lisaR ${LOWER_DIRS_ONLY} + find ${LOWER_DIRS_ONLY} -type f -exec rm {} \; + echo "contents of LOWER_DIRS_ONLY (find ... rm)" + ls -lisaR ${LOWER_DIRS_ONLY} + BUILD_STEP_ARGS+=("--lower-dirs" "${LOWER_DIRS_ONLY}") fi # create tmp file for output of build step From 57555acd4a5ba98a0d5d7e04a6b01854a2a33ac7 Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Sun, 19 May 2024 22:14:20 +0200 Subject: [PATCH 09/17] fix copy command --- bot/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/build.sh b/bot/build.sh index c5fc9bb8a5..a12d3669fc 100755 --- a/bot/build.sh +++ b/bot/build.sh @@ -280,7 +280,7 @@ if [[ ! -z ${LOWER_DIRS} ]]; then mkdir -p ${LOWER_DIRS_ONLY} echo "contents of LOWER_DIRS_ONLY (after mkdir -p)" ls -lisaR ${LOWER_DIRS_ONLY} - cp -a ${LOWER_DIRS}/ ${LOWER_DIRS_ONLY} + cp -a ${LOWER_DIRS}/. ${LOWER_DIRS_ONLY} echo "contents of LOWER_DIRS_ONLY (after cp -a)" ls -lisaR ${LOWER_DIRS_ONLY} find ${LOWER_DIRS_ONLY} -type f -exec rm {} \; From 9f41c8eebe90a5589dd289707d6562659b59d011 Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Sun, 19 May 2024 22:41:39 +0200 Subject: [PATCH 10/17] move removal step into installation script --- EESSI-install-software.sh | 40 +++++++++++++++++++ bot/build.sh | 81 ++++++++++++++++++++------------------- 2 files changed, 82 insertions(+), 39 deletions(-) diff --git a/EESSI-install-software.sh b/EESSI-install-software.sh index 4c80a2649a..1d0f3ed470 100755 --- a/EESSI-install-software.sh +++ b/EESSI-install-software.sh @@ -218,6 +218,46 @@ fi # Don't run the Lmod GPU driver check when doing builds (may not have a GPU, and it's not relevant for vanilla builds anyway) export EESSI_OVERRIDE_GPU_CHECK=1 +# before we actually install software, we need to remove software that is requested +# to be rebuilt (need to do this here because installations of software are read-only; +# also, it should be done in the same container run or fuse-overlayfs might get confused) +changed_easystacks_rebuilds=$(cat ${pr_diff} | grep '^+++' | cut -f2 -d' ' | sed 's@^[a-z]/@@g' | grep '^easystacks/.*yml$' | egrep -v 'known-issues|missing' | grep "/rebuilds/") +if [ -z ${changed_easystacks_rebuilds} ]; then + echo "No software needs to be removed." +else + for easystack_file in ${changed_easystacks_rebuilds}; do + # determine version of EasyBuild module to load based on EasyBuild version included in name of easystack file + eb_version=$(echo ${easystack_file} | sed 's/.*eb-\([0-9.]*\).*/\1/g') + + # load EasyBuild module (will be installed if it's not available yet) + source ${TOPDIR}/load_easybuild_module.sh ${eb_version} + + if [ -f ${easystack_file} ]; then + echo_green "Software rebuild(s) requested in ${easystack_file}, so" + echo_green " determining which existing installation have to be removed (assuming contents" + echo_green " have been made writable/deletable)..." + # we need to remove existing installation directories first, + # so let's figure out which modules have to be rebuilt by doing a dry-run and grepping "someapp/someversion" for the relevant lines (with [R]) + # * [R] $CFGS/s/someapp/someapp-someversion.eb (module: someapp/someversion) + # rebuild_apps=$(eb --allow-use-as-root-and-accept-consequences --dry-run-short --rebuild --easystack ${easystack_file} | grep "^ \* \[R\]" | grep -o "module: .*[^)]" | awk '{print $2}') + rebuild_apps=$(eb --dry-run-short --rebuild --easystack ${easystack_file} | grep "^ \* \[R\]" | grep -o "module: .*[^)]" | awk '{print $2}') + for app in ${rebuild_apps}; do + app_dir=${EASYBUILD_INSTALLPATH}/software/${app} + app_module=${EASYBUILD_INSTALLPATH}/modules/all/${app}.lua + ls -lisaR ${app_dir} + ls -lisaR ${app_module} + echo_yellow "Removing ${app_dir} and ${app_module}..." + rm -rdfv ${app_dir} + rm -rdfv ${app_module} + ls -lisaR ${app_dir} + ls -lisaR ${app_module} + done + else + fatal_error "Easystack file ${easystack_file} not found!" + fi + done +fi + # use PR patch file to determine in which easystack files stuff was added changed_easystacks=$(cat ${pr_diff} | grep '^+++' | cut -f2 -d' ' | sed 's@^[a-z]/@@g' | grep '^easystacks/.*yml$' | egrep -v 'known-issues|missing') if [ -z "${changed_easystacks}" ]; then diff --git a/bot/build.sh b/bot/build.sh index a12d3669fc..2b08a8599c 100755 --- a/bot/build.sh +++ b/bot/build.sh @@ -233,31 +233,33 @@ else ls -lR ${STORAGE}/lower_dirs - # prepare directory to store tarball of tmp for removal and build steps - TARBALL_TMP_REMOVAL_STEP_DIR=${PREVIOUS_TMP_DIR}/removal_step - mkdir -p ${TARBALL_TMP_REMOVAL_STEP_DIR} - - # prepare arguments to eessi_container.sh specific to remove step - declare -a REMOVAL_STEP_ARGS=() - REMOVAL_STEP_ARGS+=("--save" "${TARBALL_TMP_REMOVAL_STEP_DIR}") - REMOVAL_STEP_ARGS+=("--storage" "${STORAGE}") - if [[ ! -z ${LOWER_DIRS} ]]; then - REMOVAL_STEP_ARGS+=("--lower-dirs" "${LOWER_DIRS}") - fi - - # create tmp file for output of removal step - removal_outerr=$(mktemp remove.outerr.XXXX) - - echo "Executing command to remove software:" - echo "./eessi_container.sh ${COMMON_ARGS[@]} ${REMOVAL_STEP_ARGS[@]}" - echo " -- ./EESSI-remove-software.sh \"${REMOVAL_SCRIPT_ARGS[@]}\" \"$@\" 2>&1 | tee -a ${removal_outerr}" - ./eessi_container.sh "${COMMON_ARGS[@]}" "${REMOVAL_STEP_ARGS[@]}" \ - -- ./EESSI-remove-software.sh "${REMOVAL_SCRIPT_ARGS[@]}" "$@" 2>&1 | tee -a ${removal_outerr} - - # make sure that the build step resumes from the same temporary directory - # this is important, as otherwise the removed software will still be there - REMOVAL_TMPDIR=$(grep ' as tmp directory ' ${removal_outerr} | cut -d ' ' -f 2) - BUILD_STEP_ARGS+=("--resume" "${REMOVAL_TMPDIR}") +# # prepare directory to store tarball of tmp for removal and build steps +# TARBALL_TMP_REMOVAL_STEP_DIR=${PREVIOUS_TMP_DIR}/removal_step +# mkdir -p ${TARBALL_TMP_REMOVAL_STEP_DIR} +# +#### +# # prepare arguments to eessi_container.sh specific to remove step +# declare -a REMOVAL_STEP_ARGS=() +# REMOVAL_STEP_ARGS+=("--save" "${TARBALL_TMP_REMOVAL_STEP_DIR}") +# REMOVAL_STEP_ARGS+=("--storage" "${STORAGE}") +# if [[ ! -z ${LOWER_DIRS} ]]; then +# REMOVAL_STEP_ARGS+=("--lower-dirs" "${LOWER_DIRS}") +# fi +# +# # create tmp file for output of removal step +# removal_outerr=$(mktemp remove.outerr.XXXX) +# +# echo "Executing command to remove software:" +# echo "./eessi_container.sh ${COMMON_ARGS[@]} ${REMOVAL_STEP_ARGS[@]}" +# echo " -- ./EESSI-remove-software.sh \"${REMOVAL_SCRIPT_ARGS[@]}\" \"$@\" 2>&1 | tee -a ${removal_outerr}" +# ./eessi_container.sh "${COMMON_ARGS[@]}" "${REMOVAL_STEP_ARGS[@]}" \ +# -- ./EESSI-remove-software.sh "${REMOVAL_SCRIPT_ARGS[@]}" "$@" 2>&1 | tee -a ${removal_outerr} +# +# # make sure that the build step resumes from the same temporary directory +# # this is important, as otherwise the removed software will still be there +# REMOVAL_TMPDIR=$(grep ' as tmp directory ' ${removal_outerr} | cut -d ' ' -f 2) +# BUILD_STEP_ARGS+=("--resume" "${REMOVAL_TMPDIR}") +#### fi # prepare directory to store tarball of tmp for build step @@ -273,20 +275,21 @@ if [[ ! -z ${SHARED_FS_PATH} ]]; then BUILD_STEP_ARGS+=("--host-injections" "${SHARED_FS_PATH}/host-injections") fi if [[ ! -z ${LOWER_DIRS} ]]; then - # make copy of LOWER_DIRS but only retain directories - lower_parent_dir=$(dirname ${LOWER_DIRS}) - the_lower_dir=$(basename ${LOWER_DIRS}) - LOWER_DIRS_ONLY="${lower_parent_dir}/${the_lower_dir}_2" - mkdir -p ${LOWER_DIRS_ONLY} - echo "contents of LOWER_DIRS_ONLY (after mkdir -p)" - ls -lisaR ${LOWER_DIRS_ONLY} - cp -a ${LOWER_DIRS}/. ${LOWER_DIRS_ONLY} - echo "contents of LOWER_DIRS_ONLY (after cp -a)" - ls -lisaR ${LOWER_DIRS_ONLY} - find ${LOWER_DIRS_ONLY} -type f -exec rm {} \; - echo "contents of LOWER_DIRS_ONLY (find ... rm)" - ls -lisaR ${LOWER_DIRS_ONLY} - BUILD_STEP_ARGS+=("--lower-dirs" "${LOWER_DIRS_ONLY}") +# # make copy of LOWER_DIRS but only retain directories +# lower_parent_dir=$(dirname ${LOWER_DIRS}) +# the_lower_dir=$(basename ${LOWER_DIRS}) +# LOWER_DIRS_ONLY="${lower_parent_dir}/${the_lower_dir}_2" +# mkdir -p ${LOWER_DIRS_ONLY} +# echo "contents of LOWER_DIRS_ONLY (after mkdir -p)" +# ls -lisaR ${LOWER_DIRS_ONLY} +# cp -a ${LOWER_DIRS}/. ${LOWER_DIRS_ONLY} +# echo "contents of LOWER_DIRS_ONLY (after cp -a)" +# ls -lisaR ${LOWER_DIRS_ONLY} +# find ${LOWER_DIRS_ONLY} -type f -exec rm {} \; +# echo "contents of LOWER_DIRS_ONLY (find ... rm)" +# ls -lisaR ${LOWER_DIRS_ONLY} +# BUILD_STEP_ARGS+=("--lower-dirs" "${LOWER_DIRS_ONLY}") + BUILD_STEP_ARGS+=("--lower-dirs" "${LOWER_DIRS}") fi # create tmp file for output of build step From a25cc1af28633dbff91037f6c009518b49cd1292 Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Sun, 19 May 2024 23:13:06 +0200 Subject: [PATCH 11/17] Revert "move removal step into installation script" This reverts commit 9f41c8eebe90a5589dd289707d6562659b59d011. --- EESSI-install-software.sh | 40 ------------------- bot/build.sh | 81 +++++++++++++++++++-------------------- 2 files changed, 39 insertions(+), 82 deletions(-) diff --git a/EESSI-install-software.sh b/EESSI-install-software.sh index 1d0f3ed470..4c80a2649a 100755 --- a/EESSI-install-software.sh +++ b/EESSI-install-software.sh @@ -218,46 +218,6 @@ fi # Don't run the Lmod GPU driver check when doing builds (may not have a GPU, and it's not relevant for vanilla builds anyway) export EESSI_OVERRIDE_GPU_CHECK=1 -# before we actually install software, we need to remove software that is requested -# to be rebuilt (need to do this here because installations of software are read-only; -# also, it should be done in the same container run or fuse-overlayfs might get confused) -changed_easystacks_rebuilds=$(cat ${pr_diff} | grep '^+++' | cut -f2 -d' ' | sed 's@^[a-z]/@@g' | grep '^easystacks/.*yml$' | egrep -v 'known-issues|missing' | grep "/rebuilds/") -if [ -z ${changed_easystacks_rebuilds} ]; then - echo "No software needs to be removed." -else - for easystack_file in ${changed_easystacks_rebuilds}; do - # determine version of EasyBuild module to load based on EasyBuild version included in name of easystack file - eb_version=$(echo ${easystack_file} | sed 's/.*eb-\([0-9.]*\).*/\1/g') - - # load EasyBuild module (will be installed if it's not available yet) - source ${TOPDIR}/load_easybuild_module.sh ${eb_version} - - if [ -f ${easystack_file} ]; then - echo_green "Software rebuild(s) requested in ${easystack_file}, so" - echo_green " determining which existing installation have to be removed (assuming contents" - echo_green " have been made writable/deletable)..." - # we need to remove existing installation directories first, - # so let's figure out which modules have to be rebuilt by doing a dry-run and grepping "someapp/someversion" for the relevant lines (with [R]) - # * [R] $CFGS/s/someapp/someapp-someversion.eb (module: someapp/someversion) - # rebuild_apps=$(eb --allow-use-as-root-and-accept-consequences --dry-run-short --rebuild --easystack ${easystack_file} | grep "^ \* \[R\]" | grep -o "module: .*[^)]" | awk '{print $2}') - rebuild_apps=$(eb --dry-run-short --rebuild --easystack ${easystack_file} | grep "^ \* \[R\]" | grep -o "module: .*[^)]" | awk '{print $2}') - for app in ${rebuild_apps}; do - app_dir=${EASYBUILD_INSTALLPATH}/software/${app} - app_module=${EASYBUILD_INSTALLPATH}/modules/all/${app}.lua - ls -lisaR ${app_dir} - ls -lisaR ${app_module} - echo_yellow "Removing ${app_dir} and ${app_module}..." - rm -rdfv ${app_dir} - rm -rdfv ${app_module} - ls -lisaR ${app_dir} - ls -lisaR ${app_module} - done - else - fatal_error "Easystack file ${easystack_file} not found!" - fi - done -fi - # use PR patch file to determine in which easystack files stuff was added changed_easystacks=$(cat ${pr_diff} | grep '^+++' | cut -f2 -d' ' | sed 's@^[a-z]/@@g' | grep '^easystacks/.*yml$' | egrep -v 'known-issues|missing') if [ -z "${changed_easystacks}" ]; then diff --git a/bot/build.sh b/bot/build.sh index 2b08a8599c..a12d3669fc 100755 --- a/bot/build.sh +++ b/bot/build.sh @@ -233,33 +233,31 @@ else ls -lR ${STORAGE}/lower_dirs -# # prepare directory to store tarball of tmp for removal and build steps -# TARBALL_TMP_REMOVAL_STEP_DIR=${PREVIOUS_TMP_DIR}/removal_step -# mkdir -p ${TARBALL_TMP_REMOVAL_STEP_DIR} -# -#### -# # prepare arguments to eessi_container.sh specific to remove step -# declare -a REMOVAL_STEP_ARGS=() -# REMOVAL_STEP_ARGS+=("--save" "${TARBALL_TMP_REMOVAL_STEP_DIR}") -# REMOVAL_STEP_ARGS+=("--storage" "${STORAGE}") -# if [[ ! -z ${LOWER_DIRS} ]]; then -# REMOVAL_STEP_ARGS+=("--lower-dirs" "${LOWER_DIRS}") -# fi -# -# # create tmp file for output of removal step -# removal_outerr=$(mktemp remove.outerr.XXXX) -# -# echo "Executing command to remove software:" -# echo "./eessi_container.sh ${COMMON_ARGS[@]} ${REMOVAL_STEP_ARGS[@]}" -# echo " -- ./EESSI-remove-software.sh \"${REMOVAL_SCRIPT_ARGS[@]}\" \"$@\" 2>&1 | tee -a ${removal_outerr}" -# ./eessi_container.sh "${COMMON_ARGS[@]}" "${REMOVAL_STEP_ARGS[@]}" \ -# -- ./EESSI-remove-software.sh "${REMOVAL_SCRIPT_ARGS[@]}" "$@" 2>&1 | tee -a ${removal_outerr} -# -# # make sure that the build step resumes from the same temporary directory -# # this is important, as otherwise the removed software will still be there -# REMOVAL_TMPDIR=$(grep ' as tmp directory ' ${removal_outerr} | cut -d ' ' -f 2) -# BUILD_STEP_ARGS+=("--resume" "${REMOVAL_TMPDIR}") -#### + # prepare directory to store tarball of tmp for removal and build steps + TARBALL_TMP_REMOVAL_STEP_DIR=${PREVIOUS_TMP_DIR}/removal_step + mkdir -p ${TARBALL_TMP_REMOVAL_STEP_DIR} + + # prepare arguments to eessi_container.sh specific to remove step + declare -a REMOVAL_STEP_ARGS=() + REMOVAL_STEP_ARGS+=("--save" "${TARBALL_TMP_REMOVAL_STEP_DIR}") + REMOVAL_STEP_ARGS+=("--storage" "${STORAGE}") + if [[ ! -z ${LOWER_DIRS} ]]; then + REMOVAL_STEP_ARGS+=("--lower-dirs" "${LOWER_DIRS}") + fi + + # create tmp file for output of removal step + removal_outerr=$(mktemp remove.outerr.XXXX) + + echo "Executing command to remove software:" + echo "./eessi_container.sh ${COMMON_ARGS[@]} ${REMOVAL_STEP_ARGS[@]}" + echo " -- ./EESSI-remove-software.sh \"${REMOVAL_SCRIPT_ARGS[@]}\" \"$@\" 2>&1 | tee -a ${removal_outerr}" + ./eessi_container.sh "${COMMON_ARGS[@]}" "${REMOVAL_STEP_ARGS[@]}" \ + -- ./EESSI-remove-software.sh "${REMOVAL_SCRIPT_ARGS[@]}" "$@" 2>&1 | tee -a ${removal_outerr} + + # make sure that the build step resumes from the same temporary directory + # this is important, as otherwise the removed software will still be there + REMOVAL_TMPDIR=$(grep ' as tmp directory ' ${removal_outerr} | cut -d ' ' -f 2) + BUILD_STEP_ARGS+=("--resume" "${REMOVAL_TMPDIR}") fi # prepare directory to store tarball of tmp for build step @@ -275,21 +273,20 @@ if [[ ! -z ${SHARED_FS_PATH} ]]; then BUILD_STEP_ARGS+=("--host-injections" "${SHARED_FS_PATH}/host-injections") fi if [[ ! -z ${LOWER_DIRS} ]]; then -# # make copy of LOWER_DIRS but only retain directories -# lower_parent_dir=$(dirname ${LOWER_DIRS}) -# the_lower_dir=$(basename ${LOWER_DIRS}) -# LOWER_DIRS_ONLY="${lower_parent_dir}/${the_lower_dir}_2" -# mkdir -p ${LOWER_DIRS_ONLY} -# echo "contents of LOWER_DIRS_ONLY (after mkdir -p)" -# ls -lisaR ${LOWER_DIRS_ONLY} -# cp -a ${LOWER_DIRS}/. ${LOWER_DIRS_ONLY} -# echo "contents of LOWER_DIRS_ONLY (after cp -a)" -# ls -lisaR ${LOWER_DIRS_ONLY} -# find ${LOWER_DIRS_ONLY} -type f -exec rm {} \; -# echo "contents of LOWER_DIRS_ONLY (find ... rm)" -# ls -lisaR ${LOWER_DIRS_ONLY} -# BUILD_STEP_ARGS+=("--lower-dirs" "${LOWER_DIRS_ONLY}") - BUILD_STEP_ARGS+=("--lower-dirs" "${LOWER_DIRS}") + # make copy of LOWER_DIRS but only retain directories + lower_parent_dir=$(dirname ${LOWER_DIRS}) + the_lower_dir=$(basename ${LOWER_DIRS}) + LOWER_DIRS_ONLY="${lower_parent_dir}/${the_lower_dir}_2" + mkdir -p ${LOWER_DIRS_ONLY} + echo "contents of LOWER_DIRS_ONLY (after mkdir -p)" + ls -lisaR ${LOWER_DIRS_ONLY} + cp -a ${LOWER_DIRS}/. ${LOWER_DIRS_ONLY} + echo "contents of LOWER_DIRS_ONLY (after cp -a)" + ls -lisaR ${LOWER_DIRS_ONLY} + find ${LOWER_DIRS_ONLY} -type f -exec rm {} \; + echo "contents of LOWER_DIRS_ONLY (find ... rm)" + ls -lisaR ${LOWER_DIRS_ONLY} + BUILD_STEP_ARGS+=("--lower-dirs" "${LOWER_DIRS_ONLY}") fi # create tmp file for output of build step From 1305649e986e4f743ccb418206461a06fa80d0b2 Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Sun, 19 May 2024 23:13:21 +0200 Subject: [PATCH 12/17] Revert "fix copy command" This reverts commit 57555acd4a5ba98a0d5d7e04a6b01854a2a33ac7. --- bot/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/build.sh b/bot/build.sh index a12d3669fc..c5fc9bb8a5 100755 --- a/bot/build.sh +++ b/bot/build.sh @@ -280,7 +280,7 @@ if [[ ! -z ${LOWER_DIRS} ]]; then mkdir -p ${LOWER_DIRS_ONLY} echo "contents of LOWER_DIRS_ONLY (after mkdir -p)" ls -lisaR ${LOWER_DIRS_ONLY} - cp -a ${LOWER_DIRS}/. ${LOWER_DIRS_ONLY} + cp -a ${LOWER_DIRS}/ ${LOWER_DIRS_ONLY} echo "contents of LOWER_DIRS_ONLY (after cp -a)" ls -lisaR ${LOWER_DIRS_ONLY} find ${LOWER_DIRS_ONLY} -type f -exec rm {} \; From fa4b77371d2d57133fc7b7ae73a1d6696bf3af7e Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Sun, 19 May 2024 23:13:23 +0200 Subject: [PATCH 13/17] Revert "create copy of lower dirs (dirs only) + skip test step" This reverts commit a960a5fecbd76f9330665a6f0f61ab0a564b26cc. --- bot/build.sh | 15 +-------------- bot/{_test.sh => test.sh} | 0 2 files changed, 1 insertion(+), 14 deletions(-) rename bot/{_test.sh => test.sh} (100%) diff --git a/bot/build.sh b/bot/build.sh index c5fc9bb8a5..2a690ecb20 100755 --- a/bot/build.sh +++ b/bot/build.sh @@ -273,20 +273,7 @@ if [[ ! -z ${SHARED_FS_PATH} ]]; then BUILD_STEP_ARGS+=("--host-injections" "${SHARED_FS_PATH}/host-injections") fi if [[ ! -z ${LOWER_DIRS} ]]; then - # make copy of LOWER_DIRS but only retain directories - lower_parent_dir=$(dirname ${LOWER_DIRS}) - the_lower_dir=$(basename ${LOWER_DIRS}) - LOWER_DIRS_ONLY="${lower_parent_dir}/${the_lower_dir}_2" - mkdir -p ${LOWER_DIRS_ONLY} - echo "contents of LOWER_DIRS_ONLY (after mkdir -p)" - ls -lisaR ${LOWER_DIRS_ONLY} - cp -a ${LOWER_DIRS}/ ${LOWER_DIRS_ONLY} - echo "contents of LOWER_DIRS_ONLY (after cp -a)" - ls -lisaR ${LOWER_DIRS_ONLY} - find ${LOWER_DIRS_ONLY} -type f -exec rm {} \; - echo "contents of LOWER_DIRS_ONLY (find ... rm)" - ls -lisaR ${LOWER_DIRS_ONLY} - BUILD_STEP_ARGS+=("--lower-dirs" "${LOWER_DIRS_ONLY}") + BUILD_STEP_ARGS+=("--lower-dirs" "${LOWER_DIRS}") fi # create tmp file for output of build step diff --git a/bot/_test.sh b/bot/test.sh similarity index 100% rename from bot/_test.sh rename to bot/test.sh From 2d14ffebe6d44330197fc74bd867485d3e86e9f4 Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Sun, 19 May 2024 23:13:25 +0200 Subject: [PATCH 14/17] Revert "list directory contents" This reverts commit 51671ee5055d75d543c6202127ac2f279c60d42f. --- EESSI-install-software.sh | 2 -- EESSI-remove-software.sh | 4 ---- 2 files changed, 6 deletions(-) diff --git a/EESSI-install-software.sh b/EESSI-install-software.sh index 4c80a2649a..d840910516 100755 --- a/EESSI-install-software.sh +++ b/EESSI-install-software.sh @@ -245,8 +245,6 @@ else if [ -f ${easystack_file} ]; then echo_green "Feeding easystack file ${easystack_file} to EasyBuild..." - ls -lisaR /cvmfs/pilot.nessi.no/versions/2023.06/software/linux/x86_64/amd/zen2/software/NESSI-extend - ${EB} --easystack ${TOPDIR}/${easystack_file} --robot ec=$? diff --git a/EESSI-remove-software.sh b/EESSI-remove-software.sh index e464a586c6..651a22f311 100755 --- a/EESSI-remove-software.sh +++ b/EESSI-remove-software.sh @@ -112,13 +112,9 @@ else for app in ${rebuild_apps}; do app_dir=${EASYBUILD_INSTALLPATH}/software/${app} app_module=${EASYBUILD_INSTALLPATH}/modules/all/${app}.lua - ls -lisaR ${app_dir} - ls -lisaR ${app_module} echo_yellow "Removing ${app_dir} and ${app_module}..." rm -rdfv ${app_dir} rm -rdfv ${app_module} - ls -lisaR ${app_dir} - ls -lisaR ${app_module} done else fatal_error "Easystack file ${easystack_file} not found!" From d3cf7065e40d3595b3126b29f2a99f0caf33b2f4 Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Sun, 19 May 2024 23:13:27 +0200 Subject: [PATCH 15/17] Revert "use lower dirs also for build step" This reverts commit 27ca2fafbde0f3e7e79b0c0a8bbf066c98faa213. --- bot/build.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/bot/build.sh b/bot/build.sh index 2a690ecb20..0d9a314a4c 100755 --- a/bot/build.sh +++ b/bot/build.sh @@ -272,9 +272,6 @@ BUILD_STEP_ARGS+=("--nvidia" "all") if [[ ! -z ${SHARED_FS_PATH} ]]; then BUILD_STEP_ARGS+=("--host-injections" "${SHARED_FS_PATH}/host-injections") fi -if [[ ! -z ${LOWER_DIRS} ]]; then - BUILD_STEP_ARGS+=("--lower-dirs" "${LOWER_DIRS}") -fi # create tmp file for output of build step build_outerr=$(mktemp build.outerr.XXXX) From 2afb50c87b31c05c48f9ebf7753855bf34270e2f Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Sun, 19 May 2024 23:21:07 +0200 Subject: [PATCH 16/17] less noise --- bot/build.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/bot/build.sh b/bot/build.sh index 0d9a314a4c..23f5fd952b 100755 --- a/bot/build.sh +++ b/bot/build.sh @@ -231,8 +231,6 @@ else chmod u+rw ${STORAGE}/lower_dirs/${remove_file} done - ls -lR ${STORAGE}/lower_dirs - # prepare directory to store tarball of tmp for removal and build steps TARBALL_TMP_REMOVAL_STEP_DIR=${PREVIOUS_TMP_DIR}/removal_step mkdir -p ${TARBALL_TMP_REMOVAL_STEP_DIR} From 5e4e2940ab49fffa9e44037a40d8b957cd27539d Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Sun, 19 May 2024 23:22:47 +0200 Subject: [PATCH 17/17] only user lowerdir arg once --- eessi_container.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/eessi_container.sh b/eessi_container.sh index 962ce2c101..c9ed97e5c6 100755 --- a/eessi_container.sh +++ b/eessi_container.sh @@ -625,7 +625,6 @@ if [[ "${ACCESS}" == "rw" ]]; then EESSI_FUSE_MOUNTS+=("--fusemount" "${EESSI_READONLY}") EESSI_WRITABLE_OVERLAY="container:fuse-overlayfs" - # EESSI_WRITABLE_OVERLAY+=" -o lowerdir=/cvmfs_ro/${repo_name}" if [[ ! -z ${LOWER_DIRS} ]]; then # need to convert ':' in LOWER_DIRS to ',' because bind mounts use ',' as # separator while the lowerdir overlayfs option uses ':'