forked from ivukotic/ML_platform_tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSetupPrivateJupyterLab.sh
executable file
·49 lines (40 loc) · 1.68 KB
/
SetupPrivateJupyterLab.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
# With RISE, a Jupyter notebook extension, you can instantly turn your jupyter notebook into a live reveal.js-based presentation.
jupyter-nbextension install rise --py --sys-prefix
jupyter-nbextension enable rise --py --sys-prefix
if [ "$1" != "" ]; then
echo "Git Repo $1 requested..."
cd /workspace/
git clone $1
fi
export SHELL=/bin/bash
# setting up users
if [ "$OWNER" != "" ] && [ "$CONNECT_GROUP" != "" ]; then
PATH=$PATH:/usr/sbin
#/sync_users_debian.sh -u root."$CONNECT_GROUP" -g root."$CONNECT_GROUP" -e https://api.ci-connect.net:18080
groupadd $CONNECT_GROUP -g $CONNECT_GID
useradd -M -u $OWNER_UID -G $CONNECT_GROUP $OWNER
# Do not leak some important tokens
unset API_TOKEN
# Ensure the owner owns their home directory ## Commented out 7/17 by L.B., causing issues with taking too long
#chown -R $OWNER: /home/$OWNER
# Set the user's $DATA dir
export DATA=/data/$OWNER
# Match PS1 as we have it on the login nodes
echo 'export PS1="[\A] \H:\w $ "' >> /etc/bash.bashrc
# Chown the /workspace directory so users can create notebooks
chown -R $OWNER: /workspace
# Change to the user's homedir
cd /home/$OWNER
# get tutorial in.
cp -r /ML_platform_tests/tutorial ~/.
# setup ROOT
cd /opt/root/
source bin/thisroot.sh
cp -r $ROOTSYS/etc/notebook/kernels/root /usr/local/share/jupyter/kernels/
python3.8 -m pip --no-cache-dir install root-pandas
unset JUPYTER_PATH
unset JUPYTER_CONFIG_DIR
cd /home/$OWNER
# Invoke Jupyter lab as the user
su $OWNER -c "jupyter lab --ServerApp.root_dir=/home/${OWNER} --no-browser --config=/usr/local/etc/jupyter_notebook_config.py"
fi