Skip to content

Commit 0154d64

Browse files
committed
Streamline the checks for missing installations
1 parent 339a71e commit 0154d64

File tree

3 files changed

+54
-11
lines changed

3 files changed

+54
-11
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
EESSI_VERSION=${EESSI_VERSION:-"2023.06"}
3+
4+
directory="easystacks/software.eessi.io/${EESSI_VERSION}"
5+
# List of example filenames
6+
files=($(ls "$directory"/*.yml))
7+
[ -n "$DEBUG" ] && echo "${files[@]}"
8+
9+
versions=()
10+
# Loop over each filename
11+
for filename in "${files[@]}"; do
12+
# Extract the semantic version using grep
13+
version=$(echo "$filename" | grep -oP '(?<=eb-)\d+\.\d+\.\d+?(?=-)')
14+
15+
# Output the result
16+
[ -n "$DEBUG" ] && echo "Filename: $filename"
17+
[ -n "$DEBUG" ] && echo "Extracted version: $version"
18+
[ -n "$DEBUG" ] && echo
19+
versions+=("$version")
20+
done
21+
highest_version=$(printf "%s\n" "${versions[@]}" | sort -V | tail -n 1)
22+
23+
[ -n "$DEBUG" ] && echo "Highest version: $highest_version"
24+
[ -n "$DEBUG" ] && echo
25+
[ -n "$DEBUG" ] && echo "Matching files:"
26+
all_latest_easystacks=($(find $directory -type f -name "*eb-$highest_version*.yml"))
27+
28+
accel_latest_easystacks=()
29+
cpu_latest_easystacks=()
30+
31+
# Loop through the array and split based on partial matching of string
32+
accel="/accel/"
33+
for item in "${all_latest_easystacks[@]}"; do
34+
if [[ "$item" == *"$accel"* ]]; then
35+
accel_latest_easystacks+=("$item")
36+
else
37+
cpu_latest_easystacks+=("$item")
38+
fi
39+
done
40+
41+
# Output the results
42+
[ -n "$ACCEL_EASYSTACKS" ] && echo "${accel_latest_easystacks[@]}" || echo "${cpu_latest_easystacks[@]}"

.github/workflows/test-software.eessi.io.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ jobs:
5757
env | grep ^EESSI | sort
5858
5959
# first check the CPU-only builds for this CPU target
60-
echo "just run check_missing_installations.sh (should use easystacks/software.eessi.io/${{matrix.EESSI_VERSION}}/eessi-${{matrix.EESSI_VERSION}}-*.yml)"
61-
for easystack_file in $(ls easystacks/software.eessi.io/${{matrix.EESSI_VERSION}}/eessi-${{matrix.EESSI_VERSION}}-eb-*.yml); do
60+
echo "just run check_missing_installations.sh (should use easystacks/software.eessi.io/${{matrix.EESSI_VERSION}}/eessi-${{matrix.EESSI_VERSION}}-*.yml with latest EasyBuild release)"
61+
for easystack_file in $(EESSI_VERSION=${{matrix.EESSI_VERSION}} .github/workflows/scripts/only_latest_easystacks.sh); do
6262
if [ ${{matrix.EESSI_SOFTWARE_SUBDIR_OVERRIDE}} = "x86_64/amd/zen4" ]; then
6363
if grep -q 2022b <<<"${easystack_file}"; then
6464
# skip the check of installed software on zen4 for foss/2022b builds
@@ -82,7 +82,7 @@ jobs:
8282
for accel in ${accelerators}; do
8383
module use ${EESSI_SOFTWARE_PATH}/accel/${accel}/modules/all
8484
echo "checking missing installations for accelerator ${accel} using modulepath: ${MODULEPATH}"
85-
for easystack_file in $(ls easystacks/software.eessi.io/${{matrix.EESSI_VERSION}}/accel/$(dirname ${accel})/eessi-${{matrix.EESSI_VERSION}}-eb-*.yml); do
85+
for easystack_file in $(EESSI_VERSION=${{matrix.EESSI_VERSION}} ACCEL_EASYSTACKS=1 .github/workflows/scripts/only_latest_easystacks.sh); do
8686
echo "check missing installations for ${easystack_file}..."
8787
./check_missing_installations.sh ${easystack_file}
8888
ec=$?

check_missing_installations.sh

+9-8
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,17 @@ easystack=$1
2525

2626
LOCAL_TMPDIR=$(mktemp -d)
2727

28+
# ~~No longer required as we use from-commit as of EB 4.9.something~~
2829
# Clone the develop branch of EasyBuild and use that to search for easyconfigs
29-
30-
if [[ -z ${EASYBUILD_ROBOT_PATHS} ]]; then
31-
git clone -b develop https://github.com/easybuilders/easybuild-easyconfigs.git $LOCAL_TMPDIR/easyconfigs
32-
export EASYBUILD_ROBOT_PATHS=$LOCAL_TMPDIR/easyconfigs/easybuild/easyconfigs
33-
fi
34-
30+
#
31+
#if [[ -z ${EASYBUILD_ROBOT_PATHS} ]]; then
32+
# git clone -b develop https://github.com/easybuilders/easybuild-easyconfigs.git $LOCAL_TMPDIR/easyconfigs
33+
# export EASYBUILD_ROBOT_PATHS=$LOCAL_TMPDIR/easyconfigs/easybuild/easyconfigs
34+
#fi
35+
#
3536
# All PRs used in EESSI are supposed to be merged, so we can strip out all cases of from-pr
36-
tmp_easystack=${LOCAL_TMPDIR}/$(basename ${easystack})
37-
grep -v from-pr ${easystack} > ${tmp_easystack}
37+
# tmp_easystack=${LOCAL_TMPDIR}/$(basename ${easystack})
38+
# grep -v from-pr ${easystack} > ${tmp_easystack}
3839

3940
source $TOPDIR/scripts/utils.sh
4041

0 commit comments

Comments
 (0)