-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add script to test S1 performance #24
Open
ocaisa
wants to merge
16
commits into
main
Choose a base branch
from
ocaisa-patch-1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+113
−4
Open
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
a93c208
Add script to test S1 performance
ocaisa 65733d8
Refactor and improve
ocaisa 2b94a66
Update run.sh
ocaisa ee00060
Update run.sh
ocaisa 559dffa
Update run.sh
ocaisa 811e45c
Update run.sh
ocaisa 5b990cb
Update test_S1_performance.sh
ocaisa 50771b4
Also save arch
ocaisa 7a21f4e
Make script executable
ocaisa 29286ed
Try to make S1 performance test restore previous setup, and run it in CI
ocaisa c38ad93
Be more careful about our location
ocaisa 3ca2347
Only cleanup once!
ocaisa 19840e5
Keep a copy of the json output in a file
ocaisa 28d3c03
Upload a copy of the performance results as an artifact
ocaisa 199801f
Tweak the output a tiny bit for readability
ocaisa e378f8b
Add number of files to json output
ocaisa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,30 @@ | ||
#!/bin/bash | ||
function join_by { | ||
local d=${1-} f=${2-} | ||
if shift 2; then | ||
printf %s "$f" "${@/#/$d}" | ||
fi | ||
} | ||
# Initialise EESSI | ||
source /cvmfs/pilot.eessi-hpc.org/latest/init/bash > /dev/null | ||
# Grab the date we do this and use that as out key for json output | ||
date=$(date -I) | ||
echo "{ \"$date\":[" | ||
json_array=() | ||
for s1server in `grep CVMFS_SERVER_URL /etc/cvmfs/domain.d/eessi-hpc.org.conf | grep -o '".*"' | sed 's/"//g' | tr ';' '\n'`; do | ||
# Edit the config file to point to a single S1 option, e.g., | ||
echo 'CVMFS_SERVER_URL="'"$s1server"'"' | sudo tee /etc/cvmfs/domain.d/eessi-hpc.org.local > /dev/null | ||
# Reconfigure CVMFS | ||
sudo cvmfs_config setup | ||
# Wipe the cache and run the example (I used Tensorflow from github.com/EESSI/eessi-demo) | ||
sudo cvmfs_config wipecache >& /dev/null | ||
# Run the TensorFlow example | ||
cd ../TensorFlow | ||
# Just print the real time | ||
realtime=$({ ./run.sh > /dev/null ; } 2> >(grep real | awk '{print $2}')) | ||
KB_per_sec=$(cvmfs_config stat pilot.eessi-hpc.org | column -t -H 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,17,18,19,20 | tail -1) | ||
# Print json output | ||
json_array+=("{\"$s1server\": [{\"time\":\"$realtime\"},{\"speed\":\"${KB_per_sec}KB/sec\"}]}") | ||
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. For parsing reasons, could we do something like this instead? (I'm not sold on using JSON in command line environments though, I fear the parsing in general.) |
||
done | ||
join_by ,$'\n' "${json_array[@]}" | ||
echo -e "\n]}" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Should have a way to check the user has the required
sudo
rightsThere 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.
Wasn't the idea to run this in a container, with bind mounts to empty directories for
/var/lib/cvmfs
& co (so empty cache), which would totally alleviate the need forsudo
?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.
It wasn't my idea...
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.
It actually doesn't seem like running it in a container can work:
I can get away with not wiping the cache since I control it, and I guess I can just overwrite the EESSI configuration file with a bind mount, but I am only left with timing the command if I can't run
cvmfs_config stat
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.
Actually, more than that, I need to be able to run
cvmfs_config setup
to put the new configuration in place. Otherwise I need to bind mount a new configuration and run each S1 in a separate container execution step.I really don't see the worth, we would lose a lot of valuable info and this implementation will run just fine as a CI job.