improve local development environment - #13
Merged
Merged
Conversation
Added Docker setup instructions and improved clarity.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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}. IfMYSQL_PASSWORDis empty, this becomes-p(prompting for a password) and the healthcheck can hang/fail indefinitely, keepingdbunhealthy 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
There was a problem hiding this comment.
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.ymlnow bakes in default passwords (e.g.NS_MARIADB_PASSWORD:-my_secure_password_123). This is a security footgun because runningdocker compose upwithout a.envwill start network-exposed services with known credentials, and these defaults may get copy-pasted into non-local environments. Consider moving default credentials intodocker-compose.local.yml(local-only override) and requiring explicit values (or at least clearly-dev-only placeholders) in the basedocker-compose.yml.
NS_MARIADB_PASSWORD: ${NS_MARIADB_PASSWORD:-my_secure_password_123}
worker/worker.cpp:428
value_endcan bestd::string::nposwhen the metadata line ends right after the numeric value. Usingvalue_end - value_startin that case wraps asize_t(very large) and relies onsubstrclamping behavior. Handle thenposcase 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));
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
ローカル開発環境の起動・ビルド・デバッグをしやすくしました。
変更内容
make local-devを追加libx264を使用make local-dev-gpuやmake local-dev-logsなどの補助コマンドを追加(READMEに詳細).env.exampleとローカル開発手順を追加