Skip to content
Permalink
Browse files
Merge pull request #42 from balesh2/GEODE-6276
GEODE-6276: use named cli options for scripts
  • Loading branch information
smgoller committed Jan 17, 2019
2 parents 048e403 + 8ec6dde commit e4a68d883bd8664db52aa71f490ba7a25a637953
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 20 deletions.
@@ -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}
@@ -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

0 comments on commit e4a68d8

Please sign in to comment.