Skip to content

Commit 5c05c55

Browse files
committed
steal CI improvements from PR 51
1 parent e4436ec commit 5c05c55

1 file changed

Lines changed: 64 additions & 20 deletions

File tree

.github/workflows/tests_scripts.yml

Lines changed: 64 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ permissions:
2929
jobs:
3030
build:
3131
runs-on: ubuntu-24.04
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
EESSI_VERSION:
36+
- '2023.06'
37+
- '2025.06'
3238
steps:
3339
- name: checkout
3440
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
@@ -39,13 +45,14 @@ jobs:
3945
4046
- name: test load_easybuild_module.sh script
4147
run: |
42-
# bind current directory into container as /software-layer
43-
export SINGULARITY_BIND="${PWD}:/software-layer"
48+
export SINGULARITY_CACHEDIR=$PWD
49+
# bind current directory into container as /software-layer-scripts
50+
export SINGULARITY_BIND="${PWD}:/software-layer-scripts"
4451
4552
# can't test with EasyBuild versions older than v4.5.2 when using EESSI 2023.06,
4653
# since Python in compat layer is Python 3.11.x;
4754
# testing with a single EasyBuild version takes a while in GitHub Actions, so stick to a single sensible version
48-
for EB_VERSION in '4.6.0'; do
55+
for EB_VERSION in '5.1.0'; do
4956
# Create script that uses load_easybuild_module.sh which we can run in compat layer environment
5057
# note: Be careful with single vs double quotes below!
5158
# ${EB_VERSION} should be expanded, so use double quotes;
@@ -58,64 +65,101 @@ jobs:
5865
echo 'export TMPDIR=$(mktemp -d)' >> ${test_script}
5966
# set up environment to have utility functions in place that load_easybuild_module.sh script relies on,
6067
# along with $EESSI_* environment variables, and Lmod
61-
echo 'ls -l /software-layer/' >> ${test_script}
62-
echo 'source /software-layer/scripts/utils.sh' >> ${test_script}
63-
echo 'source /software-layer/init/eessi_environment_variables' >> ${test_script}
68+
echo 'ls -l /software-layer-scripts/' >> ${test_script}
69+
echo 'export EESSI_VERSION_OVERRIDE="${{matrix.EESSI_VERSION}}"' >> ${test_script}
70+
echo 'source /software-layer-scripts/scripts/utils.sh' >> ${test_script}
71+
echo 'source /software-layer-scripts/init/eessi_environment_variables' >> ${test_script}
6472
echo 'source ${EPREFIX}/usr/share/Lmod/init/bash' >> ${test_script}
6573
# minimal configuration for EasyBuild so we can test installation aspect of load_easybuild_module.sh script
6674
echo "export EASYBUILD_INSTALLPATH=/tmp/eb-${EB_VERSION}" >> ${test_script}
6775
echo 'module use ${EASYBUILD_INSTALLPATH}/modules/all' >> ${test_script}
6876
echo '' >> ${test_script}
69-
echo "source /software-layer/load_easybuild_module.sh ${EB_VERSION}" >> ${test_script}
77+
echo "source /software-layer-scripts/load_easybuild_module.sh ${EB_VERSION}" >> ${test_script}
7078
echo 'module list' >> ${test_script}
7179
echo 'eb --version' >> ${test_script}
7280
7381
chmod u+x ${test_script}
7482
83+
# make sure that correct EESSI version is used (required because default is a placeholder version)
84+
export EESSI_VERSION_OVERRIDE="${{matrix.EESSI_VERSION}}"
85+
7586
# run wrapper script + capture & check output
7687
out="${PWD}/eb-${EB_VERSION}.out"
77-
./eessi_container.sh --access rw --mode run --verbose /software-layer/run_in_compat_layer_env.sh /software-layer/eb-${EB_VERSION}.sh 2>&1 | tee ${out}
88+
./eessi_container.sh --access rw --mode run --verbose /software-layer-scripts/run_in_compat_layer_env.sh /software-layer-scripts/eb-${EB_VERSION}.sh 2>&1 | tee ${out}
7889
pattern="^This is EasyBuild ${EB_VERSION} "
7990
grep "${pattern}" ${out} || (echo "Pattern '${pattern}' not found in output!" && exit 1)
8091
done
8192
8293
- name: test install_software_layer.sh script
8394
run: |
84-
# bind current directory into container as /software-layer
85-
export SINGULARITY_BIND="${PWD}:/software-layer"
95+
export SINGULARITY_CACHEDIR=$PWD
96+
# bind current directory into container as /software-layer-scripts
97+
export SINGULARITY_BIND="${PWD}:/software-layer-scripts"
8698
# force using x86_64/generic, to avoid triggering an installation from scratch
8799
sed -i "s@./EESSI-install-software.sh@\"export EESSI_SOFTWARE_SUBDIR_OVERRIDE='x86_64/generic'; ./EESSI-install-software.sh\"@g" install_software_layer.sh
88100
# skip installation of CUDA SDKs, since this is too heavy for CI
89101
sed -i "s@./EESSI-install-software.sh@./EESSI-install-software.sh --skip-cuda-install@g" install_software_layer.sh
90-
./eessi_container.sh --mode run --verbose /software-layer/install_software_layer.sh
102+
103+
# make sure that correct EESSI version is used (required because default is a placeholder version)
104+
export EESSI_VERSION_OVERRIDE="${{matrix.EESSI_VERSION}}"
105+
106+
./eessi_container.sh --mode run --verbose /software-layer-scripts/install_software_layer.sh
91107
92108
- name: test create_directory_tarballs.sh script
93109
run: |
94-
# bind current directory into container as /software-layer
95-
export SINGULARITY_BIND="${PWD}:/software-layer"
110+
export SINGULARITY_CACHEDIR=$PWD
111+
# bind current directory into container as /software-layer-scripts
112+
export SINGULARITY_BIND="${PWD}:/software-layer-scripts"
113+
114+
# make sure that correct EESSI version is used (required because default is a placeholder version)
115+
export EESSI_VERSION_OVERRIDE="${{matrix.EESSI_VERSION}}"
116+
96117
# scripts need to be copied to /tmp,
97118
# since create_directory_tarballs.sh must be accessible from within build container
98-
./eessi_container.sh --mode run --verbose /software-layer/create_directory_tarballs.sh 2023.06
119+
./eessi_container.sh --mode run --verbose /software-layer-scripts/create_directory_tarballs.sh "${{matrix.EESSI_VERSION}}"
99120
# check if tarballs have been produced
100121
ls -l *.tar.gz
101122
102123
- name: test create_lmodsitepackage.py script
103124
run: |
104-
# bind current directory into container as /software-layer
105-
export SINGULARITY_BIND="${PWD}:/software-layer"
125+
export SINGULARITY_CACHEDIR=$PWD
126+
# bind current directory into container as /software-layer-scripts
127+
export SINGULARITY_BIND="${PWD}:/software-layer-scripts"
106128
107-
# Creates .lmod/SitePackage.lua in current dir, which then gets bind-mounted into /software-layer
129+
# Creates .lmod/SitePackage.lua in current dir, which then gets bind-mounted into /software-layer-scripts
108130
python3 create_lmodsitepackage.py .
109131
# run some commands to make sure that generated Lmod SitePackage file works
110132
test_script="${PWD}/test_lmod_sitepackage.sh"
111133
echo '#!/bin/bash' > ${test_script}
112-
echo 'export LMOD_PACKAGE_PATH="/software-layer/.lmod"' > ${test_script}
134+
echo 'export LMOD_PACKAGE_PATH="/software-layer-scripts/.lmod"' > ${test_script}
113135
echo 'ml --config' >> ${test_script}
114136
115137
chmod u+x ${test_script}
116138
139+
# make sure that correct EESSI version is used (required because default is a placeholder version)
140+
export EESSI_VERSION_OVERRIDE="${{matrix.EESSI_VERSION}}"
141+
117142
out="${PWD}/test_create_lmodsitepackage.out"
118-
./eessi_container.sh --mode run --verbose /software-layer/run_in_compat_layer_env.sh /software-layer/test_lmod_sitepackage.sh 2>&1 | tee ${out}
119-
for pattern in "^Site Pkg location.*/software-layer/.lmod/SitePackage.lua" "LMOD_SITEPACKAGE_LOCATION.*/software-layer/.lmod/SitePackage.lua"; do
143+
./eessi_container.sh --mode run --verbose /software-layer-scripts/run_in_compat_layer_env.sh /software-layer-scripts/test_lmod_sitepackage.sh 2>&1 | tee ${out}
144+
for pattern in "^Site Pkg location.*/software-layer-scripts/.lmod/SitePackage.lua" "LMOD_SITEPACKAGE_LOCATION.*/software-layer-scripts/.lmod/SitePackage.lua"; do
120145
grep "${pattern}" ${out} || (echo "Pattern '${pattern}' not found in output!" && exit 1)
121146
done
147+
148+
- name: Mount EESSI CernVM-FS repository
149+
uses: eessi/github-action-eessi@v3
150+
with:
151+
eessi_stack_version: ${{matrix.EESSI_VERSION}}
152+
use_eessi_module: true
153+
154+
- name: Verify that mounted repositories are passed through directly
155+
run: |
156+
export SINGULARITY_CACHEDIR=$PWD
157+
# run wrapper script + capture & check output
158+
export SINGULARITY_BIND="${PWD}:/software-layer-scripts"
159+
# make sure that correct EESSI version is used (required because default is a placeholder version)
160+
export EESSI_VERSION_OVERRIDE="${{matrix.EESSI_VERSION}}"
161+
162+
out="${PWD}/eb-${EB_VERSION}.out"
163+
./eessi_container.sh --access rw --mode run --verbose /software-layer-scripts/run_in_compat_layer_env.sh ls 2>&1 | tee ${out}
164+
echo $(grep "SINGULARITY_BIND" ${out})
165+
grep "SINGULARITY_BIND" ${out} | grep "software.eessi.io" || (echo "software.eessi.io did not seem to be bind mounted!" && exit 1)

0 commit comments

Comments
 (0)