Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
9166400
Easyconfig that can extend EESSI
ocaisa Oct 20, 2023
f1a0e71
Add extension of EESSI to MODULEPATH
ocaisa Oct 20, 2023
98f20cd
Allow for both site and user extensions to EESSI
ocaisa Nov 7, 2023
60cb5dc
Update EESSI-extend-2023.06-easybuild.eb
ocaisa Nov 7, 2023
8fe3892
Escape hyphen for gsub
ocaisa Nov 7, 2023
8593e59
No hyphen any more so no need for lua escaping
ocaisa Apr 18, 2024
4126154
Merge remote-tracking branch 'upstream/2023.06-software.eessi.io' int…
ocaisa Apr 18, 2024
a8fc681
Merge branch 'eessi_extend_module' of github.com:ocaisa/software-laye…
ocaisa Apr 18, 2024
8e976c6
Make the hooks part of the init dir
ocaisa Apr 18, 2024
dbe6d6b
Actually install the EESSI extension module
ocaisa Apr 18, 2024
5ca2c4a
Copy over hooks along with initi files
ocaisa Apr 19, 2024
148534a
Update install_scripts.sh
ocaisa Apr 19, 2024
4ad271e
Update EESSI-extend-2023.06-easybuild.eb
ocaisa Apr 19, 2024
bde1b72
Allow for default site installations, and configurable project and/or…
ocaisa Apr 20, 2024
82f58b2
Fix conditions
ocaisa Apr 20, 2024
4ebfc20
Fix condition
ocaisa Apr 20, 2024
5c5899b
Messages only on module load
ocaisa Apr 20, 2024
8122bbd
fix location of settings
ocaisa Apr 20, 2024
04c6f0e
Always check for dir existence when using EESSI_USER_INSTALL
ocaisa Apr 22, 2024
cc91f34
fix tiny typo
trz42 May 7, 2024
38a0581
use eessi.io/docs and system easystack file
truib May 7, 2024
0ff2334
Update EESSI-extend-2023.06-easybuild.eb
ocaisa May 7, 2024
39dddf6
Update init/bash
casparvl May 7, 2024
500b1de
Update init/bash
casparvl May 7, 2024
999cbd3
relax check or tarball is not created unless also software was built
truib May 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
167 changes: 167 additions & 0 deletions EESSI-extend-2023.06-easybuild.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
easyblock = 'Bundle'

name = 'EESSI-extend'
version = '2023.06'
# May have different ways to extend EESSI in future (manually, other tools,...)
versionsuffix = '-easybuild'

homepage = 'https://eessi.io/docs/'

description = """
The goal of the European Environment for Scientific Software Installations
(EESSI, pronounced as "easy") is to build a common stack of scientific
software installations for HPC systems and beyond, including laptops,
personal workstations and cloud infrastructure.

This module allows you to extend EESSI using the same configuration for
EasyBuild as EESSI itself uses. A number of environment variables control the
behaviour of the module:
- EESSI_USER_INSTALL can be set to a location to install modules for use by
the user only. The location must already exist on the filesystem.
- EESSI_PROJECT_INSTALL can be set to a location to install modules for use by
a project. The location must already exist on the filesystem and you should
ensure that the location has the correct Linux group and the SGID permission
is set on that directory (`chmod g+s $EESSI_PROJECT_INSTALL`) so that all
members of the group have permission to read and write installations.
- EESSI_SITE_INSTALL is either defined or not and cannot be used with another
environment variable. A site installation is done in a defined location and
any installations there are (by default) world readable.
- EESSI_CVMFS_INSTALL is either defined or not and cannot be used with another
environment variable. A CVMFS installation targets a defined location which
will be ingested into CVMFS and is only useful for CVMFS administrators.
- If none of the environment variables above are defined, an EESSI_USER_INSTALL
is assumed with a value of $HOME/EESSI
Comment on lines +19 to +33
Copy link
Copy Markdown
Member Author

@ocaisa ocaisa Apr 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akesandgren What do you think of this? Basically this means you can have site installations, project installations and user installations. Project and user installations are not visible without loading the module but their location can be configured by the user

If both EESSI_USER_INSTALL and EESSI_PROJECT_INSTALL are defined, both sets of
installations are exposed, but new installations are created as user
installations.
"""

toolchain = SYSTEM

# All the dependencies we filter in EESSI
local_deps_to_filter = "Autoconf,Automake,Autotools,binutils,bzip2,DBus,flex,gettext,gperf,help2man,intltool,libreadline,libtool,M4,makeinfo,ncurses,util-linux,XZ,zlib"
local_arch_specific_deps_to_filter = {'aarch64': ',yasm', 'x86_64': ''}
local_deps_to_filter += local_arch_specific_deps_to_filter[ARCH]

# Set the universal EasyBuild variables
modextravars = {
'EASYBUILD_FILTER_DEPS': local_deps_to_filter,
'EASYBUILD_IGNORE_OSDEPS': '1',
'EASYBUILD_DEBUG': '1',
'EASYBUILD_TRACE': '1',
'EASYBUILD_ZIP_LOGS': 'bzip2',
'EASYBUILD_RPATH': '1',
'EASYBUILD_FILTER_ENV_VARS': 'LD_LIBRARY_PATH',
'EASYBUILD_READ_ONLY_INSTALLDIR': '1',
'EASYBUILD_MODULE_EXTENSIONS': '1',
'EASYBUILD_EXPERIMENTAL': '1',
}

# Need a few other variables, but they are more dynamic
# EASYBUILD_SYSROOT=${EPREFIX}
# EASYBUILD_PREFIX=${WORKDIR}/easybuild
# EASYBUILD_HOOKS=${EESSI_PREFIX}/init/easybuild/eb_hooks.py
# EASYBUILD_INSTALLPATH=${EESSI_PREFIX}/software/${EESSI_OS_TYPE}/${EESSI_SOFTWARE_SUBDIR}
# EASYBUILD_SOURCEPATH=${WORKDIR}/easybuild/sources:${EESSI_SOURCEPATH}
#
# And also some optional ones based on the kind of installation
# EASYBUILD_SET_GID_BIT
# EASYBUILD_GROUP_WRITABLE_INSTALLDIR
# EASYBUILD_UMASK
# EASYBUILD_STICKY_BIT
modluafooter = """
if (mode() == "load") then
-- Use a working directory for temporary build files
if (os.getenv("WORKING_DIR") == nil) then
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 pathJoin("/tmp", os.getenv("USER"))
-- Gather the EPREFIX to use as a sysroot
sysroot = os.getenv("EESSI_EPREFIX")
-- Use an installation prefix that we _should_ have write access to
if (os.getenv("EESSI_CVMFS_INSTALL") ~= nil) then
-- Make sure no other EESSI install environment variables are set
if ((os.getenv("EESSI_SITE_INSTALL") ~= nil) or (os.getenv("EESSI_PROJECT_INSTALL") ~= nil) or (os.getenv("EESSI_USER_INSTALL") ~= nil)) then
LmodError("You cannot use EESSI_CVMFS_INSTALL in combination with any other EESSI_*_INSTALL environment variables")
end
eessi_cvmfs_install = true
easybuild_installpath = os.getenv("EESSI_SOFTWARE_PATH")
elseif (os.getenv("EESSI_SITE_INSTALL") ~= nil) then
-- Make sure no other EESSI install environment variables are set
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')
else
-- Deal with user and project installs
project_install = os.getenv("EESSI_PROJECT_INSTALL")
project_modulepath = nil
if (project_install ~= nil) then
-- Check the folder exists
if not isDir(project_install) then
LmodError("The location of EESSI_PROJECT_INSTALL (" .. project_install .. ") does not exist or is not a folder")
end
if (mode() == "load") then
LmodMessage("Configuring for use of EESSI_PROJECT_INSTALL under " .. project_install)
end
easybuild_installpath = string.gsub(os.getenv("EESSI_SOFTWARE_PATH"), os.getenv("EESSI_CVMFS_REPO"), project_install)
project_modulepath = pathJoin(easybuild_installpath, 'modules', 'all')
end
user_install = os.getenv("EESSI_USER_INSTALL")
user_modulepath = nil
if (user_install ~= nil) then
-- Check the folder exists
if not isDir(user_install) then
LmodError("The location of EESSI_USER_INSTALL (" .. user_install .. ") does not exist or is not a folder")
end
elseif (user_install == nil) and (project_install == nil) then
-- No need to check for existence when we use a HOME subdir
user_install = pathJoin(os.getenv("HOME"), "eessi")
end
if (user_install ~= nil) then
if (mode() == "load") then
LmodMessage("Configuring for use of EESSI_USER_INSTALL under " .. user_install)
end
easybuild_installpath = string.gsub(os.getenv("EESSI_SOFTWARE_PATH"), os.getenv("EESSI_CVMFS_REPO"), user_install)
user_modulepath = pathJoin(easybuild_installpath, 'modules', 'all')
end
end
if (mode() == "load") then
LmodMessage("-- To create installations for EESSI, you _must_ have write permissions to " .. easybuild_installpath)
-- Advise them to reuse sources
if (os.getenv("EASYBUILD_SOURCEPATH") == nil) then
LmodMessage("-- You may wish to configure a sources directory for EasyBuild (for example, via setting the environment variable EASYBUILD_SOURCEPATH) to allow you to reuse existing sources for packages.")
end
end
-- Set the relevant universal environment variables for EasyBuild
setenv ("EASYBUILD_SYSROOT", sysroot)
setenv ("EASYBUILD_PREFIX", pathJoin(working_dir, "easybuild"))
setenv ("EASYBUILD_INSTALLPATH", easybuild_installpath)
setenv ("EASYBUILD_HOOKS", pathJoin(os.getenv("EESSI_PREFIX"), "init", "easybuild", "eb_hooks.py"))
setenv ("EASYBUILD_UMASK", "002")

-- Set all related environment variables if we have project or user installations (including extending MODULEPATH)
if (user_modulepath ~= nil) then
-- Use a more restrictive umask for this case
setenv ("EASYBUILD_UMASK", "022")
setenv ("EASYBUILD_STICKY_BIT", "1")
-- configure MODULEPATH
if (project_modulepath ~= nil) then
prepend_path("MODULEPATH", project_modulepath)
end
prepend_path("MODULEPATH", user_modulepath)
elseif (project_modulepath ~= nil) then
setenv ("EASYBUILD_SET_GID_BIT", "1")
setenv ("EASYBUILD_GROUP_WRITABLE_INSTALLDIR", "1")
setenv ("EASYBUILD_STICKY_BIT", "0")
-- configure MODULEPATH
prepend_path("MODULEPATH", project_modulepath)
end
-- Make sure EasyBuild itself is loaded
if not ( isloaded("EasyBuild") ) then
load("EasyBuild")
end
"""

moduleclass = 'devel'
2 changes: 1 addition & 1 deletion create_tarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fi

overlay_upper_dir="${eessi_tmpdir}/overlay-upper"

software_dir_overlay="${overlay_upper_dir}/versions/${eessi_version}/software/${os}/${cpu_arch_subdir}"
software_dir_overlay="${overlay_upper_dir}/versions/${eessi_version}"
if [ ! -d ${software_dir_overlay} ]; then
echo "Software directory overlay ${software_dir_overlay} does not exist?!" >&2
exit 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ easyconfigs:
- EasyBuild-4.9.1.eb:
options:
from-pr: 20299
- EESSI-extend-2023.06-easybuild.eb
2 changes: 1 addition & 1 deletion init/Magic_Castle/bash
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ source $(dirname "$BASH_SOURCE")/../eessi_environment_variables

# Provide a clean MODULEPATH
export MODULEPATH_ROOT=$EESSI_MODULEPATH
export MODULEPATH=$EESSI_MODULEPATH
export 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
Expand Down
2 changes: 2 additions & 0 deletions init/bash
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ if [ $? -eq 0 ]; then
# prepend location of modules for EESSI software stack to $MODULEPATH
show_msg "Prepending $EESSI_MODULEPATH to \$MODULEPATH..."
module use $EESSI_MODULEPATH
show_msg "Prepending site path $EESSI_SITE_MODULEPATH to \$MODULEPATH..."
module use $EESSI_SITE_MODULEPATH

#show_msg ""
#show_msg "*** Known problems in the ${EESSI_VERSION} software stack ***"
Expand Down
2 changes: 2 additions & 0 deletions init/eessi_environment_variables
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ 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}
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!"
false
Expand Down
6 changes: 6 additions & 0 deletions install_scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,9 @@ nvidia_files=(
install_cuda_host_injections.sh link_nvidia_host_libraries.sh
)
copy_files_by_list ${TOPDIR}/scripts/gpu_support/nvidia ${INSTALL_PREFIX}/scripts/gpu_support/nvidia "${nvidia_files[@]}"

# Copy over EasyBuild hooks file used for installations
hook_files=(
eb_hooks.py
)
copy_files_by_list ${TOPDIR} ${INSTALL_PREFIX}/init/easybuild "${hook_files[@]}"