forked from EESSI/software-layer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
check_missing_installations.sh
executable file
·51 lines (41 loc) · 1.85 KB
/
check_missing_installations.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
#
# Script to check for missing installations in EESSI pilot software stack (version 2021.12)
#
# author: Kenneth Hoste (@boegel)
# author: Thomas Roeblitz (@trz42)
#
# license: GPLv2
#
TOPDIR=$(dirname $(realpath $0))
if [ -z ${EESSI_PILOT_VERSION} ]; then
echo "ERROR: \${EESSI_PILOT_VERSION} must be set to run $0!" >&2
exit 1
fi
LOCAL_TMPDIR=$(mktemp -d)
source $TOPDIR/scripts/utils.sh
source $TOPDIR/configure_easybuild
echo ">> Checking for missing installations in ${EASYBUILD_INSTALLPATH}..."
eb_missing_out=$LOCAL_TMPDIR/eb_missing.out
# we need to use --from-pr to pull in some easyconfigs that are not available in EasyBuild version being used
# PR #16531: Nextflow-22.10.1.eb
${EB:-eb} --from-pr 16531 --easystack eessi-${EESSI_PILOT_VERSION}.yml --experimental --missing 2>&1 | tee ${eb_missing_out}
exit_code=${PIPESTATUS[0]}
ok_msg="Command 'eb --missing ...' succeeded, analysing output..."
fail_msg="Command 'eb --missing ...' failed, check log '${eb_missing_out}'"
check_exit_code ${exit_code} "${ok_msg}" "${fail_msg}"
# the above assesses the installed software for each easyconfig provided in
# the easystack file and then print messages such as
# `No missing modules!`
# or
# `2 out of 3 required modules missing:`
# depending on the result of the assessment. Hence, we need to check if the
# output does not contain any line with ` required modules missing:`
grep " required modules missing:" ${eb_missing_out} > /dev/null
exit_code=$?
# if grep returns 1 (` required modules missing:` was NOT found), we set
# MODULES_MISSING to 0, otherwise (it was found or another error) we set it to 1
[[ ${exit_code} -eq 1 ]] && MODULES_MISSING=0 || MODULES_MISSING=1
ok_msg="No missing installations, party time!"
fail_msg="On no, some installations are still missing, how did that happen?!"
check_exit_code ${MODULES_MISSING} "${ok_msg}" "${fail_msg}"