Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
42 changes: 42 additions & 0 deletions .github/workflows/tests_eessi_module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -315,3 +315,45 @@ jobs:
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}"

check_PS1_update_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 EESSI_UPDATE_PS1 to update PS1 in the EESSI module
run: |
# Initialise Lmod
. /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/compat/linux/$(uname -m)/usr/share/Lmod/init/bash

export MODULEPATH=init/modules
# Set the relevant environment variable, load the EESSI module, and grep for what we expect in PS1
export EESSI_MODULE_UPDATE_PS1=1
# Need to set PS1 manually as we are in a non-interactive shell
export PS1="mytest $"
echo $PS1
module load "EESSI/${{matrix.EESSI_VERSION}}"
GREP_PATTERN="{EESSI/${{matrix.EESSI_VERSION}}} "
# Pipe the PS1 variable into grep to check for the pattern
echo "$PS1"
echo "$PS1" | grep "$GREP_PATTERN"

# Let's also check that quiet mode works
module load "EESSI/${{matrix.EESSI_VERSION}}" |& grep -q "Module for EESSI/${{matrix.EESSI_VERSION}} loaded successfully"
export EESSI_MODULE_QUIET_LOAD=1
! module load "EESSI/${{matrix.EESSI_VERSION}}" |& grep -q "Module for EESSI/${{matrix.EESSI_VERSION}} loaded successfully"
17 changes: 15 additions & 2 deletions init/modules/EESSI/2023.06.lua
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,26 @@ if family_name then
family(family_name)
end

-- Change the PS1 to indicate you have EESSI loaded. For this to work, it requires that
-- PS1 exists _and_ is exported (i.e, an environment variable, *not* a shell variable)
-- (doesn't help with a csh or fish prompt, but we just live with that)
local quiet_load = false
if os.getenv("EESSI_MODULE_UPDATE_PS1") then
local prompt = os.getenv("PS1")
if prompt then
pushenv("PS1", "{EESSI/" .. eessi_version .. "} " .. prompt)
end
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"
local 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(load_message)
if not os.getenv("EESSI_MODULE_QUIET_LOAD") then
LmodMessage(load_message)
end
end