Skip to content

fix(fish): runtime deps, missing bind-mounts, longer warmup window#4

Merged
mabry1985 merged 1 commit into
mainfrom
fix/fish-sidecar-runtime
Apr 24, 2026
Merged

fix(fish): runtime deps, missing bind-mounts, longer warmup window#4
mabry1985 merged 1 commit into
mainfrom
fix/fish-sidecar-runtime

Conversation

@mabry1985

@mabry1985 mabry1985 commented Apr 24, 2026

Copy link
Copy Markdown
Member

Summary

Three Fish-sidecar issues that each crashed a cold rebuild, bundled because the fix is a single compose + Dockerfile pass.

Root causes

Issue File Fix
Failed to find C compiler / CalledProcessError ... cuda_utils.c on first synth 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 — needs both a C toolchain and Python.h.
/app/.venv/bin/python: No such file or directory at container start docker-compose.yml Bind-mount ../fish-speech/.venv/app/.venv read-only. fish-speech/.dockerignore excludes .venv/ (despite Dockerfile comments claiming COPY . includes it). Same story for checkpoints/ — too large to bake into the image.
Healthcheck restart loop while torch.compile was still running docker-compose.yml start_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 native POST /v1/tts isn't OpenAI-compat; an external shim in protoLabsAI/lab wraps /v1/audio/speech → Fish for LiteLLM / OpenAI SDK clients.

Test plan

  • Cold rebuild: docker compose build --no-cache fish-speech && docker compose up -d fish-speech — container stays up through the compile, serves /v1/health once warm.
  • Verify /v1/references/list returns 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-speech during first boot — no gcc / python.h / cuda_utils.c errors, no .venv/checkpoints ENOENT, healthcheck crosses over before the start_period expires.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Added guide for exposing Fish TTS sidecar via OpenAI-compatible API endpoint.
    • Enhanced Docker Compose tutorial with volume mount requirements and first-boot troubleshooting guidance.
  • Chores

    • Optimized Docker configuration for improved container health checks and startup behavior.

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>
@coderabbitai

coderabbitai Bot commented Apr 24, 2026

Copy link
Copy Markdown

Walkthrough

Updates 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

Cohort / File(s) Summary
Docker Infrastructure
Dockerfile.fish, docker-compose.yml
Added python3-dev and build-essential packages to enable torch.compile CUDA kernel compilation. Configured read-only volume mounts for .venv and checkpoints directories. Extended healthcheck startup grace period to 600 seconds and retry count to 5 for cold-start/compilation tolerance.
Documentation
docs/reference/tts-backends.md, docs/tutorials/docker-compose.md
Documented OpenAI-compatible /v1/audio/speech endpoint via external shim with wav and pcm/mp3 support. Added Docker Compose deployment guidance covering volume mount requirements, healthcheck timing configuration, and explanation of why build dependencies are necessary for Inductor CUDA extensions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the three main fixes: runtime dependencies (build-essential, python3-dev), missing bind-mounts for .venv and checkpoints, and extended healthcheck warmup window. It directly corresponds to the core changes across Dockerfile, docker-compose.yml, and supporting docs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/fish-sidecar-runtime

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 09fc076 and 04747fe.

📒 Files selected for processing (4)
  • Dockerfile.fish
  • docker-compose.yml
  • docs/reference/tts-backends.md
  • docs/tutorials/docker-compose.md

Comment thread docker-compose.yml
Comment on lines +24 to +27
# .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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

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.

Suggested change
# .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.

@mabry1985
mabry1985 merged commit ef8e63e into main Apr 24, 2026
1 check passed
@mabry1985
mabry1985 deleted the fix/fish-sidecar-runtime branch April 24, 2026 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant