Skip to content

Commit

Permalink
Merge pull request #351 from boegel/2023.06_pr_patch
Browse files Browse the repository at this point in the history
determine easystack files to process via PR patch file
  • Loading branch information
trz42 authored Oct 4, 2023
2 parents e6b72e6 + 4657384 commit 8514c36
Showing 1 changed file with 25 additions and 22 deletions.
47 changes: 25 additions & 22 deletions EESSI-pilot-install-software.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function copy_build_log() {
echo "- working directory: ${PWD}" >> ${build_log_path}
echo "- Slurm job ID: ${SLURM_OUT}" >> ${build_log_path}
echo "- EasyBuild version: ${eb_version}" >> ${build_log_path}
echo "- easystack file: ${es}" >> ${build_log_path}
echo "- easystack file: ${easystack_file}" >> ${build_log_path}

echo "EasyBuild log file ${build_log} copied to ${build_log_path} (with context appended)"
fi
Expand Down Expand Up @@ -186,36 +186,39 @@ else
echo_green ">> MODULEPATH set up: ${MODULEPATH}"
fi

for eb_version in '4.7.2' '4.8.0' '4.8.1'; do
# use 'git diff' to determine which easystack files were changed
for easystack_file in $(git diff --name-only | grep '^eessi.*yml$'); do

echo -e "Processing easystack file ${easystack_file}...\n\n"

# 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}

echo_green "All set, let's start installing some software with EasyBuild v${eb_version} in ${EASYBUILD_INSTALLPATH}..."

for es in $(ls eessi-${EESSI_PILOT_VERSION}-eb-${eb_version}-*.yml); do

if [ -f ${es} ]; then
echo_green "Feeding easystack file ${es} to EasyBuild..."

${EB} --easystack ${TOPDIR}/${es} --robot
ec=$?
if [ -f ${easystack_file} ]; then
echo_green "Feeding easystack file ${easystack_file} to EasyBuild..."

# copy EasyBuild log file if EasyBuild exited with an error
if [ ${ec} -ne 0 ]; then
eb_last_log=$(unset EB_VERBOSE; eb --last-log)
# copy to current working directory
cp -a ${eb_last_log} .
echo "Last EasyBuild log file copied from ${eb_last_log} to ${PWD}"
# copy to build logs dir (with context added)
copy_build_log "${eb_last_log}" "${build_logs_dir}"
fi
${EB} --easystack ${TOPDIR}/${easystack_file} --robot
ec=$?

$TOPDIR/check_missing_installations.sh ${TOPDIR}/${es}
else
fatal_error "Easystack file ${es} not found!"
# copy EasyBuild log file if EasyBuild exited with an error
if [ ${ec} -ne 0 ]; then
eb_last_log=$(unset EB_VERBOSE; eb --last-log)
# copy to current working directory
cp -a ${eb_last_log} .
echo "Last EasyBuild log file copied from ${eb_last_log} to ${PWD}"
# copy to build logs dir (with context added)
copy_build_log "${eb_last_log}" "${build_logs_dir}"
fi
done

$TOPDIR/check_missing_installations.sh ${TOPDIR}/${easystack_file}
else
fatal_error "Easystack file ${easystack_file} not found!"
fi

done

Expand Down

0 comments on commit 8514c36

Please sign in to comment.