Skip to content
Open
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
37 changes: 37 additions & 0 deletions .github/workflows/tests_eessi_module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -315,3 +315,40 @@ 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"
9 changes: 9 additions & 0 deletions init/modules/EESSI/2023.06.lua
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,15 @@ if family_name then
family(family_name)
end

-- change the PS1 if it exists to indicate you have EESSI loaded
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will shift this down, and if the PS1 is changed I won't print the load message

-- (doesn't help with a csh or fish prompt, but we just live with that)
if os.getenv("EESSI_MODULE_UPDATE_PS1") then
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"
if os.getenv("EESSI_MODULE_STICKY") then
Expand Down