-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathstandalone.sh
executable file
·72 lines (63 loc) · 2.35 KB
/
standalone.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
#
# Copyright 2016 MakeMyTrip (Kunal Aggarwal)
#
# This file is part of dataShark.
#
# dataShark is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# dataShark is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with dataShark. If not, see <http://www.gnu.org/licenses/>.
## GLOBALS
ERROR="[X]"
WARN="[!]"
INFO="[*]"
JARS=`ls lib/*.jar | awk -vORS=, '{ print $1 }' | sed 's/,$/\n/'`
CDIR=`pwd`
CODE_PATH=`ls conf/ | grep -v ".py" | xargs -i echo "$CDIR/conf/{}" | awk -vORS=: '{ print $1 }' | sed 's/:$/\n/'`
# LOAD ENVIRONMENT
source datashark-env.sh
DEBUG=""
while getopts ":d:" opt; do
case $opt in
d)
DEBUG="debug"
CODEFILE=$OPTARG
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
:)
echo "Option -$OPTARG requires an argument." >&2
exit 1
;;
esac
done
export PYTHONPATH=$SPARK_HOME/python:$CODE_PATH:$CDIR/plugins/output:$PYTHONPATH
echo ' '
echo ' __ __ _____ __ __ '
echo ' ____/ /___ _/ /_____ _/ ___// /_ ____ ______/ /__'
echo ' / __ / __ `/ __/ __ `/\__ \/ __ \/ __ `/ ___/ //_/'
echo ' / /_/ / /_/ / /_/ /_/ /___/ / / / / /_/ / / / ,< '
echo ' \__,_/\__,_/\__/\__,_//____/_/ /_/\__,_/_/ /_/|_| '
echo ' '
echo ' STANDALONE MODE '
echo ' '
echo ' v1.2.1 '
echo ' '
echo ' '
if [ "x$DEBUG" == "x" ]; then
CODEFILE=$1
else
echo "$INFO Debug Mode is ON" >&2
fi
spark-submit --jars $JARS --master local[*] --executor-memory 4G --driver-memory 2G datashark_standalone.py $CODEFILE $DEBUG