Initial release: DictIA v0.8.14-alpha (fork de Speakr, AGPL-3.0)

This commit is contained in:
InnovA AI
2026-03-16 21:47:37 +00:00
commit 42772a31ed
365 changed files with 103572 additions and 0 deletions

105
deployment/tools/update.sh Normal file
View File

@@ -0,0 +1,105 @@
#!/usr/bin/env bash
# DictIA — Update script
#
# Pulls latest code, rebuilds Docker image, and restarts services.
# Detects the active deployment profile automatically.
#
# Usage: bash update.sh [--no-pull] [--no-build]
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PROJECT_DIR="$(cd "$SCRIPT_DIR/../.." && pwd)"
NO_PULL=false
NO_BUILD=false
for arg in "$@"; do
case "$arg" in
--no-pull) NO_PULL=true ;;
--no-build) NO_BUILD=true ;;
*) echo "Unknown option: $arg"; exit 1 ;;
esac
done
echo "=== DictIA Update ==="
echo "Project: $PROJECT_DIR"
echo
# 1. Detect active compose file
COMPOSE_FILE=""
PROFILE=""
for f in cloud local-cpu local-gpu; do
CF="$PROJECT_DIR/deployment/docker/docker-compose.$f.yml"
if [ -f "$CF" ] && docker compose -f "$CF" ps --quiet 2>/dev/null | grep -q .; then
COMPOSE_FILE="$CF"
PROFILE="$f"
break
fi
done
if [ -z "$COMPOSE_FILE" ]; then
# Fallback: check .env for profile
if [ -f "$PROJECT_DIR/.env" ]; then
PROFILE=$(grep -E '^DICTIA_PROFILE=' "$PROJECT_DIR/.env" 2>/dev/null | cut -d= -f2 || echo "cloud")
fi
PROFILE="${PROFILE:-cloud}"
COMPOSE_FILE="$PROJECT_DIR/deployment/docker/docker-compose.$PROFILE.yml"
fi
echo "Profile: $PROFILE"
echo "Compose: $COMPOSE_FILE"
echo
# 2. Git pull
if [ "$NO_PULL" = false ]; then
echo "[1/5] Pulling latest code..."
cd "$PROJECT_DIR"
git pull origin dictia-branding
else
echo "[1/5] Skipping git pull (--no-pull)"
fi
# 3. Rebuild DictIA image
if [ "$NO_BUILD" = false ]; then
echo "[2/5] Building DictIA image..."
cd "$PROJECT_DIR"
docker build -t innova-ai/dictia:latest .
else
echo "[2/5] Skipping build (--no-build)"
fi
# 3b. Pull upstream images (WhisperX) if local profile
if [ "$PROFILE" != "cloud" ] && [ "$NO_BUILD" = false ]; then
echo "[3/5] Pulling upstream images (WhisperX)..."
docker compose -f "$COMPOSE_FILE" pull whisperx-asr 2>/dev/null || true
else
echo "[3/5] Skipping upstream pull (cloud profile or --no-build)"
fi
# 4. Restart containers
echo "[4/5] Restarting containers..."
docker compose -f "$COMPOSE_FILE" down
docker compose -f "$COMPOSE_FILE" up -d
# 5. Wait for health
echo "[5/5] Waiting for health check..."
RETRIES=30
for i in $(seq 1 $RETRIES); do
if docker compose -f "$COMPOSE_FILE" ps | grep -q "healthy"; then
echo " DictIA is healthy!"
break
fi
if [ "$i" -eq "$RETRIES" ]; then
echo " WARNING: Health check timeout. Check: docker compose -f $COMPOSE_FILE logs"
fi
sleep 5
done
# Cleanup dangling images
echo
echo "Cleaning up old images..."
docker image prune -f 2>/dev/null || true
echo
echo "=== Update complete ==="
echo "DictIA: http://localhost:8899"
docker compose -f "$COMPOSE_FILE" ps