From 84d9f1deabbb366ba8799dbc7d26f45f4b6ae157 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Wed, 16 Oct 2024 12:46:55 +0200 Subject: [PATCH] Make sure Lmod has run once before storing environment settings --- .github/workflows/tests_eessi_module.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests_eessi_module.yml b/.github/workflows/tests_eessi_module.yml index de99543f6d..807c16eb8e 100644 --- a/.github/workflows/tests_eessi_module.yml +++ b/.github/workflows/tests_eessi_module.yml @@ -45,7 +45,8 @@ jobs: - name: Test for archdetect_cpu functionality with invalid path run: | - . /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/compat/linux/$(uname -m)/usr/share/Lmod/init/bash # Initialise Lmod + # Initialise Lmod + . /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/compat/linux/$(uname -m)/usr/share/Lmod/init/bash export MODULEPATH=init/modules set +e # Do not exit immediately if a command exits with a non-zero status export EESSI_ARCHDETECT_OPTIONS_OVERRIDE="dummy/cpu" @@ -86,7 +87,8 @@ jobs: - name: Test for expected variables match between Lmod init script and original bash script run: | - . /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/compat/linux/$(uname -m)/usr/share/Lmod/init/bash # Initialise Lmod + # Initialise Lmod + . /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/compat/linux/$(uname -m)/usr/share/Lmod/init/bash # Set our path overrides according to our matrix export EESSI_SOFTWARE_SUBDIR_OVERRIDE=${{matrix.EESSI_SOFTWARE_SUBDIR_OVERRIDE}} @@ -160,7 +162,8 @@ jobs: - name: Test for identical environment after loading and unloading the EESSI module run: | - . /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/compat/linux/$(uname -m)/usr/share/Lmod/init/bash # Initialise Lmod + # Initialise Lmod + . /cvmfs/software.eessi.io/versions/${{matrix.EESSI_VERSION}}/compat/linux/$(uname -m)/usr/share/Lmod/init/bash # Set our cpu path overrides according to our matrix if [[ "${{matrix.EESSI_SOFTWARE_SUBDIR_OVERRIDE}}" != "none" ]]; then @@ -178,11 +181,14 @@ jobs: initial_env_file="initial_env.txt" module_cycled_file="load_unload_cycle.txt" + # prepare Lmod + export MODULEPATH=init/modules + module list + # Store the initial environment env | sort > "${initial_env_file}" # Do (and undo) loading the EESSI module - export MODULEPATH=init/modules CPU_ARCH=$(./init/eessi_archdetect.sh -a cpupath) module load EESSI/${{matrix.EESSI_VERSION}} module unload EESSI/${{matrix.EESSI_VERSION}}