Files
serv_benchmark/QUICKSTART.md
gilles soulier c6a8e8e83d feat: Complete MVP implementation of Linux BenchTools
 Features:
- Backend FastAPI complete (25 Python files)
  - 5 SQLAlchemy models (Device, HardwareSnapshot, Benchmark, Link, Document)
  - Pydantic schemas for validation
  - 4 API routers (benchmark, devices, links, docs)
  - Authentication with Bearer token
  - Automatic score calculation
  - File upload support

- Frontend web interface (13 files)
  - 4 HTML pages (Dashboard, Devices, Device Detail, Settings)
  - 7 JavaScript modules
  - Monokai dark theme CSS
  - Responsive design
  - Complete CRUD operations

- Client benchmark script (500+ lines Bash)
  - Hardware auto-detection
  - CPU, RAM, Disk, Network benchmarks
  - JSON payload generation
  - Robust error handling

- Docker deployment
  - Optimized Dockerfile
  - docker-compose with 2 services
  - Persistent volumes
  - Environment variables

- Documentation & Installation
  - Automated install.sh script
  - README, QUICKSTART, DEPLOYMENT guides
  - Complete API documentation
  - Project structure documentation

📊 Stats:
- ~60 files created
- ~5000 lines of code
- Full MVP feature set implemented

🚀 Ready for production deployment!

🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-07 14:46:10 +01:00

3.9 KiB

Quick Start - Linux BenchTools

Guide de démarrage rapide pour Linux BenchTools.

🚀 Installation en 3 étapes

1. Cloner le dépôt

git clone https://gitea.maison43.duckdns.org/gilles/linux-benchtools.git
cd linux-benchtools

2. Lancer l'installation

./install.sh

Le script va :

  • Vérifier Docker et Docker Compose
  • Créer les répertoires nécessaires
  • Générer un fichier .env avec un token aléatoire
  • Construire les images Docker
  • Démarrer les services
  • Afficher les URLs et le token API

3. Accéder à l'interface

Ouvrez votre navigateur sur :

http://localhost:8087

📊 Lancer votre premier benchmark

Sur une machine Linux à benchmarker, exécutez :

curl -s http://VOTRE_SERVEUR:8087/scripts/bench.sh | bash -s -- \
  --server http://VOTRE_SERVEUR:8007/api/benchmark \
  --token "VOTRE_TOKEN_API"

Remplacez :

  • VOTRE_SERVEUR par l'IP ou hostname de votre serveur
  • VOTRE_TOKEN_API par le token affiché lors de l'installation

🎯 Options du script benchmark

# Mode rapide (tests courts)
--short

# Spécifier un nom de device personnalisé
--device "mon-serveur-prod"

# Serveur iperf3 pour tests réseau
--iperf-server 192.168.1.100

# Ignorer certains tests
--skip-cpu
--skip-memory
--skip-disk
--skip-network
--skip-gpu

Exemple complet

curl -s http://192.168.1.50:8087/scripts/bench.sh | bash -s -- \
  --server http://192.168.1.50:8007/api/benchmark \
  --token "abc123..." \
  --device "elitedesk-800g3" \
  --iperf-server 192.168.1.50 \
  --short

📁 Structure des fichiers

linux-benchtools/
├── backend/           # API FastAPI
├── frontend/          # Interface web
├── scripts/           # Scripts clients
│   └── bench.sh       # Script de benchmark
├── uploads/           # Documents uploadés
├── docker-compose.yml # Orchestration Docker
├── .env               # Configuration (généré)
└── install.sh         # Script d'installation

🔧 Commandes utiles

Gérer les services

# Voir les logs
docker compose logs -f

# Voir les logs du backend uniquement
docker compose logs -f backend

# Arrêter les services
docker compose down

# Redémarrer les services
docker compose restart

# Mettre à jour
git pull
docker compose up -d --build

Accès aux services

Service URL Description
Frontend http://localhost:8087 Interface web
Backend API http://localhost:8007 API REST
API Docs http://localhost:8007/docs Documentation Swagger
Health Check http://localhost:8007/api/health Vérification statut

🐛 Dépannage

Le backend ne démarre pas

# Voir les logs
docker compose logs backend

# Vérifier que le port 8007 est libre
ss -tulpn | grep 8007

# Reconstruire l'image
docker compose build --no-cache backend
docker compose up -d backend

Le frontend ne s'affiche pas

# Vérifier que le port 8087 est libre
ss -tulpn | grep 8087

# Redémarrer le frontend
docker compose restart frontend

Erreur 401 lors du benchmark

Vérifiez que vous utilisez le bon token :

grep API_TOKEN .env

Base de données corrompue

# Sauvegarder l'ancienne base
mv backend/data/data.db backend/data/data.db.backup

# Redémarrer (la base sera recréée)
docker compose restart backend

📖 Documentation complète

🆘 Besoin d'aide ?

  1. Consultez les spécifications
  2. Vérifiez les logs
  3. Ouvrez une issue sur Gitea

🎉 C'est tout !

Votre système de benchmarking est prêt. Amusez-vous bien ! 🚀