From 025ff29e6519b94b3aaf1ed2edc5aafc66f26576 Mon Sep 17 00:00:00 2001 From: Kenneth Hoste Date: Tue, 17 Sep 2024 18:42:57 +0200 Subject: [PATCH] update create_tarball.sh script to make it aware of installations in accel/ subdirectory --- EESSI-install-software.sh | 2 -- bot/build.sh | 4 +-- create_tarball.sh | 57 +++++++++++++++++++++------------------ 3 files changed, 33 insertions(+), 30 deletions(-) diff --git a/EESSI-install-software.sh b/EESSI-install-software.sh index 27c96eba9f..f9dd971a0d 100755 --- a/EESSI-install-software.sh +++ b/EESSI-install-software.sh @@ -309,8 +309,6 @@ else done fi -### add packages here - echo ">> Creating/updating Lmod RC file..." export LMOD_CONFIG_DIR="${EASYBUILD_INSTALLPATH}/.lmod" lmod_rc_file="$LMOD_CONFIG_DIR/lmodrc.lua" diff --git a/bot/build.sh b/bot/build.sh index 7a07d09c4c..1c4032ecbc 100755 --- a/bot/build.sh +++ b/bot/build.sh @@ -282,8 +282,8 @@ export TGZ=$(printf "eessi-%s-software-%s-%s-%d.tar.gz" ${EESSI_VERSION} ${EESSI TMP_IN_CONTAINER=/tmp echo "Executing command to create tarball:" echo "./eessi_container.sh ${COMMON_ARGS[@]} ${TARBALL_STEP_ARGS[@]}" -echo " -- ./create_tarball.sh ${TMP_IN_CONTAINER} ${EESSI_VERSION} ${EESSI_SOFTWARE_SUBDIR_OVERRIDE} /eessi_bot_job/${TGZ} 2>&1 | tee -a ${tar_outerr}" +echo " -- ./create_tarball.sh ${TMP_IN_CONTAINER} ${EESSI_VERSION} ${EESSI_SOFTWARE_SUBDIR_OVERRIDE} \"${EESSI_ACCELERATOR_TARGET}\" /eessi_bot_job/${TGZ} 2>&1 | tee -a ${tar_outerr}" ./eessi_container.sh "${COMMON_ARGS[@]}" "${TARBALL_STEP_ARGS[@]}" \ - -- ./create_tarball.sh ${TMP_IN_CONTAINER} ${EESSI_VERSION} ${EESSI_SOFTWARE_SUBDIR_OVERRIDE} /eessi_bot_job/${TGZ} 2>&1 | tee -a ${tar_outerr} + -- ./create_tarball.sh ${TMP_IN_CONTAINER} ${EESSI_VERSION} ${EESSI_SOFTWARE_SUBDIR_OVERRIDE} "${EESSI_ACCELERATOR_TARGET}" /eessi_bot_job/${TGZ} 2>&1 | tee -a ${tar_outerr} exit 0 diff --git a/create_tarball.sh b/create_tarball.sh index 2dee665060..48f6fe3341 100755 --- a/create_tarball.sh +++ b/create_tarball.sh @@ -5,13 +5,14 @@ set -e base_dir=$(dirname $(realpath $0)) if [ $# -ne 4 ]; then - echo "ERROR: Usage: $0 " >&2 + echo "ERROR: Usage: $0 " >&2 exit 1 fi eessi_tmpdir=$1 eessi_version=$2 cpu_arch_subdir=$3 -target_tgz=$4 +accel_subdir=$4 +target_tgz=$5 tmpdir=`mktemp -d` echo ">> tmpdir: $tmpdir" @@ -57,30 +58,34 @@ if [ -d ${eessi_version}/init ]; then find ${eessi_version}/init -type f | grep -v '/\.wh\.' >> ${files_list} fi -if [ -d ${eessi_version}/software/${os}/${cpu_arch_subdir}/modules ]; then - # module files - find ${eessi_version}/software/${os}/${cpu_arch_subdir}/modules -type f | grep -v '/\.wh\.' >> ${files_list} - # module symlinks - find ${eessi_version}/software/${os}/${cpu_arch_subdir}/modules -type l | grep -v '/\.wh\.' >> ${files_list} - # module files and symlinks - find ${eessi_version}/software/${os}/${cpu_arch_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 \ - >> ${module_files_list} -fi - -if [ -d ${eessi_version}/software/${os}/${cpu_arch_subdir}/software -a -r ${module_files_list} ]; then - # installation directories but only those for which module files were created - # Note, we assume that module names (as defined by 'PACKAGE_NAME/VERSION.lua' - # using EasyBuild's standard module naming scheme) match the name of the - # software installation directory (expected to be 'PACKAGE_NAME/VERSION/'). - # If either side changes (module naming scheme or naming of software - # installation directories), the procedure will likely not work. - for package_version in $(cat ${module_files_list}); do - echo "handling ${package_version}" - ls -d ${eessi_version}/software/${os}/${cpu_arch_subdir}/software/${package_version} \ - | grep -v '/\.wh\.' >> ${files_list} - done -fi +# consider both CPU-only and accelerator subdirectories +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} + # module symlinks + find ${eessi_version}/software/${os}/${subdir}/modules -type l | grep -v '/\.wh\.' >> ${files_list} + # 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 \ + >> ${module_files_list} + fi + + if [ -d ${eessi_version}/software/${os}/${subdir}/software -a -r ${module_files_list} ]; then + # installation directories but only those for which module files were created + # Note, we assume that module names (as defined by 'PACKAGE_NAME/VERSION.lua' + # using EasyBuild's standard module naming scheme) match the name of the + # software installation directory (expected to be 'PACKAGE_NAME/VERSION/'). + # If either side changes (module naming scheme or naming of software + # installation directories), the procedure will likely not work. + 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} + done + fi +done # add a bit debug output echo "wrote file list to ${files_list}"