-
Notifications
You must be signed in to change notification settings - Fork 64
{2023.06}[2023a,2023b] rebuild CUDA/* modules to update module files #918
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
Closed
trz42
wants to merge
11
commits into
EESSI:2023.06-software.eessi.io
from
trz42:2023.06-rebuild_cuda_module_files
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7d18f68
{2023.06}[2023a] rebuild CUDA/* modules to update module files
truib cfcc072
force rebuilding CUDA/12.1.1
truib 95bc014
use previous workaround for permission denied issue, revert #907
truib 67e8142
mount writable overlay with debug option
truib 54930d6
use rebuild with lowerdir approach from #810
truib c1f631b
disable overlayfs debug output
truib 7c38586
show output of eb command to determine packages to be rebuilt
truib ee85ec7
show output of eb command to determine packages to be rebuilt
truib e16b096
fix eessi_container.sh command arg typo
truib c41ce4a
show complete eb output
truib d1803f0
need to grep [F] for rebuilds with force
truib 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
#!/bin/bash | ||
# | ||
# Script to determine which parts of the EESSI software stack (version set through init/eessi_defaults) | ||
# have to be rebuilt | ||
|
||
# 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 | ||
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) | ||
# * [F] $CFGS/s/someapp/someapp-someversion.eb (module: someapp/someversion) | ||
eb --dry-run-short --rebuild --easystack ${easystack_file} | ||
rebuild_apps=$(eb --dry-run-short --rebuild --easystack ${easystack_file} | grep "^ \* \[[FR]\]" | 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}..." | ||
find ${app_dir} -type d | sed -e 's/^/REMOVE_DIRECTORY /' | ||
find ${app_dir} -type f | sed -e 's/^/REMOVE_FILE /' | ||
echo "REMOVE_MODULE ${app_module}" | ||
done | ||
else | ||
fatal_error "Easystack file ${easystack_file} not found!" | ||
fi | ||
done | ||
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
14 changes: 14 additions & 0 deletions
14
...are.eessi.io/2023.06/accel/nvidia/rebuilds/20250215-eb-4.9.4-CUDA-update-module-files.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,14 @@ | ||
# 2025.02.15 | ||
# We need to update the module files for all CUDA installations to add | ||
# additional directories to LIBRARY_PATH. | ||
# See https://github.com/easybuilders/easybuild-easyblocks/pull/3516 | ||
easyconfigs: | ||
- CUDA-12.1.1.eb: | ||
options: | ||
accept-eula-for: CUDA | ||
force: True | ||
include-easyblocks-from-commit: 3469151ce7e4f85415c877dee555aeea7691c757 | ||
- CUDA-12.4.0.eb: | ||
options: | ||
accept-eula-for: CUDA | ||
include-easyblocks-from-commit: 3469151ce7e4f85415c877dee555aeea7691c757 |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change doesn't look right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is, the comments will need updating
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, just trying to get it working by using an alternative approach that doesn't use fakeroot ;)