geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smgol...@apache.org
Subject [geode-benchmarks] branch develop updated: GEODE-6276: use named cli options for scripts
Date Thu, 17 Jan 2019 17:33:13 GMT
This is an automated email from the ASF dual-hosted git repository.

smgoller 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 8ec6dde  GEODE-6276: use named cli options for scripts
     new e4a68d8  Merge pull request #42 from balesh2/GEODE-6276
8ec6dde is described below

commit 8ec6dde1701e568db3fdbe7b9326935553a26207
Author: Helena A. Bales <hbales@pivotal.io>
AuthorDate: Wed Jan 16 15:55:11 2019 -0800

    GEODE-6276: use named cli options for scripts
    
    Name the cli options for running the benchmark. Support either a version
    number or a branch/commit ref. Use version to fetch previously built
    releases, to avoid rebuilding them every time.
    
    Signed-off-by: Jacob Barrett <jbarrett@pivotal.io>
---
 infrastructure/scripts/aws/run_against_baseline.sh | 69 ++++++++++++++++++---
 infrastructure/scripts/aws/run_tests.sh            | 72 ++++++++++++++++++----
 2 files changed, 121 insertions(+), 20 deletions(-)

diff --git a/infrastructure/scripts/aws/run_against_baseline.sh b/infrastructure/scripts/aws/run_against_baseline.sh
index 0e3f24b..b4be318 100755
--- a/infrastructure/scripts/aws/run_against_baseline.sh
+++ b/infrastructure/scripts/aws/run_against_baseline.sh
@@ -19,17 +19,70 @@
 
 set -e -o pipefail
 
+BENCHMARK_BRANCH='develop'
+
+TEMP=`getopt t:b::v::B::V::m::o::h "$@"`
+eval set -- "$TEMP"
+
+while true ; do
+    case "$1" in
+        -t)
+            TAG=$2 ; shift 2 ;;
+        -m)
+            BENCHMARK_BRANCH=$2 ; shift 2 ;;
+        -o)
+            OUTPUT=$2 ; shift 2 ;;
+        -b)
+            BRANCH=$2 ; shift 2 ;;
+        -v)
+            VERSION=$2 ; shift 2 ;;
+        -B)
+            BASELINE_BRANCH=$2 ; shift 2 ;;
+        -V)
+            BASELINE_VERSION=$2 ; shift 2 ;;
+        -h)
+            echo "Usage: run_test.sh -t [tag] [-v [version] | -b [branch]] [-V [baseline
version] | -B [baseline branch]] <options...>"
+            echo "Options:"
+            echo "-m : Benchmark branch (optional - defaults to develop)"
+            echo "-o : Output directory (optional - defaults to ./output-<date>-<tag>"
+            echo "-v : Geode Version"
+            echo "-b : Geode Branch"
+            echo "-V : Geode Baseline Version"
+            echo "-B : Geode Baseline Branch"
+            echo "-t : Cluster tag"
+            echo "-h : This help message"
+            shift 2
+            exit 1 ;;
+        --) shift ; break ;;
+        *) echo "Internal error!" ; exit 1 ;;
+    esac
+done
+
+
+
 DATE=$(date '+%m-%d-%Y-%H-%M-%S')
-TAG=${1}
-BRANCH=${2:-develop}
-BASELINE=${3:-"rel/v1.8.0"}
-BENCHMARK_BRANCH=${4:-develop}
-DEFAULT_OUTPUT_DIR=output-${DATE}-${TAG}
-OUTPUT=${5:-${DEFAULT_OUTPUT_DIR}}
+
+if [ -z "${TAG}" ]; then
+  echo "--tag argument is required."
+  exit 1
+fi
+
+OUTPUT=${OUTPUT:-output-${DATE}-${TAG}}
+
 if ! [[ "$OUTPUT" = /* ]]; then
   OUTPUT="$(pwd)/${OUTPUT}"
 fi
 
-./run_tests.sh ${TAG} ${BRANCH} ${BENCHMARK_BRANCH} ${OUTPUT}/branch
-./run_tests.sh ${TAG} ${BASELINE} ${BENCHMARK_BRANCH} ${OUTPUT}/baseline
+if [ -z "${VERSION}" ]; then
+  ./run_tests.sh -t ${TAG} -b ${BRANCH} -m ${BENCHMARK_BRANCH} -o ${OUTPUT}/branch
+else
+  ./run_tests.sh -t ${TAG} -v ${VERSION} -m ${BENCHMARK_BRANCH} -o ${OUTPUT}/branch
+fi
+
+if [ -z "${BASELINE_VERSION}" ]; then
+./run_tests.sh -t ${TAG} -b ${BASELINE_BRANCH} -m ${BENCHMARK_BRANCH} -o ${OUTPUT}/baseline
+else
+./run_tests.sh -t ${TAG} -v ${BASELINE_VERSION} -m ${BENCHMARK_BRANCH} -o ${OUTPUT}/baseline
+fi
+
 ./analyze_tests.sh ${OUTPUT}
diff --git a/infrastructure/scripts/aws/run_tests.sh b/infrastructure/scripts/aws/run_tests.sh
index f635e84..5035462 100755
--- a/infrastructure/scripts/aws/run_tests.sh
+++ b/infrastructure/scripts/aws/run_tests.sh
@@ -17,14 +17,50 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-set -e -o pipefail
+set -x -e -o pipefail
+
+BENCHMARK_BRANCH='develop'
+
+TEMP=`getopt t:b:v:m:o:h "$@"`
+eval set -- "$TEMP"
+
+while true ; do
+    case "$1" in
+        -t)
+            TAG=$2 ; shift 2 ;;
+        -m)
+            BENCHMARK_BRANCH=$2 ; shift 2 ;;
+        -o)
+            OUTPUT=$2 ; shift 2 ;;
+        -b)
+            BRANCH=$2 ; shift 2 ;;
+        -v)
+            VERSION=$2 ; shift 2 ;;
+        -h)
+            echo "Usage: run_test.sh -t [tag] [-v [version] | -b [branch]] <options...>"
+            echo "Options:"
+            echo "-m : Benchmark branch (optional - defaults to develop)"
+            echo "-o : Output directory (optional - defaults to ./output-<date>-<tag>"
+            echo "-v : Geode Version"
+            echo "-b : Geode Branch"
+            echo "-t : Cluster tag"
+            echo "-h : This help message"
+            shift 2
+            exit 1 ;;
+        --) shift ; break ;;
+        *) echo "Internal error!" ; exit 1 ;;
+    esac
+done
+
 
 DATE=$(date '+%m-%d-%Y-%H-%M-%S')
 
-TAG=${1}
-BRANCH=${2:-develop}
-BENCHMARK_BRANCH=${3:-develop}
-OUTPUT=${4:-output-${DATE}-${TAG}}
+if [ -z "${TAG}" ]; then
+  echo "--tag argument is required."
+  exit 1
+fi
+
+OUTPUT=${OUTPUT:-output-${DATE}-${TAG}}
 PREFIX="geode-performance-${TAG}"
 
 if [[ -z "${AWS_ACCESS_KEY_ID}" ]]; then
@@ -39,22 +75,34 @@ FIRST_INSTANCE=`aws ec2 describe-instances --query 'Reservations[*].Instances[*]
 echo "FIRST_INSTANCE=${FIRST_INSTANCE}"
 echo "HOSTS=${HOSTS}"
 
-ssh ${SSH_OPTIONS} geode@$FIRST_INSTANCE "\
-  rm -rf geode-benchmarks geode && \
-  git clone https://github.com/apache/geode geode && \
-  (pushd geode && git checkout ${BRANCH}) && \
-  (pushd geode && ./gradlew install installDist)"
+if [ ! -z "${BRANCH}" ]; then
+  if [ ! -z "${VERSION}" ]; then
+    echo "Specify --version or --branch."
+    exit 1
+  fi
+
+  ssh ${SSH_OPTIONS} geode@$FIRST_INSTANCE "\
+    rm -rf geode && \
+    git clone https://github.com/apache/geode --branch ${BRANCH} && \
+    cd geode && \
+    ./gradlew install installDist"
+
 
+  VERSION=$(ssh ${SSH_OPTIONS} geode@$FIRST_INSTANCE geode/geode-assembly/build/install/apache-geode/bin/gfsh
version)
+fi
 
-VERSION=$(ssh ${SSH_OPTIONS} geode@$FIRST_INSTANCE geode/geode-assembly/build/install/apache-geode/bin/gfsh
version)
+if [ -z "${VERSION}" ]; then
+  echo "Either --version or --branch is required."
+  exit 1
+fi
 
 
 ssh ${SSH_OPTIONS} geode@$FIRST_INSTANCE "\
+  rm -rf geode-benchmarks && \
   git clone https://github.com/apache/geode-benchmarks --branch ${BENCHMARK_BRANCH} &&
\
   cd geode-benchmarks && \
   ./gradlew -PgeodeVersion=${VERSION} benchmark -Phosts=${HOSTS}"
 
-
 mkdir -p ${OUTPUT}
 
 scp ${SSH_OPTIONS} -r geode@${FIRST_INSTANCE}:geode-benchmarks/geode-benchmarks/build/reports
${OUTPUT}/reports


Mime
View raw message