This is an automated email from the ASF dual-hosted git repository.
mmiller pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/accumulo-testing.git
The following commit(s) were added to refs/heads/master by this push:
new c63ea3d Resolves #78 Script to automate EC2 (#96)
c63ea3d is described below
commit c63ea3ddc3efbaf1f049322a2e1f195fd2093c02
Author: Russell Carter <russell.c12@gmail.com>
AuthorDate: Fri Sep 20 12:09:52 2019 -0400
Resolves #78 Script to automate EC2 (#96)
---
test/automation/automateEC2.sh | 82 ++++++++++++++++++++++++++++++++++++++++
test/automation/cluster_props.sh | 28 ++++++++++++++
2 files changed, 110 insertions(+)
diff --git a/test/automation/automateEC2.sh b/test/automation/automateEC2.sh
new file mode 100755
index 0000000..e4f3619
--- /dev/null
+++ b/test/automation/automateEC2.sh
@@ -0,0 +1,82 @@
+#! /usr/bin/env bash
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# reads all git repositories and properties from cluster_props.sh
+source cluster_props.sh
+while true; do
+
+ # check for null properties
+ [ -z "$ACCUMULO_REPO" ] && echo "Check accumulo in cluster_props.sh" &&
break
+ [ -z "$ACCUMULO_BRANCH" ] && echo "Check accumulo branch in cluster_props.sh" &&
break
+ [ -z "$ACCUMULO_TESTING_REPO" ] && echo "Check accumulo-testing in cluster_props.sh"
&& break
+ [ -z "$ACCUMULO_TESTING_BRANCH" ] && echo "Check accumulo-testing branch in cluster_props.sh"
&& break
+ [ -z "$FLUO_MUCHOS_REPO" ] && echo "Check fluo-muchos in cluster_props.sh" &&
break
+ [ -z "$FLUO_MUCHOS_BRANCH" ] && echo "Check fluo-muchos branch in cluster_props.sh"
&& break
+ [[ -z "$MUCHOS_PROPS" || ! -f "$MUCHOS_PROPS" ]] && echo "Check muchos.props in
cluster_props.sh" && break
+
+
+
+ # builds Accumulo tarball and installs fluo-muchos in a temporary directory
+ TMPDIR=`mktemp -d`
+ echo "Directory created: $TMPDIR " && cd $TMPDIR
+ git clone --single-branch --branch $FLUO_MUCHOS_BRANCH $FLUO_MUCHOS_REPO
+ git clone --single-branch --branch $ACCUMULO_BRANCH $ACCUMULO_REPO && cd accumulo
+ mvn clean package -DskipFormat -PskipQA
+
+ # copies the tarball to the given muchos directory
+ cp ./assemble/target/*.gz $TMPDIR/fluo-muchos/conf/upload/
+ if [ $? -eq 0 ]; then
+ echo "Accumulo tarball copied to fluo-muchos"
+ else
+ break
+ fi
+
+ # sets up the cluster
+ cd $TMPDIR/fluo-muchos || (echo "Could not find Fluo-Muchos" && break)
+ cp conf/muchos.props.example conf/muchos.props
+ cp $MUCHOS_PROPS ./conf/muchos.props || (echo Could not use custom config. Check path in
cluster_props.sh)
+
+ ./bin/muchos launch -c "$USER-cluster" && echo "Setting up cluster.."
+ # repeat setup until all nodes are intialized
+ until ./bin/muchos setup; do
+ echo "Script will resume once nodes are intialized."
+ echo "Retrying in 20 seconds..."
+ sleep 20
+ done
+
+
+ if [ $? -eq 0 ]; then
+ echo "EC2 cluster setup as $USER-cluster"
+ else
+ echo "Terminating cluster"
+ ./bin/muchos terminate -c $USER-cluster
+ break
+ fi
+
+ CLUSTERUSER=`./bin/muchos config -p cluster_user`
+ PROXYIP=`./bin/muchos config -p proxy.public.ip`
+ M2='/home/centos/install/apache-maven*/bin'
+
+ # clones and builds accumulo and accumulo-testing to EC2
+ ssh $CLUSTERUSER@$PROXYIP "git clone --single-branch --branch $ACCUMULO_BRANCH $ACCUMULO_REPO"
+ ssh $CLUSTERUSER@$PROXYIP "cd accumulo && $M2/mvn clean install -PskipQA &&
cd .."
+ ssh $CLUSTERUSER@$PROXYIP "git clone --single-branch --branch $ACCUMULO_TESTING_BRANCH $ACCUMULO_TESTING_REPO"
+ ssh $CLUSTERUSER@$PROXYIP "cd accumulo-testing && $M2/mvn clean package"
+
+ break
+done
diff --git a/test/automation/cluster_props.sh b/test/automation/cluster_props.sh
new file mode 100644
index 0000000..1466f15
--- /dev/null
+++ b/test/automation/cluster_props.sh
@@ -0,0 +1,28 @@
+#! /usr/bin/env bash
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+export ACCUMULO_REPO=https://github.com/apache/accumulo.git
+export ACCUMULO_BRANCH=master
+
+export ACCUMULO_TESTING_REPO=https://github.com/apache/accumulo-testing.git
+export ACCUMULO_TESTING_BRANCH=master
+
+export FLUO_MUCHOS_REPO=https://github.com/apache/fluo-muchos
+export FLUO_MUCHOS_BRANCH=master
+
+export MUCHOS_PROPS=${MUCHOS_PROPS:-/path/to/muchos/props}
+
|