From 73652d1f3eb704981ce1e0089b9c5f73e1eafa4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 1 Nov 2024 15:04:38 +0100 Subject: [PATCH 01/31] easystack file to test RISC-V bot --- .../riscv.eessi.io/20240402/eessi-20240402-eb-4.9.4-2023b.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 easystacks/riscv.eessi.io/20240402/eessi-20240402-eb-4.9.4-2023b.yml diff --git a/easystacks/riscv.eessi.io/20240402/eessi-20240402-eb-4.9.4-2023b.yml b/easystacks/riscv.eessi.io/20240402/eessi-20240402-eb-4.9.4-2023b.yml new file mode 100644 index 0000000000..3bd95ecf7f --- /dev/null +++ b/easystacks/riscv.eessi.io/20240402/eessi-20240402-eb-4.9.4-2023b.yml @@ -0,0 +1,2 @@ +easyconfigs: + - GCCcore-13.2.0.eb From 6411fe7863d3a97242b24c802cc6254d5d25dc73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 15 Nov 2024 17:01:30 +0100 Subject: [PATCH 02/31] use EESSI_CVMFS_REPO --- init/lmod/bash | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/init/lmod/bash b/init/lmod/bash index b4941d6766..24b81e049f 100644 --- a/init/lmod/bash +++ b/init/lmod/bash @@ -1,8 +1,9 @@ # Choose an EESSI version +EESSI_CVMFS_REPO="${EESSI_CVMFS_REPO:-/cvmfs/software.eessi.io}" EESSI_VERSION="${EESSI_VERSION:-2023.06}" # Path to top-level module tree -export MODULEPATH=/cvmfs/software.eessi.io/versions/"$EESSI_VERSION"/init/modules -. /cvmfs/software.eessi.io/versions/"$EESSI_VERSION"/compat/linux/$(uname -m)/usr/share/Lmod/init/bash +export MODULEPATH="${EESSI_CVMFS_REPO}/versions/$EESSI_VERSION/init/modules" +. "${EESSI_CVMFS_REPO}/versions/$EESSI_VERSION/compat/linux/$(uname -m)/usr/share/Lmod/init/bash" if [ -z "$__Init_Default_Modules" ]; then export __Init_Default_Modules=1; From 9af136029b2dcb167b71935480f90b260b4033d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 15 Nov 2024 17:02:35 +0100 Subject: [PATCH 03/31] add modulefile for RISC-V version 20240402 --- init/modules/EESSI/20240402.lua | 157 ++++++++++++++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 init/modules/EESSI/20240402.lua diff --git a/init/modules/EESSI/20240402.lua b/init/modules/EESSI/20240402.lua new file mode 100644 index 0000000000..8a5b8d8d81 --- /dev/null +++ b/init/modules/EESSI/20240402.lua @@ -0,0 +1,157 @@ +help([[ +Description +=========== +The European Environment for Scientific Software Installations (EESSI, pronounced as easy) is a collaboration between different European partners in HPC community.The goal of this project is to build a common stack of scientific software installations for HPC systems and beyond, including laptops, personal workstations and cloud infrastructure. + +More information +================ + - URL: https://www.eessi.io/docs/ +]]) +whatis("Description: The European Environment for Scientific Software Installations (EESSI, pronounced as easy) is a collaboration between different European partners in HPC community. The goal of this project is to build a common stack of scientific software installations for HPC systems and beyond, including laptops, personal workstations and cloud infrastructure.") +whatis("URL: https://www.eessi.io/docs/") +conflict("EESSI") +local eessi_version = myModuleVersion() +local eessi_repo = "/cvmfs/riscv.eessi.io" +local eessi_prefix = pathJoin(eessi_repo, "versions", eessi_version) +local eessi_os_type = "linux" +setenv("EESSI_VERSION", eessi_version) +setenv("EESSI_CVMFS_REPO", eessi_repo) +setenv("EESSI_OS_TYPE", eessi_os_type) +function eessiDebug(text) + if (mode() == "load" and os.getenv("EESSI_DEBUG_INIT")) then + LmodMessage(text) + end +end +function archdetect_cpu() + local script = pathJoin(eessi_prefix, 'init', 'lmod_eessi_archdetect_wrapper.sh') + -- make sure that we grab the value for architecture before the module unsets the environment variable (in unload mode) + local archdetect_options = os.getenv("EESSI_ARCHDETECT_OPTIONS") or (os.getenv("EESSI_ARCHDETECT_OPTIONS_OVERRIDE") or "") + if not os.getenv("EESSI_ARCHDETECT_OPTIONS_OVERRIDE") then + if convertToCanonical(LmodVersion()) < convertToCanonical("8.6") then + LmodError("Loading this modulefile requires using Lmod version >= 8.6, but you can export EESSI_ARCHDETECT_OPTIONS_OVERRIDE to the available cpu architecture in the form of: x86_64/intel/haswell:x86_64/generic or aarch64/neoverse_v1:aarch64/generic") + end + source_sh("bash", script) + end + -- EESSI_ARCHDETECT_OPTIONS is set by the script (_if_ it was called) + archdetect_options = os.getenv("EESSI_ARCHDETECT_OPTIONS") or archdetect_options + if archdetect_options then + eessiDebug("Got archdetect CPU options: " .. archdetect_options) + -- archdetect_options is a colon-separated list of CPU architectures that are compatible with + -- the host CPU and ordered from most specific to least specific, e.g., + -- x86_64/intel/skylake_avx512:x86_64/intel/haswell:x86_64/generic + -- We loop over the list, and return the highest matching arch for which a directory exists for this EESSI version + for archdetect_filter_cpu in string.gmatch(archdetect_options, "([^" .. ":" .. "]+)") do + if isDir(pathJoin(eessi_prefix, "software", eessi_os_type, archdetect_filter_cpu, "software")) then + -- use x86_64/amd/zen3 for now when AMD Genoa (Zen4) CPU is detected, + -- since optimized software installations for Zen4 are a work-in-progress, + -- see https://gitlab.com/eessi/support/-/issues/37 + if (archdetect_filter_cpu == "x86_64/amd/zen4" and not os.getenv("EESSI_SOFTWARE_SUBDIR_OVERRIDE") == "x86_64/amd/zen4") then + archdetect_filter_cpu = "x86_64/amd/zen3" + if mode() == "load" then + LmodMessage("Sticking to " .. archdetect_filter_cpu .. " for now, since optimized installations for AMD Genoa (Zen4) are a work in progress.") + end + end + eessiDebug("Selected archdetect CPU: " .. archdetect_filter_cpu) + return archdetect_filter_cpu + end + end + LmodError("Software directory check for the detected architecture failed") + else + -- Still need to return something + return nil + end +end +function archdetect_accel() + local script = pathJoin(eessi_prefix, 'init', 'lmod_eessi_archdetect_wrapper_accel.sh') + -- for unload mode, we need to grab the value before it is unset + local archdetect_accel = os.getenv("EESSI_ACCEL_SUBDIR") or (os.getenv("EESSI_ACCELERATOR_TARGET_OVERRIDE") or "") + if not os.getenv("EESSI_ACCELERATOR_TARGET_OVERRIDE ") then + if convertToCanonical(LmodVersion()) < convertToCanonical("8.6") then + LmodError("Loading this modulefile requires using Lmod version >= 8.6, but you can export EESSI_ACCELERATOR_TARGET_OVERRIDE to the available accelerator architecture in the form of: accel/nvidia/cc80") + end + source_sh("bash", script) + end + archdetect_accel = os.getenv("EESSI_ACCEL_SUBDIR") or archdetect_accel + eessiDebug("Got archdetect accel option: " .. archdetect_accel) + return archdetect_accel +end +-- archdetect finds the best compatible architecture, e.g., x86_64/amd/zen3 +local archdetect = archdetect_cpu() +-- archdetect_accel() attempts to identify an accelerator, e.g., accel/nvidia/cc80 +local archdetect_accel = archdetect_accel() +-- eessi_cpu_family is derived from the archdetect match, e.g., x86_64 +local eessi_cpu_family = archdetect:match("([^/]+)") +local eessi_software_subdir = archdetect +-- eessi_eprefix is the base location of the compat layer, e.g., /cvmfs/software.eessi.io/versions/2023.06/compat/linux/x86_64 +local eessi_eprefix = pathJoin(eessi_prefix, "compat", eessi_os_type, eessi_cpu_family) +-- eessi_software_path is the location of the software installations, e.g., +-- /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/amd/zen3 +local eessi_software_path = pathJoin(eessi_prefix, "software", eessi_os_type, eessi_software_subdir) +local eessi_modules_subdir = pathJoin("modules", "all") +-- eessi_module_path is the location of the _CPU_ module files, e.g., +-- /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/amd/zen3/modules/all +local eessi_module_path = pathJoin(eessi_software_path, eessi_modules_subdir) +local eessi_site_software_path = string.gsub(eessi_software_path, "versions", "host_injections") +-- Site module path is the same as the EESSI one, but with `versions` changed to `host_injections`, e.g., +-- /cvmfs/software.eessi.io/host_injections/2023.06/software/linux/x86_64/amd/zen3/modules/all +local eessi_site_module_path = pathJoin(eessi_site_software_path, eessi_modules_subdir) +setenv("EPREFIX", eessi_eprefix) +eessiDebug("Setting EPREFIX to " .. eessi_eprefix) +setenv("EESSI_CPU_FAMILY", eessi_cpu_family) +eessiDebug("Setting EESSI_CPU_FAMILY to " .. eessi_cpu_family) +setenv("EESSI_SITE_SOFTWARE_PATH", eessi_site_software_path) +eessiDebug("Setting EESSI_SITE_SOFTWARE_PATH to " .. eessi_site_software_path) +setenv("EESSI_SITE_MODULEPATH", eessi_site_module_path) +eessiDebug("Setting EESSI_SITE_MODULEPATH to " .. eessi_site_module_path) +setenv("EESSI_SOFTWARE_SUBDIR", eessi_software_subdir) +eessiDebug("Setting EESSI_SOFTWARE_SUBDIR to " .. eessi_software_subdir) +setenv("EESSI_PREFIX", eessi_prefix) +eessiDebug("Setting EESSI_PREFIX to " .. eessi_prefix) +setenv("EESSI_EPREFIX", eessi_eprefix) +eessiDebug("Setting EPREFIX to " .. eessi_eprefix) +prepend_path("PATH", pathJoin(eessi_eprefix, "bin")) +eessiDebug("Adding " .. pathJoin(eessi_eprefix, "bin") .. " to PATH") +prepend_path("PATH", pathJoin(eessi_eprefix, "usr", "bin")) +eessiDebug("Adding " .. pathJoin(eessi_eprefix, "usr", "bin") .. " to PATH") +setenv("EESSI_SOFTWARE_PATH", eessi_software_path) +eessiDebug("Setting EESSI_SOFTWARE_PATH to " .. eessi_software_path) +setenv("EESSI_MODULEPATH", eessi_module_path) +eessiDebug("Setting EESSI_MODULEPATH to " .. eessi_module_path) +-- We ship our spider cache, so this location does not need to be spider-ed +if ( mode() ~= "spider" ) then + prepend_path("MODULEPATH", eessi_module_path) + eessiDebug("Adding " .. eessi_module_path .. " to MODULEPATH") +end +prepend_path("LMOD_RC", pathJoin(eessi_software_path, ".lmod", "lmodrc.lua")) +eessiDebug("Adding " .. pathJoin(eessi_software_path, ".lmod", "lmodrc.lua") .. " to LMOD_RC") +-- Use pushenv for LMOD_PACKAGE_PATH as this may be set locally by the site +pushenv("LMOD_PACKAGE_PATH", pathJoin(eessi_software_path, ".lmod")) +eessiDebug("Setting LMOD_PACKAGE_PATH to " .. pathJoin(eessi_software_path, ".lmod")) + +-- the accelerator may have an empty value and we need to give some flexibility +-- * construct the path we expect to find +-- * then check it exists +-- * then update the modulepath +if not (archdetect_accel == nil or archdetect_accel == '') then + -- The CPU subdirectory of the accelerator installations is _usually_ the same as host CPU, but this can be overridden + eessi_accel_software_subdir = os.getenv("EESSI_ACCEL_SOFTWARE_SUBDIR_OVERRIDE") or eessi_software_subdir + -- CPU location of the accelerator installations, e.g., + -- /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/amd/zen3 + eessi_accel_software_path = pathJoin(eessi_prefix, "software", eessi_os_type, eessi_accel_software_subdir) + -- location of the accelerator modules, e.g., + -- /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/amd/zen3/accel/nvidia/cc80/modules/all + eessi_module_path_accel = pathJoin(eessi_accel_software_path, archdetect_accel, eessi_modules_subdir) + eessiDebug("Checking if " .. eessi_module_path_accel .. " exists") + if isDir(eessi_module_path_accel) then + setenv("EESSI_MODULEPATH_ACCEL", eessi_module_path_accel) + prepend_path("MODULEPATH", eessi_module_path_accel) + eessiDebug("Using acclerator modules at: " .. eessi_module_path_accel) + end +end + +-- prepend the site module path last so it has priority +prepend_path("MODULEPATH", eessi_site_module_path) +eessiDebug("Adding " .. eessi_site_module_path .. " to MODULEPATH") +if mode() == "load" then + LmodMessage("EESSI/" .. eessi_version .. " loaded successfully") +end From e4b4a8feab7306c67eeed5818ae229cbe6320fa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Tue, 3 Dec 2024 13:59:55 +0100 Subject: [PATCH 04/31] use EESSI_VERSION instead of hardcoding the version --- EESSI-extend-2023.06-easybuild.eb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/EESSI-extend-2023.06-easybuild.eb b/EESSI-extend-2023.06-easybuild.eb index 8e328c3ece..338d19f624 100644 --- a/EESSI-extend-2023.06-easybuild.eb +++ b/EESSI-extend-2023.06-easybuild.eb @@ -1,7 +1,8 @@ easyblock = 'Bundle' name = 'EESSI-extend' -version = '2023.06' +import os +version = os.getenv('EESSI_VERSION', '2023.06') # May have different ways to extend EESSI in future (manually, other tools,...) versionsuffix = '-easybuild' From 17daa4c1cf10f7f33e1d5301f1fb6f871f1de93f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Tue, 3 Dec 2024 14:02:41 +0100 Subject: [PATCH 05/31] add system easystack for EESSI-extend --- .../20240402/eessi-20240402-eb-4.9.4-001-system.eb | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 easystacks/riscv.eessi.io/20240402/eessi-20240402-eb-4.9.4-001-system.eb diff --git a/easystacks/riscv.eessi.io/20240402/eessi-20240402-eb-4.9.4-001-system.eb b/easystacks/riscv.eessi.io/20240402/eessi-20240402-eb-4.9.4-001-system.eb new file mode 100644 index 0000000000..48974f11b0 --- /dev/null +++ b/easystacks/riscv.eessi.io/20240402/eessi-20240402-eb-4.9.4-001-system.eb @@ -0,0 +1,2 @@ +easyconfigs: + - EESSI-extend-2023.06-easybuild.eb From 40062216c9387feb4ffd9e8cd042d8a755d757fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Tue, 3 Dec 2024 20:51:11 +0100 Subject: [PATCH 06/31] remove version from EESSI-extend easyconfig --- EESSI-extend-easybuild.eb | 189 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 189 insertions(+) create mode 100644 EESSI-extend-easybuild.eb diff --git a/EESSI-extend-easybuild.eb b/EESSI-extend-easybuild.eb new file mode 100644 index 0000000000..21b62461bf --- /dev/null +++ b/EESSI-extend-easybuild.eb @@ -0,0 +1,189 @@ +easyblock = 'Bundle' + +name = 'EESSI-extend' +import os +version = os.getenv('EESSI_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 + 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") + eessi_accelerator_target = os.getenv("EESSI_ACCELERATOR_TARGET") + if (eessi_accelerator_target ~= nil) then + cuda_compute_capability = string.match(eessi_accelerator_target, "^nvidia/cc([0-9][0-9])$") + if (cuda_compute_capability ~= nil) then + easybuild_installpath = pathJoin(easybuild_installpath, 'accel', eessi_accelerator_target) + easybuild_cuda_compute_capabilities = cuda_compute_capability:sub(1, 1) .. "." .. cuda_compute_capability:sub(2, 2) + else + LmodError("Incorrect value for $EESSI_ACCELERATOR_TARGET: " .. eessi_accelerator_target) + end + end +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 = os.getenv("EESSI_SITE_SOFTWARE_PATH") +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")) + +-- Make sure to use the general umask that allows a global read +setenv ("EASYBUILD_UMASK", "022") + +-- Allow this module to be loaded when running EasyBuild +setenv ("EASYBUILD_ALLOW_LOADED_MODULES", "EasyBuild,EESSI-extend") + +-- Set environment variables if building for CUDA compute capabilities +if (easybuild_cuda_compute_capabilities ~= nil) then + setenv ("EASYBUILD_CUDA_COMPUTE_CAPABILITIES", easybuild_cuda_compute_capabilities) +end + +-- 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", "077") + 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") + setenv ("EASYBUILD_UMASK", "002") + -- configure MODULEPATH + prepend_path("MODULEPATH", project_modulepath) +end +-- Make sure EasyBuild itself is loaded +if not ( isloaded("EasyBuild") ) then + load(latest("EasyBuild")) +end +""" + +moduleclass = 'devel' From 251a396b2921a81b5f1b667e2b41affa23addfa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Tue, 3 Dec 2024 20:54:02 +0100 Subject: [PATCH 07/31] use renamed easyconfig for EESSI-extend --- load_eessi_extend_module.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/load_eessi_extend_module.sh b/load_eessi_extend_module.sh index 62b6e3f3ae..aa8f659ef1 100755 --- a/load_eessi_extend_module.sh +++ b/load_eessi_extend_module.sh @@ -93,7 +93,7 @@ else fail_msg="Installing EESSI-extend/${EESSI_EXTEND_VERSION} failed, that's not good... (output: ${eb_install_out})" # while always adding --try-amend=keep... may do no harm, we could make # an attempt to figure out if it is needed, e.g., when we are rebuilding - ${EB} "EESSI-extend-${EESSI_EXTEND_VERSION}.eb" --try-amend=keeppreviousinstall=True 2>&1 | tee ${eb_install_out} + ${EB} "EESSI-extend-easybuild.eb" --try-amend=keeppreviousinstall=True 2>&1 | tee ${eb_install_out} check_exit_code $? "${ok_msg}" "${fail_msg}" ) From cebc099bf3779001b69bec9855753a8a2708a8c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Tue, 3 Dec 2024 20:54:21 +0100 Subject: [PATCH 08/31] use renamed easyconfig for EESSI-extend --- .../20240402/eessi-20240402-eb-4.9.4-001-system.eb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easystacks/riscv.eessi.io/20240402/eessi-20240402-eb-4.9.4-001-system.eb b/easystacks/riscv.eessi.io/20240402/eessi-20240402-eb-4.9.4-001-system.eb index 48974f11b0..4bdc216f91 100644 --- a/easystacks/riscv.eessi.io/20240402/eessi-20240402-eb-4.9.4-001-system.eb +++ b/easystacks/riscv.eessi.io/20240402/eessi-20240402-eb-4.9.4-001-system.eb @@ -1,2 +1,2 @@ easyconfigs: - - EESSI-extend-2023.06-easybuild.eb + - EESSI-extend-easybuild.eb From 920f5fc378c82b4d7477c046363017cced0d1c83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Tue, 3 Dec 2024 22:38:03 +0100 Subject: [PATCH 09/31] add riscv64 to local_arch_specific_deps_to_filter --- EESSI-extend-easybuild.eb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EESSI-extend-easybuild.eb b/EESSI-extend-easybuild.eb index 21b62461bf..762d5f9356 100644 --- a/EESSI-extend-easybuild.eb +++ b/EESSI-extend-easybuild.eb @@ -41,7 +41,7 @@ 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_arch_specific_deps_to_filter = {'aarch64': ',yasm', 'x86_64': '', 'riscv64': ''} local_deps_to_filter += local_arch_specific_deps_to_filter[ARCH] # Set the universal EasyBuild variables From 6433728ed087a2f1f2be52197b8540c692fd7ed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Tue, 3 Dec 2024 22:38:34 +0100 Subject: [PATCH 10/31] renamed, remove version from filename --- EESSI-extend-2023.06-easybuild.eb | 189 ------------------------------ 1 file changed, 189 deletions(-) delete mode 100644 EESSI-extend-2023.06-easybuild.eb diff --git a/EESSI-extend-2023.06-easybuild.eb b/EESSI-extend-2023.06-easybuild.eb deleted file mode 100644 index 21b62461bf..0000000000 --- a/EESSI-extend-2023.06-easybuild.eb +++ /dev/null @@ -1,189 +0,0 @@ -easyblock = 'Bundle' - -name = 'EESSI-extend' -import os -version = os.getenv('EESSI_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 - 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") - eessi_accelerator_target = os.getenv("EESSI_ACCELERATOR_TARGET") - if (eessi_accelerator_target ~= nil) then - cuda_compute_capability = string.match(eessi_accelerator_target, "^nvidia/cc([0-9][0-9])$") - if (cuda_compute_capability ~= nil) then - easybuild_installpath = pathJoin(easybuild_installpath, 'accel', eessi_accelerator_target) - easybuild_cuda_compute_capabilities = cuda_compute_capability:sub(1, 1) .. "." .. cuda_compute_capability:sub(2, 2) - else - LmodError("Incorrect value for $EESSI_ACCELERATOR_TARGET: " .. eessi_accelerator_target) - end - end -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 = os.getenv("EESSI_SITE_SOFTWARE_PATH") -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")) - --- Make sure to use the general umask that allows a global read -setenv ("EASYBUILD_UMASK", "022") - --- Allow this module to be loaded when running EasyBuild -setenv ("EASYBUILD_ALLOW_LOADED_MODULES", "EasyBuild,EESSI-extend") - --- Set environment variables if building for CUDA compute capabilities -if (easybuild_cuda_compute_capabilities ~= nil) then - setenv ("EASYBUILD_CUDA_COMPUTE_CAPABILITIES", easybuild_cuda_compute_capabilities) -end - --- 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", "077") - 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") - setenv ("EASYBUILD_UMASK", "002") - -- configure MODULEPATH - prepend_path("MODULEPATH", project_modulepath) -end --- Make sure EasyBuild itself is loaded -if not ( isloaded("EasyBuild") ) then - load(latest("EasyBuild")) -end -""" - -moduleclass = 'devel' From 345299380bea7f69c498f08604b2faeeebd61c79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Wed, 4 Dec 2024 12:36:17 +0100 Subject: [PATCH 11/31] use JOB_STORAGE as parent dir for SINGULARITY_TMPDIR --- bot/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/build.sh b/bot/build.sh index 81b3ef4660..fe247b8a7a 100755 --- a/bot/build.sh +++ b/bot/build.sh @@ -110,7 +110,7 @@ echo "bot/build.sh: LOAD_MODULES='${LOAD_MODULES}'" # singularity/apptainer settings: CONTAINER, HOME, TMPDIR, BIND CONTAINER=$(cfg_get_value "repository" "container") export SINGULARITY_HOME="${PWD}:/eessi_bot_job" -export SINGULARITY_TMPDIR="${PWD}/singularity_tmpdir" +export SINGULARITY_TMPDIR="${JOB_STORAGE}/singularity_tmpdir" mkdir -p ${SINGULARITY_TMPDIR} # load modules if LOAD_MODULES is not empty From 9c32981037e99940735e36d28cf04697413de1fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Wed, 4 Dec 2024 13:28:37 +0100 Subject: [PATCH 12/31] use JOB_STORAGE as parent dir for SINGULARITY_TMPDIR --- bot/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/test.sh b/bot/test.sh index d3f3630ea8..820618b477 100755 --- a/bot/test.sh +++ b/bot/test.sh @@ -130,7 +130,7 @@ echo "bot/test.sh: LOAD_MODULES='${LOAD_MODULES}'" # singularity/apptainer settings: CONTAINER, HOME, TMPDIR, BIND CONTAINER=$(cfg_get_value "repository" "container") export SINGULARITY_HOME="${PWD}:/eessi_bot_job" -export SINGULARITY_TMPDIR="${PWD}/singularity_tmpdir" +export SINGULARITY_TMPDIR="${JOB_STORAGE:-${PWD}}/singularity_tmpdir" mkdir -p ${SINGULARITY_TMPDIR} # load modules if LOAD_MODULES is not empty From 0c5a4dd832f4378b96747c50e00914cecb316244 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Wed, 4 Dec 2024 13:35:19 +0100 Subject: [PATCH 13/31] skip CUDA installation for riscv.eessi.io --- bot/build.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bot/build.sh b/bot/build.sh index fe247b8a7a..278b452e42 100755 --- a/bot/build.sh +++ b/bot/build.sh @@ -173,10 +173,15 @@ COMMON_ARGS+=("--mode" "run") # Also expose software.eessi.io when configured for dev.eessi.io # Need software.eessi.io for the compat layer -if [[ "${REPOSITORY}" == dev.eessi.io ]]; then +if [[ "${REPOSITORY}" == "dev.eessi.io" ]]; then COMMON_ARGS+=("--repository" "software.eessi.io,access=ro") fi +# Skip CUDA installation for riscv.eessi.io +if [[ "${REPOSITORY}" == "riscv.eessi.io" ]]; then + INSTALL_SCRIPT_ARGS+=("--skip-cuda-install") +fi + # make sure to use the same parent dir for storing tarballs of tmp PREVIOUS_TMP_DIR=${PWD}/previous_tmp From 8c260c6c07d23030218f984a510067746934a805 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Thu, 5 Dec 2024 10:48:41 +0100 Subject: [PATCH 14/31] debug --- bot/build.sh | 1 + bot/test.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/bot/build.sh b/bot/build.sh index 278b452e42..c53e3d835c 100755 --- a/bot/build.sh +++ b/bot/build.sh @@ -181,6 +181,7 @@ fi if [[ "${REPOSITORY}" == "riscv.eessi.io" ]]; then INSTALL_SCRIPT_ARGS+=("--skip-cuda-install") fi +echo "DEBUG: repo: ${REPOSITORY}, ${INSTALL_SCRIPTS_ARGS[@]}" # make sure to use the same parent dir for storing tarballs of tmp PREVIOUS_TMP_DIR=${PWD}/previous_tmp diff --git a/bot/test.sh b/bot/test.sh index 820618b477..fb56bbb792 100755 --- a/bot/test.sh +++ b/bot/test.sh @@ -131,6 +131,7 @@ echo "bot/test.sh: LOAD_MODULES='${LOAD_MODULES}'" CONTAINER=$(cfg_get_value "repository" "container") export SINGULARITY_HOME="${PWD}:/eessi_bot_job" export SINGULARITY_TMPDIR="${JOB_STORAGE:-${PWD}}/singularity_tmpdir" +echo "DEBUG: job storage: ${JOB_STORAGE}, sing tmpdir: ${SINGULARITY_TMPDIR}" mkdir -p ${SINGULARITY_TMPDIR} # load modules if LOAD_MODULES is not empty From 9a8d0a8845b0d836d7f5430e198420f4a880b532 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Thu, 5 Dec 2024 11:11:46 +0100 Subject: [PATCH 15/31] dont install cuda for any repo named riscv.eessi.io* --- bot/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/build.sh b/bot/build.sh index c53e3d835c..92b833bcd2 100755 --- a/bot/build.sh +++ b/bot/build.sh @@ -173,12 +173,12 @@ COMMON_ARGS+=("--mode" "run") # Also expose software.eessi.io when configured for dev.eessi.io # Need software.eessi.io for the compat layer -if [[ "${REPOSITORY}" == "dev.eessi.io" ]]; then +if [[ "${REPOSITORY}" == dev.eessi.io ]]; then COMMON_ARGS+=("--repository" "software.eessi.io,access=ro") fi # Skip CUDA installation for riscv.eessi.io -if [[ "${REPOSITORY}" == "riscv.eessi.io" ]]; then +if [[ "${REPOSITORY}" == riscv.eessi.io* ]]; then INSTALL_SCRIPT_ARGS+=("--skip-cuda-install") fi echo "DEBUG: repo: ${REPOSITORY}, ${INSTALL_SCRIPTS_ARGS[@]}" From aa08fc1f93fe5cba3b5b13942938c2f960700f45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Thu, 5 Dec 2024 11:38:57 +0100 Subject: [PATCH 16/31] more debugging output --- bot/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/test.sh b/bot/test.sh index fb56bbb792..0c107636bb 100755 --- a/bot/test.sh +++ b/bot/test.sh @@ -131,7 +131,7 @@ echo "bot/test.sh: LOAD_MODULES='${LOAD_MODULES}'" CONTAINER=$(cfg_get_value "repository" "container") export SINGULARITY_HOME="${PWD}:/eessi_bot_job" export SINGULARITY_TMPDIR="${JOB_STORAGE:-${PWD}}/singularity_tmpdir" -echo "DEBUG: job storage: ${JOB_STORAGE}, sing tmpdir: ${SINGULARITY_TMPDIR}" +echo "DEBUG: storage: ${STORAGE}, job storage: ${JOB_STORAGE}, tmpdir: ${TMPDIR}, sing tmpdir: ${SINGULARITY_TMPDIR}, resumedir: ${RESUME_DIR}" mkdir -p ${SINGULARITY_TMPDIR} # load modules if LOAD_MODULES is not empty From dfe7f792f5dfa8ddaa751455007756c4b8e2cec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Thu, 5 Dec 2024 12:02:50 +0100 Subject: [PATCH 17/31] print message when disabling CUDA for RISC-V --- bot/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bot/build.sh b/bot/build.sh index 92b833bcd2..504f197e79 100755 --- a/bot/build.sh +++ b/bot/build.sh @@ -179,6 +179,7 @@ fi # Skip CUDA installation for riscv.eessi.io if [[ "${REPOSITORY}" == riscv.eessi.io* ]]; then + echo "bot/build.sh: disabling CUDA installation for RISC-V repository ${REPOSITORY}" INSTALL_SCRIPT_ARGS+=("--skip-cuda-install") fi echo "DEBUG: repo: ${REPOSITORY}, ${INSTALL_SCRIPTS_ARGS[@]}" From ebad04b3bc2de2a9e100930083d5daa8b24739e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Thu, 5 Dec 2024 12:51:16 +0100 Subject: [PATCH 18/31] move code block that disables CUDA installation for RISC-V --- bot/build.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bot/build.sh b/bot/build.sh index 504f197e79..fd84b46e83 100755 --- a/bot/build.sh +++ b/bot/build.sh @@ -177,13 +177,6 @@ if [[ "${REPOSITORY}" == dev.eessi.io ]]; then COMMON_ARGS+=("--repository" "software.eessi.io,access=ro") fi -# Skip CUDA installation for riscv.eessi.io -if [[ "${REPOSITORY}" == riscv.eessi.io* ]]; then - echo "bot/build.sh: disabling CUDA installation for RISC-V repository ${REPOSITORY}" - INSTALL_SCRIPT_ARGS+=("--skip-cuda-install") -fi -echo "DEBUG: repo: ${REPOSITORY}, ${INSTALL_SCRIPTS_ARGS[@]}" - # make sure to use the same parent dir for storing tarballs of tmp PREVIOUS_TMP_DIR=${PWD}/previous_tmp @@ -198,6 +191,13 @@ fi [[ ! -z ${BUILD_LOGS_DIR} ]] && INSTALL_SCRIPT_ARGS+=("--build-logs-dir" "${BUILD_LOGS_DIR}") [[ ! -z ${SHARED_FS_PATH} ]] && INSTALL_SCRIPT_ARGS+=("--shared-fs-path" "${SHARED_FS_PATH}") +# Skip CUDA installation for riscv.eessi.io +if [[ "${REPOSITORY}" == riscv.eessi.io* ]]; then + echo "bot/build.sh: disabling CUDA installation for RISC-V repository ${REPOSITORY}" + INSTALL_SCRIPT_ARGS+=("--skip-cuda-install") +fi +echo "DEBUG: repo: ${REPOSITORY}, ${INSTALL_SCRIPTS_ARGS[@]}" + # determine if the removal step has to be run # assume there's only one diff file that corresponds to the PR patch file pr_diff=$(ls [0-9]*.diff | head -1) From de06aab38e8e82d695a4134c71f3bcec34fd2c6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Thu, 5 Dec 2024 13:00:19 +0100 Subject: [PATCH 19/31] reorder code for resuming from a dir/tarball, always create job storage dir --- bot/test.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/bot/test.sh b/bot/test.sh index 0c107636bb..43e94bf158 100755 --- a/bot/test.sh +++ b/bot/test.sh @@ -101,8 +101,14 @@ fi # try to determine tmp directory from build job RESUME_DIR=$(grep 'Using .* as tmp directory' slurm-${SLURM_JOBID}.out | head -1 | awk '{print $2}') - if [[ -z ${RESUME_DIR} ]]; then + RESUME_TGZ=${PWD}/previous_tmp/build_step/$(ls previous_tmp/build_step) + if [[ -z ${RESUME_TGZ} ]]; then + echo "bot/test.sh: no information about tmp directory and tarball of build step; --> giving up" + exit 2 + fi +fi + echo -n "setting \$STORAGE by replacing any var in '${LOCAL_TMP}' -> " # replace any env variable in ${LOCAL_TMP} with its # current value (e.g., a value that is local to the job) @@ -116,13 +122,6 @@ if [[ -z ${RESUME_DIR} ]]; then JOB_STORAGE=$(mktemp --directory --tmpdir=${STORAGE} bot_job_tmp_XXX) echo "bot/test.sh: created unique base tmp storage directory at ${JOB_STORAGE}" - RESUME_TGZ=${PWD}/previous_tmp/build_step/$(ls previous_tmp/build_step) - if [[ -z ${RESUME_TGZ} ]]; then - echo "bot/test.sh: no information about tmp directory and tarball of build step; --> giving up" - exit 2 - fi -fi - # obtain list of modules to be loaded LOAD_MODULES=$(cfg_get_value "site_config" "load_modules") echo "bot/test.sh: LOAD_MODULES='${LOAD_MODULES}'" From 851fdaed7060ad06e3d3c94998000a7d18f802f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Thu, 5 Dec 2024 13:23:30 +0100 Subject: [PATCH 20/31] fix typo in debug message --- bot/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/build.sh b/bot/build.sh index fd84b46e83..8cb2fae239 100755 --- a/bot/build.sh +++ b/bot/build.sh @@ -196,7 +196,7 @@ if [[ "${REPOSITORY}" == riscv.eessi.io* ]]; then echo "bot/build.sh: disabling CUDA installation for RISC-V repository ${REPOSITORY}" INSTALL_SCRIPT_ARGS+=("--skip-cuda-install") fi -echo "DEBUG: repo: ${REPOSITORY}, ${INSTALL_SCRIPTS_ARGS[@]}" +echo "DEBUG: repo: ${REPOSITORY}, ${INSTALL_SCRIPT_ARGS[@]}" # determine if the removal step has to be run # assume there's only one diff file that corresponds to the PR patch file From b602e42d3dee9161866f8f9f0b5b26575f0f37f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Thu, 5 Dec 2024 14:14:19 +0100 Subject: [PATCH 21/31] use variables for repository id and name, and use the appropriate ones throughout the script --- bot/build.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/bot/build.sh b/bot/build.sh index 8cb2fae239..2930ad947b 100755 --- a/bot/build.sh +++ b/bot/build.sh @@ -125,7 +125,9 @@ else fi # determine repository to be used from entry .repository in ${JOB_CFG_FILE} -REPOSITORY=$(cfg_get_value "repository" "repo_id") +REPOSITORY_ID=$(cfg_get_value "repository" "repo_id") +REPOSITORY_NAME=$(cfg_get_value "repository" "repo_name") +REPOSITORY_VERSION=$(cfg_get_value "repository" "repo_version") EESSI_REPOS_CFG_DIR_OVERRIDE=$(cfg_get_value "repository" "repos_cfg_dir") export EESSI_REPOS_CFG_DIR_OVERRIDE=${EESSI_REPOS_CFG_DIR_OVERRIDE:-${PWD}/cfg} echo "bot/build.sh: EESSI_REPOS_CFG_DIR_OVERRIDE='${EESSI_REPOS_CFG_DIR_OVERRIDE}'" @@ -134,13 +136,13 @@ echo "bot/build.sh: EESSI_REPOS_CFG_DIR_OVERRIDE='${EESSI_REPOS_CFG_DIR_OVERRIDE # here, just set & export EESSI_VERSION_OVERRIDE # next script (eessi_container.sh) makes use of it via sourcing init scripts # (e.g., init/eessi_defaults or init/minimal_eessi_env) -export EESSI_VERSION_OVERRIDE=$(cfg_get_value "repository" "repo_version") +export EESSI_VERSION_OVERRIDE=${REPOSITORY_VERSION} echo "bot/build.sh: EESSI_VERSION_OVERRIDE='${EESSI_VERSION_OVERRIDE}'" # determine CVMFS repo to be used from .repository.repo_name in ${JOB_CFG_FILE} # here, just set EESSI_CVMFS_REPO_OVERRIDE, a bit further down # "source init/eessi_defaults" via sourcing init/minimal_eessi_env -export EESSI_CVMFS_REPO_OVERRIDE=/cvmfs/$(cfg_get_value "repository" "repo_name") +export EESSI_CVMFS_REPO_OVERRIDE=/cvmfs/${REPOSITORY_NAME} echo "bot/build.sh: EESSI_CVMFS_REPO_OVERRIDE='${EESSI_CVMFS_REPO_OVERRIDE}'" # determine CPU architecture to be used from entry .architecture in ${JOB_CFG_FILE} @@ -169,11 +171,11 @@ COMMON_ARGS+=("--mode" "run") [[ ! -z ${CONTAINER} ]] && COMMON_ARGS+=("--container" "${CONTAINER}") [[ ! -z ${HTTP_PROXY} ]] && COMMON_ARGS+=("--http-proxy" "${HTTP_PROXY}") [[ ! -z ${HTTPS_PROXY} ]] && COMMON_ARGS+=("--https-proxy" "${HTTPS_PROXY}") -[[ ! -z ${REPOSITORY} ]] && COMMON_ARGS+=("--repository" "${REPOSITORY}") +[[ ! -z ${REPOSITORY_ID} ]] && COMMON_ARGS+=("--repository" "${REPOSITORY_ID}") # Also expose software.eessi.io when configured for dev.eessi.io # Need software.eessi.io for the compat layer -if [[ "${REPOSITORY}" == dev.eessi.io ]]; then +if [[ "${REPOSITORY_NAME}" == "dev.eessi.io" ]]; then COMMON_ARGS+=("--repository" "software.eessi.io,access=ro") fi @@ -192,11 +194,11 @@ fi [[ ! -z ${SHARED_FS_PATH} ]] && INSTALL_SCRIPT_ARGS+=("--shared-fs-path" "${SHARED_FS_PATH}") # Skip CUDA installation for riscv.eessi.io -if [[ "${REPOSITORY}" == riscv.eessi.io* ]]; then - echo "bot/build.sh: disabling CUDA installation for RISC-V repository ${REPOSITORY}" +if [[ "${REPOSITORY_NAME}" == "riscv.eessi.io" ]]; then + echo "bot/build.sh: disabling CUDA installation for RISC-V repository ${REPOSITORY_NAME}" INSTALL_SCRIPT_ARGS+=("--skip-cuda-install") fi -echo "DEBUG: repo: ${REPOSITORY}, ${INSTALL_SCRIPT_ARGS[@]}" +echo "DEBUG: repo: ${REPOSITORY_NAME}, ${INSTALL_SCRIPT_ARGS[@]}" # determine if the removal step has to be run # assume there's only one diff file that corresponds to the PR patch file From 9ea2830399c0e4137a070efd576a43972a2dcf0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Sat, 7 Dec 2024 14:48:27 +0100 Subject: [PATCH 22/31] readd blank line --- bot/test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bot/test.sh b/bot/test.sh index f0d111571e..2e2c838dfa 100755 --- a/bot/test.sh +++ b/bot/test.sh @@ -101,6 +101,7 @@ fi # try to determine tmp directory from build job RESUME_DIR=$(grep 'Using .* as tmp directory' slurm-${SLURM_JOBID}.out | head -1 | awk '{print $2}') + if [[ -z ${RESUME_DIR} ]]; then RESUME_TGZ=${PWD}/previous_tmp/build_step/$(ls previous_tmp/build_step) if [[ -z ${RESUME_TGZ} ]]; then From 02f1e1ba503455199c8ef626c3aa089f2827e27a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Sat, 7 Dec 2024 14:48:55 +0100 Subject: [PATCH 23/31] remove redundant line --- init/lmod/bash | 1 - 1 file changed, 1 deletion(-) diff --git a/init/lmod/bash b/init/lmod/bash index afc55fe4d5..b2db9a8802 100644 --- a/init/lmod/bash +++ b/init/lmod/bash @@ -1,7 +1,6 @@ # Choose an EESSI CVMFS repository EESSI_CVMFS_REPO="${EESSI_CVMFS_REPO:-/cvmfs/software.eessi.io}" # Choose an EESSI version -EESSI_CVMFS_REPO="${EESSI_CVMFS_REPO:-/cvmfs/software.eessi.io}" EESSI_VERSION="${EESSI_VERSION:-2023.06}" # Path to top-level module tree export MODULEPATH="${EESSI_CVMFS_REPO}/versions/${EESSI_VERSION}/init/modules" From e845c68e9d83ff56f1063102f43160dc179b97ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Mon, 9 Dec 2024 15:21:28 +0100 Subject: [PATCH 24/31] remove RISC-V module file --- init/modules/EESSI/20240402.lua | 157 -------------------------------- 1 file changed, 157 deletions(-) delete mode 100644 init/modules/EESSI/20240402.lua diff --git a/init/modules/EESSI/20240402.lua b/init/modules/EESSI/20240402.lua deleted file mode 100644 index 8a5b8d8d81..0000000000 --- a/init/modules/EESSI/20240402.lua +++ /dev/null @@ -1,157 +0,0 @@ -help([[ -Description -=========== -The European Environment for Scientific Software Installations (EESSI, pronounced as easy) is a collaboration between different European partners in HPC community.The goal of this project is to build a common stack of scientific software installations for HPC systems and beyond, including laptops, personal workstations and cloud infrastructure. - -More information -================ - - URL: https://www.eessi.io/docs/ -]]) -whatis("Description: The European Environment for Scientific Software Installations (EESSI, pronounced as easy) is a collaboration between different European partners in HPC community. The goal of this project is to build a common stack of scientific software installations for HPC systems and beyond, including laptops, personal workstations and cloud infrastructure.") -whatis("URL: https://www.eessi.io/docs/") -conflict("EESSI") -local eessi_version = myModuleVersion() -local eessi_repo = "/cvmfs/riscv.eessi.io" -local eessi_prefix = pathJoin(eessi_repo, "versions", eessi_version) -local eessi_os_type = "linux" -setenv("EESSI_VERSION", eessi_version) -setenv("EESSI_CVMFS_REPO", eessi_repo) -setenv("EESSI_OS_TYPE", eessi_os_type) -function eessiDebug(text) - if (mode() == "load" and os.getenv("EESSI_DEBUG_INIT")) then - LmodMessage(text) - end -end -function archdetect_cpu() - local script = pathJoin(eessi_prefix, 'init', 'lmod_eessi_archdetect_wrapper.sh') - -- make sure that we grab the value for architecture before the module unsets the environment variable (in unload mode) - local archdetect_options = os.getenv("EESSI_ARCHDETECT_OPTIONS") or (os.getenv("EESSI_ARCHDETECT_OPTIONS_OVERRIDE") or "") - if not os.getenv("EESSI_ARCHDETECT_OPTIONS_OVERRIDE") then - if convertToCanonical(LmodVersion()) < convertToCanonical("8.6") then - LmodError("Loading this modulefile requires using Lmod version >= 8.6, but you can export EESSI_ARCHDETECT_OPTIONS_OVERRIDE to the available cpu architecture in the form of: x86_64/intel/haswell:x86_64/generic or aarch64/neoverse_v1:aarch64/generic") - end - source_sh("bash", script) - end - -- EESSI_ARCHDETECT_OPTIONS is set by the script (_if_ it was called) - archdetect_options = os.getenv("EESSI_ARCHDETECT_OPTIONS") or archdetect_options - if archdetect_options then - eessiDebug("Got archdetect CPU options: " .. archdetect_options) - -- archdetect_options is a colon-separated list of CPU architectures that are compatible with - -- the host CPU and ordered from most specific to least specific, e.g., - -- x86_64/intel/skylake_avx512:x86_64/intel/haswell:x86_64/generic - -- We loop over the list, and return the highest matching arch for which a directory exists for this EESSI version - for archdetect_filter_cpu in string.gmatch(archdetect_options, "([^" .. ":" .. "]+)") do - if isDir(pathJoin(eessi_prefix, "software", eessi_os_type, archdetect_filter_cpu, "software")) then - -- use x86_64/amd/zen3 for now when AMD Genoa (Zen4) CPU is detected, - -- since optimized software installations for Zen4 are a work-in-progress, - -- see https://gitlab.com/eessi/support/-/issues/37 - if (archdetect_filter_cpu == "x86_64/amd/zen4" and not os.getenv("EESSI_SOFTWARE_SUBDIR_OVERRIDE") == "x86_64/amd/zen4") then - archdetect_filter_cpu = "x86_64/amd/zen3" - if mode() == "load" then - LmodMessage("Sticking to " .. archdetect_filter_cpu .. " for now, since optimized installations for AMD Genoa (Zen4) are a work in progress.") - end - end - eessiDebug("Selected archdetect CPU: " .. archdetect_filter_cpu) - return archdetect_filter_cpu - end - end - LmodError("Software directory check for the detected architecture failed") - else - -- Still need to return something - return nil - end -end -function archdetect_accel() - local script = pathJoin(eessi_prefix, 'init', 'lmod_eessi_archdetect_wrapper_accel.sh') - -- for unload mode, we need to grab the value before it is unset - local archdetect_accel = os.getenv("EESSI_ACCEL_SUBDIR") or (os.getenv("EESSI_ACCELERATOR_TARGET_OVERRIDE") or "") - if not os.getenv("EESSI_ACCELERATOR_TARGET_OVERRIDE ") then - if convertToCanonical(LmodVersion()) < convertToCanonical("8.6") then - LmodError("Loading this modulefile requires using Lmod version >= 8.6, but you can export EESSI_ACCELERATOR_TARGET_OVERRIDE to the available accelerator architecture in the form of: accel/nvidia/cc80") - end - source_sh("bash", script) - end - archdetect_accel = os.getenv("EESSI_ACCEL_SUBDIR") or archdetect_accel - eessiDebug("Got archdetect accel option: " .. archdetect_accel) - return archdetect_accel -end --- archdetect finds the best compatible architecture, e.g., x86_64/amd/zen3 -local archdetect = archdetect_cpu() --- archdetect_accel() attempts to identify an accelerator, e.g., accel/nvidia/cc80 -local archdetect_accel = archdetect_accel() --- eessi_cpu_family is derived from the archdetect match, e.g., x86_64 -local eessi_cpu_family = archdetect:match("([^/]+)") -local eessi_software_subdir = archdetect --- eessi_eprefix is the base location of the compat layer, e.g., /cvmfs/software.eessi.io/versions/2023.06/compat/linux/x86_64 -local eessi_eprefix = pathJoin(eessi_prefix, "compat", eessi_os_type, eessi_cpu_family) --- eessi_software_path is the location of the software installations, e.g., --- /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/amd/zen3 -local eessi_software_path = pathJoin(eessi_prefix, "software", eessi_os_type, eessi_software_subdir) -local eessi_modules_subdir = pathJoin("modules", "all") --- eessi_module_path is the location of the _CPU_ module files, e.g., --- /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/amd/zen3/modules/all -local eessi_module_path = pathJoin(eessi_software_path, eessi_modules_subdir) -local eessi_site_software_path = string.gsub(eessi_software_path, "versions", "host_injections") --- Site module path is the same as the EESSI one, but with `versions` changed to `host_injections`, e.g., --- /cvmfs/software.eessi.io/host_injections/2023.06/software/linux/x86_64/amd/zen3/modules/all -local eessi_site_module_path = pathJoin(eessi_site_software_path, eessi_modules_subdir) -setenv("EPREFIX", eessi_eprefix) -eessiDebug("Setting EPREFIX to " .. eessi_eprefix) -setenv("EESSI_CPU_FAMILY", eessi_cpu_family) -eessiDebug("Setting EESSI_CPU_FAMILY to " .. eessi_cpu_family) -setenv("EESSI_SITE_SOFTWARE_PATH", eessi_site_software_path) -eessiDebug("Setting EESSI_SITE_SOFTWARE_PATH to " .. eessi_site_software_path) -setenv("EESSI_SITE_MODULEPATH", eessi_site_module_path) -eessiDebug("Setting EESSI_SITE_MODULEPATH to " .. eessi_site_module_path) -setenv("EESSI_SOFTWARE_SUBDIR", eessi_software_subdir) -eessiDebug("Setting EESSI_SOFTWARE_SUBDIR to " .. eessi_software_subdir) -setenv("EESSI_PREFIX", eessi_prefix) -eessiDebug("Setting EESSI_PREFIX to " .. eessi_prefix) -setenv("EESSI_EPREFIX", eessi_eprefix) -eessiDebug("Setting EPREFIX to " .. eessi_eprefix) -prepend_path("PATH", pathJoin(eessi_eprefix, "bin")) -eessiDebug("Adding " .. pathJoin(eessi_eprefix, "bin") .. " to PATH") -prepend_path("PATH", pathJoin(eessi_eprefix, "usr", "bin")) -eessiDebug("Adding " .. pathJoin(eessi_eprefix, "usr", "bin") .. " to PATH") -setenv("EESSI_SOFTWARE_PATH", eessi_software_path) -eessiDebug("Setting EESSI_SOFTWARE_PATH to " .. eessi_software_path) -setenv("EESSI_MODULEPATH", eessi_module_path) -eessiDebug("Setting EESSI_MODULEPATH to " .. eessi_module_path) --- We ship our spider cache, so this location does not need to be spider-ed -if ( mode() ~= "spider" ) then - prepend_path("MODULEPATH", eessi_module_path) - eessiDebug("Adding " .. eessi_module_path .. " to MODULEPATH") -end -prepend_path("LMOD_RC", pathJoin(eessi_software_path, ".lmod", "lmodrc.lua")) -eessiDebug("Adding " .. pathJoin(eessi_software_path, ".lmod", "lmodrc.lua") .. " to LMOD_RC") --- Use pushenv for LMOD_PACKAGE_PATH as this may be set locally by the site -pushenv("LMOD_PACKAGE_PATH", pathJoin(eessi_software_path, ".lmod")) -eessiDebug("Setting LMOD_PACKAGE_PATH to " .. pathJoin(eessi_software_path, ".lmod")) - --- the accelerator may have an empty value and we need to give some flexibility --- * construct the path we expect to find --- * then check it exists --- * then update the modulepath -if not (archdetect_accel == nil or archdetect_accel == '') then - -- The CPU subdirectory of the accelerator installations is _usually_ the same as host CPU, but this can be overridden - eessi_accel_software_subdir = os.getenv("EESSI_ACCEL_SOFTWARE_SUBDIR_OVERRIDE") or eessi_software_subdir - -- CPU location of the accelerator installations, e.g., - -- /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/amd/zen3 - eessi_accel_software_path = pathJoin(eessi_prefix, "software", eessi_os_type, eessi_accel_software_subdir) - -- location of the accelerator modules, e.g., - -- /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/amd/zen3/accel/nvidia/cc80/modules/all - eessi_module_path_accel = pathJoin(eessi_accel_software_path, archdetect_accel, eessi_modules_subdir) - eessiDebug("Checking if " .. eessi_module_path_accel .. " exists") - if isDir(eessi_module_path_accel) then - setenv("EESSI_MODULEPATH_ACCEL", eessi_module_path_accel) - prepend_path("MODULEPATH", eessi_module_path_accel) - eessiDebug("Using acclerator modules at: " .. eessi_module_path_accel) - end -end - --- prepend the site module path last so it has priority -prepend_path("MODULEPATH", eessi_site_module_path) -eessiDebug("Adding " .. eessi_site_module_path .. " to MODULEPATH") -if mode() == "load" then - LmodMessage("EESSI/" .. eessi_version .. " loaded successfully") -end From fd0707298e5a8c06a399a76acc2dcec965374177 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Mon, 9 Dec 2024 15:37:48 +0100 Subject: [PATCH 25/31] stick to init/bash for risc-v --- EESSI-install-software.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/EESSI-install-software.sh b/EESSI-install-software.sh index 83c06c2184..0cfc1020e7 100755 --- a/EESSI-install-software.sh +++ b/EESSI-install-software.sh @@ -171,8 +171,13 @@ module --force purge module unuse $MODULEPATH # Initialize the EESSI environment -module use $TOPDIR/init/modules -module load EESSI/$EESSI_VERSION +if [[ ${EESSI_CVMFS_REPO} == "/cvmfs/riscv.eessi.io" ]]; then + # For the RISC-V repository we don't have a module file, so stick to the bash init script + source $TOPDIR/init/bash +else + module use $TOPDIR/init/modules + module load EESSI/$EESSI_VERSION +fi # make sure we're in Prefix environment by checking $SHELL # We can only do this after loading the EESSI module, as we need ${EPREFIX} From 1106fad54333762aa3c066293979ac4a95be1f99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Mon, 9 Dec 2024 16:06:06 +0100 Subject: [PATCH 26/31] comment RISC-V init, try another approach with the module file --- EESSI-install-software.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/EESSI-install-software.sh b/EESSI-install-software.sh index 0cfc1020e7..cbe8d98b01 100755 --- a/EESSI-install-software.sh +++ b/EESSI-install-software.sh @@ -171,13 +171,13 @@ module --force purge module unuse $MODULEPATH # Initialize the EESSI environment -if [[ ${EESSI_CVMFS_REPO} == "/cvmfs/riscv.eessi.io" ]]; then - # For the RISC-V repository we don't have a module file, so stick to the bash init script - source $TOPDIR/init/bash -else +#if [[ ${EESSI_CVMFS_REPO} == "/cvmfs/riscv.eessi.io" ]]; then +# # For the RISC-V repository we don't have a module file, so stick to the bash init script +# source $TOPDIR/init/bash +#else module use $TOPDIR/init/modules module load EESSI/$EESSI_VERSION -fi +#fi # make sure we're in Prefix environment by checking $SHELL # We can only do this after loading the EESSI module, as we need ${EPREFIX} From 061d4f0c9691daaa1c440ad24ea343c49a079f90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Mon, 9 Dec 2024 16:06:18 +0100 Subject: [PATCH 27/31] switch to RISC-V dev repo for RISC-V clients --- init/modules/EESSI/2023.06.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/init/modules/EESSI/2023.06.lua b/init/modules/EESSI/2023.06.lua index 348699c0f1..78f65f6b43 100644 --- a/init/modules/EESSI/2023.06.lua +++ b/init/modules/EESSI/2023.06.lua @@ -12,6 +12,13 @@ whatis("URL: https://www.eessi.io/docs/") conflict("EESSI") local eessi_version = myModuleVersion() local eessi_repo = "/cvmfs/software.eessi.io" +if (capture("uname -m"):gsub("\n$","") == "x86_64") then + eessi_version = "20240402" + eessi_repo = "/cvmfs/riscv.eessi.io" + LmodMessage("RISC-V architecture detected, but there is no RISC-V support yet in the production repository.\n" .. + "Automatically switching to version " .. eessi_version .. " of the RISC-V development repository " .. eessi_repo .. ".\n" .. + "For more details about this repository, see https://www.eessi.io/docs/repositories/riscv.eessi.io/.") +end local eessi_prefix = pathJoin(eessi_repo, "versions", eessi_version) local eessi_os_type = "linux" setenv("EESSI_VERSION", eessi_version) From 2b853ff08cb328f7c0055ac45023cece060a6aaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Mon, 9 Dec 2024 16:07:07 +0100 Subject: [PATCH 28/31] use correct check in if statement --- init/modules/EESSI/2023.06.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init/modules/EESSI/2023.06.lua b/init/modules/EESSI/2023.06.lua index 78f65f6b43..eefbd370d7 100644 --- a/init/modules/EESSI/2023.06.lua +++ b/init/modules/EESSI/2023.06.lua @@ -12,7 +12,7 @@ whatis("URL: https://www.eessi.io/docs/") conflict("EESSI") local eessi_version = myModuleVersion() local eessi_repo = "/cvmfs/software.eessi.io" -if (capture("uname -m"):gsub("\n$","") == "x86_64") then +if (capture("uname -m"):gsub("\n$","") == "riscv64") then eessi_version = "20240402" eessi_repo = "/cvmfs/riscv.eessi.io" LmodMessage("RISC-V architecture detected, but there is no RISC-V support yet in the production repository.\n" .. From 53c8409e661dee7d735a7761bdc43eacb14106c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Mon, 9 Dec 2024 16:16:39 +0100 Subject: [PATCH 29/31] symlink 20240402 to 2023.06 --- init/modules/EESSI/20240402.lua | 1 + 1 file changed, 1 insertion(+) create mode 120000 init/modules/EESSI/20240402.lua diff --git a/init/modules/EESSI/20240402.lua b/init/modules/EESSI/20240402.lua new file mode 120000 index 0000000000..cbf80d1fcd --- /dev/null +++ b/init/modules/EESSI/20240402.lua @@ -0,0 +1 @@ +2023.06.lua \ No newline at end of file From 9f22039142dd2154550b988623839273a0496ccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Mon, 9 Dec 2024 17:02:55 +0100 Subject: [PATCH 30/31] use EESSI_VERSION_OVERRIDE to detect RISC-V repo version, fallback to 20240402 --- init/modules/EESSI/2023.06.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init/modules/EESSI/2023.06.lua b/init/modules/EESSI/2023.06.lua index eefbd370d7..04268f30e1 100644 --- a/init/modules/EESSI/2023.06.lua +++ b/init/modules/EESSI/2023.06.lua @@ -13,7 +13,7 @@ conflict("EESSI") local eessi_version = myModuleVersion() local eessi_repo = "/cvmfs/software.eessi.io" if (capture("uname -m"):gsub("\n$","") == "riscv64") then - eessi_version = "20240402" + eessi_version = os.getenv("EESSI_VERSION_OVERRIDE") or "20240402" eessi_repo = "/cvmfs/riscv.eessi.io" LmodMessage("RISC-V architecture detected, but there is no RISC-V support yet in the production repository.\n" .. "Automatically switching to version " .. eessi_version .. " of the RISC-V development repository " .. eessi_repo .. ".\n" .. From 0cafae892d11df9f896c8770c656375fc9f87d5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Tue, 10 Dec 2024 09:56:58 +0100 Subject: [PATCH 31/31] subprocess instead of capture --- init/modules/EESSI/2023.06.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init/modules/EESSI/2023.06.lua b/init/modules/EESSI/2023.06.lua index 04268f30e1..eb1cd1753b 100644 --- a/init/modules/EESSI/2023.06.lua +++ b/init/modules/EESSI/2023.06.lua @@ -12,7 +12,7 @@ whatis("URL: https://www.eessi.io/docs/") conflict("EESSI") local eessi_version = myModuleVersion() local eessi_repo = "/cvmfs/software.eessi.io" -if (capture("uname -m"):gsub("\n$","") == "riscv64") then +if (subprocess("uname -m"):gsub("\n$","") == "riscv64") then eessi_version = os.getenv("EESSI_VERSION_OVERRIDE") or "20240402" eessi_repo = "/cvmfs/riscv.eessi.io" LmodMessage("RISC-V architecture detected, but there is no RISC-V support yet in the production repository.\n" ..