Skip to content

Commit

Permalink
Merge branch 'main' into feature-archdetect-rpi
Browse files Browse the repository at this point in the history
  • Loading branch information
ocaisa authored Apr 12, 2024
2 parents c858fb4 + 686ac58 commit 1c3dc26
Show file tree
Hide file tree
Showing 53 changed files with 2,237 additions and 188 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/test_eessi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,33 @@ jobs:
export EESSI_OS_TYPE=linux
export EESSI_SOFTWARE_SUBDIR=${{matrix.EESSI_SOFTWARE_SUBDIR}}
env | grep ^EESSI | sort
echo "just run check_missing_installations.sh (should use eessi-${{matrix.EESSI_VERSION}}.yml)"
./check_missing_installations.sh
- name: Test check_missing_installations.sh with missing package (GCC/8.3.0)
run: |
source /cvmfs/pilot.eessi-hpc.org/versions/${{matrix.EESSI_VERSION}}/init/bash
module load EasyBuild
eb --version
export EESSI_PREFIX=/cvmfs/pilot.eessi-hpc.org/versions/${{matrix.EESSI_VERSION}}
export EESSI_OS_TYPE=linux
export EESSI_SOFTWARE_SUBDIR=${{matrix.EESSI_SOFTWARE_SUBDIR}}
env | grep ^EESSI | sort
echo "modify eessi-${{matrix.EESSI_VERSION}}.yml by adding a missing package (GCC/8.3.0)"
echo " GCC:" >> eessi-${{matrix.EESSI_VERSION}}.yml
echo " toolchains:" >> eessi-${{matrix.EESSI_VERSION}}.yml
echo " SYSTEM:" >> eessi-${{matrix.EESSI_VERSION}}.yml
echo " versions: '8.3.0'" >> eessi-${{matrix.EESSI_VERSION}}.yml
tail -n 4 eessi-${{matrix.EESSI_VERSION}}.yml
# note, check_missing_installations.sh exits 1 if a package was
# missing, which is intepreted as false (exit code based, not
# boolean logic), hence when the script exits 0 if no package was
# missing it is interpreted as true, thus the test did not capture
# the missing package
if ./check_missing_installations.sh; then
echo "did NOT capture missing package; test FAILED"
exit 1
else
echo "captured missing package; test PASSED"
exit 0
fi
135 changes: 135 additions & 0 deletions .github/workflows/test_eessi_container_script.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# documentation: https://help.github.com/en/articles/workflow-syntax-for-github-actions
name: Tests for eessi_container.sh script
on: [push, pull_request, workflow_dispatch]
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
eessi_container_script:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
SCRIPT_TEST:
- help
- listrepos_default
- listrepos_custom
- run
- shell
- container
- resume
# FIXME disabled because '--access rw' is not working in CI environment
#- readwrite
#- save
steps:
- name: Check out software-layer repository
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0

- name: install Apptainer
run: |
./install_apptainer_ubuntu.sh
- name: Collect info on test environment
run: |
mount
df -h
- name: Test eessi_container.sh script
run: |
test_cmd="cat /etc/os-release"
out_pattern="Debian GNU/Linux 11"
if [[ ${{matrix.SCRIPT_TEST}} == 'help' ]]; then
./eessi_container.sh --help
# test use of --list-repos without custom repos.cfg
elif [[ ${{matrix.SCRIPT_TEST}} == 'listrepos_default' ]]; then
outfile=out_listrepos.txt
./eessi_container.sh --verbose --list-repos | tee ${outfile}
grep "EESSI-pilot" ${outfile}
# test use of --list-repos with custom repos.cfg
elif [[ ${{matrix.SCRIPT_TEST}} == 'listrepos_custom' ]]; then
outfile=out_listrepos.txt
outfile2=out_listrepos_2.txt
mkdir -p ${PWD}/cfg
echo "[EESSI/20AB.CD]" > cfg/repos.cfg
echo "repo_version = 20AB.CD" >> cfg/repos.cfg
echo "[EESSI/20HT.TP]" >> cfg/repos.cfg
echo "repo_version = 20HT.TP" >> cfg/repos.cfg
./eessi_container.sh --verbose --list-repos | tee ${outfile}
grep "EESSI-pilot" ${outfile}
export EESSI_REPOS_CFG_DIR_OVERRIDE=${PWD}/cfg
./eessi_container.sh --verbose --list-repos | tee ${outfile2}
grep "[EESSI/2023.02]" ${outfile2}
# test use of --mode run
elif [[ ${{matrix.SCRIPT_TEST}} == 'run' ]]; then
outfile=out_run.txt
echo "${test_cmd}" > test_script.sh
chmod u+x test_script.sh
export SINGULARITY_BIND="$PWD:/test"
./eessi_container.sh --verbose --mode run /test/test_script.sh | tee ${outfile}
grep "${out_pattern}" ${outfile}
# test use of --mode shell
elif [[ ${{matrix.SCRIPT_TEST}} == 'shell' ]]; then
outfile=out_shell.txt
./eessi_container.sh --verbose --mode shell <<< "${test_cmd}" 2>&1 | tee ${outfile}
grep "${out_pattern}" ${outfile}
# test use of --container option, using a totally different container;
# cfr. https://github.com/easybuilders/easybuild-containers
elif [[ ${{matrix.SCRIPT_TEST}} == 'container' ]]; then
outfile=out_container.txt
container="docker://ghcr.io/eessi/build-node:debian10"
./eessi_container.sh --verbose --container ${container} --mode shell <<< "${test_cmd}" 2>&1 | tee ${outfile}
grep "Debian GNU/Linux 10" ${outfile}
# test use of '--access rw' to get write access in container
elif [[ ${{matrix.SCRIPT_TEST}} == 'readwrite' ]]; then
outfile=out_readwrite.txt
fn="test_${RANDOM}.txt"
echo "touch /cvmfs/pilot.eessi-hpc.org/${fn}" > test_script.sh
chmod u+x test_script.sh
export SINGULARITY_BIND="$PWD:/test"
./eessi_container.sh --verbose --access rw --mode run /test/test_script.sh > ${outfile}
tmpdir=$(grep "\-\-resume" ${outfile} | sed "s/.*--resume \([^']*\).*/\1/g")
# note: must use '--access rw' again here, since touched file is in overlay upper dir
./eessi_container.sh --verbose --resume ${tmpdir} --access rw --mode shell <<< "ls -l /cvmfs/pilot.eessi-hpc.org/${fn}" > ${outfile}
grep "/cvmfs/pilot.eessi-hpc.org/${fn}$" $outfile
# test use of --resume
elif [[ ${{matrix.SCRIPT_TEST}} == 'resume' ]]; then
outfile=out_resume.txt
./eessi_container.sh --verbose --mode shell <<< "${test_cmd}" > ${outfile}
tmpdir=$(grep "\-\-resume" ${outfile} | sed "s/.*--resume \([^']*\).*/\1/g")
rm -f ${outfile}
# make sure that container image exists
test -f ${tmpdir}/ghcr.io_eessi_build_node_debian11.sif || (echo "Container image not found in ${tmpdir}" >&2 && ls ${tmpdir} && exit 1)
./eessi_container.sh --verbose --resume ${tmpdir} --mode shell <<< "${test_cmd}" > ${outfile}
cat ${outfile}
grep "Resuming from previous run using temporary storage at ${tmpdir}" ${outfile}
grep "${out_pattern}" ${outfile}
# test use of --save (+ --resume)
elif [[ ${{matrix.SCRIPT_TEST}} == 'save' ]]; then
outfile=out_save.txt
fn="test_${RANDOM}.txt"
test_cmd="touch /cvmfs/pilot.eessi-hpc.org/${fn}"
./eessi_container.sh --verbose --mode shell --access rw --save test-save.tar <<< "${test_cmd}" 2>&1 | tee ${outfile}
rm -f ${outfile}
./eessi_container.sh --verbose --mode shell --access rw --resume test-save.tar <<< "ls -l /cvmfs/pilot.eessi-hpc.org/${fn}" > ${outfile}
grep "/cvmfs/pilot.eessi-hpc.org/${fn}$" $outfile
tar tfv test-save.tar | grep "overlay-upper/${fn}"
else
echo "Unknown test case: ${{matrix.SCRIPT_TEST}}" >&2
exit 1
fi
23 changes: 18 additions & 5 deletions .github/workflows/tests_archdetect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ jobs:
- x86_64/amd/zen2/Azure-CentOS7-7V12
- x86_64/amd/zen3/Azure-CentOS7-7V73X
- ppc64le/power9le/unknown-power9le
- aarch64/arm/neoverse-n1/Azure-Ubuntu20-Altra
- aarch64/arm/neoverse-n1/AWS-awslinux-graviton2
- aarch64/arm/neoverse-v1/AWS-awslinux-graviton3
- aarch64/arm/cortex-a72/debian-rpi4
- aarch64/neoverse_n1/Azure-Ubuntu20-Altra
- aarch64/neoverse_n1/AWS-awslinux-graviton2
- aarch64/neoverse_v1/AWS-awslinux-graviton3
- aarch64/cortex-a72/debian-rpi4
fail-fast: false
steps:
- name: checkout
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0

- name: Enable EESSI
uses: eessi/github-action-eessi@58b50fd2eead2162c2b9ac258d4fb60cc9f30503 # v2.0.13
- name: test eessi_archdetect.sh
run: |
export EESSI_MACHINE_TYPE=${{matrix.proc_cpuinfo}}
Expand All @@ -35,3 +36,15 @@ jobs:
echo "Test for ${{matrix.proc_cpuinfo}} FAILED: $CPU_ARCH" >&2
exit 1
fi
CPU_ARCHES=$(./init/eessi_archdetect.sh -a cpupath)
if [[ $CPU_ARCHES == "$( cat ./tests/archdetect/${{matrix.proc_cpuinfo}}.all.output )" ]]; then
echo "Test for ${{matrix.proc_cpuinfo}} PASSED: $CPU_ARCHES" >&2
else
echo "Test for ${{matrix.proc_cpuinfo}} FAILED: $CPU_ARCHES" >&2
exit 1
fi
# Check all those architectures actually exist
for dir in $(echo "$CPU_ARCHES" | tr ':' '\n'); do
# Search all EESSI versions as we may drop support at some point
ls -d "$EESSI_PREFIX"/../*/software/linux/"$dir"
done
32 changes: 32 additions & 0 deletions .github/workflows/tests_readme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# documentation: https://help.github.com/en/articles/workflow-syntax-for-github-actions
name: Tests for consistency of README.md
on:
push:
paths:
- README.md
- init/eessi_defaults

pull_request:
branches:
- main
paths:
- README.md
- init/eessi_defaults
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Check out software-layer repository
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0

- name: verify if README.md is consistent with EESSI_PILOT_VERSION from init/eessi_defaults
run: |
source init/eessi_defaults
grep "${EESSI_PILOT_VERSION}" README.md
- name: verify if README.md is consistent with EESSI_CVMFS_REPO from init/eessi_defaults
run: |
source init/eessi_defaults
grep "${EESSI_CVMFS_REPO}" README.md
70 changes: 58 additions & 12 deletions .github/workflows/tests_scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,25 @@ on:
push:
paths:
- build_container.sh
- create_directory_tarballs.sh
- EESSI-pilot-install-software.sh
- install_software_layer.sh
- load_easybuild_module.sh
- run_in_compat_layer_env.sh
- utils.sh
- scripts/utils.sh
- update_lmod_cache.sh

pull_request:
branches:
- main
paths:
- build_container.sh
- create_directory_tarballs.sh
- EESSI-pilot-install-software.sh
- install_software_layer.sh
- load_easybuild_module.sh
- run_in_compat_layer_env.sh
- utils.sh
- scripts/utils.sh
- update_lmod_cache.sh
permissions:
contents: read # to fetch code (actions/checkout)
Expand All @@ -27,18 +33,48 @@ jobs:
- name: checkout
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0

# see https://github.com/apptainer/singularity/issues/5390#issuecomment-899111181
- name: install Apptainer
run: |
sudo apt-get install alien
alien --version
apptainer_rpm=$(curl --silent -L https://dl.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/a/ | grep 'apptainer-[0-9]' | sed 's/.*\(apptainer[0-9._a-z-]*.rpm\).*/\1/g')
curl -OL https://dl.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/a/$apptainer_rpm
sudo alien -d $apptainer_rpm
sudo apt install ./apptainer*.deb
apptainer --version
# also check whether 'singularity' command is still provided by Apptainer installation
singularity --version
./install_apptainer_ubuntu.sh
- name: test load_easybuild_module.sh script
run: |
# bind current directory into container as /software-layer
export SINGULARITY_BIND="${PWD}:/software-layer"
for EB_VERSION in '4.5.0' '4.5.1' '4.7.2'; do
# Create script that uses load_easybuild_module.sh which we can run in compat layer environment
# note: Be careful with single vs double quotes below!
# ${EB_VERSION} should be expanded, so use double quotes;
# For statements using variables that are only defined in the script, like ${EASYBUILD_INSTALLPATH},
# use single quotes to avoid expansion while creating the script.
test_script="${PWD}/eb-${EB_VERSION}.sh"
echo '#!/bin/bash' > ${test_script}
# both $EB and $TMPDIR environment must be set, required by load_easybuild_module.sh script
echo 'export EB="eb"' >> ${test_script}
echo 'export TMPDIR=$(mktemp -d)' >> ${test_script}
# set up environment to have utility functions in place that load_easybuild_module.sh script relies on,
# along with $EESSI_* environment variables, and Lmod
echo 'ls -l /software-layer/' >> ${test_script}
echo 'source /software-layer/scripts/utils.sh' >> ${test_script}
echo 'source /software-layer/init/eessi_environment_variables' >> ${test_script}
echo 'source ${EPREFIX}/usr/share/Lmod/init/bash' >> ${test_script}
# minimal configuration for EasyBuild so we can test installation aspect of load_easybuild_module.sh script
echo "export EASYBUILD_INSTALLPATH=/tmp/eb-${EB_VERSION}" >> ${test_script}
echo 'module use ${EASYBUILD_INSTALLPATH}/modules/all' >> ${test_script}
echo '' >> ${test_script}
echo "source /software-layer/load_easybuild_module.sh ${EB_VERSION}" >> ${test_script}
echo 'module list' >> ${test_script}
echo 'eb --version' >> ${test_script}
chmod u+x ${test_script}
# run wrapper script + capture & check output
out="${PWD}/eb-${EB_VERSION}.out"
./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}
pattern="^This is EasyBuild ${EB_VERSION} "
grep "${pattern}" ${out} || (echo "Pattern '${pattern}' not found in output!" && exit 1)
done
- name: test install_software_layer.sh script
run: |
Expand All @@ -49,3 +85,13 @@ jobs:
# force using x86_64/generic, to avoid triggering an installation from scratch
sed -i "s@./EESSI-pilot-install-software.sh@\"export EESSI_SOFTWARE_SUBDIR_OVERRIDE='x86_64/generic'; ./EESSI-pilot-install-software.sh\"@g" install_software_layer.sh
./build_container.sh run /tmp/$USER/EESSI /tmp/install_software_layer.sh
- name: test create_directory_tarballs.sh script
run: |
# scripts need to be copied to /tmp,
# since create_directory_tarballs.sh must be accessible from within build container
cp -a * /tmp/
cd /tmp
./build_container.sh run /tmp/$USER/EESSI /tmp/create_directory_tarballs.sh 2021.12
# check if tarballs have been produced
ls -l *.tar.gz
Loading

0 comments on commit 1c3dc26

Please sign in to comment.