ADAPT-Chase's picture
Add files using upload-large-folder tool
fbf3c28 verified
#!/usr/bin/env bash
set -euo pipefail
# Deploy latest OUI-MAX to Open WebUI: pull, seed, restart
# Usage: sudo bash deploy.sh [branch]
BRANCH=${1:-main}
ROOT_DIR="/data/adaptai/projects/oui-max"
SEED="$ROOT_DIR/scripts/bootstrap.sh"
SUPERVISOR_OPEN_WEBUI="/opt/supervisor-scripts/open_webui.sh"
DB="/data/adaptai/migrate/vast/workspace-vast1-2/webui/webui.db"
cd "$ROOT_DIR"
# Stash local changes if any
# if ! git diff --quiet || ! git diff --cached --quiet; then
# echo "[info] Stashing local changes"
# git stash push -u -m "deploy-$(date +%s)" >/dev/null || true
# fi
# echo "[info] Fetching and switching to $BRANCH"
# git fetch origin >/dev/null 2>&1 || true
# git checkout "$BRANCH" >/dev/null 2>&1 || git checkout -b "$BRANCH" || true
# git pull --ff-only origin "$BRANCH" || true
# Seed DB
if [ -x "$SEED" ]; then
echo "[info] Seeding DB at $DB"
WEBUI_DB="$DB" OUI_MAX_ROOT="$ROOT_DIR" "$SEED"
else
echo "[warn] Seed script not found: $SEED" >&2
fi
# Restart Open WebUI
if [ -x "$SUPERVISOR_OPEN_WEBUI" ]; then
echo "[info] Restarting Open WebUI"
pkill -f "/venv/main/bin/open-webui serve" 2>/dev/null || true
sleep 1
pkill -9 -f "/venv/main/bin/open-webui serve" 2>/dev/null || true
setsid "$SUPERVISOR_OPEN_WEBUI" >/dev/null 2>&1 < /dev/null &
sleep 2
pgrep -fl "open-webui serve" || true
else
echo "[warn] Supervisor script not found: $SUPERVISOR_OPEN_WEBUI" >&2
fi
# Check vLLM endpoint
VLLM_ENDPOINT="http://localhost:8001/v1/models"
echo "[info] Checking vLLM endpoint: $VLLM_ENDPOINT"
if curl -sS --max-time 5 "$VLLM_ENDPOINT" >/dev/null; then
echo "[info] vLLM endpoint is reachable."
else
echo "[warn] vLLM endpoint is NOT reachable or timed out." >&2
fi
echo "[done] Deploy complete"