v1.0 - Version stable: multi-PC, détection UI-DETR-1, 3 modes exécution
- Frontend v4 accessible sur réseau local (192.168.1.40) - Ports ouverts: 3002 (frontend), 5001 (backend), 5004 (dashboard) - Ollama GPU fonctionnel - Self-healing interactif - Dashboard confiance Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
272
server/verify_installation.sh
Executable file
272
server/verify_installation.sh
Executable file
@@ -0,0 +1,272 @@
|
||||
#!/bin/bash
|
||||
# verify_installation.sh
|
||||
# Vérifie que tous les composants serveur sont correctement installés
|
||||
|
||||
set -e
|
||||
|
||||
echo "========================================"
|
||||
echo "RPA Vision V3 - Vérification Serveur"
|
||||
echo "========================================"
|
||||
echo ""
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
|
||||
|
||||
ERRORS=0
|
||||
WARNINGS=0
|
||||
|
||||
# Fonction pour afficher les résultats
|
||||
check_ok() {
|
||||
echo "✅ $1"
|
||||
}
|
||||
|
||||
check_warning() {
|
||||
echo "⚠️ $1"
|
||||
((WARNINGS++))
|
||||
}
|
||||
|
||||
check_error() {
|
||||
echo "❌ $1"
|
||||
((ERRORS++))
|
||||
}
|
||||
|
||||
# 1. Vérifier l'environnement virtuel
|
||||
echo "📦 Vérification environnement virtuel..."
|
||||
if [ -d "$PROJECT_DIR/venv_v3" ]; then
|
||||
check_ok "Environnement virtuel trouvé"
|
||||
source "$PROJECT_DIR/venv_v3/bin/activate"
|
||||
else
|
||||
check_error "Environnement virtuel non trouvé: $PROJECT_DIR/venv_v3"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
# 2. Vérifier les dépendances Python
|
||||
echo "🐍 Vérification dépendances Python..."
|
||||
|
||||
# FastAPI
|
||||
if python -c "import fastapi" 2>/dev/null; then
|
||||
check_ok "FastAPI installé"
|
||||
else
|
||||
check_error "FastAPI non installé (pip install fastapi)"
|
||||
fi
|
||||
|
||||
# Uvicorn
|
||||
if python -c "import uvicorn" 2>/dev/null; then
|
||||
check_ok "Uvicorn installé"
|
||||
else
|
||||
check_error "Uvicorn non installé (pip install uvicorn)"
|
||||
fi
|
||||
|
||||
# Flask
|
||||
if python -c "import flask" 2>/dev/null; then
|
||||
check_ok "Flask installé"
|
||||
else
|
||||
check_error "Flask non installé (pip install flask)"
|
||||
fi
|
||||
|
||||
# Cryptography
|
||||
if python -c "import cryptography" 2>/dev/null; then
|
||||
check_ok "Cryptography installé"
|
||||
else
|
||||
check_error "Cryptography non installé (pip install cryptography)"
|
||||
fi
|
||||
|
||||
# Dépendances optionnelles
|
||||
if python -c "import torch" 2>/dev/null; then
|
||||
check_ok "PyTorch installé (optionnel)"
|
||||
else
|
||||
check_warning "PyTorch non installé (embeddings désactivés)"
|
||||
fi
|
||||
|
||||
if python -c "import clip" 2>/dev/null; then
|
||||
check_ok "CLIP installé (optionnel)"
|
||||
else
|
||||
check_warning "CLIP non installé (embeddings désactivés)"
|
||||
fi
|
||||
|
||||
if python -c "import faiss" 2>/dev/null; then
|
||||
check_ok "FAISS installé (optionnel)"
|
||||
else
|
||||
check_warning "FAISS non installé (indexation désactivée)"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
# 3. Vérifier les fichiers serveur
|
||||
echo "📁 Vérification fichiers serveur..."
|
||||
|
||||
FILES=(
|
||||
"server/api_upload.py"
|
||||
"server/processing_pipeline.py"
|
||||
"server/storage_encrypted.py"
|
||||
"server/requirements_server.txt"
|
||||
"server/start_all.sh"
|
||||
"server/setup_production.sh"
|
||||
"web_dashboard/app.py"
|
||||
"web_dashboard/templates/index.html"
|
||||
"web_dashboard/requirements.txt"
|
||||
)
|
||||
|
||||
for file in "${FILES[@]}"; do
|
||||
if [ -f "$PROJECT_DIR/$file" ]; then
|
||||
check_ok "$file"
|
||||
else
|
||||
check_error "$file manquant"
|
||||
fi
|
||||
done
|
||||
|
||||
echo ""
|
||||
|
||||
# 4. Vérifier les répertoires
|
||||
echo "📂 Vérification répertoires..."
|
||||
|
||||
DIRS=(
|
||||
"data/training/uploads"
|
||||
"data/training/sessions"
|
||||
"logs"
|
||||
)
|
||||
|
||||
for dir in "${DIRS[@]}"; do
|
||||
if [ -d "$PROJECT_DIR/$dir" ]; then
|
||||
check_ok "$dir"
|
||||
else
|
||||
check_warning "$dir manquant (sera créé au démarrage)"
|
||||
mkdir -p "$PROJECT_DIR/$dir"
|
||||
fi
|
||||
done
|
||||
|
||||
echo ""
|
||||
|
||||
# 5. Vérifier les permissions
|
||||
echo "🔐 Vérification permissions..."
|
||||
|
||||
if [ -x "$SCRIPT_DIR/start_all.sh" ]; then
|
||||
check_ok "start_all.sh exécutable"
|
||||
else
|
||||
check_warning "start_all.sh non exécutable"
|
||||
chmod +x "$SCRIPT_DIR/start_all.sh"
|
||||
check_ok "Permissions corrigées"
|
||||
fi
|
||||
|
||||
if [ -x "$SCRIPT_DIR/setup_production.sh" ]; then
|
||||
check_ok "setup_production.sh exécutable"
|
||||
else
|
||||
check_warning "setup_production.sh non exécutable"
|
||||
chmod +x "$SCRIPT_DIR/setup_production.sh"
|
||||
check_ok "Permissions corrigées"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
# 6. Vérifier les ports
|
||||
echo "🔌 Vérification ports..."
|
||||
|
||||
if netstat -tlnp 2>/dev/null | grep -q ":8000"; then
|
||||
check_warning "Port 8000 déjà utilisé"
|
||||
else
|
||||
check_ok "Port 8000 disponible"
|
||||
fi
|
||||
|
||||
if netstat -tlnp 2>/dev/null | grep -q ":5001"; then
|
||||
check_warning "Port 5001 déjà utilisé"
|
||||
else
|
||||
check_ok "Port 5001 disponible"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
# 7. Test rapide des modules
|
||||
echo "🧪 Test rapide des modules..."
|
||||
|
||||
# Test import API
|
||||
if python -c "import sys; sys.path.insert(0, '$SCRIPT_DIR'); from api_upload import app; print('OK')" 2>/dev/null | grep -q "OK"; then
|
||||
check_ok "Module api_upload importable"
|
||||
else
|
||||
check_error "Erreur import api_upload"
|
||||
fi
|
||||
|
||||
# Test import Pipeline
|
||||
if python -c "import sys; sys.path.insert(0, '$SCRIPT_DIR'); from processing_pipeline import ProcessingPipeline; print('OK')" 2>/dev/null | grep -q "OK"; then
|
||||
check_ok "Module processing_pipeline importable"
|
||||
else
|
||||
check_error "Erreur import processing_pipeline"
|
||||
fi
|
||||
|
||||
# Test import Dashboard
|
||||
if python -c "import sys; sys.path.insert(0, '$PROJECT_DIR/web_dashboard'); from app import app; print('OK')" 2>/dev/null | grep -q "OK"; then
|
||||
check_ok "Module dashboard importable"
|
||||
else
|
||||
check_error "Erreur import dashboard"
|
||||
fi
|
||||
|
||||
# Test import Encryption
|
||||
if python -c "import sys; sys.path.insert(0, '$SCRIPT_DIR'); from storage_encrypted import decrypt_file; print('OK')" 2>/dev/null | grep -q "OK"; then
|
||||
check_ok "Module storage_encrypted importable"
|
||||
else
|
||||
check_error "Erreur import storage_encrypted"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
# 8. Vérifier la configuration
|
||||
echo "⚙️ Vérification configuration..."
|
||||
|
||||
if [ -z "$ENCRYPTION_PASSWORD" ]; then
|
||||
check_warning "ENCRYPTION_PASSWORD non défini (utilisera le défaut)"
|
||||
else
|
||||
if [ "$ENCRYPTION_PASSWORD" = "rpa_vision_v3_default_key" ]; then
|
||||
check_warning "ENCRYPTION_PASSWORD utilise la valeur par défaut (changer pour production!)"
|
||||
else
|
||||
check_ok "ENCRYPTION_PASSWORD personnalisé défini"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
# 9. Résumé
|
||||
echo "========================================"
|
||||
echo "📊 Résumé"
|
||||
echo "========================================"
|
||||
echo ""
|
||||
|
||||
if [ $ERRORS -eq 0 ] && [ $WARNINGS -eq 0 ]; then
|
||||
echo "✅ Tout est OK! Le serveur est prêt."
|
||||
echo ""
|
||||
echo "🚀 Pour démarrer:"
|
||||
echo " ./server/start_all.sh"
|
||||
echo ""
|
||||
echo "📚 Documentation:"
|
||||
echo " - Guide de test: SERVER_TESTING_GUIDE.md"
|
||||
echo " - Guide HTTPS: server/nginx_https_setup.md"
|
||||
echo " - Résumé complet: SERVER_COMPLETE.md"
|
||||
exit 0
|
||||
elif [ $ERRORS -eq 0 ]; then
|
||||
echo "⚠️ $WARNINGS avertissement(s) - Le serveur devrait fonctionner"
|
||||
echo ""
|
||||
echo "🚀 Pour démarrer:"
|
||||
echo " ./server/start_all.sh"
|
||||
echo ""
|
||||
echo "💡 Recommandations:"
|
||||
if python -c "import torch" 2>/dev/null; then
|
||||
:
|
||||
else
|
||||
echo " - Installer PyTorch pour les embeddings"
|
||||
fi
|
||||
if [ "$ENCRYPTION_PASSWORD" = "rpa_vision_v3_default_key" ] || [ -z "$ENCRYPTION_PASSWORD" ]; then
|
||||
echo " - Définir ENCRYPTION_PASSWORD pour la production"
|
||||
fi
|
||||
exit 0
|
||||
else
|
||||
echo "❌ $ERRORS erreur(s), $WARNINGS avertissement(s)"
|
||||
echo ""
|
||||
echo "🔧 Actions requises:"
|
||||
echo " 1. Installer les dépendances manquantes:"
|
||||
echo " pip install -r server/requirements_server.txt"
|
||||
echo " pip install -r web_dashboard/requirements.txt"
|
||||
echo ""
|
||||
echo " 2. Vérifier les fichiers manquants"
|
||||
echo ""
|
||||
echo " 3. Relancer la vérification:"
|
||||
echo " ./server/verify_installation.sh"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user