diff --git a/EESSI-remove-software.sh b/EESSI-remove-software.sh index 446a156cb8..05572257a5 100755 --- a/EESSI-remove-software.sh +++ b/EESSI-remove-software.sh @@ -79,6 +79,17 @@ echo ">> Setting up \$MODULEPATH..." module --force purge # ignore current $MODULEPATH entirely module unuse $MODULEPATH + +# if an accelerator target is specified, we need to make sure that the CPU-only modules are also still available +if [ ! -z ${EESSI_ACCELERATOR_TARGET} ]; then + CPU_ONLY_MODULES_PATH=$(echo $EASYBUILD_INSTALLPATH | sed "s@/accel/${EESSI_ACCELERATOR_TARGET}@@g")/modules/all + if [ -d ${CPU_ONLY_MODULES_PATH} ]; then + module use ${CPU_ONLY_MODULES_PATH} + else + fatal_error "Derived path to CPU-only modules does not exist: ${CPU_ONLY_MODULES_PATH}" + fi +fi + module use $EASYBUILD_INSTALLPATH/modules/all if [[ -z ${MODULEPATH} ]]; then fatal_error "Failed to set up \$MODULEPATH?!" @@ -109,8 +120,12 @@ if [ $EUID -eq 0 ]; then # * [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}') for app in ${rebuild_apps}; do - app_dir=${EASYBUILD_INSTALLPATH}/software/${app} - app_module=${EASYBUILD_INSTALLPATH}/modules/all/${app}.lua + # Returns e.g. /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/amd/zen2/modules/all: + app_modulepath=$(module --terse av ${app} 2>&1 | head -n 1 | sed 's/://') + # Two dirname invocations, so returns e.g. /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/amd/zen2 + app_installprefix=$(dirname $(dirname ${app_modulepath})) + app_dir=${app_installprefix}/software/${app} + app_module=${app_installprefix}/modules/all/${app}.lua echo_yellow "Removing ${app_dir} and ${app_module}..." rm -rf ${app_dir} rm -rf ${app_module} diff --git a/create_tarball.sh b/create_tarball.sh index e70a9b18d6..9c212681a5 100755 --- a/create_tarball.sh +++ b/create_tarball.sh @@ -64,9 +64,9 @@ for subdir in ${cpu_arch_subdir} ${cpu_arch_subdir}/accel/${accel_subdir}; do if [ -d ${eessi_version}/software/${os}/${subdir}/modules ]; then # module files - find ${eessi_version}/software/${os}/${subdir}/modules -type f | grep -v '/\.wh\.' >> ${files_list} + find ${eessi_version}/software/${os}/${subdir}/modules -type f | grep -v '/\.wh\.' >> ${files_list} || true # Make sure we don't exit because of set -e if grep doesn't return a match # module symlinks - find ${eessi_version}/software/${os}/${subdir}/modules -type l | grep -v '/\.wh\.' >> ${files_list} + find ${eessi_version}/software/${os}/${subdir}/modules -type l | grep -v '/\.wh\.' >> ${files_list} || true # Make sure we don't exit because of set -e if grep doesn't return a match # module files and symlinks find ${eessi_version}/software/${os}/${subdir}/modules/all -type f -o -type l \ | grep -v '/\.wh\.' | grep -v '/\.modulerc\.lua' | sed -e 's/.lua$//' | sed -e 's@.*/modules/all/@@g' | sort -u \ @@ -83,7 +83,7 @@ for subdir in ${cpu_arch_subdir} ${cpu_arch_subdir}/accel/${accel_subdir}; do for package_version in $(cat ${module_files_list}); do echo "handling ${package_version}" ls -d ${eessi_version}/software/${os}/${subdir}/software/${package_version} \ - | grep -v '/\.wh\.' >> ${files_list} + | grep -v '/\.wh\.' >> ${files_list} || true # Make sure we don't exit because of set -e if grep doesn't return a match done fi done diff --git a/eessi_container.sh b/eessi_container.sh index 34fa833d99..fc97f9877c 100755 --- a/eessi_container.sh +++ b/eessi_container.sh @@ -846,14 +846,14 @@ if [[ ! -z ${SAVE} ]]; then # of these aspects to where the script is used if [[ -d ${SAVE} ]]; then # assume SAVE is name of a directory to which tarball shall be written to - # name format: {REPO_ID}-{TIMESTAMP}.tgz + # name format: tmp_storage-{TIMESTAMP}.tgz ts=$(date +%s) - TGZ=${SAVE}/${REPOSITORY}-${ts}.tgz + TGZ=${SAVE}/tmp_storage-${ts}.tgz else # assume SAVE is the full path to a tarball's name TGZ=${SAVE} fi - tar cf ${TGZ} -C ${EESSI_TMPDIR} . + tar czf ${TGZ} -C ${EESSI_TMPDIR} . echo "Saved contents of tmp directory '${EESSI_TMPDIR}' to tarball '${TGZ}' (to resume session add '--resume ${TGZ}')" fi