Skip to content

Commit 773613b

Browse files
committed
resolve merge conflixt
2 parents 31eb3c3 + 7b211de commit 773613b

11 files changed

Lines changed: 214 additions & 311 deletions

File tree

.github/workflows/scripts/test_init_scripts.sh

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ if [ ! -d assert.sh ]; then
2626
fi
2727
. assert.sh/assert.sh
2828

29-
TEST_SHELLS=("bash" "zsh" "fish" "ksh" "csh")
29+
TEST_SHELLS=("bash" "zsh" "fish" "ksh" "csh" "sh")
3030
SHELLS=$@
3131

3232
for shell in ${SHELLS[@]}; do
@@ -43,7 +43,11 @@ for shell in ${SHELLS[@]}; do
4343

4444
# TEST 1: Source Script and check Module Output
4545
expected_pattern=".*EESSI has selected $EESSI_SOFTWARE_SUBDIR_OVERRIDE as the compatible CPU target for EESSI/$EESSI_VERSION.*"
46-
assert_raises "$shell -c 'source init/lmod/$shell' 2>&1 | grep -E \"${expected_pattern}\""
46+
if [ "$shell" = "csh" ]; then
47+
assert_raises "$shell -c 'source init/lmod/$shell' 2>&1 | grep -E \"${expected_pattern}\""
48+
else
49+
assert_raises "$shell -c '. init/lmod/$shell' 2>&1 | grep -E \"${expected_pattern}\""
50+
fi
4751

4852
# TEST 2: Check if module overviews first section is the loaded EESSI module
4953
if [ "$shell" = "csh" ]; then
@@ -53,7 +57,7 @@ for shell in ${SHELLS[@]}; do
5357
echo "source init/lmod/$shell" > ~/.cshrc
5458
MODULE_SECTIONS=($($shell -c "module ov" 2>&1 | grep -e '---'))
5559
else
56-
MODULE_SECTIONS=($($shell -c "source init/lmod/$shell >/dev/null 2>&1; module ov 2>&1 | grep -e '---'"))
60+
MODULE_SECTIONS=($($shell -c ". init/lmod/$shell >/dev/null 2>&1; module ov 2>&1 | grep -e '---'"))
5761
fi
5862
PATTERN="/cvmfs/software\.eessi\.io/versions/$EESSI_VERSION/software/linux/$EESSI_SOFTWARE_SUBDIR_OVERRIDE/modules/all"
5963
assert_raises 'echo "${MODULE_SECTIONS[1]}" | grep -E "$PATTERN"'
@@ -68,7 +72,7 @@ for shell in ${SHELLS[@]}; do
6872
echo "source init/lmod/$shell" > ~/.cshrc
6973
command="$shell -c 'module load EasyBuild/${EXPECTED_EASYBUILD_VERSION}; eb --version' | tail -n 1 | awk '{print \$4}'"
7074
else
71-
command="$shell -c 'source init/lmod/$shell >/dev/null 2>&1; module load EasyBuild/${EXPECTED_EASYBUILD_VERSION}; eb --version' | tail -n 1 | awk '{print \$4}'"
75+
command="$shell -c '. init/lmod/$shell >/dev/null 2>&1; module load EasyBuild/${EXPECTED_EASYBUILD_VERSION}; eb --version' | tail -n 1 | awk '{print \$4}'"
7276
fi
7377
assert "$command" "$EXPECTED_EASYBUILD_VERSION"
7478

@@ -77,7 +81,7 @@ for shell in ${SHELLS[@]}; do
7781
echo "source init/lmod/$shell" > ~/.cshrc
7882
EASYBUILD_PATH=$($shell -c "module load EasyBuild/${EXPECTED_EASYBUILD_VERSION}; which eb")
7983
else
80-
EASYBUILD_PATH=$($shell -c "source init/lmod/$shell 2>/dev/null; module load EasyBuild/${EXPECTED_EASYBUILD_VERSION}; which eb")
84+
EASYBUILD_PATH=$($shell -c ". init/lmod/$shell 2>/dev/null; module load EasyBuild/${EXPECTED_EASYBUILD_VERSION}; which eb")
8185
fi
8286
# escape the dots in ${EASYBUILD_VERSION}
8387
PATTERN="/cvmfs/software\.eessi\.io/versions/$EESSI_VERSION/software/linux/$EESSI_SOFTWARE_SUBDIR_OVERRIDE/software/EasyBuild/${EXPECTED_EASYBUILD_VERSION//./\\.}/bin/eb"
@@ -97,8 +101,8 @@ for shell in ${SHELLS[@]}; do
97101
TEST_LMOD_SYSTEM_DEFAULT_MODULES=$($shell -c 'set -x EESSI_DEFAULT_MODULES_APPEND append_module ; set -x EESSI_DEFAULT_MODULES_PREPEND prepend_module ; set -x EESSI_EXTRA_MODULEPATH .github/workflows/modules ; source init/lmod/'"$shell"' 2>/dev/null; echo $LMOD_SYSTEM_DEFAULT_MODULES')
98102
TEST_MODULEPATH=$($shell -c 'set -x EESSI_DEFAULT_MODULES_APPEND append_module ; set -x EESSI_DEFAULT_MODULES_PREPEND prepend_module ; set -x EESSI_EXTRA_MODULEPATH .github/workflows/modules ; source init/lmod/'"$shell"' 2>/dev/null; echo $MODULEPATH')
99103
else
100-
TEST_LMOD_SYSTEM_DEFAULT_MODULES=$($shell -c 'export EESSI_DEFAULT_MODULES_APPEND=append_module ; export EESSI_DEFAULT_MODULES_PREPEND=prepend_module ; export EESSI_EXTRA_MODULEPATH=.github/workflows/modules ; source init/lmod/'"$shell"' ; echo $LMOD_SYSTEM_DEFAULT_MODULES')
101-
TEST_MODULEPATH=$($shell -c 'export EESSI_DEFAULT_MODULES_APPEND=append_module ; export EESSI_DEFAULT_MODULES_PREPEND=prepend_module ; export EESSI_EXTRA_MODULEPATH=.github/workflows/modules ; source init/lmod/'"$shell"' 2>/dev/null; echo $MODULEPATH')
104+
TEST_LMOD_SYSTEM_DEFAULT_MODULES=$($shell -c 'export EESSI_DEFAULT_MODULES_APPEND=append_module ; export EESSI_DEFAULT_MODULES_PREPEND=prepend_module ; export EESSI_EXTRA_MODULEPATH=.github/workflows/modules ; . init/lmod/'"$shell"' ; echo $LMOD_SYSTEM_DEFAULT_MODULES')
105+
TEST_MODULEPATH=$($shell -c 'export EESSI_DEFAULT_MODULES_APPEND=append_module ; export EESSI_DEFAULT_MODULES_PREPEND=prepend_module ; export EESSI_EXTRA_MODULEPATH=.github/workflows/modules ; . init/lmod/'"$shell"' 2>/dev/null; echo $MODULEPATH')
102106
fi
103107
LMOD_SYSTEM_DEFAULT_MODULES_PATTERN='^prepend_module:.*:append_module$'
104108
# echo "$TEST_LMOD_SYSTEM_DEFAULT_MODULES" AND "$LMOD_SYSTEM_DEFAULT_MODULES_PATTERN"
@@ -126,8 +130,8 @@ for shell in ${SHELLS[@]}; do
126130
TEST_EESSI_WITH_PURGE=$($shell -c "source $LMOD_PKG/init/$shell 2>/dev/null ; source init/lmod/$shell 2>/dev/null")
127131
TEST_EESSI_WITHOUT_PURGE=$($shell -c "set -x EESSI_NO_MODULE_PURGE_ON_INIT 1 ; source $LMOD_PKG/init/$shell 2>/dev/null ; source init/lmod/$shell 2>/dev/null")
128132
else
129-
TEST_EESSI_WITH_PURGE=$($shell -c "source $LMOD_PKG/init/$shell 2>/dev/null ; source init/lmod/$shell 2>/dev/null")
130-
TEST_EESSI_WITHOUT_PURGE=$($shell -c "export EESSI_NO_MODULE_PURGE_ON_INIT=1 ; source $LMOD_PKG/init/$shell 2>/dev/null ; source init/lmod/$shell 2>/dev/null")
133+
TEST_EESSI_WITH_PURGE=$($shell -c ". $LMOD_PKG/init/$shell 2>/dev/null ; . init/lmod/$shell 2>/dev/null")
134+
TEST_EESSI_WITHOUT_PURGE=$($shell -c "export EESSI_NO_MODULE_PURGE_ON_INIT=1 ; . $LMOD_PKG/init/$shell 2>/dev/null ; . init/lmod/$shell 2>/dev/null")
131135
fi
132136
# In the first case we should have the test and in the second case we shouldn't
133137
pattern="Modules purged before initialising EESSI"
@@ -139,13 +143,18 @@ for shell in ${SHELLS[@]}; do
139143
fi
140144

141145
# Optional test 10, check if the prompt has been updated
142-
if [ "$shell" = "bash" ] || [ "$shell" = "ksh" ] || [ "$shell" = "zsh" ]; then
146+
if [ "$shell" = "bash" ] || [ "$shell" = "ksh" ] || [ "$shell" = "zsh" ] || [ "$shell" = "sh" ]; then
143147
# Typically this is a non-interactive shell, so manually unset PS1 and reset to a non-exported variable when testing
144-
TEST_EESSI_PS1_UPDATE=$($shell -c "unset PS1 ; PS1='$ ' ; source init/lmod/$shell 2>/dev/null ; echo \"\$PS1\"")
145-
TEST_EESSI_NO_PS1_UPDATE=$($shell -c "unset PS1 ; source init/lmod/$shell 2>/dev/null ; echo \"\$PS1\"")
148+
TEST_EESSI_PS1_UPDATE=$($shell -c "unset PS1 ; PS1='$ ' ; . init/lmod/$shell 2>/dev/null ; echo \"\$PS1\"")
149+
TEST_EESSI_NO_PS1_UPDATE=$($shell -c "unset PS1 ; . init/lmod/$shell 2>/dev/null ; echo \"\$PS1\"")
146150
pattern="{EESSI/${EESSI_VERSION}} "
147151
assert_raises 'echo "$TEST_EESSI_PS1_UPDATE" | grep "$pattern"'
148152
assert_raises 'echo "$TEST_EESSI_NO_PS1_UPDATE" | grep "$pattern"' 1
153+
# Also check when we explicitly ask for it not to be updated
154+
TEST_EESSI_EXPLICIT_NO_PS1_UPDATE=$($shell -c "unset PS1 ; PS1='test> ' ; export EESSI_MODULE_UPDATE_PS1=0 ; . init/lmod/$shell 2>/dev/null ; echo \"\$PS1\"")
155+
TEST_EESSI_EXPLICIT_NO_PS1_UPDATE_CALLED_TWICE=$($shell -c "unset PS1 ; PS1='$ ' ; export EESSI_MODULE_UPDATE_PS1=0 ; . init/lmod/$shell 2>/dev/null ; . init/lmod/$shell 2>/dev/null ; echo \"\$PS1\"")
156+
assert_raises 'echo "$TEST_EESSI_EXPLICIT_NO_PS1_UPDATE" | grep "$pattern"' 1
157+
assert_raises 'echo "$TEST_EESSI_EXPLICIT_NO_PS1_UPDATE_CALLED_TWICE" | grep "$pattern"' 1
149158
fi
150159

151160
# End Test Suite

.github/workflows/tests_init_module.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ jobs:
5757
- name: Install missing shells
5858
run: |
5959
sudo apt update
60+
# We're in Ubuntu so dash is already installed (and is symlinked to sh)
6061
sudo apt install zsh ksh fish tcsh
6162
echo "# INIT ZSH" > ~/.zshrc
6263
@@ -65,7 +66,7 @@ jobs:
6566
export EESSI_SOFTWARE_SUBDIR_OVERRIDE=${{matrix.EESSI_SOFTWARE_SUBDIR_OVERRIDE}}
6667
export EESSI_VERSION=${{matrix.EESSI_VERSION}}
6768
export EXPECTED_EASYBUILD_VERSION=${{matrix.EXPECTED_EASYBUILD_VERSION}}
68-
.github/workflows/scripts/test_init_scripts.sh "bash" "zsh" "ksh" "fish" "csh"
69+
.github/workflows/scripts/test_init_scripts.sh "bash" "zsh" "ksh" "fish" "csh" "sh"
6970
- name: Run tests for available shells with system Lmod
7071
run: |
7172
# We also want to perform the same test when there is an Lmod version available on the system
@@ -76,4 +77,4 @@ jobs:
7677
export EESSI_SOFTWARE_SUBDIR_OVERRIDE=${{matrix.EESSI_SOFTWARE_SUBDIR_OVERRIDE}}
7778
export EESSI_VERSION=${{matrix.EESSI_VERSION}}
7879
export EXPECTED_EASYBUILD_VERSION=${{matrix.EXPECTED_EASYBUILD_VERSION}}
79-
.github/workflows/scripts/test_init_scripts.sh "bash" "zsh" "ksh" "fish" "csh"
80+
.github/workflows/scripts/test_init_scripts.sh "bash" "zsh" "ksh" "fish" "csh" "sh"

create_lmodsitepackage.py

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
if packagesList[simpleName] then
125125
-- simpleName is a module in packagesList
126126
-- first, check the old host_injections path prior to https://github.com/EESSI/software-layer-scripts/pull/59
127-
-- If that exists, print a more targetted, explanatory warning
127+
-- If that exists, print a more targeted, explanatory warning
128128
local previousHostInjections = string.gsub(os.getenv('EESSI_SOFTWARE_PATH') or "", 'versions', 'host_injections')
129129
local previousPackageEasyBuildDir = previousHostInjections .. "/software/" .. t.modFullName .. "/easybuild"
130130
local previousPackageDirExists = isDir(previousPackageEasyBuildDir)
@@ -161,24 +161,38 @@
161161
local checkGpu = mt:haveProperty(simpleName,"arch","gpu")
162162
local overrideGpuCheck = os.getenv("EESSI_OVERRIDE_GPU_CHECK")
163163
if checkGpu and (overrideGpuCheck == nil) then
164-
local arch = os.getenv("EESSI_CPU_FAMILY") or ""
165-
local cvmfs_repo = os.getenv("EESSI_CVMFS_REPO") or ""
166-
local cudaVersionFile = cvmfs_repo .. "/host_injections/nvidia/" .. arch .. "/latest/cuda_version.txt"
167-
local cudaDriverFile = cvmfs_repo .. "/host_injections/nvidia/" .. arch .. "/latest/libcuda.so"
164+
local eessi_version = os.getenv('EESSI_VERSION') or ""
165+
local eessi_eprefix = os.getenv("EESSI_EPREFIX") or ""
166+
if eessi_eprefix == nil or eessi_version == nil then
167+
LmodError("EESSI_VERSION and EESSI_EPREFIX must be defined for GPU driver check to work\\n")
168+
end
169+
local cudaDriverDir = nil
170+
if eessi_version == "2023.06" then
171+
cudaDriverDir = string.gsub(eessi_eprefix, 'versions', 'host_injections') .. "/lib"
172+
else
173+
cudaDriverDir = eessi_eprefix .. "/lib/nvidia"
174+
end
175+
local cudaVersionFile = cudaDriverDir .. "/cuda_version.txt"
176+
local cudaDriverFile = cudaDriverDir .. "/libcuda.so"
168177
local cudaDriverExists = isFile(cudaDriverFile)
169178
local singularityCudaExists = isFile("/.singularity.d/libs/libcuda.so")
170179
if not (cudaDriverExists or singularityCudaExists) then
171180
local advice = "which relies on the CUDA runtime environment and driver libraries. "
172181
advice = advice .. "In order to be able to use the module, you will need "
173-
advice = advice .. "to make sure EESSI can find the GPU driver libraries on your host system. You can "
174-
advice = advice .. "override this check by setting the environment variable EESSI_OVERRIDE_GPU_CHECK but "
182+
advice = advice .. "to make sure EESSI can find the GPU driver libraries on your host system. "
183+
advice = advice .. "The file being checked for on your system is \\n" .. cudaDriverFile .. "\\n"
184+
advice = advice .. "You can override this check by setting the environment variable "
185+
advice = advice .. "EESSI_OVERRIDE_GPU_CHECK but "
175186
advice = advice .. "the loaded application will not be able to execute on your system.\\n"
176187
advice = advice .. refer_to_docs
177188
LmodError("\\nYou requested to load ", simpleName, " ", advice)
178189
else
179190
-- CUDA driver exists, now we check its version to see if an update is needed
180191
if cudaDriverExists then
181192
local cudaVersion = read_file(cudaVersionFile)
193+
if not cudaVersion then
194+
LmodError("No CUDA version file\\n" .. cudaVersionFile .. "\\nfound. " .. refer_to_docs)
195+
end
182196
local cudaVersion_req = os.getenv("EESSICUDAVERSION")
183197
-- driver CUDA versions don't give a patch version for CUDA
184198
local major, minor = string.match(cudaVersion, "(%d+)%.(%d+)")

eb_hooks.py

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,23 +1575,6 @@ def pre_test_hook_ignore_failing_tests_OpenBabel_a64fx(self, *args, **kwargs):
15751575
self.cfg['testopts'] = "|| echo ignoring failing tests"
15761576

15771577

1578-
def pre_test_hook_ignore_failing_tests_LAMMPS_ARM_generic(self, *args, **kwargs):
1579-
"""
1580-
Pre-test hook for LAMMPS: skip failing ctest for selected LAMMPS version on ARM generic.
1581-
1582-
See: https://github.com/lammps/lammps/issues/4926
1583-
"""
1584-
print('build option before pre_test_hooki: ', build_option('ignore_test_failure'))
1585-
if self.name == 'LAMMPS' and self.version in ('22Jul2025'):
1586-
cpu_target = get_eessi_envvar('EESSI_SOFTWARE_SUBDIR')
1587-
print('Debug: ', cpu_target)
1588-
if cpu_target == CPU_TARGET_AARCH64_GENERIC:
1589-
print('I will reset ignore_test_failure')
1590-
self.orig_ignore_test_failure = build_option('ignore_test_failure')
1591-
update_build_option('ignore_test_failure', True)
1592-
print(build_option('ignore_test_failure'))
1593-
1594-
15951578
def pre_single_extension_hook(ext, *args, **kwargs):
15961579
"""Main pre-extension: trigger custom functions based on software name."""
15971580
if ext.name in PRE_SINGLE_EXTENSION_HOOKS:
@@ -1939,23 +1922,23 @@ def post_easyblock_hook(self, *args, **kwargs):
19391922
post_easyblock_hook_copy_easybuild_subdir(self, *args, **kwargs)
19401923
else:
19411924
self.log.debug("No CVMFS/site installation requested, not running post_easyblock_hook_copy_easybuild_subdir.")
1942-
1943-
# If self.orig_ignore_test_failure is set return it to its original value.
1944-
if hasattr(self, "orig_ignore_test_failure") and self.orig_ignore_test_failure != build_option('ignore_test_failure'):
1945-
update_build_option('ignore_test_failure', self.orig_ignore_test_failure)
19461925
else:
19471926
print_warning(f"Not enabling the post_easybuild_hook, as it requires EasyBuild 5.1.1 or newer (you are using {EASYBUILD_VERSION}).")
19481927

19491928

19501929
def pre_run_shell_cmd_hook(cmd, work_dir=None, **kwargs):
19511930
"""Main pre_shell_cmd_hook: trigger custom funtions based on software name."""
1931+
19521932
# Ignore failing ctest for LAMMPS/22Jul2025 on aarch64/generic
19531933
cpu_target = get_eessi_envvar('EESSI_SOFTWARE_SUBDIR')
19541934
if cpu_target == CPU_TARGET_AARCH64_GENERIC:
19551935
if bool(re.search('LAMMPS', work_dir)) and bool(re.search('22Jul2025', work_dir)):
19561936
if isinstance(cmd, str) and cmd.startswith('ctest') and '-LE unstable' in cmd:
19571937
cmd = cmd + ' || true'
19581938

1939+
1940+
1941+
19591942
PARSE_HOOKS = {
19601943
'casacore': parse_hook_casacore_disable_vectorize,
19611944
'CGAL': parse_hook_cgal_toolchainopts_precise,
@@ -2016,7 +1999,6 @@ def pre_run_shell_cmd_hook(cmd, work_dir=None, **kwargs):
20161999
'netCDF': pre_test_hook_ignore_failing_tests_netCDF,
20172000
'OpenBabel': pre_test_hook_ignore_failing_tests_OpenBabel_a64fx,
20182001
'PyTorch': pre_test_hook_increase_max_failed_tests_arm_PyTorch,
2019-
'LAMMPS': pre_test_hook_ignore_failing_tests_LAMMPS_ARM_generic,
20202002
}
20212003

20222004
PRE_SINGLE_EXTENSION_HOOKS = {

0 commit comments

Comments
 (0)