Skip to content

RG-T125 TTS docker build fix#424

Merged
ucswift merged 1 commit into
masterfrom
develop
Jul 16, 2026
Merged

RG-T125 TTS docker build fix#424
ucswift merged 1 commit into
masterfrom
develop

Conversation

@ucswift

@ucswift ucswift commented Jul 16, 2026

Copy link
Copy Markdown
Member

Summary

This PR fixes the Docker build process for the Resgrid TTS (Text-to-Speech) web service by improving build reliability, error handling, and reproducibility.

Key Changes

  1. Pinned Piper voices repository revision: Added a new build argument PIPER_VOICES_REVISION that locks the Hugging Face Piper voices download to a specific git commit, ensuring reproducible builds instead of always pulling from the main branch (which could introduce breaking changes).

  2. Improved error handling: Split the single large RUN command into multiple separate RUN steps, each using set -eu to ensure the build fails immediately on any error or unset variable, rather than silently continuing.

  3. Enhanced download reliability: Increased curl retry attempts from 3 to 5 and added the --retry-all-errors flag so that all types of download errors (not just transient ones) are retried.

  4. Better build logging: Added echo statements to provide visibility into download progress (FFmpeg, Piper binary, and individual Piper voice files) during the Docker build.

@request-info

request-info Bot commented Jul 16, 2026

Copy link
Copy Markdown

Thanks for opening this, but we'd appreciate a little more information. Could you update it with more details?

@Resgrid-Bot

Resgrid-Bot commented Jul 16, 2026

Copy link
Copy Markdown

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug
Performance
Security
Business Logic

Access your configuration settings here.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The TTS Dockerfile adds a Piper voice revision build argument, pins voice model downloads to that revision, and hardens FFmpeg and Piper downloads with stricter shell failure handling and curl retries.

Changes

TTS Docker build

Layer / File(s) Summary
Pinned and resilient artifact downloads
Web/Resgrid.Web.Tts/Dockerfile
Adds PIPER_VOICES_REVISION, pins Piper voice files to the selected revision, and applies set -eu with stronger curl retry handling to FFmpeg, Piper, and voice downloads.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • Resgrid/Core#364: Modifies Piper Docker build arguments and artifact URL construction.
  • Resgrid/Core#382: Modifies Piper voice model download logic in the same Dockerfile.
  • Resgrid/Core#385: Modifies the FFmpeg installation step in the TTS Docker build.

Suggested reviewers: github-actions

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.
Title check ✅ Passed The title is concise and correctly describes the TTS Docker build fix in the changed Dockerfile.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch develop

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Web/Resgrid.Web.Tts/Dockerfile`:
- Around line 25-42: Align the FFmpeg installation destination in the
Dockerfile’s download/install RUN block with the Kubernetes deployment’s
expected /usr/bin/ffmpeg path. Update the cp target from /usr/local/bin/ffmpeg,
or consistently adjust the deployment configuration to use the installed path,
ensuring the TTS service resolves the binary in Kubernetes.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 59616282-f564-4d1d-8deb-4cf5a23ae09d

📥 Commits

Reviewing files that changed from the base of the PR and between 2c71df3 and 88cd8b0.

📒 Files selected for processing (1)
  • Web/Resgrid.Web.Tts/Dockerfile

Comment on lines +25 to +42
ARG PIPER_VOICES_REVISION=e21c7de8d4eab79b902f0d61e662b3f21664b8d2
COPY --from=base /etc/passwd /tmp/base-passwd
COPY --from=base /etc/group /tmp/base-group
RUN apt-get update \
RUN set -eu; \
apt-get update \
&& apt-get install -y --no-install-recommends \
libespeak-ng1 \
ca-certificates \
curl \
xz-utils \
gzip \
passwd \
&& rm -rf /var/lib/apt/lists/* \
&& curl -fsSL --retry 3 --retry-delay 5 "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz" -o /tmp/ffmpeg.tar.xz \
&& curl -fsSL "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz.md5" -o /tmp/ffmpeg.tar.xz.md5 \
&& rm -rf /var/lib/apt/lists/*

RUN set -eu; \
echo "Downloading FFmpeg" \
&& curl -fsSL --retry 5 --retry-delay 5 --retry-all-errors "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz" -o /tmp/ffmpeg.tar.xz \
&& curl -fsSL --retry 5 --retry-delay 5 --retry-all-errors "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz.md5" -o /tmp/ffmpeg.tar.xz.md5 \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Ensure the FFmpeg installation path aligns with the Kubernetes configuration.

The Dockerfile installs the static FFmpeg binary to /usr/local/bin/ffmpeg (line 49). However, the downstream Kubernetes deployment configuration explicitly expects it at /usr/bin/ffmpeg.

If the base image does not already provide a system-level FFmpeg symlink or binary at /usr/bin/ffmpeg, the TTS service will fail when attempting to process audio in Kubernetes. Please verify this behavior and consider either updating the cp destination here to /usr/bin/ffmpeg or modifying the deployment YAML to match /usr/local/bin/ffmpeg.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Web/Resgrid.Web.Tts/Dockerfile` around lines 25 - 42, Align the FFmpeg
installation destination in the Dockerfile’s download/install RUN block with the
Kubernetes deployment’s expected /usr/bin/ffmpeg path. Update the cp target from
/usr/local/bin/ffmpeg, or consistently adjust the deployment configuration to
use the installed path, ensuring the TTS service resolves the binary in
Kubernetes.

@ucswift ucswift merged commit 79a1656 into master Jul 16, 2026
19 checks passed
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.

2 participants