nikdevs commited on
Commit
d2ad269
·
verified ·
1 Parent(s): 934ffa4

minimax: boot log shipping to HF for debuggability

Browse files
Files changed (1) hide show
  1. worker/minimax_start.sh +24 -0
worker/minimax_start.sh CHANGED
@@ -7,6 +7,12 @@
7
  # 3. installs the lora-from-url custom node.
8
  set -eo pipefail
9
 
 
 
 
 
 
 
10
  VARIANT="${MODEL_VARIANT:-fl2va}"
11
  REPO="nikdevs/minimax-h3-${VARIANT}"
12
  TARGET="${COMFY_VERSION:-v0.31.0}"
@@ -80,4 +86,22 @@ open("/comfyui/custom_nodes/lora_from_url.py", "wb").write(urllib.request.urlope
80
  print("[minimax] lora_from_url node installed")
81
  PYEOF
82
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  exec /start.sh
 
7
  # 3. installs the lora-from-url custom node.
8
  set -eo pipefail
9
 
10
+ # Mirror all boot + ComfyUI + handler output into a log file, and ship it to
11
+ # HF periodically so boot failures are debuggable without console access.
12
+ # (fd redirection survives the exec /start.sh at the bottom.)
13
+ LOG=/tmp/minimax-boot.log
14
+ exec > >(tee -a "$LOG") 2>&1
15
+
16
  VARIANT="${MODEL_VARIANT:-fl2va}"
17
  REPO="nikdevs/minimax-h3-${VARIANT}"
18
  TARGET="${COMFY_VERSION:-v0.31.0}"
 
86
  print("[minimax] lora_from_url node installed")
87
  PYEOF
88
 
89
+ # Background log shipper: uploads the boot log to HF a few times so the tail
90
+ # of a crashed ComfyUI startup is visible from outside.
91
+ "$PY" -m pip show huggingface_hub >/dev/null 2>&1 || "$PY" -m pip install -q huggingface_hub
92
+ (
93
+ for i in 1 2 3 4; do
94
+ sleep 300
95
+ "$PY" - <<'PYEOF' || true
96
+ import os
97
+ from huggingface_hub import HfApi
98
+ api = HfApi(token=os.environ.get("HF_TOKEN"))
99
+ pod = os.environ.get("RUNPOD_POD_ID", "unknown")
100
+ api.upload_file(path_or_fileobj="/tmp/minimax-boot.log",
101
+ path_in_repo=f"logs/boot-{pod}.log",
102
+ repo_id="nikdevs/qwen", commit_message=f"boot log {pod}")
103
+ PYEOF
104
+ done
105
+ ) &
106
+
107
  exec /start.sh