- New: src/rag/engine/ — in-process hybrid search (FTS5 BM25 + sqlite-vec + LLM rerank) - New: src/rag/qmd/ — compatibility layer (qmd_query, qmd_chat, qmd_chat_stream, qmd_index_*) - New: src/ingest/stub_writer.py — .md stubs for binary files (videos, archives) - New: scripts/deploy.sh + scripts/pull_models.sh + Makefile + .env.example - Removed: LightRAG, sentence-transformers embedding via separate package, rag_standalone/ - Removed: @nousresearch/qmd npm dep (package not published); Node.js from Dockerfile - Updated: tests/ (46 passed), docker-compose, .dockerignore, config.yaml, README Engine: in-process Python (no daemon, no npm), sentence-transformers 384-dim, RRF fusion (k=60), BM25 + vector with numpy fallback. WebSocket API unchanged. Deploy: 'git clone' + 'make init' + 'make pull-models MODELS_SOURCE=...' + 'make up'. Models (5.83 GB) live outside git; pulled via rsync from dev host.
52 lines
1.3 KiB
Bash
52 lines
1.3 KiB
Bash
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
APP_DIR="/home/art/transcription"
|
|
MIGRATE_DIR="$APP_DIR/migrate"
|
|
SUDO_PASS="${1:-}"
|
|
|
|
cd "$APP_DIR"
|
|
|
|
mkdir -p data uploads processed models tmp
|
|
|
|
if [ -f "$MIGRATE_DIR/data.tar.gz" ]; then
|
|
tar xzf "$MIGRATE_DIR/data.tar.gz" -C data
|
|
fi
|
|
|
|
if [ -f "$MIGRATE_DIR/processed.tar.gz" ]; then
|
|
tar xzf "$MIGRATE_DIR/processed.tar.gz" -C processed
|
|
fi
|
|
|
|
if [ -f "$MIGRATE_DIR/uploads.tar.gz" ]; then
|
|
echo "Extracting uploads (may take several minutes)..."
|
|
tar xzf "$MIGRATE_DIR/uploads.tar.gz" -C uploads
|
|
fi
|
|
|
|
if [ -f "$MIGRATE_DIR/models_huggingface.tar.gz" ]; then
|
|
echo "Extracting models (may take several minutes)..."
|
|
mkdir -p models/huggingface
|
|
tar xzf "$MIGRATE_DIR/models_huggingface.tar.gz" -C models/huggingface
|
|
fi
|
|
|
|
if [ -f "$MIGRATE_DIR/nltk_data.tar.gz" ]; then
|
|
mkdir -p models/nltk_data
|
|
tar xzf "$MIGRATE_DIR/nltk_data.tar.gz" -C models/nltk_data
|
|
fi
|
|
|
|
docker_cmd() {
|
|
if docker info >/dev/null 2>&1; then
|
|
docker "$@"
|
|
else
|
|
echo "$SUDO_PASS" | sudo -S docker "$@"
|
|
fi
|
|
}
|
|
|
|
echo "Building base image..."
|
|
docker_cmd build -f Dockerfile -t transcription-transcription:latest .
|
|
|
|
echo "Starting service..."
|
|
docker_cmd compose -f docker-compose.yml -f docker-compose.prod.yml up -d --build
|
|
|
|
sleep 15
|
|
curl -sf http://localhost:8000/api/health && echo " HEALTH OK" || echo " HEALTH CHECK FAILED (service may still be starting)"
|