From 8404bd1cb06340b411ed11a38e4c4875b473a998 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Tue, 8 Oct 2024 15:23:41 +0200 Subject: [PATCH 1/9] Rebuild EESSI-extend to use EESSI_SITE_INSTALLPATH --- .../2023.06/rebuilds/20241008-eb-4.9.4-EESSI-extend.yml | 5 +++++ init/eessi_environment_variables | 2 ++ init/modules/EESSI/2023.06.lua | 2 ++ 3 files changed, 9 insertions(+) create mode 100644 easystacks/software.eessi.io/2023.06/rebuilds/20241008-eb-4.9.4-EESSI-extend.yml diff --git a/easystacks/software.eessi.io/2023.06/rebuilds/20241008-eb-4.9.4-EESSI-extend.yml b/easystacks/software.eessi.io/2023.06/rebuilds/20241008-eb-4.9.4-EESSI-extend.yml new file mode 100644 index 0000000000..5491ef8427 --- /dev/null +++ b/easystacks/software.eessi.io/2023.06/rebuilds/20241008-eb-4.9.4-EESSI-extend.yml @@ -0,0 +1,5 @@ +# 2024.10.08 +# EESSI-extend should use EESSI_SITE_INSTALLPATH, instead of recalculating this +easyconfigs: + - EESSI-extend-2023.06-easybuild.eb + diff --git a/init/eessi_environment_variables b/init/eessi_environment_variables index 8c10b1fca8..307616ac35 100644 --- a/init/eessi_environment_variables +++ b/init/eessi_environment_variables @@ -81,6 +81,8 @@ if [ -d $EESSI_PREFIX ]; then if [ ! -z $EESSI_BASIC_ENV ]; then show_msg "Only setting up basic environment, so we're done" elif [ -d $EESSI_SOFTWARE_PATH ]; then + EESSI_SITE_INSTALLPATH=${EESSI_SOFTWARE_PATH/versions/host_injections} + show_msg "Using ${EESSI_SITE_INSTALLPATH} as the site extension directory for installations." # Allow for the use of a custom MNS if [ -z ${EESSI_CUSTOM_MODULEPATH+x} ]; then # EESSI_CUSTOM_MODULEPATH not set so we use our defaults diff --git a/init/modules/EESSI/2023.06.lua b/init/modules/EESSI/2023.06.lua index 32aaf6c07f..ecc145c8e4 100644 --- a/init/modules/EESSI/2023.06.lua +++ b/init/modules/EESSI/2023.06.lua @@ -48,9 +48,11 @@ local eessi_software_subdir = archdetect local eessi_eprefix = pathJoin(eessi_prefix, "compat", eessi_os_type, eessi_cpu_family) local eessi_software_path = pathJoin(eessi_prefix, "software", eessi_os_type, eessi_software_subdir) local eessi_module_path = pathJoin(eessi_software_path, "modules", "all") +local eessi_site_install_path = string.gsub(eessi_software_path, "versions", "host_injections") local eessi_site_module_path = string.gsub(eessi_module_path, "versions", "host_injections") setenv("EPREFIX", eessi_eprefix) setenv("EESSI_CPU_FAMILY", eessi_cpu_family) +setenv("EESSI_SITE_INSTALLPATH", eessi_site_install_path) setenv("EESSI_SITE_MODULEPATH", eessi_site_module_path) setenv("EESSI_SOFTWARE_SUBDIR", eessi_software_subdir) setenv("EESSI_PREFIX", eessi_prefix) From 227581646d495bdbca676fa7fdc43297cd2967d0 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen <33718780+casparvl@users.noreply.github.com> Date: Tue, 8 Oct 2024 16:13:20 +0200 Subject: [PATCH 2/9] Apply suggestions from code review Co-authored-by: ocaisa --- init/eessi_environment_variables | 2 +- init/modules/EESSI/2023.06.lua | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/init/eessi_environment_variables b/init/eessi_environment_variables index 307616ac35..c4afd9ab5e 100644 --- a/init/eessi_environment_variables +++ b/init/eessi_environment_variables @@ -81,7 +81,7 @@ if [ -d $EESSI_PREFIX ]; then if [ ! -z $EESSI_BASIC_ENV ]; then show_msg "Only setting up basic environment, so we're done" elif [ -d $EESSI_SOFTWARE_PATH ]; then - EESSI_SITE_INSTALLPATH=${EESSI_SOFTWARE_PATH/versions/host_injections} + EESSI_SITE_SOFTWARE_PATH=${EESSI_SOFTWARE_PATH/versions/host_injections} show_msg "Using ${EESSI_SITE_INSTALLPATH} as the site extension directory for installations." # Allow for the use of a custom MNS if [ -z ${EESSI_CUSTOM_MODULEPATH+x} ]; then diff --git a/init/modules/EESSI/2023.06.lua b/init/modules/EESSI/2023.06.lua index ecc145c8e4..463706ce6c 100644 --- a/init/modules/EESSI/2023.06.lua +++ b/init/modules/EESSI/2023.06.lua @@ -48,11 +48,11 @@ local eessi_software_subdir = archdetect local eessi_eprefix = pathJoin(eessi_prefix, "compat", eessi_os_type, eessi_cpu_family) local eessi_software_path = pathJoin(eessi_prefix, "software", eessi_os_type, eessi_software_subdir) local eessi_module_path = pathJoin(eessi_software_path, "modules", "all") -local eessi_site_install_path = string.gsub(eessi_software_path, "versions", "host_injections") -local eessi_site_module_path = string.gsub(eessi_module_path, "versions", "host_injections") +local eessi_site_software_path = string.gsub(eessi_software_path, "versions", "host_injections") +local eessi_site_module_path = pathJoin(eessi_site_software_path, "modules", "all") setenv("EPREFIX", eessi_eprefix) setenv("EESSI_CPU_FAMILY", eessi_cpu_family) -setenv("EESSI_SITE_INSTALLPATH", eessi_site_install_path) +setenv("EESSI_SITE_SOFTWARE_PATH", eessi_site_software_path) setenv("EESSI_SITE_MODULEPATH", eessi_site_module_path) setenv("EESSI_SOFTWARE_SUBDIR", eessi_software_subdir) setenv("EESSI_PREFIX", eessi_prefix) From 30c1bb362ef9197e234984065f0b5193b8b0845c Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Tue, 8 Oct 2024 16:19:32 +0200 Subject: [PATCH 3/9] Be consistent --- init/eessi_environment_variables | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init/eessi_environment_variables b/init/eessi_environment_variables index c4afd9ab5e..90b295e56d 100644 --- a/init/eessi_environment_variables +++ b/init/eessi_environment_variables @@ -82,7 +82,7 @@ if [ -d $EESSI_PREFIX ]; then show_msg "Only setting up basic environment, so we're done" elif [ -d $EESSI_SOFTWARE_PATH ]; then EESSI_SITE_SOFTWARE_PATH=${EESSI_SOFTWARE_PATH/versions/host_injections} - show_msg "Using ${EESSI_SITE_INSTALLPATH} as the site extension directory for installations." + show_msg "Using ${EESSI_SITE_SOFTWARE_PATH} as the site extension directory for installations." # Allow for the use of a custom MNS if [ -z ${EESSI_CUSTOM_MODULEPATH+x} ]; then # EESSI_CUSTOM_MODULEPATH not set so we use our defaults From d209b272837b60bed6dd221e74eb323fa7b8009f Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Tue, 8 Oct 2024 16:23:58 +0200 Subject: [PATCH 4/9] Make sure EESSI_MODULE_SUBDIR is always set. Then, use that to define the EESSI_SITE_MODULEPATH --- init/eessi_environment_variables | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/init/eessi_environment_variables b/init/eessi_environment_variables index 90b295e56d..1ff03ac198 100644 --- a/init/eessi_environment_variables +++ b/init/eessi_environment_variables @@ -83,15 +83,15 @@ if [ -d $EESSI_PREFIX ]; then elif [ -d $EESSI_SOFTWARE_PATH ]; then EESSI_SITE_SOFTWARE_PATH=${EESSI_SOFTWARE_PATH/versions/host_injections} show_msg "Using ${EESSI_SITE_SOFTWARE_PATH} as the site extension directory for installations." + # Allow for use of alternative module tree shipped with EESSI + if [ -z ${EESSI_MODULE_SUBDIR+x} ]; then + # EESSI_MODULE_SUBDIR not set + EESSI_MODULE_SUBDIR="modules/all" + fi # Allow for the use of a custom MNS if [ -z ${EESSI_CUSTOM_MODULEPATH+x} ]; then # EESSI_CUSTOM_MODULEPATH not set so we use our defaults - # Allow for use of alternative module tree shipped with EESSI - if [ -z ${EESSI_MODULE_SUBDIR+x} ]; then - # EESSI_MODULE_SUBDIR not set - EESSI_MODULE_SUBDIR="modules/all" - fi EESSI_MODULEPATH=$EESSI_SOFTWARE_PATH/$EESSI_MODULE_SUBDIR else show_msg "Using defined environment variable \$EESSI_CUSTOM_MODULEPATH to set EESSI_MODULEPATH." @@ -101,7 +101,7 @@ if [ -d $EESSI_PREFIX ]; then if [ -d $EESSI_MODULEPATH ]; then export EESSI_MODULEPATH=$EESSI_MODULEPATH show_msg "Using ${EESSI_MODULEPATH} as the directory to be added to MODULEPATH." - export EESSI_SITE_MODULEPATH=${EESSI_MODULEPATH/versions/host_injections} + export EESSI_SITE_MODULEPATH=$EESSI_SITE_SOFTWARE_PATH/$EESSI_MODULE_SUBDIR show_msg "Using ${EESSI_SITE_MODULEPATH} as the site extension directory to be added to MODULEPATH." else error "EESSI module path at $EESSI_MODULEPATH not found!" From 022be33385fec3dd425174d8de7c632b4c2a6c31 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Tue, 8 Oct 2024 16:27:30 +0200 Subject: [PATCH 5/9] This was what it was all about... have EESSI extend use the EESSI_SITE_INSTALLPATH --- EESSI-extend-2023.06-easybuild.eb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EESSI-extend-2023.06-easybuild.eb b/EESSI-extend-2023.06-easybuild.eb index ba8629c02e..d7bdbe562d 100644 --- a/EESSI-extend-2023.06-easybuild.eb +++ b/EESSI-extend-2023.06-easybuild.eb @@ -92,7 +92,7 @@ elseif (os.getenv("EESSI_SITE_INSTALL") ~= nil) then if ((os.getenv("EESSI_PROJECT_INSTALL") ~= nil) or (os.getenv("EESSI_USER_INSTALL") ~= nil)) then LmodError("You cannot use EESSI_SITE_INSTALL in combination with any other EESSI_*_INSTALL environment variables") end - easybuild_installpath = string.gsub(os.getenv("EESSI_SOFTWARE_PATH"), 'versions', 'host_injections') + easybuild_installpath = os.getenv("EESSI_SITE_INSTALLPATH") else -- Deal with user and project installs project_install = os.getenv("EESSI_PROJECT_INSTALL") From 6f5419a7c7757b1fa79f2fa2ea4898b75863f499 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Wed, 9 Oct 2024 11:00:35 +0200 Subject: [PATCH 6/9] Renamed --- EESSI-extend-2023.06-easybuild.eb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EESSI-extend-2023.06-easybuild.eb b/EESSI-extend-2023.06-easybuild.eb index d7bdbe562d..8e328c3ece 100644 --- a/EESSI-extend-2023.06-easybuild.eb +++ b/EESSI-extend-2023.06-easybuild.eb @@ -92,7 +92,7 @@ elseif (os.getenv("EESSI_SITE_INSTALL") ~= nil) then if ((os.getenv("EESSI_PROJECT_INSTALL") ~= nil) or (os.getenv("EESSI_USER_INSTALL") ~= nil)) then LmodError("You cannot use EESSI_SITE_INSTALL in combination with any other EESSI_*_INSTALL environment variables") end - easybuild_installpath = os.getenv("EESSI_SITE_INSTALLPATH") + easybuild_installpath = os.getenv("EESSI_SITE_SOFTWARE_PATH") else -- Deal with user and project installs project_install = os.getenv("EESSI_PROJECT_INSTALL") From 4b61bc0a6aa88f95fa52a71a240aaa2c17b7eac9 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Wed, 9 Oct 2024 11:01:18 +0200 Subject: [PATCH 7/9] Export EESSI_SITE_SOFTWARE_PATH --- init/eessi_environment_variables | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init/eessi_environment_variables b/init/eessi_environment_variables index 1ff03ac198..43a95a7889 100644 --- a/init/eessi_environment_variables +++ b/init/eessi_environment_variables @@ -81,7 +81,7 @@ if [ -d $EESSI_PREFIX ]; then if [ ! -z $EESSI_BASIC_ENV ]; then show_msg "Only setting up basic environment, so we're done" elif [ -d $EESSI_SOFTWARE_PATH ]; then - EESSI_SITE_SOFTWARE_PATH=${EESSI_SOFTWARE_PATH/versions/host_injections} + export EESSI_SITE_SOFTWARE_PATH=${EESSI_SOFTWARE_PATH/versions/host_injections} show_msg "Using ${EESSI_SITE_SOFTWARE_PATH} as the site extension directory for installations." # Allow for use of alternative module tree shipped with EESSI if [ -z ${EESSI_MODULE_SUBDIR+x} ]; then From 79332f34eb7a73f1d2eeb53e7e1b4a9a94054167 Mon Sep 17 00:00:00 2001 From: ocaisa Date: Wed, 9 Oct 2024 11:43:44 +0200 Subject: [PATCH 8/9] Get the script to explain the differences between the Lmod and init scripts --- .github/workflows/tests_eessi_module.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests_eessi_module.yml b/.github/workflows/tests_eessi_module.yml index d2e3cd1338..8d6bd6edb0 100644 --- a/.github/workflows/tests_eessi_module.yml +++ b/.github/workflows/tests_eessi_module.yml @@ -80,6 +80,7 @@ jobs: echo "Test for checking env variables PASSED" else echo "Test for checking env variables FAILED" >&2 + diff "${moduleoutfile}" "${sourceoutfile}" exit 1 fi From 9f7982d73caeef98315ce54aca8b38360906bb23 Mon Sep 17 00:00:00 2001 From: ocaisa Date: Wed, 9 Oct 2024 11:51:39 +0200 Subject: [PATCH 9/9] Use the `init/bash` in the repo, not the one shipped by EESSI --- .github/workflows/tests_eessi_module.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests_eessi_module.yml b/.github/workflows/tests_eessi_module.yml index 8d6bd6edb0..cbcffe6385 100644 --- a/.github/workflows/tests_eessi_module.yml +++ b/.github/workflows/tests_eessi_module.yml @@ -72,7 +72,7 @@ jobs: module load EESSI/${{matrix.EESSI_VERSION}} env | grep -E '^(EESSI_S|EESSI_C)' | sort > "${moduleoutfile}" module unload EESSI/${{matrix.EESSI_VERSION}} - source /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/init/bash + source ./init/bash env | grep -E '^(EESSI_S|EESSI_C)' | sort > "${sourceoutfile}" cat "${moduleoutfile}" cat "${sourceoutfile}"