Skip to content

Commit

Permalink
ignore fakeroot and do not remove packages
Browse files Browse the repository at this point in the history
  • Loading branch information
truib committed Apr 12, 2024
1 parent 82cfe67 commit 6f9d7ad
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
21 changes: 15 additions & 6 deletions EESSI-remove-software.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ fi
pr_diff=$(ls [0-9]*.diff | head -1)

# if this script is run as root, use PR patch file to determine if software needs to be removed first
if [ $EUID -eq 0 ]; then
# if [ $EUID -eq 0 ]; then
# working around lacking support for `--fakeroot` and/or user namespaces
# we only run as non-root
if [ $EUID -ne 0 ]; then
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."
Expand All @@ -107,19 +110,25 @@ if [ $EUID -eq 0 ]; then
# 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 --allow-use-as-root-and-accept-consequences --dry-run-short --rebuild --easystack ${easystack_file} | grep "^ \* \[R\]" | grep -o "module: .*[^)]" | awk '{print $2}')
# we cannot run as root so we removed `--allow-use-as-root...`
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
echo_yellow "Removing ${app_dir} and ${app_module}..."
rm -rf ${app_dir}
rm -rf ${app_module}
echo_yellow "Removing ${app_dir} and ${app_module}... (just reporting what would have been done)"
# echo_yellow "Removing ${app_dir} and ${app_module}..."
# rm -rf ${app_dir}
# rm -rf ${app_module}
done
else
fatal_error "Easystack file ${easystack_file} not found!"
fi
done
fi
else
fatal_error "This script can only be run by root!"
fatal_error "This script can NOT be run by root! (lacking support for `--fakeroot` and/or user namespaces)"
fi
# else
# fatal_error "This script can only be run by root!"
# fi
4 changes: 3 additions & 1 deletion bot/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ else
REMOVAL_STEP_ARGS+=("--storage" "${STORAGE}")
# add fakeroot option in order to be able to remove software, see:
# https://github.com/EESSI/software-layer/issues/312
REMOVAL_STEP_ARGS+=("--fakeroot")
# CURRENTLY NOT SUPPORTED; software packages need to be removed from
# CernVM-FS repository first
# REMOVAL_STEP_ARGS+=("--fakeroot")

# create tmp file for output of removal step
removal_outerr=$(mktemp remove.outerr.XXXX)
Expand Down
5 changes: 4 additions & 1 deletion eessi_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ display_help() {
echo " -c | --container IMG - image file or URL defining the container to use"
echo " [default: docker://ghcr.io/eessi/build-node:debian11]"
echo " -f | --fakeroot - run the container with --fakeroot [default: false]"
echo " Note, currently this option is ignored."
echo " -g | --storage DIR - directory space on host machine (used for"
echo " temporary data) [default: 1. TMPDIR, 2. /tmp]"
echo " -h | --help - display this usage information [default: false]"
Expand Down Expand Up @@ -143,7 +144,9 @@ while [[ $# -gt 0 ]]; do
# shift 1
# ;;
-f|--fakeroot)
FAKEROOT=1
# Currently this argument is being ignored
echo "NOTE, '-f' and '--fakeroot' are currently being ignored."
# FAKEROOT=1
shift 1
;;
-g|--storage)
Expand Down

0 comments on commit 6f9d7ad

Please sign in to comment.