Skip to content

Commit bf584c7

Browse files
committed
solve merge conflicts
2 parents d3d18fe + 2dc460b commit bf584c7

File tree

5 files changed

+257
-31
lines changed

5 files changed

+257
-31
lines changed

.github/workflows/scripts/test_init_scripts.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ for shell in ${SHELLS[@]}; do
3232
echo -e "\033[33mWe don't now how to test the shell '$shell', PRs are Welcome.\033[0m"
3333
else
3434
# TEST 1: Source Script and check Module Output
35-
assert "$shell -c 'source init/lmod/$shell' 2>&1 " "EESSI/$EESSI_VERSION loaded successfully"
35+
assert "$shell -c 'source init/lmod/$shell' 2>&1 " "Module for EESSI/$EESSI_VERSION loaded successfully"
3636
# TEST 2: Check if module overviews first section is the loaded EESSI module
3737
MODULE_SECTIONS=($($shell -c "source init/lmod/$shell 2>/dev/null; module ov 2>&1 | grep -e '---'"))
3838
PATTERN="/cvmfs/software\.eessi\.io/versions/$EESSI_VERSION/software/linux/x86_64/(intel/haswell|amd/zen3)/modules/all"
Lines changed: 74 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,32 @@
11
# documentation: https://help.github.com/en/articles/workflow-syntax-for-github-actions
2-
name: Check whether eb_hooks.py script is up-to-date
2+
name: Run checks on EasyBuild hooks script
33
on:
44
push:
55
pull_request:
66
workflow_dispatch:
77
permissions:
88
contents: read # to fetch code (actions/checkout)
99
jobs:
10-
check_eb_hooks:
10+
check_eb_hooks_uptodate:
1111
runs-on: ubuntu-24.04
1212
strategy:
1313
matrix:
1414
EESSI_VERSION:
1515
- '2023.06'
1616
- '2025.06'
17+
1718
steps:
1819
- name: Check out software-layer repository
1920
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2021
with:
2122
fetch-depth: 0 # Fetch all history for all branches and tags
22-
23-
- name: Show host system info
24-
run: |
25-
echo "/proc/cpuinfo:"
26-
cat /proc/cpuinfo
27-
echo
28-
echo "lscpu:"
29-
lscpu
30-
31-
- name: Mount EESSI CernVM-FS pilot repository
32-
uses: cvmfs-contrib/github-action-cvmfs@55899ca74cf78ab874bdf47f5a804e47c198743c # v4.0
23+
- name: Mount EESSI CernVM-FS repository
24+
uses: eessi/github-action-eessi@v3
3325
with:
34-
cvmfs_config_package: https://github.com/EESSI/filesystem-layer/releases/download/latest/cvmfs-config-eessi_latest_all.deb
35-
cvmfs_http_proxy: DIRECT
36-
cvmfs_repositories: software.eessi.io
26+
eessi_stack_version: ${{matrix.EESSI_VERSION}}
27+
use_eessi_module: true
3728

38-
- name: Check that EasyBuild hook is up to date
29+
- name: Check whether eb_hooks.py script is up-to-date
3930
if: ${{ github.event_name == 'pull_request' }}
4031
run: |
4132
FILE="eb_hooks.py"
@@ -57,6 +48,71 @@ jobs:
5748
sed -i "s/<EESSI_VERSION>/${{matrix.EESSI_VERSION}}/g" "${TEMP_FILE}"
5849
5950
# Compare the hooks to what is shipped in the repository
60-
source /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/init/bash
6151
module load EESSI-extend
6252
diff "$TEMP_FILE" "$EASYBUILD_HOOKS"
53+
54+
check_eb_hooks_functionality:
55+
runs-on: ubuntu-24.04
56+
strategy:
57+
matrix:
58+
EESSI_VERSION:
59+
- '2023.06'
60+
- '2025.06'
61+
include:
62+
# For each EESSI version we need to test different modules
63+
- EESSI_VERSION: '2023.06'
64+
COMPATIBLE_EASYCONFIG: 'M4-1.4.19-GCCcore-13.2.0.eb'
65+
INCOMPATIBLE_EASYCONFIG: 'M4-1.4.19-GCCcore-14.2.0.eb'
66+
# Pick a site toolchain that will allow the incompatible easyconfig
67+
# (the name will be modified when exported)
68+
SITE_TOP_LEVEL_TOOLCHAINS: '[{"name": "GCCcore", "version": "14.2.0"}]'
69+
- EESSI_VERSION: '2025.06'
70+
COMPATIBLE_EASYCONFIG: 'M4-1.4.19-GCCcore-14.2.0.eb'
71+
INCOMPATIBLE_EASYCONFIG: 'M4-1.4.19-GCCcore-13.2.0.eb'
72+
# Pick a site toolchain that will allow the incompatible easyconfig
73+
# (the name will be modified when exported)
74+
SITE_TOP_LEVEL_TOOLCHAINS: '[{"name": "GCCcore", "version": "13.2.0"}]'
75+
76+
steps:
77+
- name: Check out software-layer repository
78+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
79+
80+
- name: Mount EESSI CernVM-FS repository
81+
uses: eessi/github-action-eessi@v3
82+
with:
83+
eessi_stack_version: ${{matrix.EESSI_VERSION}}
84+
use_eessi_module: true
85+
86+
- name: Test that hook toolchain verification check works
87+
if: ${{ github.event_name == 'pull_request' }}
88+
run: |
89+
# Set up some environment variables
90+
export COMPATIBLE_EASYCONFIG=${{matrix.COMPATIBLE_EASYCONFIG}}
91+
export INCOMPATIBLE_EASYCONFIG=${{matrix.INCOMPATIBLE_EASYCONFIG}}
92+
93+
# Load specific EESSI-extend vertsion (proxies a version check)
94+
module load EESSI-extend/${{matrix.EESSI_VERSION}}-easybuild
95+
96+
# Test an easyconfig that should work
97+
eb --hooks=$PWD/eb_hooks.py "$COMPATIBLE_EASYCONFIG" --stop fetch
98+
echo "Success for hook with easyconfig $COMPATIBLE_EASYCONFIG with EESSI/${{matrix.EESSI_VERSION}}"
99+
100+
# Now ensure an incompatible easyconfig does not work
101+
eb --hooks=$PWD/eb_hooks.py "$INCOMPATIBLE_EASYCONFIG" --stop fetch 2>&1 1>/dev/null | grep -q "not supported in EESSI"
102+
echo "Found expected failure for hook with easyconfig $INCOMPATIBLE_EASYCONFIG and EESSI/${{matrix.EESSI_VERSION}}"
103+
104+
# Check the override works
105+
EESSI_OVERRIDE_TOOLCHAIN_CHECK=1 eb --hooks=$PWD/eb_hooks.py "$INCOMPATIBLE_EASYCONFIG" --stop fetch
106+
echo "Hook ignored via EESSI_OVERRIDE_TOOLCHAIN_CHECK with easyconfig $INCOMPATIBLE_EASYCONFIG and EESSI/${{matrix.EESSI_VERSION}}"
107+
108+
# Now check if we can set a site list of supported toolchains
109+
export SANITIZED_EESSI_VERSION=$(echo "${{ matrix.EESSI_VERSION }}" | sed 's/\./_/g')
110+
export EESSI_SITE_TOP_LEVEL_TOOLCHAINS_"$SANITIZED_EESSI_VERSION"='${{matrix.SITE_TOP_LEVEL_TOOLCHAINS}}'
111+
eb --hooks=$PWD/eb_hooks.py "$INCOMPATIBLE_EASYCONFIG" --stop fetch
112+
echo "Site supported toolchain from $EESSI_SITE_TOP_LEVEL_TOOLCHAINS successfully used with easyconfig $INCOMPATIBLE_EASYCONFIG and EESSI/${{matrix.EESSI_VERSION}}"
113+
114+
# Make sure an invalid list of dicts fails
115+
export EESSI_SITE_TOP_LEVEL_TOOLCHAINS_"$SANITIZED_EESSI_VERSION"="Not a list of dicts"
116+
eb --hooks=$PWD/eb_hooks.py "$INCOMPATIBLE_EASYCONFIG" --stop fetch 2>&1 1>/dev/null | grep -q "does not contain a valid list of dictionaries"
117+
echo "Incorrect format for EESSI_SITE_TOP_LEVEL_TOOLCHAINS caught"
118+

.github/workflows/tests_eessi_module.yml

Lines changed: 84 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Check out software-layer repository
2020
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2121

22-
- name: Mount EESSI CernVM-FS pilot repository
22+
- name: Mount EESSI CernVM-FS repository
2323
uses: cvmfs-contrib/github-action-cvmfs@55899ca74cf78ab874bdf47f5a804e47c198743c # v4.0
2424
with:
2525
cvmfs_config_package: https://github.com/EESSI/filesystem-layer/releases/download/latest/cvmfs-config-eessi_latest_all.deb
@@ -43,7 +43,7 @@ jobs:
4343
env | grep LMOD
4444
module purge
4545
unset MODULEPATH
46-
46+
4747
- name: Test for archdetect_cpu functionality with invalid path
4848
run: |
4949
# Initialise Lmod
@@ -83,7 +83,7 @@ jobs:
8383
- name: Check out software-layer repository
8484
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
8585

86-
- name: Mount EESSI CernVM-FS pilot repository
86+
- name: Mount EESSI CernVM-FS repository
8787
uses: cvmfs-contrib/github-action-cvmfs@55899ca74cf78ab874bdf47f5a804e47c198743c # v4.0
8888
with:
8989
cvmfs_config_package: https://github.com/EESSI/filesystem-layer/releases/download/latest/cvmfs-config-eessi_latest_all.deb
@@ -176,7 +176,7 @@ jobs:
176176
- name: Check out software-layer repository
177177
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
178178

179-
- name: Mount EESSI CernVM-FS pilot repository
179+
- name: Mount EESSI CernVM-FS repository
180180
uses: cvmfs-contrib/github-action-cvmfs@55899ca74cf78ab874bdf47f5a804e47c198743c # v4.0
181181
with:
182182
cvmfs_config_package: https://github.com/EESSI/filesystem-layer/releases/download/latest/cvmfs-config-eessi_latest_all.deb
@@ -235,3 +235,83 @@ jobs:
235235
# (script uses EESSI_SOFTWARE_SUBDIR_OVERRIDE and EESSI_ACCELERATOR_TARGET_OVERRIDE
236236
# as the starting point for the comparison)
237237
python .github/workflows/scripts/verify_eessi_environment.py
238+
239+
check_sticky_eessi_module:
240+
runs-on: ubuntu-24.04
241+
strategy:
242+
fail-fast: false
243+
matrix:
244+
EESSI_VERSION:
245+
- '2023.06'
246+
- '2025.06'
247+
248+
steps:
249+
- name: Check out software-layer repository
250+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
251+
252+
- name: Mount EESSI CernVM-FS repository
253+
uses: cvmfs-contrib/github-action-cvmfs@55899ca74cf78ab874bdf47f5a804e47c198743c # v4.0
254+
with:
255+
cvmfs_config_package: https://github.com/EESSI/filesystem-layer/releases/download/latest/cvmfs-config-eessi_latest_all.deb
256+
cvmfs_http_proxy: DIRECT
257+
cvmfs_repositories: software.eessi.io
258+
259+
- name: Make sure we have a sticky EESSI module
260+
run: |
261+
# Initialise Lmod
262+
. /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/compat/linux/$(uname -m)/usr/share/Lmod/init/bash
263+
264+
# Make sure we are using the module file from the repository
265+
export MODULEPATH=init/modules
266+
267+
# Set the relevant environment variable and load the EESSI module
268+
export EESSI_MODULE_STICKY=1
269+
module load "EESSI/${{matrix.EESSI_VERSION}}"
270+
module list |& grep "EESSI/${{matrix.EESSI_VERSION}}"
271+
272+
# Purge and check the module is still loaded
273+
module purge
274+
module list |& grep "EESSI/${{matrix.EESSI_VERSION}}"
275+
276+
check_family_eessi_module:
277+
runs-on: ubuntu-24.04
278+
strategy:
279+
fail-fast: false
280+
matrix:
281+
EESSI_VERSION:
282+
- '2023.06'
283+
- '2025.06'
284+
285+
steps:
286+
- name: Check out software-layer repository
287+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
288+
289+
- name: Mount EESSI CernVM-FS repository
290+
uses: cvmfs-contrib/github-action-cvmfs@55899ca74cf78ab874bdf47f5a804e47c198743c # v4.0
291+
with:
292+
cvmfs_config_package: https://github.com/EESSI/filesystem-layer/releases/download/latest/cvmfs-config-eessi_latest_all.deb
293+
cvmfs_http_proxy: DIRECT
294+
cvmfs_repositories: software.eessi.io
295+
296+
- name: Make sure we can use the family directive in the EESSI module
297+
run: |
298+
# Initialise Lmod
299+
. /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/compat/linux/$(uname -m)/usr/share/Lmod/init/bash
300+
301+
# Add a test modulefile for a dummy stack with a "software_stack" family directive
302+
FAMILY=software_stack
303+
TMP_MODULEFILES=$(mktemp -d)
304+
LOCAL_STACK_NAME="local_stack"
305+
LOCAL_STACK_VERSION="${{matrix.EESSI_VERSION}}"
306+
mkdir -p "${TMP_MODULEFILES}/${LOCAL_STACK_NAME}"
307+
echo "family(\"${FAMILY}\")" > "${TMP_MODULEFILES}/${LOCAL_STACK_NAME}/${LOCAL_STACK_VERSION}.lua"
308+
309+
# Make sure we are using the EESSI module file from the repository and the temporary one for the dummy local stack
310+
export MODULEPATH=init/modules:${TMP_MODULEFILES}
311+
312+
# Set the relevant environment variable, load the EESSI module and the local stack module, and grep for
313+
# Lmod is automatically replacing "..." with "...".
314+
export EESSI_MODULE_FAMILY_NAME=${FAMILY}
315+
module load "EESSI/${{matrix.EESSI_VERSION}}"
316+
GREP_PATTERN="Lmod is automatically replacing \"EESSI/${{matrix.EESSI_VERSION}}\" with \"${LOCAL_STACK_NAME}/${LOCAL_STACK_VERSION}\"."
317+
module load "${LOCAL_STACK_NAME}/${LOCAL_STACK_VERSION}" |& grep "${GREP_PATTERN}"

0 commit comments

Comments
 (0)