Add ASR engine dev setup helper

This commit is contained in:
Rishikanth Chandrasekaran
2026-01-29 18:18:14 -08:00
parent 29fc31964a
commit 2cf633dbb9
3 changed files with 34 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
.PHONY: help docs docs-serve docs-clean website website-dev website-build dev asr-engine-dev
.PHONY: help docs docs-serve docs-clean website website-dev website-build dev asr-engine-dev asr-engine-setup
help: ## Show this help message
@echo 'Usage: make [target]'
@@ -77,6 +77,10 @@ asr-engine-dev: ## Start ASR engine daemon for local development
echo "🔌 ASR engine socket: $$ASR_ENGINE_SOCKET"; \
cd asr-engines/scriberr-asr-onnx && uv run asr-engine-server --socket $$ASR_ENGINE_SOCKET
asr-engine-setup: ## Install uv and sync ASR engine dependencies
@echo "🧠 Setting up ASR engine dev environment..."
@bash scripts/dev_setup_asr_engine.sh
docs: ## Generate API documentation from Go code annotations
@echo "Generating API documentation..."
@command -v swag >/dev/null 2>&1 || { echo "Error: swag not installed. Run: go install github.com/swaggo/swag/cmd/swag@latest"; exit 1; }

View File

@@ -324,6 +324,7 @@ Notes:
- The ASR engine uses a Unix socket at `/tmp/scriberr-asr.sock` by default.
- Set `ASR_ENGINE_SKIP_SYNC=1` to skip `uv sync` on every `make dev`.
- You can run just the engine with `make asr-engine-dev`.
- One-time setup helper: `make asr-engine-setup`.
### Build (local)

28
scripts/dev_setup_asr_engine.sh Executable file
View File

@@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
ENGINE_DIR="$ROOT_DIR/asr-engines/scriberr-asr-onnx"
echo "🧠 ASR engine dev setup"
if ! command -v uv >/dev/null 2>&1; then
echo "⚠️ 'uv' not found. Installing via official installer..."
curl -LsSf https://astral.sh/uv/install.sh | sh
if ! command -v uv >/dev/null 2>&1; then
echo "❌ 'uv' still not found. Add it to PATH and re-run."
exit 1
fi
echo "✅ 'uv' installed"
fi
if [ ! -d "$ENGINE_DIR" ]; then
echo "❌ Missing ASR engine directory: $ENGINE_DIR"
exit 1
fi
echo "📦 Syncing ASR engine deps..."
cd "$ENGINE_DIR"
uv sync
echo "✅ ASR engine dev setup complete"