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

minimax: ship boot log on ERR too

Browse files
Files changed (1) hide show
  1. worker/minimax_start.sh +19 -16
worker/minimax_start.sh CHANGED
@@ -13,6 +13,22 @@ set -eo pipefail
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,22 +102,9 @@ open("/comfyui/custom_nodes/lora_from_url.py", "wb").write(urllib.request.urlope
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
 
13
  LOG=/tmp/minimax-boot.log
14
  exec > >(tee -a "$LOG") 2>&1
15
 
16
+ ship_log() {
17
+ local py="${PY:-$(command -v python3)}"
18
+ "$py" -m pip show huggingface_hub >/dev/null 2>&1 || "$py" -m pip install -q huggingface_hub || true
19
+ "$py" - <<'PYEOF' || true
20
+ import os
21
+ from huggingface_hub import HfApi
22
+ api = HfApi(token=os.environ.get("HF_TOKEN"))
23
+ pod = os.environ.get("RUNPOD_POD_ID", "unknown")
24
+ api.upload_file(path_or_fileobj="/tmp/minimax-boot.log",
25
+ path_in_repo=f"logs/boot-{pod}.log",
26
+ repo_id="nikdevs/qwen", commit_message=f"boot log {pod}")
27
+ print("[minimax] boot log shipped")
28
+ PYEOF
29
+ }
30
+ trap 'echo "[minimax] BOOT FAILED (line $LINENO)"; ship_log' ERR
31
+
32
  VARIANT="${MODEL_VARIANT:-fl2va}"
33
  REPO="nikdevs/minimax-h3-${VARIANT}"
34
  TARGET="${COMFY_VERSION:-v0.31.0}"
 
102
  print("[minimax] lora_from_url node installed")
103
  PYEOF
104
 
105
+ # Background log shipper: uploads the boot log a few times so the tail of a
106
+ # crashed ComfyUI startup is visible from outside.
107
  "$PY" -m pip show huggingface_hub >/dev/null 2>&1 || "$PY" -m pip install -q huggingface_hub
108
+ ( for i in 1 2 3 4; do sleep 300; ship_log; done ) &
 
 
 
 
 
 
 
 
 
 
 
 
 
109
 
110
  exec /start.sh