Skip to content

improve local development environment - #13

Merged
UnABC merged 8 commits into
mainfrom
feat/improve-local-dev
Aug 21, 2026
Merged

improve local development environment#13
UnABC merged 8 commits into
mainfrom
feat/improve-local-dev

Conversation

@pdpd22

@pdpd22 pdpd22 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

概要

ローカル開発環境の起動・ビルド・デバッグをしやすくしました。

変更内容

  • make local-dev を追加
    • MySQL、Redis、MinIO、バックエンドを起動
    • 未ビルド時は通常ビルド、以降はインクリメンタルビルド
    • CPUのlibx264を使用
  • make local-dev-gpumake local-dev-logsなどの補助コマンドを追加(READMEに詳細)
  • Composeにローカル用デフォルト値とhealthcheckを追加
  • .env.exampleとローカル開発手順を追加
  • ローカルワーカーの実行パスを設定可能に変更

@pdpd22 pdpd22 self-assigned this Aug 20, 2026
Added Docker setup instructions and improved clarity.
@pdpd22
pdpd22 requested review from UnABC and a lite review from Copilot August 20, 2026 18:31

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

ローカル開発環境での起動・ビルド・デバッグを簡単にするために、Make/Compose/Dev用スクリプト整備と、ローカル実行時のワーカー/エンコーダー設定の柔軟化を行うPRです。

Changes:

  • make local-dev を中心に、ローカル起動・ログ表示・GPUモード等の補助コマンドを追加
  • Composeにローカル向けデフォルト値とhealthcheck、ローカル起動用オーバーライドを追加
  • ローカルワーカーの実行パス設定、ワーカーのエンコーダー設定表示/進捗更新処理を改善

Reviewed changes

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

Show a summary per file
File Description
worker/worker.cpp ローカルCPU/GPUエンコーダー設定の定数化、エンコーダー設定表示、進捗更新方式の変更
controllers/webhooks_minio.cpp ローカルワーカー起動パスを環境変数で切り替え可能に
CMakeLists.txt ローカルGPUエンコーダー用オプション追加、ローカルワーカーdispatchの定義整理
GNUmakefile make local-dev/GPU/ログ/status/shell/down 等の開発用ターゲット追加
Dockerfile.dev development/builder段の分離、ローカルワーカー実行パスENVの追加
docker-compose.yml ローカル用デフォルト値・healthcheck・depends_on条件の追加、LOCAL_WORKER_EXECUTABLEの導入
docker-compose.local.yml backend をローカル起動スクリプトで立ち上げるオーバーライド追加
docker-compose.local-gpu.yml GPU公開とGPUエンコーダーモードONのオーバーライド追加
docker/minio/init.sh set -eu、引用符付与、イベント登録の冪等化
docker/dev/start.sh ローカルCMake configure/build→backend起動の自動化
docker/dev/wait-ready.sh backendの起動完了待ち(PID+ポート監視)追加
docker/dev/status.sh ローカルビルド設定/ワーカーエンコーダー/GPU露出状況の表示追加
README.md ローカル開発手順と make local-dev /補助コマンドの説明を追加
.env.example ローカル開発向けの環境変数例を追加

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread worker/worker.cpp Outdated
Comment thread controllers/webhooks_minio.cpp Outdated
Comment thread docker/dev/wait-ready.sh
Comment thread worker/worker.cpp Outdated

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

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Suppressed comments (1)

docker-compose.yml:53

  • The MySQL healthcheck uses -p$${MYSQL_PASSWORD}. If MYSQL_PASSWORD is empty, this becomes -p (prompting for a password) and the healthcheck can hang/fail indefinitely, keeping db unhealthy and blocking dependent services. Use --password= form instead to avoid prompting.
    healthcheck:
      test: ["CMD-SHELL", "mysqladmin ping -h localhost -u$${MYSQL_USER} -p$${MYSQL_PASSWORD} --silent"]
      interval: 5s

Comment thread worker/worker.cpp

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

Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.

Suppressed comments (2)

docker-compose.yml:19

  • docker-compose.yml now bakes in default passwords (e.g. NS_MARIADB_PASSWORD:-my_secure_password_123). This is a security footgun because running docker compose up without a .env will start network-exposed services with known credentials, and these defaults may get copy-pasted into non-local environments. Consider moving default credentials into docker-compose.local.yml (local-only override) and requiring explicit values (or at least clearly-dev-only placeholders) in the base docker-compose.yml.
      NS_MARIADB_PASSWORD: ${NS_MARIADB_PASSWORD:-my_secure_password_123}

worker/worker.cpp:428

  • value_end can be std::string::npos when the metadata line ends right after the numeric value. Using value_end - value_start in that case wraps a size_t (very large) and relies on substr clamping behavior. Handle the npos case explicitly to keep the intent clear and avoid warnings.
						const std::size_t value_start = pts_position + sizeof("pts_time:") - 1;
						const std::size_t value_end = line.find_first_of(" \t", value_start);
						const double current_sec = std::stod(line.substr(value_start, value_end - value_start));

@UnABC UnABC left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@UnABC
UnABC merged commit b9132bf into main Aug 21, 2026
6 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.

3 participants