You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2019/09/09 21:37:35 UTC

[GitHub] [accumulo-testing] rcarterjr commented on a change in pull request #96: Resolves #78 Script to automate EC2

rcarterjr commented on a change in pull request #96: Resolves #78 Script to automate EC2 
URL: https://github.com/apache/accumulo-testing/pull/96#discussion_r322466545
 
 

 ##########
 File path: bin/automateEC2
 ##########
 @@ -0,0 +1,77 @@
+#! /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.
+
+
+ACCUMULO_REPO=$1
+ACCUMULO_TESTING_REPO=$2
+MUCHOS_REPO=$3
+
+while true; do
+
+	# builds Accumulo tarball in a temporary directory
+	mkdir ~/accumulotmp && cd ~/accumulotmp
+	git clone --single-branch --branch 2.0 --depth=1 $ACCUMULO_REPO && cd accumulo
+	mvn clean package -DskipFormat -PskipQA
+	
+	# copies the tarball to the given muchos directory
+	cp ./assemble/target/*.gz $MUCHOS_REPO/conf/upload/
+	if [ $? -eq 0 ]; then
+		echo "Accumulo tarball copied to fluo-muchos"
+		rm -rf ~/accumulotmp
+	else
+		break
+		rm -rf ~/accumulotmp
+	fi
+
+	# sets up the cluster
+	cd $MUCHOS_REPO || (echo "Incorrect fluo-muchos path: $MUCHOS_REPO" && break)
+	./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'
+	
+	# installs java-11 and makes it the default for mvn
+	ssh $CLUSTERUSER@$PROXYIP "sudo yum -y install java-11-openjdk-devel &"
+	ssh $CLUSTERUSER@$PROXYIP "sed -i '/export JAVA_HOME/d' ~/.bashrc"
+	ssh $CLUSTERUSER@$PROXYIP "sed -i '/# .bashrc/a export JAVA_HOME=/usr/lib/jvm/java-11-openjdk' ~/.bashrc"
+	ssh $CLUSTERUSER@$PROXYIP "source ~/.bashrc"
 
 Review comment:
   That's correct, I removed it on my most recent commit but I haven't pushed it. Once I test it further I will push, but I don't get back to the office until next week.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services