Skip to content

Commit

Permalink
test CI against software.eessi.io and show last eb log
Browse files Browse the repository at this point in the history
  • Loading branch information
truib committed Jan 24, 2024
1 parent a82f163 commit 2c1d681
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
43 changes: 43 additions & 0 deletions .github/workflows/tests_scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,49 @@ jobs:
export EESSI_REPOS_CFG_DIR_OVERRIDE=${PWD}/repos
./eessi_container.sh --list-repos
- name: test load_easybuild_module.sh script with software.eessi.io
run: |
# bind current directory into container as /software-layer
export SINGULARITY_BIND="${PWD}:/software-layer"
# can't test with EasyBuild versions older than v4.5.2 when using EESSI 2023.06,
# since Python in compat layer is Python 3.11.x;
# testing with a single EasyBuild version takes a while in GitHub Actions, so stick to a single sensible version
for EB_VERSION in '4.6.0'; do
# Create script that uses load_easybuild_module.sh which we can run in compat layer environment
# note: Be careful with single vs double quotes below!
# ${EB_VERSION} should be expanded, so use double quotes;
# For statements using variables that are only defined in the script, like ${EASYBUILD_INSTALLPATH},
# use single quotes to avoid expansion while creating the script.
test_script="${PWD}/eb-${EB_VERSION}.sh"
echo '#!/bin/bash' > ${test_script}
# both $EB and $TMPDIR environment must be set, required by load_easybuild_module.sh script
echo 'export EB="eb"' >> ${test_script}
echo 'export TMPDIR=$(mktemp -d)' >> ${test_script}
# set up environment to have utility functions in place that load_easybuild_module.sh script relies on,
# along with $EESSI_* environment variables, and Lmod
echo 'ls -l /software-layer/' >> ${test_script}
echo 'source /software-layer/scripts/utils.sh' >> ${test_script}
echo 'source /software-layer/init/eessi_environment_variables' >> ${test_script}
echo 'source ${EPREFIX}/usr/share/Lmod/init/bash' >> ${test_script}
# minimal configuration for EasyBuild so we can test installation aspect of load_easybuild_module.sh script
echo "export EASYBUILD_INSTALLPATH=/tmp/eb-${EB_VERSION}" >> ${test_script}
echo 'module use ${EASYBUILD_INSTALLPATH}/modules/all' >> ${test_script}
echo '' >> ${test_script}
echo "source /software-layer/load_easybuild_module.sh ${EB_VERSION}" >> ${test_script}
echo 'module list' >> ${test_script}
echo 'eb --version' >> ${test_script}
chmod u+x ${test_script}
# run wrapper script + capture & check output
out="${PWD}/eb-${EB_VERSION}.out"
export EESSI_REPOS_CFG_DIR_OVERRIDE=${PWD}/repos
./eessi_container.sh --access rw --mode run --verbose --repository EESSI /software-layer/run_in_compat_layer_env.sh /software-layer/eb-${EB_VERSION}.sh 2>&1 | tee ${out}
pattern="^This is EasyBuild ${EB_VERSION} "
grep "${pattern}" ${out} || (echo "Pattern '${pattern}' not found in output!" && exit 1)
done
- name: test load_easybuild_module.sh script
run: |
# bind current directory into container as /software-layer
Expand Down
7 changes: 6 additions & 1 deletion load_easybuild_module.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ else
ok_msg="Latest EasyBuild release installed, let's go!"
fail_msg="Installing latest EasyBuild release failed, that's not good... (output: ${eb_install_out})"
${EB} --install-latest-eb-release 2>&1 | tee ${eb_install_out}
check_exit_code $? "${ok_msg}" "${fail_msg}"
exit_code=$?
if [[ $exit_code -ne 0 ]]; then
# show last log
cat $(${EB} --last-log)
fi
check_exit_code ${exit_code} "${ok_msg}" "${fail_msg}"

# maybe the module obtained with --install-latest-eb-release is exactly the EasyBuild version we wanted?
IGNORE_CACHE=''
Expand Down

0 comments on commit 2c1d681

Please sign in to comment.