You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by jb...@apache.org on 2019/04/18 16:46:52 UTC

[geode-benchmarks] branch develop updated: Fixes parameter parsing in AWS scripts.

This is an automated email from the ASF dual-hosted git repository.

jbarrett pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-benchmarks.git


The following commit(s) were added to refs/heads/develop by this push:
     new 43ea8ed  Fixes parameter parsing in AWS scripts.
43ea8ed is described below

commit 43ea8eded9f15feafc771d7bdec80cfbd969ee98
Author: Jacob Barrett <jb...@pivotal.io>
AuthorDate: Thu Apr 18 09:46:37 2019 -0700

    Fixes parameter parsing in AWS scripts.
---
 infrastructure/scripts/aws/copy_to_cluster.sh      |  6 ++---
 infrastructure/scripts/aws/destroy_cluster.sh      |  6 ++---
 infrastructure/scripts/aws/launch_cluster.sh       |  8 +++---
 infrastructure/scripts/aws/run_against_baseline.sh | 31 +++++++++++-----------
 infrastructure/scripts/aws/run_on_cluster.sh       |  6 ++---
 infrastructure/scripts/aws/run_tests.sh            | 11 ++++----
 6 files changed, 29 insertions(+), 39 deletions(-)

diff --git a/infrastructure/scripts/aws/copy_to_cluster.sh b/infrastructure/scripts/aws/copy_to_cluster.sh
index 46d0509..9b9a95c 100755
--- a/infrastructure/scripts/aws/copy_to_cluster.sh
+++ b/infrastructure/scripts/aws/copy_to_cluster.sh
@@ -24,7 +24,7 @@ BENCHMARK_BRANCH='develop'
 
 REPO='https://github.com/apache/geode'
 
-while :; do
+while (( "$#" )); do
   case $1 in
     -t|--tag )
       if [ "$2" ]; then
@@ -50,10 +50,8 @@ while :; do
       ;;
     -?* )
       printf 'Invalid option: %s\n' "$1" >&2
-      break
+      exit 1
       ;;
-    * )
-      break
   esac
   shift
 done
diff --git a/infrastructure/scripts/aws/destroy_cluster.sh b/infrastructure/scripts/aws/destroy_cluster.sh
index b6cafec..a56d8e2 100755
--- a/infrastructure/scripts/aws/destroy_cluster.sh
+++ b/infrastructure/scripts/aws/destroy_cluster.sh
@@ -20,7 +20,7 @@
 TAG=
 CI=
 
-while :; do
+while (( "$#" )); do
   case $1 in
     -t|--tag )
       if [ "$2" ]; then
@@ -49,10 +49,8 @@ while :; do
       ;;
     -?* )
       printf 'Invalid option: %s\n' "$1" >&2
-      break
+      exit 1
       ;;
-    * )
-      break
   esac
   shift
 done
diff --git a/infrastructure/scripts/aws/launch_cluster.sh b/infrastructure/scripts/aws/launch_cluster.sh
index 13d6b33..b07fbe9 100755
--- a/infrastructure/scripts/aws/launch_cluster.sh
+++ b/infrastructure/scripts/aws/launch_cluster.sh
@@ -23,8 +23,8 @@ TAG=
 COUNT=
 CI=
 
-while :; do
-  case $1 in
+while (( "$#" )); do
+  case "$1" in
     -t|--tag )
       if [ "$2" ]; then
         TAG=$2
@@ -62,10 +62,8 @@ while :; do
       ;;
     -?* )
       printf 'Invalid option: %s\n' "$1" >&2
-      break
+      exit 1
       ;;
-    * )
-      break
   esac
   shift
 done
diff --git a/infrastructure/scripts/aws/run_against_baseline.sh b/infrastructure/scripts/aws/run_against_baseline.sh
index 52bc07a..fa2f4fd 100755
--- a/infrastructure/scripts/aws/run_against_baseline.sh
+++ b/infrastructure/scripts/aws/run_against_baseline.sh
@@ -38,7 +38,7 @@ TAG=
 METADATA=
 OUTPUT=
 
-while :; do
+while (( "$#" )); do
   case $1 in
     -t|--tag )
       if [ "$2" ]; then
@@ -133,10 +133,8 @@ while :; do
       ;;
     -?* )
       printf 'Invalid option: %s\n' "$1" >&2
-      break
+      exit 1
       ;;
-    * )
-      break
   esac
   shift
 done
@@ -155,47 +153,48 @@ if ! [[ "$OUTPUT" = /* ]]; then
   OUTPUT="$(pwd)/${OUTPUT}"
 fi
 
-if [[ -z "${VERSION}" ]]; then
+if [[ -z "${BASELINE_BRANCH}" ]]; then
   ./run_tests.sh \
       -t ${TAG} \
-      -r ${REPO} \
-      -b ${BRANCH} \
+      -v ${BASELINE_VERSION} \
       -p ${BENCHMARK_REPO} \
       -e ${BENCHMARK_BRANCH} \
-      -o ${OUTPUT}/branch \
+      -o ${OUTPUT}/baseline \
       -m "${METADATA}" \
       -- "$@"
 else
   ./run_tests.sh \
       -t ${TAG} \
-      -v ${VERSION} \
+      -r ${BASELINE_REPO} \
+      -b ${BASELINE_BRANCH} \
       -p ${BENCHMARK_REPO} \
       -e ${BENCHMARK_BRANCH} \
-      -o ${OUTPUT}/branch \
+      -o ${OUTPUT}/baseline \
       -m "${METADATA}" \
       -- "$@"
 fi
 
-if [[ -z "${BASELINE_BRANCH}" ]]; then
+if [[ -z "${VERSION}" ]]; then
   ./run_tests.sh \
       -t ${TAG} \
-      -v ${BASELINE_VERSION} \
+      -r ${REPO} \
+      -b ${BRANCH} \
       -p ${BENCHMARK_REPO} \
       -e ${BENCHMARK_BRANCH} \
-      -o ${OUTPUT}/baseline \
+      -o ${OUTPUT}/branch \
       -m "${METADATA}" \
       -- "$@"
 else
   ./run_tests.sh \
       -t ${TAG} \
-      -r ${BASELINE_REPO} \
-      -b ${BASELINE_BRANCH} \
+      -v ${VERSION} \
       -p ${BENCHMARK_REPO} \
       -e ${BENCHMARK_BRANCH} \
-      -o ${OUTPUT}/baseline \
+      -o ${OUTPUT}/branch \
       -m "${METADATA}" \
       -- "$@"
 fi
+
 set +x
 
 ./analyze_tests.sh ${OUTPUT}
diff --git a/infrastructure/scripts/aws/run_on_cluster.sh b/infrastructure/scripts/aws/run_on_cluster.sh
index f1ffdf6..b959221 100755
--- a/infrastructure/scripts/aws/run_on_cluster.sh
+++ b/infrastructure/scripts/aws/run_on_cluster.sh
@@ -24,7 +24,7 @@ BENCHMARK_BRANCH='develop'
 
 REPO='https://github.com/apache/geode'
 
-while :; do
+while (( "$#" )); do
   case $1 in
     -t|--tag )
       if [ "$2" ]; then
@@ -50,10 +50,8 @@ while :; do
       ;;
     -?* )
       printf 'Invalid option: %s\n' "$1" >&2
-      break
+      exit 1
       ;;
-    * )
-      break
   esac
   shift
 done
diff --git a/infrastructure/scripts/aws/run_tests.sh b/infrastructure/scripts/aws/run_tests.sh
index 88eec9c..93d130e 100755
--- a/infrastructure/scripts/aws/run_tests.sh
+++ b/infrastructure/scripts/aws/run_tests.sh
@@ -34,7 +34,7 @@ METADATA=
 OUTPUT=
 VERSION=
 
-while :; do
+while (( "$#" )); do
   case $1 in
     -t|--tag )
       if [ "$2" ]; then
@@ -108,10 +108,8 @@ while :; do
       ;;
     -?* )
       printf 'Invalid option: %s\n' "$1" >&2
-      break
+      exit 1
       ;;
-    * )
-      break
   esac
   shift
 done
@@ -195,7 +193,8 @@ instance_id=$(ssh ${SSH_OPTIONS} geode@$FIRST_INSTANCE cat .geode-benchmarks-ide
 
 ssh ${SSH_OPTIONS} geode@${FIRST_INSTANCE} \
   rm -rf geode-benchmarks '&&' \
-  git clone ${BENCHMARK_REPO} --branch ${BENCHMARK_BRANCH}
+  git clone ${BENCHMARK_REPO} '&&' \
+  cd geode-benchmarks '&&' git checkout ${BENCHMARK_BRANCH}
 
 BENCHMARK_SHA=$(ssh ${SSH_OPTIONS} geode@${FIRST_INSTANCE} \
   cd geode-benchmarks '&&' \
@@ -207,7 +206,7 @@ METADATA="${METADATA},'source_repo':'${GEODE_REPO}','benchmark_repo':'${BENCHMAR
 
 ssh ${SSH_OPTIONS} geode@${FIRST_INSTANCE} \
   cd geode-benchmarks '&&' \
-  ./gradlew -PgeodeVersion=${VERSION} benchmark -Phosts=${HOSTS} -Pmetadata="${METADATA}" "$@"
+  ./gradlew -PgeodeVersion=${VERSION} benchmark "-Phosts=${HOSTS}" "-Pmetadata=${METADATA}" "$@"
 
 mkdir -p ${OUTPUT}