Download bootstrap-h3.sh from exefg/hypium-worker-src: direct link, hf CLI and curl.
- Browser
- Download file 2.4 kB
-
https://huggingface.co/datasets/exefg/hypium-worker-src/resolve/main/bootstrap-h3.sh
- Command line
-
hf download hf://datasets/exefg/hypium-worker-src/bootstrap-h3.sh
-
curl -L -o bootstrap-h3.sh https://huggingface.co/datasets/exefg/hypium-worker-src/resolve/main/bootstrap-h3.sh
2.4 kB
| # Remote worker bootstrap for hypium-h3-prod-v1. | |
| # Official RunPod PyTorch image + HF-hosted worker source. Weights come from | |
| # RunPod --model-reference, never from this Mac. | |
| set -uo pipefail | |
| export DEBIAN_FRONTEND=noninteractive | |
| export PYTHONUNBUFFERED=1 | |
| SRC_URL="${H3_WORKER_SRC_URL:-https://huggingface.co/datasets/exefg/hypium-worker-src/resolve/main/h3-src.tgz}" | |
| COMFY_PIN="${H3_COMFY_PIN:-12d5279438bfefc058a269eae805ceab6047777f}" | |
| log() { echo "{\"event\":\"h3_boot\",\"msg\":\"$*\"}"; } | |
| fail() { echo "{\"event\":\"h3_boot_failed\",\"msg\":\"$*\"}"; sleep 3600; exit 1; } | |
| log "python=$(command -v python3 || true) $(python3 --version 2>/dev/null || true)" | |
| df -h / | tail -1 || true | |
| apt-get update || fail "apt-get update" | |
| apt-get install -y --no-install-recommends git ffmpeg ca-certificates curl || fail "apt-get install" | |
| mkdir -p /opt/hypium | |
| curl -fL --retry 5 "$SRC_URL" -o /tmp/h3-src.tgz || fail "download h3-src.tgz" | |
| tar -xzf /tmp/h3-src.tgz -C /opt/hypium || fail "extract h3-src.tgz" | |
| export PYTHONPATH=/opt/hypium/worker | |
| if ! python3 -c "import runpod, h3_worker" >/dev/null 2>&1; then | |
| pip install --no-cache-dir --break-system-packages --ignore-installed cryptography -r /opt/hypium/worker/requirements.txt || fail "pip worker reqs" | |
| pip install --no-cache-dir --break-system-packages --ignore-installed cryptography runpod==1.10.1 || fail "pip runpod" | |
| fi | |
| if [[ ! -d /opt/ComfyUI ]]; then | |
| git clone --depth 1 --branch v0.34.0 https://github.com/comfyanonymous/ComfyUI.git /opt/ComfyUI || fail "clone ComfyUI" | |
| cd /opt/ComfyUI | |
| git fetch --depth 1 origin "$COMFY_PIN" || true | |
| git checkout "$COMFY_PIN" || fail "checkout Comfy pin" | |
| pip install --no-cache-dir --break-system-packages -r requirements.txt || fail "pip Comfy reqs" | |
| fi | |
| # Comfy requirements can shadow/remove runpod. Reinstall after that pip. | |
| pip install --no-cache-dir --break-system-packages --ignore-installed cryptography runpod==1.10.1 || fail "pip runpod after comfy" | |
| python3 -c "import runpod" || fail "runpod import after comfy" | |
| export WORKSPACE_DIR="${WORKSPACE_DIR:-/opt/hypium/worker}" | |
| export COMFYUI_PATH="${COMFYUI_PATH:-/opt/ComfyUI}" | |
| export COMFYUI_MODELS="${COMFYUI_MODELS:-/opt/ComfyUI/models}" | |
| export PYTHONPATH=/opt/hypium/worker | |
| export MODE_TO_RUN=serverless | |
| chmod +x /opt/hypium/worker/start.sh || fail "chmod start.sh" | |
| log "starting start.sh" | |
| exec /opt/hypium/worker/start.sh | |