diff --git a/EESSI-2023.06-extend.eb b/EESSI-extend-2023.06-easybuild.eb similarity index 69% rename from EESSI-2023.06-extend.eb rename to EESSI-extend-2023.06-easybuild.eb index e4fafb860c..fd9f897326 100644 --- a/EESSI-2023.06-extend.eb +++ b/EESSI-extend-2023.06-easybuild.eb @@ -1,8 +1,9 @@ easyblock = 'Binary' -name = 'EESSI' +name = 'EESSI-extend' version = '2023.06' -versionsuffix = '-extend' +# May have different ways to extend EESSI in future (manually, other tools,...) +versionsuffix = '-easybuild' homepage = 'https://eessi.github.io/docs/' @@ -13,9 +14,10 @@ description = """ personal workstations and cloud infrastructure. This module allows you to extend EESSI using the same configuration for - EasyBuild as EESSI itself uses. It installs the modules in a special location - that is configurable in the CVMFS configuration (so can be on a shared - filesystem), and automatically found when using the default EESSI environment. + EasyBuild as EESSI itself uses. The default installation is the users + home directory, but this can be overridden for a site installation (by setting + EESSI_SITE_INSTALL) or for a direct installation under CVMFS (by setting + EESSI_CVMFS_INSTALL). """ toolchain = SYSTEM @@ -55,14 +57,20 @@ modluafooter = """ if (mode() == "load") then -- Use a working directory for temporary build files if (os.getenv("WORKING_DIR") == nil) then - LmodMessage("-- Using /tmp as a temporary working directory for installations, you can override this by setting the environment variable WORKING_DIR and reloading the module (e.g., /dev/shm is a common option)") + LmodMessage("-- Using /tmp/$USER as a temporary working directory for installations, you can override this by setting the environment variable WORKING_DIR and reloading the module (e.g., /dev/shm is a common option)") end end -working_dir = os.getenv("WORKING_DIR") or "/tmp" +working_dir = os.getenv("WORKING_DIR") or pathJoin("/tmp", os.getenv("USER")) -- Gather the EPREFIX to use as a sysroot -sysroot = os.getenv("EPREFIX") +sysroot = os.getenv("EESSI_EPREFIX") -- Use an installation prefix that we _should_ have write access to -easybuild_installpath = string.gsub(os.getenv("EESSI_SOFTWARE_PATH"), 'versions', 'host_injections') +if (os.getenv("EESSI_CVMFS_INSTALL") ~= nil) then + easybuild_installpath = os.getenv("EESSI_SOFTWARE_PATH") +elseif (os.getenv("EESSI_SITE_INSTALL") ~= nil) then + easybuild_installpath = string.gsub(os.getenv("EESSI_SOFTWARE_PATH"), 'versions', 'host_injections') +else + easybuild_installpath = string.gsub(os.getenv("EESSI_SOFTWARE_PATH"), os.getenv("EESSI_CVMFS_REPO"), pathJoin(os.getenv("HOME"), "eessi")) +end if (mode() == "load") then LmodMessage("-- To create installations for EESSI, you _must_ have write permissions to " .. easybuild_installpath) -- Advise them to reuse sources @@ -74,7 +82,9 @@ end setenv ("EASYBUILD_SYSROOT", sysroot) setenv ("EASYBUILD_PREFIX", pathJoin(working_dir, "easybuild")) setenv ("EASYBUILD_INSTALLPATH", easybuild_installpath) -always_load("EasyBuild") +if not ( isloaded("EasyBuild") ) then + load("EasyBuild") +end """ sanity_check_paths = { diff --git a/init/Magic_Castle/bash b/init/Magic_Castle/bash index 219c6d3a85..0ee9d612f3 100644 --- a/init/Magic_Castle/bash +++ b/init/Magic_Castle/bash @@ -10,7 +10,7 @@ source $(dirname "$BASH_SOURCE")/../eessi_environment_variables # Provide a clean MODULEPATH export MODULEPATH_ROOT=$EESSI_MODULEPATH -export MODULEPATH=$EESSI_EXTEND_MODULEPATH:$EESSI_MODULEPATH +export MODULEPATH=$EESSI_USER_MODULEPATH:$EESSI_SITE_MODULEPATH:$EESSI_MODULEPATH # Extensions are too many, let's not print them by default (requires Lmod 8.4.12) export LMOD_AVAIL_EXTENSIONS=no diff --git a/init/bash b/init/bash index bf8ada4fd2..76c1e9154a 100644 --- a/init/bash +++ b/init/bash @@ -26,8 +26,10 @@ if [ $? -eq 0 ]; then # prepend location of modules for EESSI software stack to $MODULEPATH echo "Prepending $EESSI_MODULEPATH to \$MODULEPATH..." >> $output module use $EESSI_MODULEPATH - echo "Prepending $EESSI_EXTEND_MODULEPATH to \$MODULEPATH..." >> $output - module use $EESSI_EXTEND_MODULEPATH + echo "Prepending site path $EESSI_SITE_MODULEPATH to \$MODULEPATH..." >> $output + module use $EESSI_SITE_MODULEPATH + echo "Prepending user path $EESSI_SITE_MODULEPATH to \$MODULEPATH..." >> $output + module use $EESSI_USER_MODULEPATH #echo >> $output #echo "*** Known problems in the ${EESSI_PILOT_VERSION} pilot software stack ***" >> $output diff --git a/init/eessi_environment_variables b/init/eessi_environment_variables index 7b4f82bbd3..656fbc6637 100644 --- a/init/eessi_environment_variables +++ b/init/eessi_environment_variables @@ -60,8 +60,10 @@ if [ -d $EESSI_PREFIX ]; then if [ -d $EESSI_MODULEPATH ]; then export EESSI_MODULEPATH=$EESSI_MODULEPATH echo "Using ${EESSI_MODULEPATH} as the directory to be added to MODULEPATH." >> $output - export EESSI_EXTEND_MODULEPATH=${EESSI_MODULEPATH/versions/host_injections} - echo "Using ${EESSI_EXTEND_MODULEPATH} as the extension directory to be added to MODULEPATH." >> $output + export EESSI_SITE_MODULEPATH=${EESSI_MODULEPATH/versions/host_injections} + echo "Using ${EESSI_SITE_MODULEPATH} as the site extension directory to be added to MODULEPATH." >> $output + export EESSI_USER_MODULEPATH=${EESSI_MODULEPATH/${EESSI_CVMFS_REPO}/${HOME}\/eessi} + echo "Using ${EESSI_USER_MODULEPATH} as the user extension directory to be added to MODULEPATH." >> $output else error "EESSI module path at $EESSI_MODULEPATH not found!" false