Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding history server; mount volumes to persist logs;
- Loading branch information
1 parent
61fe4aa
commit 05e0c21
Showing
14 changed files
with
80,361 additions
and
104 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
FROM pavanpkulkarni/spark_image_2.0.1:first_image | ||
MAINTAINER pavan.git@gmail.com | ||
FROM img_221 | ||
LABEL authors="pavanpkulkarni@pavanpkulkarni.com" | ||
|
||
COPY SparkDocker-1.0.jar /opt/SparkDocker-1.0.jar | ||
COPY Docker_WordCount_Spark-1.0.jar /opt/Docker_WordCount_Spark-1.0.jar | ||
COPY sample.txt /opt/sample.txt | ||
|
||
CMD /opt/spark/bin/spark-submit --class $SPARK_CLASS --master spark://master:7077 /opt/SparkDocker-1.0.jar /opt/sample.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,41 @@ | ||
#!/bin/bash | ||
|
||
#pull docker image | ||
docker pull pavanpkulkarni/spark_image_2.0.1:first_image | ||
currtime=$(date +"%Y%m%d") | ||
LogFile=dockerRun_${currtime}.log | ||
|
||
#create a 5 node cluster with default configurations | ||
docker-compose build && docker-compose up -d && docker-compose scale slave=5 | ||
#pull spark docker image | ||
echo "***** Begin Pulling image ***** " >>$LogFile 2>&1 | ||
docker pull pavanpkulkarni/spark_image:2.2.1 | ||
echo "***** End Pulling image *****" >>$LogFile 2>&1 | ||
|
||
#spawn an image from where the job will be submitted to cluster | ||
docker build -t pavanpkulkarni/spark_image_2.0.1:first_image . | ||
#create a n node cluster with default configurations | ||
number_of_nodes=3 | ||
echo "***** Creating " $number_of_nodes " node cluster *****" >>$LogFile 2>&1 | ||
docker-compose build >>$LogFile 2>&1 | ||
docker-compose up -d --scale slave=$number_of_nodes >>$LogFile 2>&1 | ||
|
||
#run the job on the cluster | ||
docker run --net createandrunsparkjob_default -e "SPARK_CLASS=com.pavanpkulkarni.docker.SampleSparkScalaCode" pavanpkulkarni/spark_image_2.0.1:first_image | ||
echo "***** Executing job on " $number_of_nodes "node cluster *****" >>$LogFile 2>&1 | ||
docker exec master /opt/spark/bin/spark-submit \ | ||
--class com.pavanpkulkarni.dockerwordcount.DockerWordCount \ | ||
--master spark://master:6066 \ | ||
--deploy-mode cluster \ | ||
--verbose \ | ||
/opt/Docker_WordCount_Spark-1.0.jar /opt/sample.txt /opt/output/op1 >>$LogFile 2>&1 | ||
|
||
#remove the cluster | ||
docker-compose down | ||
|
||
#Uncomment below lines to add logic to bring down the cluster after spark job finish | ||
|
||
# submissionId=$(grep submissionId $LogFile | cut -d \" -f4) | ||
|
||
# echo "submission Id is : " $submissionId >>$LogFile 2>&1 | ||
|
||
# driverState=$(curl http://localhost:6066/v1/submissions/status/$submissionId | grep driverState | cut -d \" -f4) >>$LogFile 2>&1 | ||
|
||
# echo "driver state is : " $driverState >>$LogFile 2>&1 | ||
|
||
# #remove the cluster iff driver is finished | ||
# if [[ "$driverState" == "FINISH" ]]; then | ||
# echo "driver has successfully finished execution.. bringing down the cluster !!! " >>$LogFile 2>&1 | ||
# docker-compose down >>$LogFile 2>&1 | ||
# fi |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file added
BIN
+108 Bytes
docker-volume/spark-output/op1/.part-00000-119b7d77-8dee-46ad-a4ec-5293a835798a-c000.csv.crc
Binary file not shown.
Empty file.
Oops, something went wrong.