-
Notifications
You must be signed in to change notification settings - Fork 64
Add functionality for rebuilding software: try it on OpenMPI 4.1.x to fix smcuda
issue
#488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
casparvl
merged 63 commits into
EESSI:2023.06-software.eessi.io
from
bedroge:software_rebuilds
Mar 26, 2024
Merged
Changes from all commits
Commits
Show all changes
63 commits
Select commit
Hold shift + click to select a range
e666e2c
launch with --fakeroot for build jobs triggered by bot
bedroge 34bc1c2
remove existing dirs for rebuilds
bedroge 46e7532
rebuild all OpenMPI 4.1.x versions
bedroge 21959d6
add some comments/links
bedroge 7054a58
fix syntax, add missing parentheses
bedroge 7b78861
remove spaces from blank lines
bedroge 87e5ff0
rename file to be able to find EB version
bedroge d07879f
clarify comment about fakeroot
bedroge 135c3c8
add --allow-use-as-root-and-accept-consequences
bedroge f1831b4
add missing $
bedroge 68212a4
fix app_dir variable
bedroge 6bcd0e3
split loop, first remove everything that needs to be removed, then dr…
bedroge c81c0de
add missing else and fi
bedroge f994583
su without hypen
bedroge 21e3735
rerun the script with a regular user after removing installations
bedroge 4f436b3
fix typo and add missing quote
bedroge 0676fda
fix syntax
bedroge 95d6aaa
fix typo in app_dir variable
bedroge e52afc1
run removal step without Prefix
bedroge be4c592
move removal part to its own script, at least for now
bedroge 340b833
remove su, add error message
bedroge 88d21d9
first run the EESSI-remove-software.sh script in a separate container…
bedroge 499328d
undo
bedroge 8100fed
dont use TMPDIR
bedroge c758d74
use EUID instead of UID
bedroge 78cc503
do set/override TMPDIR
bedroge c660a42
dont set fakeroot here
bedroge be5aa37
run build step with fakeroot
bedroge 4946b08
if run as root, run the removal script
bedroge 123c47a
add fakeroot option
bedroge 93ccf68
add echo
bedroge 017803b
add echo
bedroge c492406
add removal step
bedroge 7b57e81
remove removal step
bedroge 485ff46
call EESSI-remove-software.sh for removal step
bedroge 8204a52
remove echo command
bedroge 15eb765
remove unused code
bedroge 1f7501f
rename remove to removal, resume tarball step from removal dir
bedroge 333762b
determine whether or not the removal step has to be run
bedroge 0b826ae
remove proxy arguments
bedroge 0ed1249
remove code for setting http(s)_proxy
bedroge bc4fd89
no need to set build logs dir
bedroge fd7a9ea
remove commented code
bedroge 994d573
fix comment about purpose of script
bedroge 3d7a959
remove code and parameter for setting shared fs path
bedroge 6d49425
Merge branch '2023.06-software.eessi.io' into software_rebuilds
bedroge a148920
remove openmpi hook that provided a temporary workaround
bedroge 2a7629c
solve merge conflict, remove openmpi hook that provided a temporary w…
bedroge 5d4542e
remove hook.register for cuda hook
bedroge 9d62787
source init/bash instead of minimal eessi env
bedroge 229ce93
remove GENERIC variable
bedroge 977bcaa
clean up eb optarch=generic settings
bedroge f1cfc1b
source init/bash and clean up redundant code
bedroge aa4a82d
set EB variable
bedroge 6ca6a70
remove build-dir argument from display_help
bedroge e89cb05
export the EASYBUILD_OPTARCH variable
bedroge 502c023
remove EASYBUILD_OPTARCH
bedroge 3206a0f
remove echo_yellow call for generic builds
bedroge ee1c2ce
use separate variable for removal script arguments
bedroge c55ee6b
clarify why we need fakeroot, add link to issue
bedroge 85a6749
Merge branch '2023.06-software.eessi.io' into software_rebuilds
bedroge 57d8b6f
remove openmpi hook for smcuda workaround
bedroge bde75ee
Merge branch '2023.06-software.eessi.io' of github.com:EESSI/software…
bedroge File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
#!/bin/bash | ||
# | ||
# Script to remove part of the EESSI software stack (version set through init/eessi_defaults) | ||
|
||
# see example parsing of command line arguments at | ||
# https://wiki.bash-hackers.org/scripting/posparams#using_a_while_loop | ||
# https://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash | ||
|
||
display_help() { | ||
echo "usage: $0 [OPTIONS]" | ||
echo " -g | --generic - instructs script to build for generic architecture target" | ||
echo " -h | --help - display this usage information" | ||
} | ||
|
||
POSITIONAL_ARGS=() | ||
|
||
while [[ $# -gt 0 ]]; do | ||
case $1 in | ||
-g|--generic) | ||
DETECTION_PARAMETERS="--generic" | ||
shift | ||
;; | ||
-h|--help) | ||
display_help # Call your function | ||
# no shifting needed here, we're done. | ||
exit 0 | ||
;; | ||
-*|--*) | ||
echo "Error: Unknown option: $1" >&2 | ||
exit 1 | ||
;; | ||
*) # No more options | ||
POSITIONAL_ARGS+=("$1") # save positional arg | ||
shift | ||
;; | ||
esac | ||
done | ||
|
||
set -- "${POSITIONAL_ARGS[@]}" | ||
|
||
TOPDIR=$(dirname $(realpath $0)) | ||
|
||
export TMPDIR=$(mktemp -d /tmp/eessi-remove.XXXXXXXX) | ||
|
||
source $TOPDIR/scripts/utils.sh | ||
|
||
echo ">> Determining software subdirectory to use for current build host..." | ||
if [ -z $EESSI_SOFTWARE_SUBDIR_OVERRIDE ]; then | ||
export EESSI_SOFTWARE_SUBDIR_OVERRIDE=$(python3 $TOPDIR/eessi_software_subdir.py $DETECTION_PARAMETERS) | ||
echo ">> Determined \$EESSI_SOFTWARE_SUBDIR_OVERRIDE via 'eessi_software_subdir.py $DETECTION_PARAMETERS' script" | ||
else | ||
echo ">> Picking up pre-defined \$EESSI_SOFTWARE_SUBDIR_OVERRIDE: ${EESSI_SOFTWARE_SUBDIR_OVERRIDE}" | ||
fi | ||
|
||
echo ">> Setting up environment..." | ||
|
||
source $TOPDIR/init/bash | ||
|
||
if [ -d $EESSI_CVMFS_REPO ]; then | ||
echo_green "$EESSI_CVMFS_REPO available, OK!" | ||
else | ||
fatal_error "$EESSI_CVMFS_REPO is not available!" | ||
fi | ||
|
||
if [[ -z ${EESSI_SOFTWARE_SUBDIR} ]]; then | ||
fatal_error "Failed to determine software subdirectory?!" | ||
elif [[ "${EESSI_SOFTWARE_SUBDIR}" != "${EESSI_SOFTWARE_SUBDIR_OVERRIDE}" ]]; then | ||
fatal_error "Values for EESSI_SOFTWARE_SUBDIR_OVERRIDE (${EESSI_SOFTWARE_SUBDIR_OVERRIDE}) and EESSI_SOFTWARE_SUBDIR (${EESSI_SOFTWARE_SUBDIR}) differ!" | ||
else | ||
echo_green ">> Using ${EESSI_SOFTWARE_SUBDIR} as software subdirectory!" | ||
fi | ||
|
||
echo ">> Configuring EasyBuild..." | ||
EB="eb" | ||
source $TOPDIR/configure_easybuild | ||
|
||
echo ">> Setting up \$MODULEPATH..." | ||
# make sure no modules are loaded | ||
module --force purge | ||
# ignore current $MODULEPATH entirely | ||
module unuse $MODULEPATH | ||
module use $EASYBUILD_INSTALLPATH/modules/all | ||
if [[ -z ${MODULEPATH} ]]; then | ||
fatal_error "Failed to set up \$MODULEPATH?!" | ||
else | ||
echo_green ">> MODULEPATH set up: ${MODULEPATH}" | ||
fi | ||
|
||
# assume there's only one diff file that corresponds to the PR patch file | ||
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 | ||
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 determining which existing installation have to be removed..." | ||
# 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}') | ||
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} | ||
done | ||
else | ||
fatal_error "Easystack file ${easystack_file} not found!" | ||
fi | ||
done | ||
fi | ||
else | ||
fatal_error "This script can only be run by root!" | ||
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
easystacks/software.eessi.io/2023.06/rebuilds/20240301-eb-4.9.0-OpenMPI-4.1.x-fix-smcuda.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# 2024-03-01 | ||
# Rebuild all OpenMPI 4.1.x versions due to an issue with smcuda: | ||
# https://github.com/open-mpi/ompi/issues/12270 | ||
# https://github.com/open-mpi/ompi/pull/12344 | ||
# https://github.com/easybuilders/easybuild-easyconfigs/pull/19940 | ||
easyconfigs: | ||
- OpenMPI-4.1.4-GCC-12.2.0.eb: | ||
options: | ||
from-pr: 19940 | ||
- OpenMPI-4.1.5-GCC-12.3.0: | ||
options: | ||
from-pr: 19940 | ||
- OpenMPI-4.1.6-GCC-13.2.0: | ||
options: | ||
from-pr: 19940 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.