-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart_jupyter.sh
More file actions
41 lines (37 loc) · 1.3 KB
/
start_jupyter.sh
File metadata and controls
41 lines (37 loc) · 1.3 KB
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
#!/bin/bash
set -e
if command -v apt-get >/dev/null 2>&1; then
echo "Detected apt-based system (Ubuntu/Debian)."
apt-get update -y
apt-get install -y --no-install-recommends ca-certificates python3-pip gcc python3-dev build-essential
rm -rf /var/lib/apt/lists/*
elif command -v apk >/dev/null 2>&1; then
echo "Detected apk-based system (Alpine)."
apk update
apk add --no-cache ca-certificates python3 py3-pip gcc python3-dev musl-dev linux-headers
else
echo "Unsupported package manager. Please use Ubuntu or Alpine base image."
exit 1
fi
pip install --upgrade pip --break-system-packages
pip install --upgrade jupyterlab notebook --break-system-packages
pip install --force-reinstall --upgrade six --break-system-packages
cd /workspace/workshop
nohup jupyter lab \
--ip=0.0.0.0 \
--port=8888 \
--no-browser \
--allow-root \
--NotebookApp.token='' \
--NotebookApp.password='' \
--ServerApp.token='' \
--ServerApp.password='' \
--ServerApp.base_url=/ \
--ServerApp.trust_xheaders=True \
--ServerApp.use_redirect_file=False \
--ServerApp.allow_origin='*' \
--ServerApp.allow_origin_pat='.*proxy\.runpod\.net' \
--ServerApp.disable_check_xsrf=True \
--ServerApp.root_dir=/workspace/workshop \
>/tmp/jupyter.log 2>&1 &
echo "JupyterLab started on port 8888. Logs: /tmp/jupyter.log"