Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easyconfig that can extend EESSI #371

Merged
merged 25 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
95 changes: 95 additions & 0 deletions EESSI-extend-2023.06-easybuild.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
easyblock = 'Binary'

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

homepage = 'https://eessi.github.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. 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

source_urls = None
sources = ['eb_hooks.py']
ocaisa marked this conversation as resolved.
Show resolved Hide resolved
checksums = ['8ae609f99b6953beae89aa1945913686c86c156509dbc55e2b6b8017b13fcf66']

# Don't extend the PATH
prepend_to_path = None

# 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]

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',
'EASYBUILD_HOOKS': '%(installdir)s/eb_hooks.py',
}

# Need a few other variables, but they are more dynamic
# EASYBUILD_SYSROOT=${EPREFIX}
# EASYBUILD_PREFIX=${WORKDIR}/easybuild
# EASYBUILD_INSTALLPATH=${EESSI_PREFIX}/software/${EESSI_OS_TYPE}/${EESSI_SOFTWARE_SUBDIR}
# EASYBUILD_SOURCEPATH=${WORKDIR}/easybuild/sources:${EESSI_SOURCEPATH}
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
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"))
ocaisa marked this conversation as resolved.
Show resolved Hide resolved
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 environment variables for EasyBuild
setenv ("EASYBUILD_SYSROOT", sysroot)
setenv ("EASYBUILD_PREFIX", pathJoin(working_dir, "easybuild"))
setenv ("EASYBUILD_INSTALLPATH", easybuild_installpath)
if not ( isloaded("EasyBuild") ) then
load("EasyBuild")
end
"""

sanity_check_paths = {
'files': ['eb_hooks.py'],
'dirs': ['']
}

moduleclass = 'devel'
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_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
Expand Down
4 changes: 4 additions & 0 deletions init/bash
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +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 site path $EESSI_SITE_MODULEPATH to \$MODULEPATH..." >> $output
casparvl marked this conversation as resolved.
Show resolved Hide resolved
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
Expand Down
4 changes: 4 additions & 0 deletions init/eessi_environment_variables
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +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_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
Expand Down
Loading