-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #795 from ocaisa/streamline_install_check_ci
Streamline the checks for missing installations
- Loading branch information
Showing
5 changed files
with
72 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/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=($(find "$directory" -name "*.yml" | grep -e '-eb-')) | ||
[ -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 | ||
if [ -n "$ACCEL_EASYSTACKS" ]; then | ||
echo "${accel_latest_easystacks[@]}" | ||
else | ||
echo "${cpu_latest_easystacks[@]}" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.