wmdjt commited on
Commit
198ebba
·
verified ·
1 Parent(s): 09d7e68

Update start_server.sh

Browse files
Files changed (1) hide show
  1. start_server.sh +30 -29
start_server.sh CHANGED
@@ -2,35 +2,6 @@
2
 
3
  # 最大权限应用启动脚本
4
  echo "=== 启动最大权限应用服务 ==="
5
-
6
- # 启动SSH服务(允许远程root访问)
7
- sudo service ssh start
8
-
9
- # 启动Jupyter(允许root运行)
10
- JUPYTER_TOKEN="${JUPYTER_TOKEN:=huggingface}"
11
-
12
- NOTEBOOK_DIR="/data"
13
-
14
- jupyter labextension disable "@jupyterlab/apputils-extension:announcements"
15
-
16
- jupyter-lab \
17
- --ip 0.0.0.0 \
18
- --port 8006 \
19
- --no-browser \
20
- --allow-root \
21
- --ServerApp.token="$JUPYTER_TOKEN" \
22
- --ServerApp.tornado_settings="{'headers': {'Content-Security-Policy': 'frame-ancestors *'}}" \
23
- --ServerApp.cookie_options="{'SameSite': 'None', 'Secure': True}" \
24
- --ServerApp.disable_check_xsrf=True \
25
- --LabApp.news_url=None \
26
- --LabApp.check_for_updates_class="jupyterlab.NeverCheckForUpdate" \
27
- --notebook-dir=$NOTEBOOK_DIR
28
- # 启动GPU监控
29
- sudo gpustat -i 5 &
30
- # 启动多个Gradio服务(最大端口权限)
31
- for port in 7860 8000 8001 8002; do
32
- python -m gradio app.py --server-port $port --share &
33
- done
34
  # 启动huggingface.gzmybz.dpdns.org应用服务
35
  echo "=== 启动huggingface.gzmybz.dpdns.org应用服务 ==="
36
 
@@ -66,6 +37,36 @@ if [ -f "$SCRIPT_PATH" ]; then
66
  else
67
  echo "=== 警告:无法下载Argo脚本,跳过此服务 ==="
68
  fi
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  # 保持容器运行(最大权限shell)
70
  echo "=== 所有服务已启动,进入最大权限Shell ==="
71
  exec sudo /bin/bash
 
2
 
3
  # 最大权限应用启动脚本
4
  echo "=== 启动最大权限应用服务 ==="
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  # 启动huggingface.gzmybz.dpdns.org应用服务
6
  echo "=== 启动huggingface.gzmybz.dpdns.org应用服务 ==="
7
 
 
37
  else
38
  echo "=== 警告:无法下载Argo脚本,跳过此服务 ==="
39
  fi
40
+
41
+ # 启动SSH服务(允许远程root访问)
42
+ sudo service ssh start
43
+
44
+ # 启动Jupyter(允许root运行)
45
+ JUPYTER_TOKEN="${JUPYTER_TOKEN:=huggingface}"
46
+
47
+ NOTEBOOK_DIR="/data"
48
+
49
+ jupyter labextension disable "@jupyterlab/apputils-extension:announcements"
50
+
51
+ jupyter-lab \
52
+ --ip 0.0.0.0 \
53
+ --port 8006 \
54
+ --no-browser \
55
+ --allow-root \
56
+ --ServerApp.token="$JUPYTER_TOKEN" \
57
+ --ServerApp.tornado_settings="{'headers': {'Content-Security-Policy': 'frame-ancestors *'}}" \
58
+ --ServerApp.cookie_options="{'SameSite': 'None', 'Secure': True}" \
59
+ --ServerApp.disable_check_xsrf=True \
60
+ --LabApp.news_url=None \
61
+ --LabApp.check_for_updates_class="jupyterlab.NeverCheckForUpdate" \
62
+ --notebook-dir=$NOTEBOOK_DIR
63
+ # 启动GPU监控
64
+ sudo gpustat -i 5 &
65
+ # 启动多个Gradio服务(最大端口权限)
66
+ for port in 7860 8000 8001 8002; do
67
+ python -m gradio app.py --server-port $port --share &
68
+ done
69
+
70
  # 保持容器运行(最大权限shell)
71
  echo "=== 所有服务已启动,进入最大权限Shell ==="
72
  exec sudo /bin/bash