Files
esh-pfi-infrastructure/stacks/kokoro/.env.example
T
vh 83e5e941d8 stacks/kokoro: cpu/gpu variant toggle + tighter pull-log filter
Two fixes from the failed first deploy on irv-ml1:

1. CPU/GPU variant. Kokoro's GPU image needs CUDA >= 12.9; irv-ml1's
   driver 570.124.06 caps at 12.8 so the gpu variant fails with
   "nvidia-container-cli: requirement error: unsatisfied condition:
   cuda>=12.9". Make the variant a knob:

     KOKORO_VARIANT=cpu         (default — works anywhere)
     KOKORO_VARIANT=gpu         (after driver bump)
     KOKORO_USE_GPU=false|true  (matches the variant)

   Kokoro is tiny (82M params) so CPU is workable: TTFA ~1s vs ~300ms
   on GPU. Acceptable while the driver bump gets scheduled. compose.yaml
   no longer hard-codes `runtime: nvidia` — relies on the daemon's
   default-runtime + NVIDIA_VISIBLE_DEVICES gating, same as how the
   wrapper's USE_GPU flag selects the inference path inside the
   container. Toggling between variants is now a `.env` edit + restart.

2. Tighter pull-log filter. --quiet on `docker compose pull` only
   suppresses the pull command's stdout; the docker daemon still
   emits per-layer extraction events on stderr ("ffbfd7a09415
   Extracting 64.06MB" repeated dozens of times per layer). Drop those
   too via grep on the SHA-prefixed pattern. set -o pipefail keeps a
   real pull failure visible.

For existing deployments: removing /opt/docker/compose/kokoro/.env
on the host and rerunning the playbook re-seeds with the new schema.
2026-04-25 16:31:01 -07:00

53 lines
2.8 KiB
Bash

# Kokoro-FastAPI stack tunables. Copy to `.env` on irv-ml1 before deploying.
# ── image pin ────────────────────────────────────────────────────────
# Image variant. Two choices:
# cpu — works on any host. Kokoro is tiny (82M params) so CPU
# inference is acceptable: TTFA ~1s on a modern CPU vs
# ~300ms on a 30-series-or-newer GPU. Fine as a default.
# gpu — requires NVIDIA driver supporting CUDA >= 12.9. As of
# 2026-04-25, irv-ml1's driver 570.124.06 caps at CUDA 12.8,
# so the gpu variant won't start there yet. Bump the driver
# (separate procedure, requires reboot) then flip this to gpu.
KOKORO_VARIANT=cpu
# Tagged release on GHCR. Avoid `latest` — upstream warns it can move
# without notice. v0.2.4-master = 2025-12-13 release with Kokoro-82M v1.0
# baked in (commit 9901c2b).
KOKORO_TAG=v0.2.4-master
# ── network ──────────────────────────────────────────────────────────
# Host port. Container listens on 8880 internally.
# Reserved on irv-ml1: 8188 ComfyUI, 8190 CosyVoice, 8191 Qwen3-TTS,
# 8192 IndexTTS-2, 8765 Parakeet. 8193 picked here.
KOKORO_PORT=8193
# Bind address. 0.0.0.0 exposes on all interfaces (incl. WG tunnel
# interface 10.100.79.3); 127.0.0.1 restricts to local-only.
KOKORO_BIND=0.0.0.0
# ── runtime / GPU ────────────────────────────────────────────────────
# Only used when KOKORO_VARIANT=gpu. Leave empty for the cpu variant.
# When using the gpu variant: "0" pins to the RTX 3090 (Kokoro is tiny
# — ~1 GB VRAM — and doesn't need the A6000); "all" exposes both.
KOKORO_GPU_DEVICES=
# Tells the wrapper to route inference through CUDA. Must be `false`
# for the cpu variant (it has no CUDA libraries). Flip to `true` when
# you switch KOKORO_VARIANT=gpu.
KOKORO_USE_GPU=false
# Logging level for the FastAPI app. INFO is the upstream default.
KOKORO_LOG_LEVEL=INFO
# ── persistent storage on the host ───────────────────────────────────
# Voicepacks dir — bind-mount target IF the (commented-out) override
# is enabled in compose.yaml. Default: leave empty and use the
# in-image voicepacks.
KOKORO_VOICES_DIR=/worktank/kokoro/voices
# User-voices dir — a parallel directory the wrapper *also* scans for
# voicepacks alongside the in-image ones. Always mounted (cheap, empty
# by default). Drop your own .pt files here if you train Kokoro voices.
KOKORO_USER_VOICES_DIR=/worktank/kokoro/user_voices