From c01fec185d37eb22e2d2f66fdc4e1c9ae681213e Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Thu, 21 May 2026 15:57:18 +0200 Subject: [PATCH 1/6] Add check for the existence of the EESSI_SITE_SOFTWARE_PATH. This is needed if we make this location configurable thourhg EESSI_SITE_SOFTWARE_PREFIX as is done in https://github.com/EESSI/software-layer-scripts/pull/232 --- EESSI-extend-easybuild.eb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/EESSI-extend-easybuild.eb b/EESSI-extend-easybuild.eb index 4658d2a8..1463144f 100644 --- a/EESSI-extend-easybuild.eb +++ b/EESSI-extend-easybuild.eb @@ -143,9 +143,17 @@ elseif eessi_site_install 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") - -- enforce accelerator subdirectory usage for site installs (only if an accelerator install is requested) + -- Check that the plain EESSI_SITE_SOFTWARE_PATH exists + if not isDir(easybuild_installpath) then + LmodError("The location of EESSI_SITE_SOFTWARE_PATH (" .. easybuild_installdir .. ") does not exist or is not a folder") + end + -- enforce accelerator subdirectory usage for site installs (only if an accelerator install is requested) if (eessi_accelerator_target ~= nil) and (cuda_compute_capability ~= nil) and (os.getenv("EESSI_ACCELERATOR_INSTALL") ~= nil) then easybuild_installpath = pathJoin(easybuild_installpath, eessi_accelerator_target) + -- Check that the EESSI_SITE_SOFTWARE_PATH with eessi_accelerator_target prefix exists + if not isDir(easybuild_installpath) then + LmodError("The easybuild install directory (" .. easybuild_installdir ..") does not exist or is not a folder") + end end else -- Deal with user and project installs From 85977e393015aedaf0aa6a133e077f9758c35fd2 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Mon, 25 May 2026 10:12:22 +0200 Subject: [PATCH 2/6] Use correct variable name in LmodError --- EESSI-extend-easybuild.eb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EESSI-extend-easybuild.eb b/EESSI-extend-easybuild.eb index 1463144f..01a0d36b 100644 --- a/EESSI-extend-easybuild.eb +++ b/EESSI-extend-easybuild.eb @@ -145,14 +145,14 @@ elseif eessi_site_install then easybuild_installpath = os.getenv("EESSI_SITE_SOFTWARE_PATH") -- Check that the plain EESSI_SITE_SOFTWARE_PATH exists if not isDir(easybuild_installpath) then - LmodError("The location of EESSI_SITE_SOFTWARE_PATH (" .. easybuild_installdir .. ") does not exist or is not a folder") + LmodError("The location of EESSI_SITE_SOFTWARE_PATH (" .. easybuild_installpath .. ") does not exist or is not a folder") end -- enforce accelerator subdirectory usage for site installs (only if an accelerator install is requested) if (eessi_accelerator_target ~= nil) and (cuda_compute_capability ~= nil) and (os.getenv("EESSI_ACCELERATOR_INSTALL") ~= nil) then easybuild_installpath = pathJoin(easybuild_installpath, eessi_accelerator_target) -- Check that the EESSI_SITE_SOFTWARE_PATH with eessi_accelerator_target prefix exists if not isDir(easybuild_installpath) then - LmodError("The easybuild install directory (" .. easybuild_installdir ..") does not exist or is not a folder") + LmodError("The easybuild install directory (" .. easybuild_installpath ..") does not exist or is not a folder") end end else From abb481b28e031220ccac68c18edc00c389a5d994 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen <33718780+casparvl@users.noreply.github.com> Date: Wed, 1 Jul 2026 09:58:20 +0200 Subject: [PATCH 3/6] Apply suggestion from @ocaisa Co-authored-by: ocaisa --- 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 01a0d36b..b5672152 100644 --- a/EESSI-extend-easybuild.eb +++ b/EESSI-extend-easybuild.eb @@ -147,7 +147,7 @@ elseif eessi_site_install then if not isDir(easybuild_installpath) then LmodError("The location of EESSI_SITE_SOFTWARE_PATH (" .. easybuild_installpath .. ") does not exist or is not a folder") end - -- enforce accelerator subdirectory usage for site installs (only if an accelerator install is requested) + -- enforce accelerator subdirectory usage for site installs (only if an accelerator install is requested) if (eessi_accelerator_target ~= nil) and (cuda_compute_capability ~= nil) and (os.getenv("EESSI_ACCELERATOR_INSTALL") ~= nil) then easybuild_installpath = pathJoin(easybuild_installpath, eessi_accelerator_target) -- Check that the EESSI_SITE_SOFTWARE_PATH with eessi_accelerator_target prefix exists From 21e4ae06559b7805481f8493ef14f5328f828fa1 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Thu, 2 Jul 2026 16:49:43 +0200 Subject: [PATCH 4/6] Turn into an LmodWarning. EasyBuild will create it the first time someone installs something anyway --- EESSI-extend-easybuild.eb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EESSI-extend-easybuild.eb b/EESSI-extend-easybuild.eb index 4c2b9eb3..d7d702ff 100644 --- a/EESSI-extend-easybuild.eb +++ b/EESSI-extend-easybuild.eb @@ -145,14 +145,14 @@ elseif eessi_site_install then easybuild_installpath = os.getenv("EESSI_SITE_SOFTWARE_PATH") -- Check that the plain EESSI_SITE_SOFTWARE_PATH exists if not isDir(easybuild_installpath) then - LmodError("The location of EESSI_SITE_SOFTWARE_PATH (" .. easybuild_installpath .. ") does not exist or is not a folder") + LmodWarning("The location of EESSI_SITE_SOFTWARE_PATH (" .. easybuild_installpath .. ") does not exist or is not a directory") end -- Enforce accelerator subdirectory usage for site installs (only if an accelerator install is requested) if (eessi_accelerator_target ~= nil) and (cuda_compute_capability ~= nil) and (os.getenv("EESSI_ACCELERATOR_INSTALL") ~= nil) then easybuild_installpath = pathJoin(easybuild_installpath, eessi_accelerator_target) -- Check that the EESSI_SITE_SOFTWARE_PATH with eessi_accelerator_target prefix exists if not isDir(easybuild_installpath) then - LmodError("The easybuild install directory (" .. easybuild_installpath ..") does not exist or is not a folder") + LmodWarning("The easybuild install directory (" .. easybuild_installpath ..") does not exist or is not a directory") end end else From fd59e50d7851941752c0ca0c4b970fe1c25e5e3c Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen <33718780+casparvl@users.noreply.github.com> Date: Mon, 13 Jul 2026 14:26:47 +0200 Subject: [PATCH 5/6] Apply suggestions from code review Co-authored-by: ocaisa --- EESSI-extend-easybuild.eb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/EESSI-extend-easybuild.eb b/EESSI-extend-easybuild.eb index d7d702ff..c8be0660 100644 --- a/EESSI-extend-easybuild.eb +++ b/EESSI-extend-easybuild.eb @@ -145,14 +145,18 @@ elseif eessi_site_install then easybuild_installpath = os.getenv("EESSI_SITE_SOFTWARE_PATH") -- Check that the plain EESSI_SITE_SOFTWARE_PATH exists if not isDir(easybuild_installpath) then - LmodWarning("The location of EESSI_SITE_SOFTWARE_PATH (" .. easybuild_installpath .. ") does not exist or is not a directory") + installpath_warning = "The location of EESSI_SITE_SOFTWARE_PATH (" .. easybuild_installpath .. ") does not exist or is not a directory. " + installpath_warning = installpath_warning .. "If you have sufficient permissions this location will be created, otherwise you will run into errors." + LmodWarning(installpath_warning) end -- Enforce accelerator subdirectory usage for site installs (only if an accelerator install is requested) if (eessi_accelerator_target ~= nil) and (cuda_compute_capability ~= nil) and (os.getenv("EESSI_ACCELERATOR_INSTALL") ~= nil) then easybuild_installpath = pathJoin(easybuild_installpath, eessi_accelerator_target) -- Check that the EESSI_SITE_SOFTWARE_PATH with eessi_accelerator_target prefix exists if not isDir(easybuild_installpath) then - LmodWarning("The easybuild install directory (" .. easybuild_installpath ..") does not exist or is not a directory") + installpath_warning = "The location of EESSI_SITE_SOFTWARE_PATH (" .. easybuild_installpath .. ") does not exist or is not a directory. " + installpath_warning = installpath_warning .. "If you have sufficient permissions this location will be created, otherwise you will run into errors." + LmodWarning(installpath_warning) end end else From 660cbed89084eee291575639a1f7c42473cbc88b Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Mon, 20 Jul 2026 11:34:36 +0200 Subject: [PATCH 6/6] Add CI to check that EESSI-extend is installed and consistent everywhere --- .../workflows/scripts/diff_eessi_extend.sh | 76 +++++++++++++++++++ .../workflows/tests_eessi_extend_module.yml | 8 +- 2 files changed, 83 insertions(+), 1 deletion(-) create mode 100755 .github/workflows/scripts/diff_eessi_extend.sh diff --git a/.github/workflows/scripts/diff_eessi_extend.sh b/.github/workflows/scripts/diff_eessi_extend.sh new file mode 100755 index 00000000..dd5ba833 --- /dev/null +++ b/.github/workflows/scripts/diff_eessi_extend.sh @@ -0,0 +1,76 @@ +#!/bin/bash +set -euo pipefail + +shopt -s nullglob + +total_failures=0 +failure_summary=() + +compare_group() { + local version="$1" + shift + local files=("$@") + + (( ${#files[@]} > 1 )) || return 0 + + local ref="${files[0]}" + local failures=0 + + # echo + # echo "Reference file: $ref" + + for f in "${files[@]:1}"; do + # echo -e "\tComparing with $f" + + if ! diff \ + <(grep -v '^local root = ' "$ref") \ + <(grep -v '^local root = ' "$f"); then + + failure_summary+=("$version|$ref|$f") + + ((++total_failures)) + fi + done +} + +for version_dir in /cvmfs/software.eessi.io/versions/*; do + version=$(basename "$version_dir") + + x86_64_files=( + "$version_dir"/software/linux/x86_64/*/modules/all/EESSI-extend/"$version"-easybuild.lua + "$version_dir"/software/linux/x86_64/*/*/modules/all/EESSI-extend/"$version"-easybuild.lua + ) + compare_group "$version" "${x86_64_files[@]}" + + aarch64_files=( + "$version_dir"/software/linux/aarch64/*/modules/all/EESSI-extend/"$version"-easybuild.lua + "$version_dir"/software/linux/aarch64/*/*/modules/all/EESSI-extend/"$version"-easybuild.lua + ) + # For aarch64 we also check our RISC-V development repo + riscv_version_dirs=(/cvmfs/dev.eessi.io/riscv/versions/"$version"-*) + if ((${#riscv_version_dirs[@]})); then + latest_riscv_version_dir="${riscv_version_dirs[-1]}" + aarch64_files+=( + "$latest_riscv_version_dir"/software/linux/riscv64/*/modules/all/EESSI-extend/"$version"-easybuild.lua + "$latest_riscv_version_dir"/software/linux/riscv64/*/*/modules/all/EESSI-extend/"$version"-easybuild.lua + ) + fi + + compare_group "$version" "${aarch64_files[@]}" +done + +if (( total_failures > 0 )); then + echo + echo "Summary of differences:" + for entry in "${failure_summary[@]}"; do + IFS='|' read -r version ref file <<< "$entry" + printf 'Version: %s\n' "$version" + printf 'Reference: %s\n' "$ref" + printf 'File: %s\n\n' "$file" + done + + echo "$total_failures file(s) differed." + exit 1 +fi + +echo "All files matched." diff --git a/.github/workflows/tests_eessi_extend_module.yml b/.github/workflows/tests_eessi_extend_module.yml index 94a1d68f..de51b650 100644 --- a/.github/workflows/tests_eessi_extend_module.yml +++ b/.github/workflows/tests_eessi_extend_module.yml @@ -28,7 +28,7 @@ jobs: eessi_stack_version: ${{matrix.eessi_version}} use_eessi_module: true - - name: Install the EESSI-extend shipped with the repository + - name: Install the EESSI-extend shipped with the repository and verify it is consistent with the CVMFS repo run: | # Define a function to check the values of environment variables # and another that checks an environment does not contain environment @@ -64,6 +64,12 @@ jobs: eb --rebuild ${{matrix.rebuild_software}} echo "Testing a rebuild using the hooks in the current branch" eb --rebuild --hooks=./eb_hooks.py ${{matrix.rebuild_software}} + + # First, check if it differs against what is currently shipped by CVMFS + diff <(grep -v '^local root = ' /cvmfs/software.eessi.io/versions/${{matrix.eessi_version}}/software/linux/$(uname -m)/generic/modules/all/EESSI-extend/${{matrix.eessi_version}}-easybuild.lua) <(grep -v '^local root = ' $MY_INSTALLATION_PATH/modules/all/EESSI-extend/${{matrix.eessi_version}}-easybuild.lua) + # Then do a consistency check in CVMFS for all architectures + .github/workflows/scripts/diff_eessi_extend.sh + # Proceed with unload and checking the environment variables module unload EESSI-extend # That should have unset all EasyBuild envvars (including EASYBUILD_PREFIX)