Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
4e2f6d0
Move bash utils to new scripts dir, add new dir to tarball creation
huebner-m Dec 20, 2022
5749181
Merge branch 'main' into move_bash_utils
boegel Jan 19, 2023
cdc018c
Merge branch 'main' of github.com:EESSI/software-layer into move_bash…
huebner-m Jan 25, 2023
8cac3df
Update of where utils.sh is located when sourcing
huebner-m Jan 25, 2023
3390a2d
Add create_directory_tarballs.sh to github CI
huebner-m Jan 25, 2023
70339ac
Merge branch 'move_bash_utils' of github.com:huebner-m/software-layer…
huebner-m Jan 25, 2023
0b85bed
Merge branch 'main' into enhancement/unified_script_to_access_EESSI
boegel Feb 1, 2023
f513b12
Add CI test for the create_directory_tarballs.sh script
huebner-m Feb 2, 2023
e4702ee
Need to specify the EESSI version to test create_directory_tarballs
huebner-m Feb 2, 2023
c4b9cf5
Fix wildcard usage when building tarball of the scripts dir
huebner-m Feb 2, 2023
ad2c322
Merge pull request #213 from huebner-m/move_bash_utils
boegel Feb 4, 2023
d964241
Merge branch 'main' of github-trz:EESSI/software-layer into enhanceme…
truib Feb 8, 2023
3a6fe0e
update location of utils.sh, uniform way to determine 'TOPDIR'
truib Feb 8, 2023
756b1b6
bump default container version
truib Feb 8, 2023
4c435ab
clarifying default value for repository arg
truib Feb 8, 2023
990ebda
move commands to install Apptainer in GitHub Actions Ubuntu VM to a s…
boegel Feb 8, 2023
3d143d8
add GitHub Actions workflow for testing eessi_container.sh script
boegel Feb 8, 2023
784a380
Merge branch 'enhancement/unified_script_to_access_EESSI' of github.c…
boegel Feb 8, 2023
5fe467a
stop script as soon as any command does non-zero exit + undefined env…
boegel Feb 8, 2023
57b8315
fix typo
boegel Feb 8, 2023
fba368d
comment out 'set -e -u' for now
boegel Feb 8, 2023
09feff7
rename --info to --verbose
boegel Feb 8, 2023
fe83f85
pin eessi/github-action-eessi by hash
boegel Feb 8, 2023
125bfa2
use exit code of container command in eessi_container.sh
boegel Feb 8, 2023
be3e399
replace RUN_SCRIPT_AND_ARGS with
truib Feb 8, 2023
0af2194
Merge branch 'enhancement/unified_script_to_access_EESSI' of github.c…
boegel Feb 8, 2023
27cbdf3
add checks for various use cases of eessi_container.sh script (+ no n…
boegel Feb 8, 2023
b34afca
commented dry-run option, moved verbose option in help msg
truib Feb 8, 2023
7d3818d
add checks for various use cases of eessi_container.sh script (+ no n…
boegel Feb 8, 2023
de60163
Merge branch 'enhancement/unified_script_to_access_EESSI' of github-t…
truib Feb 8, 2023
602aa68
fix check for './eessi_container.sh --resume'
boegel Feb 8, 2023
adcc655
fix small typos in grep commands
truib Feb 8, 2023
a11f1c0
Merge branch 'enhancement/unified_script_to_access_EESSI' of github-t…
truib Feb 8, 2023
7e47023
enable --verbose + add step to collect test env info
boegel Feb 10, 2023
a1bb7df
disable broken tests for eessi_container.sh script for now
boegel Feb 10, 2023
5e3a5b3
Merge pull request #216 from trz42/enhancement/unified_script_to_acce…
boegel Feb 10, 2023
b1a3635
added a function to obtain full path to a tool
truib Jan 24, 2023
27bc203
added function to determine IPv4 address
truib Jan 25, 2023
bfe6d36
various updates for bot/build.sh and eessi_container.sh
truib Feb 18, 2023
8372341
provide CVMFS_HTTP_PROXY if necessary
truib Feb 18, 2023
3f1aed9
add functions to derive hostname and port number from proxy URL
truib Jan 27, 2023
b7abfc6
add function to determine config sections
truib Jan 27, 2023
9b7b8a4
add parameter to list repositories, fix bugs
truib Feb 18, 2023
4a414f5
replace FILE with DIR in EESSI_REPOS_CFG_FILE_OVERRIDE
truib Feb 18, 2023
37abf4f
fix whitespace issues
truib Jan 29, 2023
d468a1a
include changes made to test PR for building with the bot
truib Feb 18, 2023
af658ee
fix issues in eessi_container.sh
truib Feb 3, 2023
eb66e1c
fix RUN_QUIET setting
truib Feb 4, 2023
1cb4674
improvements to resuming job environment
truib Feb 18, 2023
0c465da
address requested change
truib Feb 7, 2023
26ab98c
cleaning up leftovers after adding updates from NESSI
truib Feb 18, 2023
a44088e
moving cfg_files.sh to scripts dir
truib Feb 18, 2023
bbbad0d
improved handling of container cache + explicit pull of image
truib Feb 20, 2023
15ae58d
use VERBOSE instead of INFO
truib Feb 20, 2023
764e713
fix test for --list-repos; improve output for --list-repos
truib Feb 20, 2023
47cc1c6
implemented requested changes
truib Feb 21, 2023
7c418cd
Merge branch 'update_for_eessi_container_sh' of github-trz:trz42/soft…
trz42 Feb 22, 2023
712c40e
improvements to resuming job environment
trz42 Feb 22, 2023
16d9857
improved handling of container cache + explicit pull of image
trz42 Feb 22, 2023
9e8ca62
changed --info -> --verbose
trz42 Feb 22, 2023
c0350a9
improved messages for resume info and adjusted parsing in bot/build.sh
trz42 Feb 22, 2023
ef9a552
delete one of two tmp storage tarballs created by bot/build.sh
trz42 Feb 22, 2023
b908b39
update Lmod cache
trz42 Feb 23, 2023
6974e4b
add verbose messages on pulling/copying/reusing of container image
boegel Feb 24, 2023
54bdea5
don't require --verbose for info message on pulling/copying/reusing c…
boegel Feb 24, 2023
a4cea9a
add check to make sure that container image exists in tmpdir
boegel Feb 24, 2023
c975832
fix determining filename from container URL
boegel Feb 24, 2023
7ea7058
Merge pull request #232 from trz42/update_for_eessi_container_sh
boegel Feb 24, 2023
1c0081d
Merge branch 'main' of github-trz:EESSI/software-layer into enhanceme…
trz42 Feb 24, 2023
7cc6575
support cmd line arg flag terminator
trz42 Feb 25, 2023
0def4e9
just print contents of cfg/job.cfg
trz42 Feb 24, 2023
ef608d1
switching from json (YQ) to ini (cfg_files.sh)
trz42 Feb 24, 2023
429d5a0
add --generic arg when running install script
trz42 Feb 23, 2023
bd31faa
fix error in regex
trz42 Feb 23, 2023
1bafb78
use command separator --
trz42 Feb 23, 2023
c9041e3
try fixing arg issue
trz42 Feb 24, 2023
9d46a22
put build args into an array
trz42 Feb 24, 2023
ff5045f
use array to define args for build and tarball step
trz42 Feb 25, 2023
d08bd21
addressed comments and changes requested by first review
trz42 Mar 7, 2023
f59bfde
fix check for missing installations
trz42 Mar 7, 2023
7bb7c1d
add test with missing package
trz42 Mar 8, 2023
68a068b
separated test cases + updated evaluation of test result
trz42 Mar 8, 2023
72185ba
fix small bug in env var name
trz42 Mar 8, 2023
094e82d
set software subdir override before sourcing init script
trz42 Mar 8, 2023
60cf7e2
Revert "set software subdir override before sourcing init script"
trz42 Mar 8, 2023
6f47152
Revert "fix small bug in env var name"
trz42 Mar 8, 2023
a15676d
tweaking output of test
trz42 Mar 8, 2023
54d2a21
improved usage information
trz42 Mar 8, 2023
db7ed50
Merge branch 'nessi.no-2022.11-dev' of gh-nessi:NorESSI/software-laye…
trz42 Mar 9, 2023
f2c94bb
Merge commit 'refs/pull/233/head' of gh-nessi:EESSI/software-layer in…
trz42 Mar 10, 2023
c3c08de
Merge commit 'refs/pull/237/head' of gh-nessi:EESSI/software-layer in…
trz42 Mar 10, 2023
99231e8
if exit_code is not zero, use fatal_error (as it was)
trz42 Mar 10, 2023
cc17987
Merge commit 'refs/pull/237/head' of gh-nessi:EESSI/software-layer in…
trz42 Mar 10, 2023
3ca678e
Merge branch 'nessi.no-2022.11-dev' of gh-nessi:NorESSI/software-laye…
trz42 Mar 10, 2023
7908234
Merge branch 'merge-eessi-PR233-nessi-2022.11' into nessi.no-2022.11-…
trz42 Mar 10, 2023
b94bd11
fix bug in test logic
trz42 Mar 10, 2023
5e4bea9
added explanation for test cases (exit code vs boolean logic)
trz42 Mar 11, 2023
b158cb0
Merge commit 'refs/pull/237/head' of gh-nessi:EESSI/software-layer in…
trz42 Mar 11, 2023
bfcb7a4
Merge branch 'merge-eessi-PR233-nessi-2022.11' into nessi.no-2022.11-…
trz42 Mar 11, 2023
04f28c8
fix bug, env var PWD is uppercase
trz42 Mar 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
27 changes: 15 additions & 12 deletions .github/workflows/tests_scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ on:
- build_container.sh
- install_software_layer.sh
- run_in_compat_layer_env.sh
- utils.sh
- scripts/utils.sh
- update_lmod_cache.sh
- create_directory_tarballs.sh

pull_request:
branches:
Expand All @@ -16,8 +17,9 @@ on:
- build_container.sh
- install_software_layer.sh
- run_in_compat_layer_env.sh
- utils.sh
- scripts/utils.sh
- update_lmod_cache.sh
- create_directory_tarballs.sh
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
Expand All @@ -27,18 +29,9 @@ 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 install_software_layer.sh script
run: |
Expand All @@ -49,3 +42,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
3 changes: 2 additions & 1 deletion EESSI-pilot-install-software.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ set -- "${POSITIONAL_ARGS[@]}"

TOPDIR=$(dirname $(realpath $0))

source $TOPDIR/utils.sh
source $TOPDIR/scripts/utils.sh

# honor $TMPDIR if it is already defined, use /tmp otherwise
if [ -z $TMPDIR ]; then
Expand Down Expand Up @@ -484,6 +484,7 @@ if [ ! -f $LMOD_RC ]; then
check_exit_code $? "$LMOD_RC created" "Failed to create $LMOD_RC"
fi

echo "Updating Lmod cache"
$TOPDIR/update_lmod_cache.sh ${EPREFIX} ${EASYBUILD_INSTALLPATH}

$TOPDIR/check_missing_installations.sh
Expand Down
Loading