From f790f0bda8e03f205acfc2b2a057fe7007c0c34a Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Mon, 26 Apr 2021 16:21:09 +0200 Subject: [PATCH 01/10] Allow rebuilding the module tree via some envvars --- EESSI-pilot-install-software.sh | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/EESSI-pilot-install-software.sh b/EESSI-pilot-install-software.sh index 285cf23aff..ea23bbe482 100755 --- a/EESSI-pilot-install-software.sh +++ b/EESSI-pilot-install-software.sh @@ -138,14 +138,29 @@ echo ">> Setting up \$MODULEPATH..." module --force purge # ignore current $MODULEPATH entirely module unuse $MODULEPATH -module use $EASYBUILD_INSTALLPATH/modules/all +if [[ -z "$EESSI_REBUILD_PATH" ]]; then + # Default behaviour is to do a full build + module use $EASYBUILD_INSTALLPATH/modules/all +else + # If EESSI_REBUILD_PATH is set, we assume software is built and we are just rebuilding the module tree + export EASYBUILD_INSTALLPATH_MODULES=$EESSI_REBUILD_PATH/modules + [[ -z "$EESSI_REBUILD_MODULEPATH" ]] && module use $EESSI_REBUILD_PATH/modules/all || module use $EESSI_REBUILD_MODULEPATH + # Use preferred MNS + [[ -z "$EESSI_REBUILD_MNS" ]] && export EASYBUILD_MODULE_NAMING_SCHEME=EasyBuildMNS || export EASYBUILD_MODULE_NAMING_SCHEME=$EESSI_REBUILD_MNS + # Only rebuild modules + export EASYBUILD_MODULE_ONLY=1 + # Make sure we can write our lock files + export EASYBUILD_LOCKS_DIR=$EESSI_REBUILD_PATH/software +fi + if [[ -z ${MODULEPATH} ]]; then error "Failed to set up \$MODULEPATH?!" else echo_green ">> MODULEPATH set up: ${MODULEPATH}" fi -echo ">> Checking for EasyBuild module..." +REQ_EB_VERSION='4.3.4' +echo ">> Checking for EasyBuild module (required version is ${REQ_EB_VERSION})..." ml_av_easybuild_out=$TMPDIR/ml_av_easybuild.out module avail easybuild &> ${ml_av_easybuild_out} if [[ $? -eq 0 ]]; then @@ -172,9 +187,9 @@ else fi fi -REQ_EB_VERSION='4.3.4' echo ">> Loading EasyBuild module..." module load EasyBuild + eb_show_system_info_out=${TMPDIR}/eb_show_system_info.out $EB --show-system-info > ${eb_show_system_info_out} if [[ $? -eq 0 ]]; then From 9711c55394a29b46d7572aa26e546a6900272a77 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Thu, 6 May 2021 10:53:05 +0200 Subject: [PATCH 02/10] Allow for MNS changes to EasyBuild name Be more specific about what version of eb we check for and install --- EESSI-pilot-install-software.sh | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/EESSI-pilot-install-software.sh b/EESSI-pilot-install-software.sh index ea23bbe482..13d9b07dae 100755 --- a/EESSI-pilot-install-software.sh +++ b/EESSI-pilot-install-software.sh @@ -62,6 +62,7 @@ export EPREFIX=${EESSI_PREFIX}/compat/${EESSI_OS_TYPE}/${EESSI_CPU_FAMILY} DETECTION_PARAMETERS='' GENERIC=0 EB='eb' +EASYBUILD='EasyBuild' if [[ "$1" == "--generic" || "$EASYBUILD_OPTARCH" == "GENERIC" ]]; then echo_yellow ">> GENERIC build requested, taking appropriate measures!" DETECTION_PARAMETERS="$DETECTION_PARAMETERS --generic" @@ -160,13 +161,13 @@ else fi REQ_EB_VERSION='4.3.4' -echo ">> Checking for EasyBuild module (required version is ${REQ_EB_VERSION})..." +echo ">> Checking for ${EASYBUILD} module (required version is ${REQ_EB_VERSION})..." ml_av_easybuild_out=$TMPDIR/ml_av_easybuild.out -module avail easybuild &> ${ml_av_easybuild_out} +module avail ${EASYBUILD}/${REQ_EB_VERSION} &> ${ml_av_easybuild_out} if [[ $? -eq 0 ]]; then - echo_green ">> EasyBuild module found!" + echo_green ">> ${EASYBUILD}/${REQ_EB_VERSION} module found!" else - echo_yellow ">> No EasyBuild module yet, installing it..." + echo_yellow ">> No ${EASYBUILD}/${REQ_EB_VERSION} module yet, installing it..." EB_TMPDIR=${TMPDIR}/ebtmp echo ">> Temporary installation (in ${EB_TMPDIR})..." @@ -177,18 +178,25 @@ else export PATH=${EB_TMPDIR}/bin:$PATH export PYTHONPATH=$(ls -d ${EB_TMPDIR}/lib/python*/site-packages):$PYTHONPATH eb_install_out=${TMPDIR}/eb_install.out - eb --install-latest-eb-release &> ${eb_install_out} + # Check whether we have an easyconfig for our required version (from last line of output) + eb --search EasyBuild-${REQ_EB_VERSION}.eb |& tail -1 | grep ${REQ_EB_VERSION} > /dev/null + if [[ $? -eq 0 ]]; then + eb EasyBuild-${REQ_EB_VERSION}.eb &> ${eb_install_out} + else + # If we don't have an easyconfig in the repo then it can only be the latest release + eb --install-latest-eb-release &> ${eb_install_out} + fi - module avail easybuild &> ${ml_av_easybuild_out} + module avail ${EASYBUILD}/${REQ_EB_VERSION} &> ${ml_av_easybuild_out} if [[ $? -eq 0 ]]; then - echo_green ">> EasyBuild module installed!" + echo_green ">> ${EASYBUILD} module installed!" else - error "EasyBuild module failed to install?! (output of 'pip install' in ${pip_install_out}, output of 'eb' in ${eb_install_out}, output of 'ml av easybuild' in ${ml_av_easybuild_out})" + error "${EASYBUILD} module failed to install?! (output of 'pip install' in ${pip_install_out}, output of 'eb' in ${eb_install_out}, output of 'ml av easybuild' in ${ml_av_easybuild_out})" fi fi -echo ">> Loading EasyBuild module..." -module load EasyBuild +echo ">> Loading ${EASYBUILD} module..." +module load ${EASYBUILD}/${REQ_EB_VERSION} eb_show_system_info_out=${TMPDIR}/eb_show_system_info.out $EB --show-system-info > ${eb_show_system_info_out} From 8aa708d45ccb22db2f92d32b6ea3f3e4461b1b00 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Thu, 6 May 2021 11:05:49 +0200 Subject: [PATCH 03/10] User "module show" over "module avail" --- EESSI-pilot-install-software.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/EESSI-pilot-install-software.sh b/EESSI-pilot-install-software.sh index 13d9b07dae..ddc2c9ffb6 100755 --- a/EESSI-pilot-install-software.sh +++ b/EESSI-pilot-install-software.sh @@ -70,7 +70,6 @@ if [[ "$1" == "--generic" || "$EASYBUILD_OPTARCH" == "GENERIC" ]]; then EB='eb --optarch=GENERIC' fi - # make sure we're in Prefix environment by which path to 'bash' command if [[ $(which bash) = ${EPREFIX}/bin/bash ]]; then echo_green ">> It looks like we're in a Gentoo Prefix environment, good!" @@ -131,7 +130,6 @@ fi export EASYBUILD_FILTER_DEPS=$DEPS_TO_FILTER - export EASYBUILD_MODULE_EXTENSIONS=1 echo ">> Setting up \$MODULEPATH..." @@ -162,8 +160,8 @@ fi REQ_EB_VERSION='4.3.4' echo ">> Checking for ${EASYBUILD} module (required version is ${REQ_EB_VERSION})..." -ml_av_easybuild_out=$TMPDIR/ml_av_easybuild.out -module avail ${EASYBUILD}/${REQ_EB_VERSION} &> ${ml_av_easybuild_out} +ml_show_easybuild_out=$TMPDIR/ml_show_easybuild.out +module show ${EASYBUILD}/${REQ_EB_VERSION} &> ${ml_show_easybuild_out} if [[ $? -eq 0 ]]; then echo_green ">> ${EASYBUILD}/${REQ_EB_VERSION} module found!" else @@ -187,11 +185,11 @@ else eb --install-latest-eb-release &> ${eb_install_out} fi - module avail ${EASYBUILD}/${REQ_EB_VERSION} &> ${ml_av_easybuild_out} + module show ${EASYBUILD}/${REQ_EB_VERSION} &> ${ml_show_easybuild_out} if [[ $? -eq 0 ]]; then echo_green ">> ${EASYBUILD} module installed!" else - error "${EASYBUILD} module failed to install?! (output of 'pip install' in ${pip_install_out}, output of 'eb' in ${eb_install_out}, output of 'ml av easybuild' in ${ml_av_easybuild_out})" + error "${EASYBUILD} module failed to install?! (output of 'pip install' in ${pip_install_out}, output of 'eb' in ${eb_install_out}, output of 'module show ${EASYBUILD}/${REQ_EB_VERSION}' in ${ml_show_easybuild_out})" fi fi From 5272f611c658963b89540190d16d172d9c3122ca Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Thu, 6 May 2021 12:49:54 +0200 Subject: [PATCH 04/10] Do a stricter check of whether we are in Gentoo Prefix --- EESSI-pilot-install-software.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/EESSI-pilot-install-software.sh b/EESSI-pilot-install-software.sh index ddc2c9ffb6..c71d11747a 100755 --- a/EESSI-pilot-install-software.sh +++ b/EESSI-pilot-install-software.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Script to install EESSI pilot software stack (version 2021.03) # @@ -70,8 +70,8 @@ if [[ "$1" == "--generic" || "$EASYBUILD_OPTARCH" == "GENERIC" ]]; then EB='eb --optarch=GENERIC' fi -# make sure we're in Prefix environment by which path to 'bash' command -if [[ $(which bash) = ${EPREFIX}/bin/bash ]]; then +# make sure we're in Prefix environment by checking which 'bash' our $SHELL is using +if [[ ${SHELL} = ${EPREFIX}/bin/bash ]]; then echo_green ">> It looks like we're in a Gentoo Prefix environment, good!" else error "Not running in Gentoo Prefix environment, run '${EPREFIX}/startprefix' first!" From 22462e3b5bf1f3fa24ed5cf07e8380d3d547f657 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Thu, 6 May 2021 12:57:47 +0200 Subject: [PATCH 05/10] Use EB_MODULE_NAME where appropriate --- EESSI-pilot-install-software.sh | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/EESSI-pilot-install-software.sh b/EESSI-pilot-install-software.sh index c71d11747a..793dc51d0d 100755 --- a/EESSI-pilot-install-software.sh +++ b/EESSI-pilot-install-software.sh @@ -62,7 +62,9 @@ export EPREFIX=${EESSI_PREFIX}/compat/${EESSI_OS_TYPE}/${EESSI_CPU_FAMILY} DETECTION_PARAMETERS='' GENERIC=0 EB='eb' -EASYBUILD='EasyBuild' +EB_MODULE_NAME='EasyBuild' +REQ_EB_VERSION='4.3.4' + if [[ "$1" == "--generic" || "$EASYBUILD_OPTARCH" == "GENERIC" ]]; then echo_yellow ">> GENERIC build requested, taking appropriate measures!" DETECTION_PARAMETERS="$DETECTION_PARAMETERS --generic" @@ -158,14 +160,13 @@ else echo_green ">> MODULEPATH set up: ${MODULEPATH}" fi -REQ_EB_VERSION='4.3.4' -echo ">> Checking for ${EASYBUILD} module (required version is ${REQ_EB_VERSION})..." +echo ">> Checking for ${EB_MODULE_NAME} module (required version is ${REQ_EB_VERSION})..." ml_show_easybuild_out=$TMPDIR/ml_show_easybuild.out -module show ${EASYBUILD}/${REQ_EB_VERSION} &> ${ml_show_easybuild_out} +module show ${EB_MODULE_NAME}/${REQ_EB_VERSION} &> ${ml_show_easybuild_out} if [[ $? -eq 0 ]]; then - echo_green ">> ${EASYBUILD}/${REQ_EB_VERSION} module found!" + echo_green ">> ${EB_MODULE_NAME}/${REQ_EB_VERSION} module found!" else - echo_yellow ">> No ${EASYBUILD}/${REQ_EB_VERSION} module yet, installing it..." + echo_yellow ">> No ${EB_MODULE_NAME}/${REQ_EB_VERSION} module yet, installing it..." EB_TMPDIR=${TMPDIR}/ebtmp echo ">> Temporary installation (in ${EB_TMPDIR})..." @@ -185,16 +186,16 @@ else eb --install-latest-eb-release &> ${eb_install_out} fi - module show ${EASYBUILD}/${REQ_EB_VERSION} &> ${ml_show_easybuild_out} + module show ${EB_MODULE_NAME}/${REQ_EB_VERSION} &> ${ml_show_easybuild_out} if [[ $? -eq 0 ]]; then - echo_green ">> ${EASYBUILD} module installed!" + echo_green ">> ${EB_MODULE_NAME} module installed!" else - error "${EASYBUILD} module failed to install?! (output of 'pip install' in ${pip_install_out}, output of 'eb' in ${eb_install_out}, output of 'module show ${EASYBUILD}/${REQ_EB_VERSION}' in ${ml_show_easybuild_out})" + error "${EB_MODULE_NAME} module failed to install?! (output of 'pip install' in ${pip_install_out}, output of 'eb' in ${eb_install_out}, output of 'module show ${EB_MODULE_NAME}/${REQ_EB_VERSION}' in ${ml_show_easybuild_out})" fi fi -echo ">> Loading ${EASYBUILD} module..." -module load ${EASYBUILD}/${REQ_EB_VERSION} +echo ">> Loading ${EB_MODULE_NAME} module..." +module load ${EB_MODULE_NAME}/${REQ_EB_VERSION} eb_show_system_info_out=${TMPDIR}/eb_show_system_info.out $EB --show-system-info > ${eb_show_system_info_out} From 4b8729d3267f004d7a29a3313c653e506ea43893 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Thu, 6 May 2021 13:02:11 +0200 Subject: [PATCH 06/10] Allow EB_MODULE_NAME to be configurable by an envvar --- EESSI-pilot-install-software.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EESSI-pilot-install-software.sh b/EESSI-pilot-install-software.sh index 793dc51d0d..439300b176 100755 --- a/EESSI-pilot-install-software.sh +++ b/EESSI-pilot-install-software.sh @@ -62,7 +62,7 @@ export EPREFIX=${EESSI_PREFIX}/compat/${EESSI_OS_TYPE}/${EESSI_CPU_FAMILY} DETECTION_PARAMETERS='' GENERIC=0 EB='eb' -EB_MODULE_NAME='EasyBuild' +if [ -z "$EB_MODULE_NAME" ] && [ "${EB_MODULE_NAME+xxx}" = "xxx" ]; then EB_MODULE_NAME='EasyBuild'; fi REQ_EB_VERSION='4.3.4' if [[ "$1" == "--generic" || "$EASYBUILD_OPTARCH" == "GENERIC" ]]; then From 9e8e864c4bbff59e2755715b783e594bac319337 Mon Sep 17 00:00:00 2001 From: ocaisa Date: Thu, 6 May 2021 13:13:19 +0200 Subject: [PATCH 07/10] Update EESSI-pilot-install-software.sh --- EESSI-pilot-install-software.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EESSI-pilot-install-software.sh b/EESSI-pilot-install-software.sh index 439300b176..84c6fe2163 100755 --- a/EESSI-pilot-install-software.sh +++ b/EESSI-pilot-install-software.sh @@ -62,7 +62,7 @@ export EPREFIX=${EESSI_PREFIX}/compat/${EESSI_OS_TYPE}/${EESSI_CPU_FAMILY} DETECTION_PARAMETERS='' GENERIC=0 EB='eb' -if [ -z "$EB_MODULE_NAME" ] && [ "${EB_MODULE_NAME+xxx}" = "xxx" ]; then EB_MODULE_NAME='EasyBuild'; fi +if [ -z "$EB_MODULE_NAME" ]; then EB_MODULE_NAME='EasyBuild'; fi REQ_EB_VERSION='4.3.4' if [[ "$1" == "--generic" || "$EASYBUILD_OPTARCH" == "GENERIC" ]]; then From af4c228ea7717136780e40751eb247ae9c368d50 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Wed, 12 May 2021 12:33:18 +0200 Subject: [PATCH 08/10] Allow oversubscription for MPI tests --- EESSI-pilot-install-software.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/EESSI-pilot-install-software.sh b/EESSI-pilot-install-software.sh index 439300b176..9fed790a2c 100755 --- a/EESSI-pilot-install-software.sh +++ b/EESSI-pilot-install-software.sh @@ -293,7 +293,10 @@ check_exit_code $? "${ok_msg}" "${fail_msg}" echo ">> Installing OpenFOAM (twice!)..." ok_msg="OpenFOAM installed, now we're talking!" fail_msg="Installation of OpenFOAM failed, we were so close..." +# May not have enough cores for the sanity check (6 required) +export OMPI_MCA_rmaps_base_oversubscribe=1 $EB OpenFOAM-8-foss-2020a.eb OpenFOAM-v2006-foss-2020a.eb --robot +unset OMPI_MCA_rmaps_base_oversubscribe check_exit_code $? "${ok_msg}" "${fail_msg}" From 2821b36f5298b0efd75547f507b367be3173de42 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Fri, 24 Sep 2021 10:32:37 +0200 Subject: [PATCH 09/10] Synch better with #134 --- EESSI-pilot-install-software.sh | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/EESSI-pilot-install-software.sh b/EESSI-pilot-install-software.sh index 78892a9b4a..fff5308788 100755 --- a/EESSI-pilot-install-software.sh +++ b/EESSI-pilot-install-software.sh @@ -148,24 +148,22 @@ else export PATH=${EB_TMPDIR}/bin:$PATH export PYTHONPATH=$(ls -d ${EB_TMPDIR}/lib/python*/site-packages):$PYTHONPATH eb_install_out=${TMPDIR}/eb_install.out - # Check whether we have an easyconfig for our required version (from last line of output) - eb --search EasyBuild-${REQ_EB_VERSION}.eb |& tail -1 | grep ${REQ_EB_VERSION} > /dev/null + eb --install-latest-eb-release &> ${eb_install_out} + + eb --search EasyBuild-${REQ_EB_VERSION}.eb | grep EasyBuild-${REQ_EB_VERSION}.eb > /dev/null if [[ $? -eq 0 ]]; then - eb EasyBuild-${REQ_EB_VERSION}.eb &> ${eb_install_out} - else - # If we don't have an easyconfig in the repo then it can only be the latest release - eb --install-latest-eb-release &> ${eb_install_out} + eb EasyBuild-${REQ_EB_VERSION}.eb >> ${eb_install_out} 2>&1 fi module show ${EB_MODULE_NAME}/${REQ_EB_VERSION} &> ${ml_show_easybuild_out} if [[ $? -eq 0 ]]; then - echo_green ">> ${EB_MODULE_NAME} module installed!" + echo_green ">> ${EB_MODULE_NAME}/${REQ_EB_VERSION} module installed!" else - fatal_error "${EB_MODULE_NAME} module failed to install?! (output of 'pip install' in ${pip_install_out}, output of 'eb' in ${eb_install_out}, output of 'module show ${EB_MODULE_NAME}/${REQ_EB_VERSION}' in ${ml_show_easybuild_out})" + fatal_error "${EB_MODULE_NAME}/${REQ_EB_VERSION} module failed to install?! (output of 'pip install' in ${pip_install_out}, output of 'eb' in ${eb_install_out}, output of 'module show ${EB_MODULE_NAME}/${REQ_EB_VERSION}' in ${ml_show_easybuild_out})" fi fi -echo ">> Loading ${EB_MODULE_NAME} module..." +echo ">> Loading ${EB_MODULE_NAME}/${REQ_EB_VERSION} module..." module load ${EB_MODULE_NAME}/${REQ_EB_VERSION} eb_show_system_info_out=${TMPDIR}/eb_show_system_info.out From 6fc8963bf9191fe7097f22b2b3c936011674d476 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Fri, 24 Sep 2021 14:42:36 +0200 Subject: [PATCH 10/10] Make DB download conditional --- EESSI-pilot-install-software.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/EESSI-pilot-install-software.sh b/EESSI-pilot-install-software.sh index fff5308788..5a6351b689 100755 --- a/EESSI-pilot-install-software.sh +++ b/EESSI-pilot-install-software.sh @@ -185,10 +185,11 @@ fi echo_green "All set, let's start installing some software in ${EASYBUILD_INSTALLPATH}..." -# download source tarball for DB (dependency for Perl) using fixed source URL, -# see https://github.com/easybuilders/easybuild-easyconfigs/pull/13813 -$EB --fetch --from-pr 13813 DB-18.1.32-GCCcore-9.3.0.eb - +if [[ -z "$EESSI_REBUILD_PATH" ]]; then + # download source tarball for DB (dependency for Perl) using fixed source URL, + # see https://github.com/easybuilders/easybuild-easyconfigs/pull/13813 + $EB --fetch --from-pr 13813 DB-18.1.32-GCCcore-9.3.0.eb +fi # install Java with fixed custom easyblock that uses patchelf to ensure right glibc is picked up, # see https://github.com/EESSI/software-layer/issues/123 # and https://github.com/easybuilders/easybuild-easyblocks/pull/2557