Skip to content
This repository was archived by the owner on Nov 16, 2019. It is now read-only.

Commit d431ac7

Browse files
authored
Create bootstrap.sh
Required: To start hadoop dfs and yarn when starting container and to pass required environment variables.
1 parent 2fde600 commit d431ac7

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
: ${HADOOP_PREFIX:=/usr/local/hadoop}
4+
5+
$HADOOP_PREFIX/etc/hadoop/hadoop-env.sh
6+
7+
rm /tmp/*.pid
8+
9+
# installing libraries if any - (resource urls added comma separated to the ACP system variable)
10+
cd $HADOOP_PREFIX/share/hadoop/common ; for cp in ${ACP//,/ }; do echo == $cp; curl -LO $cp ; done; cd -
11+
12+
# adding necessary paths to environment variables (FIXME: These are already in Dockerfile, but does not work. So giving them explicitly.)
13+
export PATH=$PATH:$SPARK_HOME/bin
14+
export PATH=$PATH:$HADOOP_HOME/bin
15+
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CAFFE_ON_SPARK/caffe-public/distribute/lib:$CAFFE_ON_SPARK/caffe-distri/distribute/lib
16+
17+
service ssh start
18+
$HADOOP_PREFIX/sbin/start-dfs.sh
19+
$HADOOP_PREFIX/sbin/start-yarn.sh
20+
21+
if [[ $1 == "-d" ]]; then
22+
while true; do sleep 1000; done
23+
fi
24+
25+
if [[ $1 == "-bash" ]]; then
26+
/bin/bash
27+
fi

0 commit comments

Comments
 (0)