Skip to content

Commit

Permalink
Fixes to get pure vagrant microservices working again
Browse files Browse the repository at this point in the history
  • Loading branch information
jayunit100 committed Feb 10, 2015
1 parent abd8cf1 commit 2780944
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
3 changes: 2 additions & 1 deletion deploy/spark/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ RUN echo "JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk/" >> /opt/spark-1.2.0-bin-ha
#CMD echo "XXXXXX" && cat /etc/hosts && echo "YYYY" && ip addr | grep 17 && hostname && if [[ `hostname` = 'scale1.docker' ]] ; then /opt/spark-1.2.0-bin-hadoop2.4/sbin/start-master.sh ; else ping -c 2 scale1.docker && /opt/spark-1.2.0-bin-hadoop2.4/sbin/start-slave.sh -h spark://scale1.docker:7077 ; fi ; tailf /opt/spark-1.2.0-bin-hadoop2.4/logs/*

ADD run.sh /opt/run.sh
CMD if [[ `hostname` = 'scale1.docker' ]] ; then /opt/run.sh master ; else /opt/run.sh slave ; fi

CMD echo `hostname` && if [[ `hostname` = 'scale1.docker' ]] ; then /opt/run.sh master ; else /opt/run.sh slave ; fi
# CMD /opt/spark-1.2.0-bin-hadoop2.4/sbin/start-master.sh
22 changes: 7 additions & 15 deletions deploy/spark/run.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
#/bin/bash

if [ $# -eq 0 ]; then
echo "No arguments supplied"
echo "USAGE ./run.sh master|slave"
exit 1
fi

echo "running docker spark startup"

echo "starting ........"
if [ $1 = "master" ] ; then
/opt/spark-1.2.0-bin-hadoop2.4/sbin/start-master.sh ;
# slave
/opt/spark-1.2.0-bin-hadoop2.4/sbin/start-master.sh ;
else
ping -c 2 scale1.docker && /opt/spark-1.2.0-bin-hadoop2.4/sbin/start-slave.sh -h spark://scale1.docker:7077 ;
fi
### In all cases, we tail the logs as the final task...
tailf /opt/spark-1.2.0-bin-hadoop2.4/logs/*
echo "pinging slave........"
ping -c 2 scale1.docker && /opt/spark-1.2.0-bin-hadoop2.4/sbin/start-slave.sh -h spark://scale1.docker:7077 ;
fi

tail -f /opt/spark-1.2.0-bin-hadoop2.4/logs/*
2 changes: 1 addition & 1 deletion deploy/vagrant-run-up-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ echo "RUNNING smoke tests..."


if `sleep 2 && docker ps | grep -q scale1`; then
docker exec -i -t scale1 /opt/spark-1.2.0-bin-hadoop2.4/bin/spark-submit --class org.apache.spark.examples.SparkPi --master spark://scale1.docker:7077 /scale-shared/spark-examples_2.10-1.1.1.jar 10000
docker exec -i -t scale1 /opt/spark-1.2.0-bin-hadoop2.4/bin/spark-submit --class org.apache.spark.examples.SparkPi --master spark://scale1.docker:7077 /scale-shared/spark-examples_2.10-1.1.1.jar 100
else
echo "FAILED: Looks like vagrant creation of the spark containers failed ..."
docker ps
Expand Down

0 comments on commit 2780944

Please sign in to comment.