From 2e3767b8d3e637459bdf8b88d0e4a443bd08a60c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Thu, 24 Jul 2025 20:06:37 +0200 Subject: [PATCH 1/5] allow end users to add a family name to the EESSI module --- 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 9497b729..755929b2 100644 --- a/init/modules/EESSI/2023.06.lua +++ b/init/modules/EESSI/2023.06.lua @@ -173,6 +173,13 @@ if isDir(eessi_module_path_accel) then eessiDebug("Using site accelerator modules at: " .. eessi_module_path_site_accel) end +-- allow sites to add a family directive to the EESSI module, +-- e.g. for preventing that users load two different/incompatible stacks at the same time +family_name = os.getenv("EESSI_MODULE_FAMILY_NAME") +if family_name then + family(family_name) +end + -- allow sites to make the EESSI module sticky by defining EESSI_MODULE_STICKY (to any value) load_message = "Module for EESSI/" .. eessi_version .. " loaded successfully" if os.getenv("EESSI_MODULE_STICKY") then From f8164d21d5ae18ef0efc9fb9c32c08609303393c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Thu, 24 Jul 2025 20:06:57 +0200 Subject: [PATCH 2/5] test the family directive functionality --- .github/workflows/tests_eessi_module.yml | 45 +++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests_eessi_module.yml b/.github/workflows/tests_eessi_module.yml index 6f11c7f8..8db0e3d8 100644 --- a/.github/workflows/tests_eessi_module.yml +++ b/.github/workflows/tests_eessi_module.yml @@ -258,7 +258,7 @@ jobs: # Initialise Lmod . /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/compat/linux/$(uname -m)/usr/share/Lmod/init/bash - # Make sure we using the module file from the repository + # Make sure we are using the module file from the repository export MODULEPATH=init/modules # Set the relevant environment variable and load the EESSI module @@ -269,3 +269,46 @@ jobs: # Purge and check the module is still loaded module purge module list |& grep "EESSI/${{matrix.EESSI_VERSION}}" + + check_family_eessi_module: + runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + EESSI_VERSION: + - '2023.06' + - '2025.06' + + steps: + - name: Check out software-layer repository + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Mount EESSI CernVM-FS repository + uses: cvmfs-contrib/github-action-cvmfs@55899ca74cf78ab874bdf47f5a804e47c198743c # v4.0 + with: + cvmfs_config_package: https://github.com/EESSI/filesystem-layer/releases/download/latest/cvmfs-config-eessi_latest_all.deb + cvmfs_http_proxy: DIRECT + cvmfs_repositories: software.eessi.io + + - name: Make sure we can use the family directive in the EESSI module + run: | + # Initialise Lmod + . /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/compat/linux/$(uname -m)/usr/share/Lmod/init/bash + + # Add a test modulefile for a dummy stack with a "software_stack" family directive + FAMILY=software_stack + TMP_MODULEFILES=$(mktemp -d) + LOCAL_STACK_NAME="local_stack" + LOCAL_STACK_VERSION="${{matrix.EESSI_VERSION}}" + mkdir -p "${TMP_MODULEFILES}/${LOCAL_STACK_NAME}" + echo "family(\"${FAMILY}\")" > "${TMP_MODULEFILES}/${LOCAL_STACK_NAME}/${LOCAL_STACK_VERSION}" + + # Make sure we are using the EESSImodule file from the repository and the temporary one for the dummy local stack + export MODULEPATH=init/modules:${TMP_MODULEFILES} + + # Set the relevant environment variable, load the EESSI module and the local stack module, and grep for + # Lmod is automatically replacing "..." with "...". + export EESSI_MODULE_FAMILY_NAME=${FAMILY} + module load "EESSI/${{matrix.EESSI_VERSION}}" + GREP_PATTERN="Lmod is automatically replacing \"EESSI/${{matrix.EESSI_VERSION}}" with \"${LOCAL_STACK_NAME}/${LOCAL_STACK_VERSION}\"." + module load "${LOCAL_STACK_NAME}/${LOCAL_STACK_VERSION}" |& grep "${GREP_PATTERN}" From 126f33fc5d061f5aa602e42c7ab9e5d72403cee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Thu, 24 Jul 2025 20:14:46 +0200 Subject: [PATCH 3/5] escape double quote --- .github/workflows/tests_eessi_module.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests_eessi_module.yml b/.github/workflows/tests_eessi_module.yml index 8db0e3d8..35c0fafb 100644 --- a/.github/workflows/tests_eessi_module.yml +++ b/.github/workflows/tests_eessi_module.yml @@ -310,5 +310,5 @@ jobs: # Lmod is automatically replacing "..." with "...". export EESSI_MODULE_FAMILY_NAME=${FAMILY} module load "EESSI/${{matrix.EESSI_VERSION}}" - GREP_PATTERN="Lmod is automatically replacing \"EESSI/${{matrix.EESSI_VERSION}}" with \"${LOCAL_STACK_NAME}/${LOCAL_STACK_VERSION}\"." + GREP_PATTERN="Lmod is automatically replacing \"EESSI/${{matrix.EESSI_VERSION}}\" with \"${LOCAL_STACK_NAME}/${LOCAL_STACK_VERSION}\"." module load "${LOCAL_STACK_NAME}/${LOCAL_STACK_VERSION}" |& grep "${GREP_PATTERN}" From 176467832332c7aece588d80dbdb86073fdbf58f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Thu, 24 Jul 2025 20:20:42 +0200 Subject: [PATCH 4/5] add .lua extension to dummy modulefile --- .github/workflows/tests_eessi_module.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests_eessi_module.yml b/.github/workflows/tests_eessi_module.yml index 35c0fafb..7b827259 100644 --- a/.github/workflows/tests_eessi_module.yml +++ b/.github/workflows/tests_eessi_module.yml @@ -301,7 +301,7 @@ jobs: LOCAL_STACK_NAME="local_stack" LOCAL_STACK_VERSION="${{matrix.EESSI_VERSION}}" mkdir -p "${TMP_MODULEFILES}/${LOCAL_STACK_NAME}" - echo "family(\"${FAMILY}\")" > "${TMP_MODULEFILES}/${LOCAL_STACK_NAME}/${LOCAL_STACK_VERSION}" + echo "family(\"${FAMILY}\")" > "${TMP_MODULEFILES}/${LOCAL_STACK_NAME}/${LOCAL_STACK_VERSION}.lua" # Make sure we are using the EESSImodule file from the repository and the temporary one for the dummy local stack export MODULEPATH=init/modules:${TMP_MODULEFILES} From a8d2b11d538e6dcb85ca8e4e76539a1359643e69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Thu, 24 Jul 2025 21:13:21 +0200 Subject: [PATCH 5/5] Update .github/workflows/tests_eessi_module.yml Co-authored-by: ocaisa --- .github/workflows/tests_eessi_module.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests_eessi_module.yml b/.github/workflows/tests_eessi_module.yml index 7b827259..31cb229b 100644 --- a/.github/workflows/tests_eessi_module.yml +++ b/.github/workflows/tests_eessi_module.yml @@ -303,7 +303,7 @@ jobs: mkdir -p "${TMP_MODULEFILES}/${LOCAL_STACK_NAME}" echo "family(\"${FAMILY}\")" > "${TMP_MODULEFILES}/${LOCAL_STACK_NAME}/${LOCAL_STACK_VERSION}.lua" - # Make sure we are using the EESSImodule file from the repository and the temporary one for the dummy local stack + # Make sure we are using the EESSI module file from the repository and the temporary one for the dummy local stack export MODULEPATH=init/modules:${TMP_MODULEFILES} # Set the relevant environment variable, load the EESSI module and the local stack module, and grep for