-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Streamline the checks for missing installations #795
base: 2023.06-software.eessi.io
Are you sure you want to change the base?
Changes from all commits
0154d64
b7e343d
0f49570
8af4653
7b49df4
94c04f8
f32a18c
118ef43
b4ef5da
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
EESSI_VERSION=${EESSI_VERSION:-"2023.06"} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you source There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wanted this to be configurable in CI via setting the envvar |
||
|
||
directory="easystacks/software.eessi.io/${EESSI_VERSION}" | ||
# List of example filenames | ||
files=($(ls "$directory"/*.yml)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While maybe a rare case, but couldn't it happen that one adds a new easystack file with a higher EB version first under |
||
[ -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[@]}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe easier to read if put into standard |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add a short header (see other .sh scripts) with: