From 0154d649eface117f71dc07b598b8dc780c61f2e Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Fri, 18 Oct 2024 13:23:11 +0200 Subject: [PATCH 01/10] Streamline the checks for missing installations --- .../scripts/only_latest_easystacks.sh | 42 +++++++++++++++++++ .github/workflows/test-software.eessi.io.yml | 6 +-- check_missing_installations.sh | 17 ++++---- 3 files changed, 54 insertions(+), 11 deletions(-) create mode 100755 .github/workflows/scripts/only_latest_easystacks.sh diff --git a/.github/workflows/scripts/only_latest_easystacks.sh b/.github/workflows/scripts/only_latest_easystacks.sh new file mode 100755 index 0000000000..c78829e724 --- /dev/null +++ b/.github/workflows/scripts/only_latest_easystacks.sh @@ -0,0 +1,42 @@ +#!/bin/bash +EESSI_VERSION=${EESSI_VERSION:-"2023.06"} + +directory="easystacks/software.eessi.io/${EESSI_VERSION}" +# List of example filenames +files=($(ls "$directory"/*.yml)) +[ -n "$DEBUG" ] && echo "${files[@]}" + +versions=() +# Loop over each filename +for filename in "${files[@]}"; do + # Extract the semantic version using grep + version=$(echo "$filename" | grep -oP '(?<=eb-)\d+\.\d+\.\d+?(?=-)') + + # Output the result + [ -n "$DEBUG" ] && echo "Filename: $filename" + [ -n "$DEBUG" ] && echo "Extracted version: $version" + [ -n "$DEBUG" ] && echo + versions+=("$version") +done +highest_version=$(printf "%s\n" "${versions[@]}" | sort -V | tail -n 1) + +[ -n "$DEBUG" ] && echo "Highest version: $highest_version" +[ -n "$DEBUG" ] && echo +[ -n "$DEBUG" ] && echo "Matching files:" +all_latest_easystacks=($(find $directory -type f -name "*eb-$highest_version*.yml")) + +accel_latest_easystacks=() +cpu_latest_easystacks=() + +# Loop through the array and split based on partial matching of string +accel="/accel/" +for item in "${all_latest_easystacks[@]}"; do + if [[ "$item" == *"$accel"* ]]; then + accel_latest_easystacks+=("$item") + else + cpu_latest_easystacks+=("$item") + fi +done + +# Output the results +[ -n "$ACCEL_EASYSTACKS" ] && echo "${accel_latest_easystacks[@]}" || echo "${cpu_latest_easystacks[@]}" diff --git a/.github/workflows/test-software.eessi.io.yml b/.github/workflows/test-software.eessi.io.yml index 6f592cf4c4..525e16f99d 100644 --- a/.github/workflows/test-software.eessi.io.yml +++ b/.github/workflows/test-software.eessi.io.yml @@ -57,8 +57,8 @@ jobs: env | grep ^EESSI | sort # first check the CPU-only builds for this CPU target - echo "just run check_missing_installations.sh (should use easystacks/software.eessi.io/${{matrix.EESSI_VERSION}}/eessi-${{matrix.EESSI_VERSION}}-*.yml)" - for easystack_file in $(ls easystacks/software.eessi.io/${{matrix.EESSI_VERSION}}/eessi-${{matrix.EESSI_VERSION}}-eb-*.yml); do + 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)" + for easystack_file in $(EESSI_VERSION=${{matrix.EESSI_VERSION}} .github/workflows/scripts/only_latest_easystacks.sh); do if [ ${{matrix.EESSI_SOFTWARE_SUBDIR_OVERRIDE}} = "x86_64/amd/zen4" ]; then if grep -q 2022b <<<"${easystack_file}"; then # skip the check of installed software on zen4 for foss/2022b builds @@ -82,7 +82,7 @@ jobs: for accel in ${accelerators}; do module use ${EESSI_SOFTWARE_PATH}/accel/${accel}/modules/all echo "checking missing installations for accelerator ${accel} using modulepath: ${MODULEPATH}" - for easystack_file in $(ls easystacks/software.eessi.io/${{matrix.EESSI_VERSION}}/accel/$(dirname ${accel})/eessi-${{matrix.EESSI_VERSION}}-eb-*.yml); do + for easystack_file in $(EESSI_VERSION=${{matrix.EESSI_VERSION}} ACCEL_EASYSTACKS=1 .github/workflows/scripts/only_latest_easystacks.sh); do echo "check missing installations for ${easystack_file}..." ./check_missing_installations.sh ${easystack_file} ec=$? diff --git a/check_missing_installations.sh b/check_missing_installations.sh index 280de294af..7edd2ebb39 100755 --- a/check_missing_installations.sh +++ b/check_missing_installations.sh @@ -25,16 +25,17 @@ easystack=$1 LOCAL_TMPDIR=$(mktemp -d) +# ~~No longer required as we use from-commit as of EB 4.9.something~~ # Clone the develop branch of EasyBuild and use that to search for easyconfigs - -if [[ -z ${EASYBUILD_ROBOT_PATHS} ]]; then - git clone -b develop https://github.com/easybuilders/easybuild-easyconfigs.git $LOCAL_TMPDIR/easyconfigs - export EASYBUILD_ROBOT_PATHS=$LOCAL_TMPDIR/easyconfigs/easybuild/easyconfigs -fi - +# +#if [[ -z ${EASYBUILD_ROBOT_PATHS} ]]; then +# git clone -b develop https://github.com/easybuilders/easybuild-easyconfigs.git $LOCAL_TMPDIR/easyconfigs +# export EASYBUILD_ROBOT_PATHS=$LOCAL_TMPDIR/easyconfigs/easybuild/easyconfigs +#fi +# # All PRs used in EESSI are supposed to be merged, so we can strip out all cases of from-pr -tmp_easystack=${LOCAL_TMPDIR}/$(basename ${easystack}) -grep -v from-pr ${easystack} > ${tmp_easystack} +# tmp_easystack=${LOCAL_TMPDIR}/$(basename ${easystack}) +# grep -v from-pr ${easystack} > ${tmp_easystack} source $TOPDIR/scripts/utils.sh From b7e343d8bdba537ce01522831fa62d4e66dae2ab Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Fri, 18 Oct 2024 13:32:46 +0200 Subject: [PATCH 02/10] Clean out all code relating to use of from-pr --- check_missing_installations.sh | 37 +--------------------------------- 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/check_missing_installations.sh b/check_missing_installations.sh index 7edd2ebb39..79f6acc733 100755 --- a/check_missing_installations.sh +++ b/check_missing_installations.sh @@ -25,18 +25,6 @@ easystack=$1 LOCAL_TMPDIR=$(mktemp -d) -# ~~No longer required as we use from-commit as of EB 4.9.something~~ -# Clone the develop branch of EasyBuild and use that to search for easyconfigs -# -#if [[ -z ${EASYBUILD_ROBOT_PATHS} ]]; then -# git clone -b develop https://github.com/easybuilders/easybuild-easyconfigs.git $LOCAL_TMPDIR/easyconfigs -# export EASYBUILD_ROBOT_PATHS=$LOCAL_TMPDIR/easyconfigs/easybuild/easyconfigs -#fi -# -# All PRs used in EESSI are supposed to be merged, so we can strip out all cases of from-pr -# tmp_easystack=${LOCAL_TMPDIR}/$(basename ${easystack}) -# grep -v from-pr ${easystack} > ${tmp_easystack} - source $TOPDIR/scripts/utils.sh source $TOPDIR/configure_easybuild @@ -46,34 +34,11 @@ ${EB:-eb} --show-config echo ">> Checking for missing installations in ${EASYBUILD_INSTALLPATH}..." eb_missing_out=$LOCAL_TMPDIR/eb_missing.out -${EB:-eb} --easystack ${tmp_easystack} --missing 2>&1 | tee ${eb_missing_out} +${EB:-eb} --easystack ${easystack} --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}'" -if [ "$exit_code" -ne 0 ] && [ ! -z "$pr_exceptions" ]; then - # We might have failed due to unmerged PRs. Try to make exceptions for --from-pr added in this PR - # to software-layer, and see if then it passes. If so, we can report a more specific fail_msg - # Note that if no --from-pr's were used in this PR, $pr_exceptions will be empty and we might as - # well skip this check - unmerged PRs can not be the reason for the non-zero exit code in that scenario - - # Let's use awk so we can allow for exceptions if we are given a PR diff file - awk_command="awk '\!/'from-pr'/ EXCEPTIONS' $easystack" - awk_command=${awk_command/\\/} # Strip out the backslash we needed for ! - eval ${awk_command/EXCEPTIONS/$pr_exceptions} > ${tmp_easystack} - - msg=">> Checking for missing installations in ${EASYBUILD_INSTALLPATH}," - msg="${msg} allowing for --from-pr's that were added in this PR..." - echo ${msg} - eb_missing_out=$LOCAL_TMPDIR/eb_missing_with_from_pr.out - ${EB:-eb} --easystack ${tmp_easystack} --missing 2>&1 | tee ${eb_missing_out} - exit_code_with_from_pr=${PIPESTATUS[0]} - - # If now we succeeded, the reason must be that we originally stripped the --from-pr's - if [ "$exit_code_with_from_pr" -eq 0 ]; then - fail_msg="$fail_msg (are you sure all PRs referenced have been merged in EasyBuild?)" - fi -fi check_exit_code ${exit_code} "${ok_msg}" "${fail_msg}" From 0f49570976f75354e3ee0a5e9f25810d45638a55 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Fri, 18 Oct 2024 13:41:46 +0200 Subject: [PATCH 03/10] Disable CUDA missing installation check for Zen4 --- .github/workflows/test-software.eessi.io.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test-software.eessi.io.yml b/.github/workflows/test-software.eessi.io.yml index 525e16f99d..3ed3289ed7 100644 --- a/.github/workflows/test-software.eessi.io.yml +++ b/.github/workflows/test-software.eessi.io.yml @@ -83,6 +83,11 @@ jobs: module use ${EESSI_SOFTWARE_PATH}/accel/${accel}/modules/all echo "checking missing installations for accelerator ${accel} using modulepath: ${MODULEPATH}" for easystack_file in $(EESSI_VERSION=${{matrix.EESSI_VERSION}} ACCEL_EASYSTACKS=1 .github/workflows/scripts/only_latest_easystacks.sh); do + if [ ${{matrix.EESSI_SOFTWARE_SUBDIR_OVERRIDE}} = "x86_64/amd/zen4" ]; then + if grep -q CUDA <<<"${easystack_file}"; then + # skip the check of install CUDA software in the CPU path for zen4 + continue + fi echo "check missing installations for ${easystack_file}..." ./check_missing_installations.sh ${easystack_file} ec=$? From 8af465370f5006376f30e7872643753a20d8d72a Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Fri, 18 Oct 2024 13:46:09 +0200 Subject: [PATCH 04/10] Typo --- .github/workflows/test-software.eessi.io.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-software.eessi.io.yml b/.github/workflows/test-software.eessi.io.yml index 3ed3289ed7..2e7a8e2724 100644 --- a/.github/workflows/test-software.eessi.io.yml +++ b/.github/workflows/test-software.eessi.io.yml @@ -85,8 +85,9 @@ jobs: for easystack_file in $(EESSI_VERSION=${{matrix.EESSI_VERSION}} ACCEL_EASYSTACKS=1 .github/workflows/scripts/only_latest_easystacks.sh); do if [ ${{matrix.EESSI_SOFTWARE_SUBDIR_OVERRIDE}} = "x86_64/amd/zen4" ]; then if grep -q CUDA <<<"${easystack_file}"; then - # skip the check of install CUDA software in the CPU path for zen4 - continue + # skip the check of install CUDA software in the CPU path for zen4 + continue + fi fi echo "check missing installations for ${easystack_file}..." ./check_missing_installations.sh ${easystack_file} From 7b49df4d76d11b28a805992aca95a36d6fb011c3 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Fri, 18 Oct 2024 15:23:25 +0200 Subject: [PATCH 05/10] Shuffle some files --- .../rebuilds/20240925-eb-4.9.4-NCCL-2.18.3-in-accel-prefix.yml | 0 ...me.yml => 20240506-eb-4.9.1-CUDA-12.1.1-ship-full-runtime.yml} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename easystacks/software.eessi.io/2023.06/{ => accel/nvidia}/rebuilds/20240925-eb-4.9.4-NCCL-2.18.3-in-accel-prefix.yml (100%) rename easystacks/software.eessi.io/2023.06/rebuilds/{2024.05.06-eb-4.9.1-CUDA-12.1.1-ship-full-runtime.yml => 20240506-eb-4.9.1-CUDA-12.1.1-ship-full-runtime.yml} (100%) diff --git a/easystacks/software.eessi.io/2023.06/rebuilds/20240925-eb-4.9.4-NCCL-2.18.3-in-accel-prefix.yml b/easystacks/software.eessi.io/2023.06/accel/nvidia/rebuilds/20240925-eb-4.9.4-NCCL-2.18.3-in-accel-prefix.yml similarity index 100% rename from easystacks/software.eessi.io/2023.06/rebuilds/20240925-eb-4.9.4-NCCL-2.18.3-in-accel-prefix.yml rename to easystacks/software.eessi.io/2023.06/accel/nvidia/rebuilds/20240925-eb-4.9.4-NCCL-2.18.3-in-accel-prefix.yml diff --git a/easystacks/software.eessi.io/2023.06/rebuilds/2024.05.06-eb-4.9.1-CUDA-12.1.1-ship-full-runtime.yml b/easystacks/software.eessi.io/2023.06/rebuilds/20240506-eb-4.9.1-CUDA-12.1.1-ship-full-runtime.yml similarity index 100% rename from easystacks/software.eessi.io/2023.06/rebuilds/2024.05.06-eb-4.9.1-CUDA-12.1.1-ship-full-runtime.yml rename to easystacks/software.eessi.io/2023.06/rebuilds/20240506-eb-4.9.1-CUDA-12.1.1-ship-full-runtime.yml From 94c04f85405e426c6eac64b67e0b2854ea860ee9 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Fri, 18 Oct 2024 15:24:52 +0200 Subject: [PATCH 06/10] Simplify things further --- .github/workflows/test-software.eessi.io.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/test-software.eessi.io.yml b/.github/workflows/test-software.eessi.io.yml index 2e7a8e2724..025f797d52 100644 --- a/.github/workflows/test-software.eessi.io.yml +++ b/.github/workflows/test-software.eessi.io.yml @@ -63,9 +63,6 @@ jobs: if grep -q 2022b <<<"${easystack_file}"; then # skip the check of installed software on zen4 for foss/2022b builds continue - elif grep -q CUDA <<<"${easystack_file}"; then - # skip the check of install CUDA software in the CPU path for zen4 - continue fi fi echo "check missing installations for ${easystack_file}..." @@ -83,12 +80,6 @@ jobs: module use ${EESSI_SOFTWARE_PATH}/accel/${accel}/modules/all echo "checking missing installations for accelerator ${accel} using modulepath: ${MODULEPATH}" for easystack_file in $(EESSI_VERSION=${{matrix.EESSI_VERSION}} ACCEL_EASYSTACKS=1 .github/workflows/scripts/only_latest_easystacks.sh); do - if [ ${{matrix.EESSI_SOFTWARE_SUBDIR_OVERRIDE}} = "x86_64/amd/zen4" ]; then - if grep -q CUDA <<<"${easystack_file}"; then - # skip the check of install CUDA software in the CPU path for zen4 - continue - fi - fi echo "check missing installations for ${easystack_file}..." ./check_missing_installations.sh ${easystack_file} ec=$? From f32a18cf1c1ade9bc411329a376904ecb4ea0db0 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Fri, 18 Oct 2024 16:15:04 +0200 Subject: [PATCH 07/10] Prune 2022b from easystacks when using Zen4 --- .github/workflows/test-software.eessi.io.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-software.eessi.io.yml b/.github/workflows/test-software.eessi.io.yml index 025f797d52..851bd323e0 100644 --- a/.github/workflows/test-software.eessi.io.yml +++ b/.github/workflows/test-software.eessi.io.yml @@ -60,10 +60,11 @@ jobs: 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)" for easystack_file in $(EESSI_VERSION=${{matrix.EESSI_VERSION}} .github/workflows/scripts/only_latest_easystacks.sh); do if [ ${{matrix.EESSI_SOFTWARE_SUBDIR_OVERRIDE}} = "x86_64/amd/zen4" ]; then - if grep -q 2022b <<<"${easystack_file}"; then - # skip the check of installed software on zen4 for foss/2022b builds - continue - fi + # Make a temporary EasyStack file where we clean out all 2022b stuff and use that + new_easystack=$(mktemp pruned_easystackXXX --suffix=.yml) + # first clean out the options then clean out the .eb name + sed '/2022b\|12\.2\.0/,/\.eb/{/\.eb/!d}' "${easystack_file}" | sed '/2022b\|12\.2\.0/d' > $new_easystack + easystack_file="$new_easystack" fi echo "check missing installations for ${easystack_file}..." ./check_missing_installations.sh ${easystack_file} From 118ef43761d80830e82f7500199a2117a1e8653b Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Fri, 18 Oct 2024 16:39:59 +0200 Subject: [PATCH 08/10] Add a diff for pruned Zen4 easystacks --- .github/workflows/test-software.eessi.io.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-software.eessi.io.yml b/.github/workflows/test-software.eessi.io.yml index 851bd323e0..e3d76351ea 100644 --- a/.github/workflows/test-software.eessi.io.yml +++ b/.github/workflows/test-software.eessi.io.yml @@ -64,6 +64,7 @@ jobs: new_easystack=$(mktemp pruned_easystackXXX --suffix=.yml) # first clean out the options then clean out the .eb name sed '/2022b\|12\.2\.0/,/\.eb/{/\.eb/!d}' "${easystack_file}" | sed '/2022b\|12\.2\.0/d' > $new_easystack + diff --unified=0 "$easystack_file" "$new_easystack" || : easystack_file="$new_easystack" fi echo "check missing installations for ${easystack_file}..." From b4ef5da4c7282f57aa0ace944f20669d435accf1 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Fri, 18 Oct 2024 16:57:59 +0200 Subject: [PATCH 09/10] Revery some stuff and handle rebuilds for Zen4 --- .github/workflows/test-software.eessi.io.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-software.eessi.io.yml b/.github/workflows/test-software.eessi.io.yml index e3d76351ea..ca3792f6ef 100644 --- a/.github/workflows/test-software.eessi.io.yml +++ b/.github/workflows/test-software.eessi.io.yml @@ -60,12 +60,18 @@ jobs: 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)" for easystack_file in $(EESSI_VERSION=${{matrix.EESSI_VERSION}} .github/workflows/scripts/only_latest_easystacks.sh); do if [ ${{matrix.EESSI_SOFTWARE_SUBDIR_OVERRIDE}} = "x86_64/amd/zen4" ]; then - # Make a temporary EasyStack file where we clean out all 2022b stuff and use that - new_easystack=$(mktemp pruned_easystackXXX --suffix=.yml) - # first clean out the options then clean out the .eb name - sed '/2022b\|12\.2\.0/,/\.eb/{/\.eb/!d}' "${easystack_file}" | sed '/2022b\|12\.2\.0/d' > $new_easystack - diff --unified=0 "$easystack_file" "$new_easystack" || : - easystack_file="$new_easystack" + if grep -q 2022b <<<"${easystack_file}"; then + # skip the check of installed software on zen4 for foss/2022b builds + continue + fi + if [[ $easystack_file == *"rebuilds"* ]]; then + # Also handle rebuilds, make a temporary EasyStack file where we clean out all 2022b stuff and use that + new_easystack=$(mktemp pruned_easystackXXX --suffix=.yml) + # first clean out the options then clean out the .eb name + sed '/2022b\|12\.2\.0/,/\.eb/{/\.eb/!d}' "${easystack_file}" | sed '/2022b\|12\.2\.0/d' > $new_easystack + diff --unified=0 "$easystack_file" "$new_easystack" || : + easystack_file="$new_easystack" + fi fi echo "check missing installations for ${easystack_file}..." ./check_missing_installations.sh ${easystack_file} From 3ec0157ef11001586de4eb72c0e3e7bbd5ac6732 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Thu, 31 Oct 2024 16:05:53 +0100 Subject: [PATCH 10/10] Address review --- .../scripts/only_latest_easystacks.sh | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scripts/only_latest_easystacks.sh b/.github/workflows/scripts/only_latest_easystacks.sh index c78829e724..acc9d3279a 100755 --- a/.github/workflows/scripts/only_latest_easystacks.sh +++ b/.github/workflows/scripts/only_latest_easystacks.sh @@ -1,9 +1,21 @@ #!/bin/bash +# +# This script figures out the latest version of EasyBuild being used for the installation of easystack +# files. +# +# This file is part of the EESSI software layer, see +# https://github.com/EESSI/software-layer.git +# +# author: Alan O'Cais (CECAM) +# +# license: GPLv2 +# + EESSI_VERSION=${EESSI_VERSION:-"2023.06"} directory="easystacks/software.eessi.io/${EESSI_VERSION}" # List of example filenames -files=($(ls "$directory"/*.yml)) +files=($(find "$directory" -name "*.yml" | grep -e '-eb-')) [ -n "$DEBUG" ] && echo "${files[@]}" versions=() @@ -39,4 +51,8 @@ for item in "${all_latest_easystacks[@]}"; do done # Output the results -[ -n "$ACCEL_EASYSTACKS" ] && echo "${accel_latest_easystacks[@]}" || echo "${cpu_latest_easystacks[@]}" +if [ -n "$ACCEL_EASYSTACKS" ]; then + echo "${accel_latest_easystacks[@]}" +else + echo "${cpu_latest_easystacks[@]}" +fi