forked from intel-analytics/BigDL-Tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start_notebook.sh
executable file
·48 lines (41 loc) · 1.3 KB
/
start_notebook.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
#!/bin/bash
# Check environment variables
if [ -z "${BIGDL_HOME}" ]; then
echo "Please set BIGDL_HOME environment variable"
exit 1
fi
if [ -z "${SPARK_HOME}" ]; then
echo "Please set SPARK_HOME environment variable"
exit 1
fi
#setup pathes
export PYSPARK_DRIVER_PYTHON=jupyter
export PYSPARK_DRIVER_PYTHON_OPTS="notebook --notebook-dir=./ --ip=* --no-browser --NotebookApp.token=''"
export BIGDL_JAR_NAME=`ls ${BIGDL_HOME}/lib/ | grep jar-with-dependencies.jar`
export BIGDL_JAR="${BIGDL_HOME}/lib/$BIGDL_JAR_NAME"
export BIGDL_PY_ZIP_NAME=`ls ${BIGDL_HOME}/lib/ | grep python-api.zip`
export BIGDL_PY_ZIP="${BIGDL_HOME}/lib/$BIGDL_PY_ZIP_NAME"
export BIGDL_CONF=${BIGDL_HOME}/conf/spark-bigdl.conf
# Check files
if [ ! -f ${BIGDL_CONF} ]; then
echo "Cannot find ${BIGDL_CONF}"
exit 1
fi
if [ ! -f ${BIGDL_PY_ZIP} ]; then
echo ${BIGDL_PY_ZIP}
echo "Cannot find ${BIGDL_PY_ZIP}"
exit 1
fi
if [ ! -f $BIGDL_JAR ]; then
echo "Cannot find $BIGDL_JAR"
exit 1
fi
${SPARK_HOME}/bin/pyspark \
--master local[4] \
--driver-memory 4g \
--properties-file ${BIGDL_CONF} \
--py-files ${BIGDL_PY_ZIP} \
--jars ${BIGDL_JAR} \
--conf spark.driver.extraClassPath=${BIGDL_JAR} \
--conf spark.executor.extraClassPath=${BIGDL_JAR} \
--conf spark.sql.catalogImplementation='in-memory'