This repository has been archived by the owner on May 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Added context deploy benchmarking script (#111)
* Context deploy benchmark script
- Loading branch information
1 parent
387393a
commit 1b24bd0
Showing
3 changed files
with
99 additions
and
0 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,51 @@ | ||
#!/usr/bin/env bash | ||
|
||
CONTEXT_AMOUNT=5 | ||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
|
||
deploy_contexts_sequential() { | ||
for ((i = 1; i <= CONTEXT_AMOUNT; i++)) | ||
do | ||
agc context deploy -c "$1$i"; | ||
done | ||
} | ||
|
||
cleanup_contexts() { | ||
for ((i = 1; i <= CONTEXT_AMOUNT; i++)) | ||
do | ||
agc context destroy -c "$1$i"; | ||
done | ||
} | ||
|
||
deploy_contexts_all() { | ||
agc context deploy --all; | ||
} | ||
|
||
get_average_runtime() { | ||
START_SECONDS=$(date +%s) | ||
$1 $2 | ||
END_SECONDS=$(date +%s) | ||
DIFF_SECONDS=$((END_SECONDS-START_SECONDS)) | ||
AVERAGE_SECONDS=$(((DIFF_SECONDS%60)/CONTEXT_AMOUNT)) | ||
AVERAGE_MINUTES=$(((DIFF_SECONDS/60)/CONTEXT_AMOUNT)) | ||
echo "Average $2 $3 time across $CONTEXT_AMOUNT contexts is: $AVERAGE_MINUTES m $AVERAGE_SECONDS s" | ||
} | ||
|
||
get_all_averages() { | ||
get_average_runtime deploy_contexts_sequential "$1" "sequential deployment" | ||
cleanup_contexts "$1" | ||
get_average_runtime deploy_contexts_all "$1" "all deployment" | ||
get_average_runtime cleanup_contexts "$1" "destruction" | ||
} | ||
|
||
validate_and_run() { | ||
if [ $1 != "1" ] || [[ $2 != "cromwell" && $2 != "nextflow" ]] | ||
then | ||
echo "Please specify engine type to benchmark (cromwell | nextflow)" | ||
else | ||
cd "$SCRIPT_DIR/$2" | ||
get_all_averages $2 | ||
fi | ||
} | ||
|
||
validate_and_run $# $1 |
24 changes: 24 additions & 0 deletions
24
scripts/context-deploy-benchmark/cromwell/agc-project.yaml
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,24 @@ | ||
--- | ||
name: CromwellContextBenchmarkTest | ||
schemaVersion: 1 | ||
contexts: | ||
cromwell1: | ||
engines: | ||
- type: wdl | ||
engine: cromwell | ||
cromwell2: | ||
engines: | ||
- type: wdl | ||
engine: cromwell | ||
cromwell3: | ||
engines: | ||
- type: wdl | ||
engine: cromwell | ||
cromwell4: | ||
engines: | ||
- type: wdl | ||
engine: cromwell | ||
cromwell5: | ||
engines: | ||
- type: wdl | ||
engine: cromwell |
24 changes: 24 additions & 0 deletions
24
scripts/context-deploy-benchmark/nextflow/agc-project.yaml
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,24 @@ | ||
--- | ||
name: NextflowContextBenchmarkTest | ||
schemaVersion: 1 | ||
contexts: | ||
nextflow1: | ||
engines: | ||
- type: nextflow | ||
engine: nextflow | ||
nextflow2: | ||
engines: | ||
- type: nextflow | ||
engine: nextflow | ||
nextflow3: | ||
engines: | ||
- type: nextflow | ||
engine: nextflow | ||
nextflow4: | ||
engines: | ||
- type: nextflow | ||
engine: nextflow | ||
nextflow5: | ||
engines: | ||
- type: nextflow | ||
engine: nextflow |