Skip to content

Commit 0a1a20c

Browse files
committed
Add scripts using tachyon tarball
- currently won't work as we're waiting on the new bin/tachyon script from tachyon
1 parent 2fa26ec commit 0a1a20c

File tree

6 files changed

+86
-3
lines changed

6 files changed

+86
-3
lines changed

make-distribution.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ echo "Version is ${VERSION}"
5858
# Initialize defaults
5959
SPARK_HADOOP_VERSION=1.0.4
6060
SPARK_YARN=false
61+
SPARK_TACHYON=false
6162
MAKE_TGZ=false
6263

6364
# Parse arguments
@@ -70,6 +71,9 @@ while (( "$#" )); do
7071
--with-yarn)
7172
SPARK_YARN=true
7273
;;
74+
--with-tachyon)
75+
SPARK_TACHYON=true
76+
;;
7377
--tgz)
7478
MAKE_TGZ=true
7579
;;
@@ -90,6 +94,12 @@ else
9094
echo "YARN disabled"
9195
fi
9296

97+
if [ "$SPARK_TACHYON" == "true" ]; then
98+
echo "Tachyon Enabled"
99+
else
100+
echo "Tachyon Disabled"
101+
fi
102+
93103
# Build fat JAR
94104
export SPARK_HADOOP_VERSION
95105
export SPARK_YARN
@@ -113,6 +123,27 @@ cp -r "$FWDIR/python" "$DISTDIR"
113123
cp -r "$FWDIR/sbin" "$DISTDIR"
114124

115125

126+
# Download and copy in tachyon, if requested
127+
if [ "$SPARK_TACHYON" == "true" ]; then
128+
TACHYON_VERSION="0.4.0"
129+
TACHYON_URL="https://github.com/amplab/tachyon/releases/download/v${TACHYON_VERSION}/tachyon-${TACHYON_VERSION}-bin.tar.gz"
130+
131+
TMPD=`mktemp -d`
132+
133+
pushd $TMPD > /dev/null
134+
echo "Fetchting tachyon tgz"
135+
wget "$TACHYON_URL"
136+
137+
tar xf "tachyon-${TACHYON_VERSION}-bin.tar.gz"
138+
cp "tachyon-${TACHYON_VERSION}/target/tachyon-${TACHYON_VERSION}-jar-with-dependencies.jar" "$DISTDIR/jars"
139+
mkdir "$DISTDIR/sbin/tachyon"
140+
cp -r "tachyon-${TACHYON_VERSION}"/{bin,conf,libexec} "$DISTDIR/sbin/tachyon"
141+
sed -i "s|export TACHYON_JAR=\$TACHYON_HOME/target/\(.*\)|# This is set for spark's make-distribution\n export TACHYON_JAR=\$TACHYON_HOME/../../jars/\1|" "$DISTDIR/sbin/tachyon/libexec/tachyon-config.sh"
142+
143+
popd > /dev/null
144+
rm -rf $TMPD
145+
fi
146+
116147
if [ "$MAKE_TGZ" == "true" ]; then
117148
TARDIR="$FWDIR/spark-$VERSION"
118149
cp -r "$DISTDIR" "$TARDIR"

sbin/start-all.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,22 @@
2424
sbin=`dirname "$0"`
2525
sbin=`cd "$sbin"; pwd`
2626

27+
TACHYON_STR=""
28+
29+
while (( "$#" )); do
30+
case $1 in
31+
--with-tachyon)
32+
TACHYON_STR="--with-tachyon"
33+
;;
34+
esac
35+
shift
36+
done
37+
2738
# Load the Spark configuration
2839
. "$sbin/spark-config.sh"
2940

3041
# Start Master
31-
"$sbin"/start-master.sh
42+
"$sbin"/start-master.sh $TACHYON_STR
3243

3344
# Start Workers
34-
"$sbin"/start-slaves.sh
45+
"$sbin"/start-slaves.sh $TACHYON_STR

sbin/start-master.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@
2222
sbin=`dirname "$0"`
2323
sbin=`cd "$sbin"; pwd`
2424

25+
START_TACHYON=false
26+
27+
while (( "$#" )); do
28+
case $1 in
29+
--with-tachyon)
30+
START_TACHYON=true
31+
;;
32+
esac
33+
shift
34+
done
35+
2536
. "$sbin/spark-config.sh"
2637

2738
if [ -f "${SPARK_CONF_DIR}/spark-env.sh" ]; then
@@ -41,3 +52,9 @@ if [ "$SPARK_MASTER_WEBUI_PORT" = "" ]; then
4152
fi
4253

4354
"$sbin"/spark-daemon.sh start org.apache.spark.deploy.master.Master 1 --ip $SPARK_MASTER_IP --port $SPARK_MASTER_PORT --webui-port $SPARK_MASTER_WEBUI_PORT
55+
56+
if [ "$START_TACHYON" == "true" ]; then
57+
"$sbin"/tachyon/bin/tachyon bootstrap-conf $SPARK_MASTER_IP
58+
"$sbin"/tachyon/bin/tachyon format -s
59+
"$sbin"/tachyon/bin/tachyon-start.sh master
60+
fi

sbin/start-slaves.sh

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@
2020
sbin=`dirname "$0"`
2121
sbin=`cd "$sbin"; pwd`
2222

23+
24+
START_TACHYON=false
25+
26+
while (( "$#" )); do
27+
case $1 in
28+
--with-tachyon)
29+
START_TACHYON=true
30+
;;
31+
esac
32+
shift
33+
done
34+
2335
. "$sbin/spark-config.sh"
2436

2537
if [ -f "${SPARK_CONF_DIR}/spark-env.sh" ]; then
@@ -37,7 +49,7 @@ fi
3749

3850
# Launch the slaves
3951
if [ "$SPARK_WORKER_INSTANCES" = "" ]; then
40-
exec "$sbin/slaves.sh" cd "$SPARK_HOME" \; "$sbin/start-slave.sh" 1 spark://$SPARK_MASTER_IP:$SPARK_MASTER_PORT
52+
"$sbin/slaves.sh" cd "$SPARK_HOME" \; "$sbin/start-slave.sh" 1 spark://$SPARK_MASTER_IP:$SPARK_MASTER_PORT
4153
else
4254
if [ "$SPARK_WORKER_WEBUI_PORT" = "" ]; then
4355
SPARK_WORKER_WEBUI_PORT=8081
@@ -46,3 +58,10 @@ else
4658
"$sbin/slaves.sh" cd "$SPARK_HOME" \; "$sbin/start-slave.sh" $(( $i + 1 )) spark://$SPARK_MASTER_IP:$SPARK_MASTER_PORT --webui-port $(( $SPARK_WORKER_WEBUI_PORT + $i ))
4759
done
4860
fi
61+
62+
if [ "$START_TACHYON" == "true" ]; then
63+
"$sbin/slaves.sh" cd "$SPARK_HOME" \; "$sbin"/tachyon/bin/tachyon bootstrap-conf $SPARK_MASTER_IP
64+
65+
# set -t so we can call sudo
66+
SPARK_SSH_OPTS="-o StrictHostKeyChecking=no -t" "$sbin/slaves.sh" cd "$SPARK_HOME" \; "$sbin/tachyon/bin/tachyon-start.sh" worker SudoMount \; sleep 1
67+
fi

sbin/stop-master.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ sbin=`cd "$sbin"; pwd`
2525
. "$sbin/spark-config.sh"
2626

2727
"$sbin"/spark-daemon.sh stop org.apache.spark.deploy.master.Master 1
28+
29+
"$sbin"/tachyon/bin/tachyon killAll tachyon.master.Master

sbin/stop-slaves.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ if [ -f "${SPARK_CONF_DIR}/spark-env.sh" ]; then
2626
. "${SPARK_CONF_DIR}/spark-env.sh"
2727
fi
2828

29+
# do before the below calls as they exec
30+
"$sbin/slaves.sh" cd "$SPARK_HOME" \; "$sbin"/tachyon/bin/tachyon killAll tachyon.worker.Worker
31+
2932
if [ "$SPARK_WORKER_INSTANCES" = "" ]; then
3033
"$sbin"/spark-daemons.sh stop org.apache.spark.deploy.worker.Worker 1
3134
else

0 commit comments

Comments
 (0)