159 lines
6.1 KiB
Markdown
Executable File
159 lines
6.1 KiB
Markdown
Executable File
# Structure du projet Linux BenchTools
|
|
|
|
## Arborescence complète
|
|
|
|
```
|
|
linux-benchtools/
|
|
│
|
|
├── backend/ # Backend FastAPI
|
|
│ ├── app/
|
|
│ │ ├── api/ # Endpoints API
|
|
│ │ │ ├── __init__.py
|
|
│ │ │ ├── benchmark.py # POST /api/benchmark
|
|
│ │ │ ├── devices.py # CRUD devices
|
|
│ │ │ ├── docs.py # Upload/download documents
|
|
│ │ │ └── links.py # CRUD liens constructeur
|
|
│ │ │
|
|
│ │ ├── core/ # Configuration & sécurité
|
|
│ │ │ ├── __init__.py
|
|
│ │ │ ├── config.py # Variables d'environnement
|
|
│ │ │ └── security.py # Authentification token
|
|
│ │ │
|
|
│ │ ├── models/ # Modèles SQLAlchemy
|
|
│ │ │ ├── __init__.py
|
|
│ │ │ ├── device.py # Table devices
|
|
│ │ │ ├── hardware_snapshot.py # Table hardware_snapshots
|
|
│ │ │ ├── benchmark.py # Table benchmarks
|
|
│ │ │ ├── manufacturer_link.py # Table manufacturer_links
|
|
│ │ │ └── document.py # Table documents
|
|
│ │ │
|
|
│ │ ├── schemas/ # Schémas Pydantic (validation)
|
|
│ │ │ ├── __init__.py
|
|
│ │ │ ├── benchmark.py # Schémas payload benchmark
|
|
│ │ │ ├── device.py # Schémas device
|
|
│ │ │ ├── hardware.py # Schémas hardware
|
|
│ │ │ ├── document.py # Schémas document
|
|
│ │ │ └── link.py # Schémas liens
|
|
│ │ │
|
|
│ │ ├── db/ # Base de données
|
|
│ │ │ ├── __init__.py
|
|
│ │ │ ├── base.py # Déclaration base SQLAlchemy
|
|
│ │ │ ├── session.py # Session & engine
|
|
│ │ │ └── init_db.py # Initialisation tables
|
|
│ │ │
|
|
│ │ ├── utils/ # Utilitaires
|
|
│ │ │ ├── __init__.py
|
|
│ │ │ └── scoring.py # Calcul scores
|
|
│ │ │
|
|
│ │ ├── main.py # Point d'entrée FastAPI
|
|
│ │ └── __init__.py
|
|
│ │
|
|
│ ├── data/ # Base SQLite (gitignored)
|
|
│ ├── Dockerfile # Image Docker backend
|
|
│ ├── requirements.txt # Dépendances Python
|
|
│ └── README.md
|
|
│
|
|
├── frontend/ # Interface web
|
|
│ ├── index.html # Dashboard
|
|
│ ├── devices.html # Liste devices
|
|
│ ├── device_detail.html # Détail device
|
|
│ ├── settings.html # Configuration
|
|
│ │
|
|
│ ├── css/
|
|
│ │ ├── main.css # Styles principaux (Monokai)
|
|
│ │ └── components.css # Composants réutilisables
|
|
│ │
|
|
│ └── js/
|
|
│ ├── api.js # Appels API
|
|
│ ├── dashboard.js # Logique Dashboard
|
|
│ ├── devices.js # Logique liste devices
|
|
│ ├── device_detail.js # Logique détail device
|
|
│ ├── settings.js # Logique settings
|
|
│ └── utils.js # Fonctions utilitaires
|
|
│
|
|
├── scripts/ # Scripts clients
|
|
│ └── bench.sh # Script de benchmark client
|
|
│
|
|
├── uploads/ # Documents uploadés (gitignored)
|
|
│
|
|
├── tests/ # Tests
|
|
│ └── data/ # Données de test
|
|
│ ├── bench_full.json # Payload complet
|
|
│ ├── bench_no_gpu.json # Sans GPU
|
|
│ └── bench_short.json # Mode court
|
|
│
|
|
├── docker-compose.yml # Orchestration Docker
|
|
├── .env.example # Exemple variables d'env
|
|
├── .gitignore # Fichiers ignorés par Git
|
|
├── install.sh # Script d'installation
|
|
├── STRUCTURE.md # Ce fichier
|
|
└── README.md # Documentation principale
|
|
|
|
├── 01_vision_fonctionnelle.md # Spécifications (existants)
|
|
├── 02_model_donnees.md
|
|
├── 03_api_backend.md
|
|
├── 04_bench_script_client.md
|
|
├── 05_webui_design.md
|
|
├── 06_backend_architecture.md
|
|
├── 08_installation_bootstrap.md
|
|
├── 09_tests_qualite.md
|
|
└── 10_roadmap_evolutions.md
|
|
```
|
|
|
|
## Description des composants
|
|
|
|
### Backend (Python/FastAPI)
|
|
- **Port** : 8007
|
|
- **Base de données** : SQLite (`backend/data/data.db`)
|
|
- **Auth** : Token Bearer simple
|
|
- **Upload** : Documents stockés dans `uploads/`
|
|
|
|
### Frontend (HTML/CSS/JS)
|
|
- **Port** : 8087 (via nginx)
|
|
- **Style** : Monokai dark theme
|
|
- **Framework** : Vanilla JS (pas de framework lourd)
|
|
|
|
### Script client (Bash)
|
|
- **Nom** : `bench.sh`
|
|
- **OS cibles** : Debian, Ubuntu, Proxmox
|
|
- **Outils** : sysbench, fio, iperf3, dmidecode, lscpu, smartctl
|
|
|
|
### Docker
|
|
- **2 services** :
|
|
- `backend` : FastAPI + Uvicorn
|
|
- `frontend` : nginx servant les fichiers statiques
|
|
|
|
## Flux de données
|
|
|
|
```
|
|
[Machine cliente]
|
|
│ exécute bench.sh
|
|
↓
|
|
[Collecte hardware + Benchmarks]
|
|
│ génère JSON
|
|
↓
|
|
[POST /api/benchmark]
|
|
│ avec token Bearer
|
|
↓
|
|
[Backend FastAPI]
|
|
│ valide + stocke SQLite
|
|
↓
|
|
[SQLite DB]
|
|
│ devices, hardware_snapshots, benchmarks
|
|
↓
|
|
[Frontend]
|
|
│ GET /api/devices, /api/benchmarks
|
|
↓
|
|
[Dashboard web]
|
|
│ affiche classement + détails
|
|
```
|
|
|
|
## Prochaines étapes
|
|
|
|
1. ✅ Arborescence créée
|
|
2. ⏳ Développement frontend
|
|
3. ⏳ Développement backend
|
|
4. ⏳ Script bench.sh
|
|
5. ⏳ Configuration Docker
|
|
6. ⏳ Script d'installation
|