Skip to content

fix: Go Docker — Debian化 + ORT修正 + OpenJTalk日本語G2P + serveサブコマンド - #332

Merged
ayutaz merged 2 commits into
devfrom
fix/go-docker-openjtalk
Apr 9, 2026
Merged

fix: Go Docker — Debian化 + ORT修正 + OpenJTalk日本語G2P + serveサブコマンド#332
ayutaz merged 2 commits into
devfrom
fix/go-docker-openjtalk

Conversation

@ayutaz

@ayutaz ayutaz commented Apr 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Go SDK Dockerfile を Alpine → Debian に変更し ONNX Runtime (glibc) との互換性を確保
  • ORT v1.21.0 (存在しないバージョン・旧命名規則) → v1.24.4 (go-ci.yml と統一) に修正
  • OpenJTalk を pyopenjtalk-plus から CMake ビルドし、-tags openjtalk で日本語G2P を有効化(辞書同梱)
  • piper-plus serve サブコマンドを追加(HTTP TTS サーバー: /synthesize, /health, /info
  • Cobra の共有フラグを PersistentFlags に移動してサブコマンド間で共有
  • pyopenjtalk-plus / ORT の SHA-256 チェックサム検証を追加
  • SIGTERM ハンドリング + graceful shutdown 実装

Changed files

ファイル 変更内容
src/go/docker/Dockerfile Debian化 + ORT 1.24.4 + OpenJTalk CMakeビルド + SHA256検証
src/go/cmd/piper-plus/serve.go 新規serve サブコマンド (graceful shutdown対応)
src/go/cmd/piper-plus/serve_test.go 新規 — Cobra コマンド構造テスト (5テスト)
src/go/cmd/piper-plus/main.go PersistentFlags 移動 + serveCmd 登録
.github/workflows/go-ci.yml docker-build ジョブ追加
src/go/README.md Docker 説明文更新

Test plan

  • go-ci.yml unit-test (3 OS) で serve_test.go のテストが通ること
  • go-ci.yml docker-build で Dockerfile のビルドが成功すること
  • go-ci.yml build (3 OS) で serve.go を含むバイナリビルドが成功すること
  • go-ci.yml lint が通ること

…ンド (#331)

## Dockerfile修正
- Alpine (musl) → Debian (glibc) に変更し ORT 互換性を確保
- ORT v1.21.0 (存在しない) → v1.24.4 (go-ci.yml と統一)
- URL 命名規則を x86_64 → x64 に修正
- pyopenjtalk-plus から OpenJTalk を CMake ビルドし -tags openjtalk で日本語G2P有効化
- MeCab 辞書をイメージに同梱

## serve サブコマンド追加
- piper-plus serve -m model.onnx --addr :8080 で HTTP TTS サーバー起動
- 共有フラグ (--model, --config, --device 等) を PersistentFlags に移動
- エンドポイント: /synthesize, /health, /info

## テスト・CI
- serve_test.go: Cobra コマンド構造のユニットテスト (5テスト)
- go-ci.yml: docker-build ジョブ追加 (PR時にDockerイメージビルド検証)
Copilot AI review requested due to automatic review settings April 9, 2026 08:19
@ayutaz ayutaz self-assigned this Apr 9, 2026

Copilot AI 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.

Pull request overview

This PR updates the Go distribution packaging and CLI to better support ONNX Runtime (glibc) and adds an HTTP “serve” mode for running Piper Plus as a TTS server.

Changes:

  • Switch Go Docker image from Alpine to Debian, bundle ONNX Runtime v1.24.4, and build/bundle OpenJTalk (Japanese G2P) assets.
  • Add piper-plus serve subcommand (HTTP endpoints: /synthesize, /health, /info) plus basic Cobra command-structure tests.
  • Move shared CLI flags to Cobra PersistentFlags and add a Docker build job to Go CI.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/go/docker/Dockerfile Debian-based multi-stage build; downloads ORT and builds OpenJTalk + bundles dictionary.
src/go/cmd/piper-plus/serve.go New serve subcommand that starts an HTTP TTS server.
src/go/cmd/piper-plus/serve_test.go New tests validating Cobra command wiring/flags for serve.
src/go/cmd/piper-plus/main.go Moves common flags to PersistentFlags and registers serve command.
.github/workflows/go-ci.yml Adds docker-build job that builds the Go Docker image in CI.
src/go/README.md Updates Docker documentation to match the Debian/ORT/OpenJTalk approach.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/go/docker/Dockerfile
Comment thread src/go/docker/Dockerfile
Comment thread src/go/docker/Dockerfile
Comment thread src/go/cmd/piper-plus/serve.go Outdated
Comment thread src/go/cmd/piper-plus/serve.go
Comment thread src/go/cmd/piper-plus/serve_test.go Outdated
- Dockerfile: OPENJTALK_DIC_DIR → OPENJTALK_DICTIONARY_PATH (Goコードが実際に読む変数名)
- Dockerfile: 辞書パスを /usr/share → /usr/local/share に修正 (exe-relative Tier 2 と一致)
- Dockerfile: pyopenjtalk-plus と ORT の SHA-256 チェックサム検証を追加
- serve.go: SIGTERM ハンドリング追加 (Docker/K8s 対応)
- serve.go: http.Server.Shutdown() による graceful shutdown 実装
- serve_test.go: TestServeCmd_RequiresModel → TestServeCmd_RunESet にリネーム
@ayutaz
ayutaz merged commit 98e9582 into dev Apr 9, 2026
55 checks passed
@ayutaz
ayutaz deleted the fix/go-docker-openjtalk branch April 9, 2026 09:00
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