-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
30 lines (22 loc) · 966 Bytes
/
Copy pathentrypoint.sh
File metadata and controls
30 lines (22 loc) · 966 Bytes
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
#!/bin/bash
set -e
useradd -m $NB_USER -G sudo -s /bin/bash && echo "$NB_USER:$NB_USER_PASS" | chpasswd
if [ "$1" = 'notebook' ]; then
echo "www-port=$PORT0" >> /etc/rstudio/rserver.conf
echo "server-app-armor-enabled=0" >> /etc/rstudio/rserver.conf
/usr/lib/rstudio-server/bin/rserver &
echo -e "#"'!'"/bin/bash\nset -e\nexport ZEPPELIN_PORT=$PORT2" > $ZEPPELIN_HOME/conf/zeppelin-env.sh
$ZEPPELIN_HOME/bin/zeppelin-daemon.sh start &
mkdir /logs
tensorboard --logdir /logs &
source /venv/bin/activate
mkdir -p $NOTEBOOK_HOME
cd $NOTEBOOK_HOME
export JPASS=`python -c "from notebook.auth import passwd; print passwd('$NB_USER_PASS')"`
export JPASSCONF="c.NotebookApp.password = u'$JPASS'"
jupyter notebook --allow-root --generate-config
echo "$JPASSCONF" >> ~/.jupyter/jupyter_notebook_config.py
jupyter notebook --no-browser --port=$PORT1 --ip=0.0.0.0 --allow-root
else
exec "$@"
fi