diff --git a/.github/workflows/tests_eessi_module.yml b/.github/workflows/tests_eessi_module.yml index c13b182b..6f11c7f8 100644 --- a/.github/workflows/tests_eessi_module.yml +++ b/.github/workflows/tests_eessi_module.yml @@ -18,7 +18,7 @@ jobs: - name: Check out software-layer repository uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: Mount EESSI CernVM-FS pilot repository + - 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 @@ -81,7 +81,7 @@ jobs: - name: Check out software-layer repository uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: Mount EESSI CernVM-FS pilot repository + - 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 @@ -173,7 +173,7 @@ jobs: - name: Check out software-layer repository uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: Mount EESSI CernVM-FS pilot repository + - 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 @@ -232,3 +232,40 @@ jobs: # (script uses EESSI_SOFTWARE_SUBDIR_OVERRIDE and EESSI_ACCELERATOR_TARGET_OVERRIDE # as the starting point for the comparison) python .github/workflows/scripts/verify_eessi_environment.py + + check_sticky_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 have a sticky EESSI module + run: | + # 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 + export MODULEPATH=init/modules + + # Set the relevant environment variable and load the EESSI module + export EESSI_MODULE_STICKY=1 + module load "EESSI/${{matrix.EESSI_VERSION}}" + module list |& grep "EESSI/${{matrix.EESSI_VERSION}}" + + # Purge and check the module is still loaded + module purge + module list |& grep "EESSI/${{matrix.EESSI_VERSION}}" diff --git a/init/modules/EESSI/2023.06.lua b/init/modules/EESSI/2023.06.lua index 0d82090b..9497b729 100644 --- a/init/modules/EESSI/2023.06.lua +++ b/init/modules/EESSI/2023.06.lua @@ -172,6 +172,14 @@ if isDir(eessi_module_path_accel) then prepend_path("MODULEPATH", eessi_module_path_site_accel) eessiDebug("Using site accelerator modules at: " .. eessi_module_path_site_accel) 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 + add_property("lmod","sticky") + load_message = load_message .. " (requires '--force' option to unload or purge)" +end + if mode() == "load" then - LmodMessage("EESSI/" .. eessi_version .. " loaded successfully") + LmodMessage(load_message) end