Skip to content

Commit 8e87c33

Browse files
committed
various changes to address suggestions
- EESSI-install-software.sh - rearranged setting up build environment and improved comments to make choices more clear - moved test if EasyBuild exists into install_cuda_and_libraries.sh, removed unnecessary export of environment variables and clarified comments accordingly - .../rebuilds/20241112-eb-4.9.4-EESSI-extend.yml - removed outdated comments - load_eessi_extend_module.sh - replaced sourcing configure_easybuild with two needed EASYBUILD_ environment settings - install_cuda_and_libraries.sh - removed comment and setting of EESSI_SITE_INSTALL - clarified comment when saving MODULEPATH - added a check if the required EasyBuild version exists and only if so use it to process the easystack file that required it
1 parent 8401bdd commit 8e87c33

File tree

4 files changed

+25
-38
lines changed

4 files changed

+25
-38
lines changed

EESSI-install-software.sh

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -231,54 +231,41 @@ fi
231231

232232
echo ">> Configuring EasyBuild..."
233233

234-
# Make sure that we use the EESSI_CVMFS_INSTALL
235-
# Since the path is set when loading EESSI-extend, we reload it to make sure it works - even if it is already loaded
236-
# Note we need to do this after running install_cuda_and_libraries, since that does installations in the EESSI_SITE_INSTALL
234+
# Make sure EESSI-extend is not loaded, and configure location variables for a
235+
# CVMFS installation
236+
module unload EESSI-extend
237237
unset EESSI_USER_INSTALL
238238
unset EESSI_PROJECT_INSTALL
239239
unset EESSI_SITE_INSTALL
240240
export EESSI_CVMFS_INSTALL=1
241-
module unload EESSI-extend
242241

243-
# The EESSI-extend module is being loaded (or installed if it doesn't exist yet).
242+
# We now run 'source load_eessi_extend_module.sh' to load or install and load the
243+
# EESSI-extend module which sets up all build environment settings.
244244
# The script requires the EESSI_VERSION given as argument, a couple of
245-
# environment variables set (TMPDIR, EB and EASYBUILD_INSTALLPATH) and the
246-
# function check_exit_code defined.
247-
# NOTE, the script exits if those variables/functions are undefined.
245+
# environment variables set (TMPDIR, EB and EASYBUILD_INSTALLPATH) and the
246+
# function check_exit_code defined.
247+
# NOTE 1, the script exits if those variables/functions are undefined.
248+
# NOTE 2, loading the EESSI-extend module may adjust the value of EASYBUILD_INSTALLPATH,
249+
# e.g., to point to the installation directory for accelerators.
250+
# NOTE 3, we have to set a default for EASYBUILD_INSTALLPATH here in cases the
251+
# EESSI-extend module itself needs to be installed.
248252
export EASYBUILD_INSTALLPATH=${EESSI_PREFIX}/software/${EESSI_OS_TYPE}/${EESSI_SOFTWARE_SUBDIR_OVERRIDE}
249-
# Loading the EESSI-extend module may adjust the value of EASYBUILD_INSTALLPATH,
250-
# e.g., to point to the installation directory for accelerators.
251253
source load_eessi_extend_module.sh ${EESSI_VERSION}
252254

253255
# Install full CUDA SDK and cu* libraries in host_injections
254256
# Hardcode this for now, see if it works
255257
# TODO: We should make a nice yaml and loop over all CUDA versions in that yaml to figure out what to install
256258
# Allow skipping CUDA SDK install in e.g. CI environments
257-
# The install_cuda... script uses EasyBuild. So, we need to check if we have EB
258-
# or skip this step.
259259
echo "Going to install full CUDA SDK and cu* libraries under host_injections if necessary"
260-
module_avail_out=$TMPDIR/ml.out
261-
module avail 2>&1 | grep EasyBuild &> ${module_avail_out}
262-
if [[ $? -eq 0 ]]; then
263-
echo_green ">> Found an EasyBuild module"
264-
else
265-
echo_yellow ">> No EasyBuild module found: skipping step to install CUDA (see output in ${module_avail_out})"
266-
export skip_cuda_install=True
267-
fi
268-
269260
temp_install_storage=${TMPDIR}/temp_install_storage
270261
mkdir -p ${temp_install_storage}
271262
if [ -z "${skip_cuda_install}" ] || [ ! "${skip_cuda_install}" ]; then
272-
# need to ensure that some variables will be available to the script
273-
# TMPDIR, EB, EESSI_VERSION, for EASYBUILD_INSTALLPATH (EESSI_PREFIX,
274-
# EESSI_OS_TYPE, EESSI_SOFTWARE_SUBDIR_OVERRIDE)
275-
export TMPDIR EB EESSI_VERSION EESSI_PREFIX EESSI_OS_TYPE EESSI_SOFTWARE_SUBDIR_OVERRIDE
276263
${EESSI_PREFIX}/scripts/gpu_support/nvidia/install_cuda_and_libraries.sh \
277264
-t ${temp_install_storage} \
278265
--accept-cuda-eula \
279266
--accept-cudnn-eula
280267
else
281-
echo "Skipping installation of CUDA SDK and cu* libraries in host_injections, since the --skip-cuda-install flag was passed OR no EasyBuild module was found"
268+
echo "Skipping installation of CUDA SDK and cu* libraries in host_injections, since the --skip-cuda-install flag was passed"
282269
fi
283270

284271
# Install NVIDIA drivers in host_injections (if they exist)

easystacks/software.eessi.io/2023.06/rebuilds/20241112-eb-4.9.4-EESSI-extend.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,3 @@
44
# EASYBUILD_CUDA_COMPUTE_CAPABILITIES
55
easyconfigs:
66
- EESSI-extend-2023.06-easybuild.eb
7-
# the options are added to load_eessi_extend_module.sh
8-
# - EESSI-extend-2023.06-easybuild.eb:
9-
# options:
10-
# try-amend: keeppreviousinstall=True

load_eessi_extend_module.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ else
8282

8383
# source configure_easybuild to use correct eb settings
8484
(
85-
EESSI_MAIN_DIR=$(dirname $(readlink -f $BASH_SOURCE))
86-
source ${EESSI_MAIN_DIR}/configure_easybuild
85+
export EASYBUILD_PREFIX=${TMPDIR}/easybuild
86+
export EASYBUILD_READ_ONLY_INSTALLDIR=1
8787

8888
echo ">> Final installation in ${EASYBUILD_INSTALLPATH}..."
8989
export PATH=${EB_TMPDIR}/bin:${PATH}

scripts/gpu_support/nvidia/install_cuda_and_libraries.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,6 @@ done
7777
# Make sure EESSI is initialised
7878
check_eessi_initialised
7979

80-
# Make sure that `EESSI-extend` will install in the site installation path EESSI_SITE_SOFTWARE_PATH
81-
export EESSI_SITE_INSTALL=1
82-
echo "EESSI_SITE_SOFTWARE_PATH=${EESSI_SITE_SOFTWARE_PATH}"
83-
8480
# we need a directory we can use for temporary storage
8581
if [[ -z "${TEMP_DIR}" ]]; then
8682
tmpdir=$(mktemp -d)
@@ -93,7 +89,7 @@ else
9389
fi
9490
echo "Created temporary directory '${tmpdir}'"
9591

96-
# use EESSI_SITE_SOFTWARE_PATH/.modules/all as MODULEPATH
92+
# Store MODULEPATH so it can be restored at the end of each loop iteration
9793
SAVE_MODULEPATH=${MODULEPATH}
9894

9995
for EASYSTACK_FILE in ${TOPDIR}/easystacks/eessi-*CUDA*.yml; do
@@ -103,8 +99,16 @@ for EASYSTACK_FILE in ${TOPDIR}/easystacks/eessi-*CUDA*.yml; do
10399
eb_version=$(echo ${EASYSTACK_FILE} | sed 's/.*eb-\([0-9.]*\).*/\1/g')
104100

105101
# Load EasyBuild version for this easystack file _before_ loading EESSI-extend
106-
module avail EasyBuild
102+
module_avail_out=${tmpdir}/ml.out
103+
module avail 2>&1 | grep EasyBuild/${eb_version} &> ${module_avail_out}
104+
if [[ $? -eq 0 ]]; then
105+
echo_green ">> Found an EasyBuild/${eb_version} module"
106+
else
107+
echo_yellow ">> No EasyBuild/${eb_version} module found: skipping step to install easystack file ${easystack_file} (see output in ${module_avail_out})"
108+
continue
109+
fi
107110
module load EasyBuild/${eb_version}
111+
108112
# Make sure EESSI-extend does a site install here
109113
# We need to reload it with the current environment variables set
110114
unset EESSI_CVMFS_INSTALL

0 commit comments

Comments
 (0)