fix(fish): runtime deps, missing bind-mounts, longer warmup window#4
Conversation
Three independent issues that each crashed the Fish sidecar on a cold rebuild, bundled because the fix is a single compose + Dockerfile pass. - Dockerfile.fish: add build-essential + python3-dev. torch.compile's Inductor backend shells out to gcc at synth time to build CUDA kernels as Python extension modules, which needs both a C toolchain AND Python.h. Missing either produces "Failed to find C compiler" or "CalledProcessError ... cuda_utils.c" on the first real call, followed by an infinite restart loop. - docker-compose.yml: bind-mount the host checkout's .venv and checkpoints into the container read-only. fish-speech's .dockerignore excludes .venv/ (despite the Dockerfile's comment claiming COPY . includes it), and checkpoints are too large to bake in. Without these mounts the container fails at startup with "/app/.venv/bin/python: No such file or directory". - docker-compose.yml: bump the healthcheck start_period from 180s to 600s (and retries 3 → 5). torch.compile warmup from cold runs 3-5 min on Blackwell; the old threshold made Docker mark the container unhealthy and restart-loop while compile was still running on its own. Also documents all three in docs/tutorials/docker-compose.md and adds a tts-backends.md note about the external OpenAI-compat shim (Fish's native API isn't /v1/audio/speech). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
WalkthroughUpdates Docker infrastructure and documentation for Fish TTS to support runtime CUDA kernel compilation. Adds Python development headers and C/C++ toolchain to the Dockerfile, configures volume mounts for the virtual environment and checkpoints in docker-compose, and documents deployment requirements and OpenAI-compatible interface. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docker-compose.yml`:
- Around line 24-27: The docker-compose binds are hardcoded to /home/ava/...
which breaks on other machines; update the two bind-mount entries that match
"/home/ava/dev/fish-speech/.venv:/app/.venv:ro" and
"/home/ava/dev/fish-speech/checkpoints:/app/checkpoints:ro" to use a
parameterized variable (e.g., ${PROJECT_ROOT} or ${PWD}) sourced from an .env or
environment so the host checkout root is configurable; ensure the .env key is
documented or defaulted and that docker-compose references that variable for
both the .venv and checkpoints mounts.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 42fd7d25-4de0-400c-999b-1992482a48a4
📒 Files selected for processing (4)
Dockerfile.fishdocker-compose.ymldocs/reference/tts-backends.mddocs/tutorials/docker-compose.md
| # .dockerignore excludes .venv/, so bind-mount from the host checkout. | ||
| # Dockerfile comment claims COPY . includes them, but it doesn't. | ||
| - /home/ava/dev/fish-speech/.venv:/app/.venv:ro | ||
| - /home/ava/dev/fish-speech/checkpoints:/app/checkpoints:ro |
There was a problem hiding this comment.
Hardcoded host bind-mount paths will break startup outside one developer machine.
Line 26 and Line 27 hardcode /home/ava/.... On other hosts this typically mounts the wrong/nonexistent source and the container fails again with missing /app/.venv/bin/python or checkpoints. Please parameterize the checkout root.
🔧 Suggested fix
volumes:
- ${FISH_REFERENCES_DIR:-/mnt/data/fish-references}:/app/references
- - /home/ava/dev/fish-speech/.venv:/app/.venv:ro
- - /home/ava/dev/fish-speech/checkpoints:/app/checkpoints:ro
+ - ${FISH_SPEECH_DIR:-../fish-speech}/.venv:/app/.venv:ro
+ - ${FISH_SPEECH_DIR:-../fish-speech}/checkpoints:/app/checkpoints:ro📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # .dockerignore excludes .venv/, so bind-mount from the host checkout. | |
| # Dockerfile comment claims COPY . includes them, but it doesn't. | |
| - /home/ava/dev/fish-speech/.venv:/app/.venv:ro | |
| - /home/ava/dev/fish-speech/checkpoints:/app/checkpoints:ro | |
| # .dockerignore excludes .venv/, so bind-mount from the host checkout. | |
| # Dockerfile comment claims COPY . includes them, but it doesn't. | |
| - ${FISH_SPEECH_DIR:-../fish-speech}/.venv:/app/.venv:ro | |
| - ${FISH_SPEECH_DIR:-../fish-speech}/checkpoints:/app/checkpoints:ro |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@docker-compose.yml` around lines 24 - 27, The docker-compose binds are
hardcoded to /home/ava/... which breaks on other machines; update the two
bind-mount entries that match "/home/ava/dev/fish-speech/.venv:/app/.venv:ro"
and "/home/ava/dev/fish-speech/checkpoints:/app/checkpoints:ro" to use a
parameterized variable (e.g., ${PROJECT_ROOT} or ${PWD}) sourced from an .env or
environment so the host checkout root is configurable; ensure the .env key is
documented or defaulted and that docker-compose references that variable for
both the .venv and checkpoints mounts.
Summary
Three Fish-sidecar issues that each crashed a cold rebuild, bundled because the fix is a single compose + Dockerfile pass.
Root causes
Failed to find C compiler/CalledProcessError ... cuda_utils.con first synthDockerfile.fishbuild-essential+python3-dev. torch.compile's Inductor backend shells out togccat synth time to build CUDA kernels as Python extension modules — needs both a C toolchain andPython.h./app/.venv/bin/python: No such file or directoryat container startdocker-compose.yml../fish-speech/.venv→/app/.venvread-only.fish-speech/.dockerignoreexcludes.venv/(despite Dockerfile comments claimingCOPY .includes it). Same story forcheckpoints/— too large to bake into the image.torch.compilewas still runningdocker-compose.ymlstart_period: 180s → 600s,retries: 3 → 5. Cold compile on Blackwell is 3-5 min; the old threshold made Docker mark unhealthy and bounce the container.Docs
docs/tutorials/docker-compose.md— documents all three gotchas so the next operator doesn't have to rediscover them.docs/reference/tts-backends.md— separately notes that Fish's nativePOST /v1/ttsisn't OpenAI-compat; an external shim inprotoLabsAI/labwraps/v1/audio/speech→ Fish for LiteLLM / OpenAI SDK clients.Test plan
docker compose build --no-cache fish-speech && docker compose up -d fish-speech— container stays up through the compile, serves/v1/healthonce warm./v1/references/listreturns populated after startup (regression check — the references dir is unaffected by this PR, but worth spot-checking after any compose change).docker compose logs -f fish-speechduring first boot — nogcc/python.h/cuda_utils.cerrors, no.venv/checkpoints ENOENT, healthcheck crosses over before the start_period expires.🤖 Generated with Claude Code
Summary by CodeRabbit
Documentation
Chores