Skip to content

Commit

Permalink
Merge pull request #778 from casparvl/define_site_installpath
Browse files Browse the repository at this point in the history
Rebuild `EESSI-extend` to use `EESSI_SITE_SOFTWARE_PATH`
  • Loading branch information
ocaisa authored Oct 10, 2024
2 parents e8686fb + 9f7982d commit 556e9b4
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/tests_eessi_module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,15 @@ 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}"
if (diff "${moduleoutfile}" "${sourceoutfile}" > /dev/null); then
echo "Test for checking env variables PASSED"
else
echo "Test for checking env variables FAILED" >&2
diff "${moduleoutfile}" "${sourceoutfile}"
exit 1
fi
2 changes: 1 addition & 1 deletion EESSI-extend-2023.06-easybuild.eb
Original file line number Diff line number Diff line change
Expand Up @@ -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_SOFTWARE_PATH")
else
-- Deal with user and project installs
project_install = os.getenv("EESSI_PROJECT_INSTALL")
Expand Down
Original file line number Diff line number Diff line change
@@ -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

14 changes: 8 additions & 6 deletions init/eessi_environment_variables
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,17 @@ 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
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
# 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."
Expand All @@ -138,7 +140,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!"
Expand Down
4 changes: 3 additions & 1 deletion init/modules/EESSI/2023.06.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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_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_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)
Expand Down

0 comments on commit 556e9b4

Please sign in to comment.