984b72757f
Zero-shot, massively-multilingual (600+ language) voice-cloning + voice-design TTS (diffusion-LM, Apache-2.0). No official image, so a thin CUDA container around the pip package running upstream's own Gradio demo (no FastAPI wrapper). Pinned to GPU 0 (3090) — the A6000 is ComfyUI-exclusive — port 8199. Built + verified live on irv-ml1 (Gradio 200, container healthy). Surface is the Gradio UI + Gradio API, NOT OpenAI-compat /v1/audio/speech (wrap later if asset-engine should consume it). deploy-omnivoice.yaml builds local + verifies.
111 lines
3.8 KiB
YAML
111 lines
3.8 KiB
YAML
# Deploy OmniVoice (https://github.com/k2-fsa/OmniVoice) to irv-ml1, GPU 0
|
|
# (RTX 3090). Apache-2.0 zero-shot multilingual voice-cloning TTS, served
|
|
# via upstream's own Gradio demo (no FastAPI wrapper).
|
|
#
|
|
# Builds the image locally from stacks/omnivoice/Dockerfile (CUDA 12.8 +
|
|
# torch 2.8.0 + omnivoice from PyPI), stages the build context under
|
|
# /opt/docker/compose/omnivoice/, brings it up, and waits for the Gradio
|
|
# UI on :8199.
|
|
#
|
|
# First run is slow: ~5-10 min docker build + a one-time HF weight pre-warm
|
|
# (k2-fsa/OmniVoice) on first container start (entrypoint.sh). The wait loop
|
|
# below allows up to ~20 min for build-then-up + pre-warm.
|
|
#
|
|
# Usage:
|
|
# scripts/elway irv-ml1 --playbook playbooks/deploy-omnivoice.yaml
|
|
#
|
|
# Idempotent — every step is creates-/when-gated; rerun is safe.
|
|
|
|
vars:
|
|
compose_dir: /opt/docker/compose/omnivoice
|
|
cache_dir: /worktank/omnivoice/hf_cache
|
|
voices_dir: /worktank/omnivoice/voices
|
|
host_port: "8199"
|
|
|
|
steps:
|
|
# ── host-side dirs ──────────────────────────────────────────────────
|
|
|
|
- name: Ensure /worktank/omnivoice root exists (one-time, sudo)
|
|
shell: mkdir -p /worktank/omnivoice
|
|
sudo: true
|
|
creates: /worktank/omnivoice
|
|
|
|
- name: Chown /worktank/omnivoice to lkraven
|
|
shell: chown lkraven:lkraven /worktank/omnivoice
|
|
sudo: true
|
|
when: '[ "$(stat -c %U /worktank/omnivoice)" != lkraven ]'
|
|
|
|
- name: Ensure cache dir exists
|
|
shell: mkdir -p {{ cache_dir }}
|
|
creates: "{{ cache_dir }}"
|
|
|
|
- name: Ensure voices dir exists
|
|
shell: mkdir -p {{ voices_dir }}
|
|
creates: "{{ voices_dir }}"
|
|
|
|
- name: Ensure compose dir exists
|
|
shell: mkdir -p {{ compose_dir }}
|
|
creates: "{{ compose_dir }}"
|
|
|
|
# ── deploy build context (compose, dockerfile, entrypoint, env) ───────
|
|
|
|
- name: Upload compose.yaml
|
|
upload:
|
|
src: stacks/omnivoice/compose.yaml
|
|
dest: "{{ compose_dir }}/compose.yaml"
|
|
mode: "0644"
|
|
|
|
- name: Upload Dockerfile
|
|
upload:
|
|
src: stacks/omnivoice/Dockerfile
|
|
dest: "{{ compose_dir }}/Dockerfile"
|
|
mode: "0644"
|
|
|
|
- name: Upload entrypoint.sh
|
|
upload:
|
|
src: stacks/omnivoice/entrypoint.sh
|
|
dest: "{{ compose_dir }}/entrypoint.sh"
|
|
mode: "0755"
|
|
|
|
- name: Seed .env from template (only if absent)
|
|
upload:
|
|
src: stacks/omnivoice/.env.example
|
|
dest: "{{ compose_dir }}/.env"
|
|
mode: "0644"
|
|
when: "[ ! -f {{ compose_dir }}/.env ]"
|
|
|
|
# ── build + bring up ────────────────────────────────────────────────
|
|
|
|
- name: docker compose build (~5-10 min first time; cached after)
|
|
shell: |
|
|
set -o pipefail
|
|
cd {{ compose_dir }} && docker compose build --progress=plain 2>&1 \
|
|
| grep -vE '^#[0-9]+ [0-9.]+ (Downloading|Collecting|Requirement|Using cached|Installing collected|Successfully (installed|built)|━|Resolved|Prepared|Built)'
|
|
|
|
- name: docker compose up -d
|
|
shell: cd {{ compose_dir }} && docker compose up -d
|
|
|
|
- name: Wait for the Gradio UI to respond (allow ~20 min for weight pre-warm)
|
|
shell: |
|
|
for i in $(seq 1 240); do
|
|
curl -sf -o /dev/null --max-time 3 http://localhost:{{ host_port }}/ && exit 0
|
|
sleep 5
|
|
done
|
|
exit 1
|
|
changed_when: "false"
|
|
|
|
verify:
|
|
- name: Gradio UI returns 200
|
|
shell: curl -sf -o /dev/null http://localhost:{{ host_port }}/
|
|
changed_when: "false"
|
|
|
|
- name: Container is running
|
|
shell: docker inspect omnivoice --format '{{.State.Status}}' | grep -q running
|
|
changed_when: "false"
|
|
|
|
- name: Container is healthy (or still starting weights)
|
|
shell: |
|
|
s=$(docker inspect omnivoice --format '{{.State.Health.Status}}' 2>/dev/null)
|
|
echo "health: $s"; [ "$s" = healthy ] || [ "$s" = starting ]
|
|
changed_when: "false"
|