Objectif : Mettre à disposition des données d'un système industriel à des data scientist.
graph TB
subgraph "Infrastructure existante - Serveur Windows"
subgraph "Système Industriel"
AUTOMATES[Automates industriels<br/>Capteurs process]
end
subgraph "Serveur intermédiaire"
DB[Base Microsoft SQL Server<br/>Données centralisées]
end
end
subgraph "Infrastructure développée - Même serveur Windows"
DOCKER[Docker Engine<br/>Orchestration conteneurs]
subgraph "Conteneur ETL"
ETL[Module ETL Python<br/>Extract Transform Load<br/>+ Scheduler automatique]
end
subgraph "Conteneur Database"
BDD[PostgreSQL 15<br/>Base optimisée analytique]
end
subgraph "Conteneur API"
API[API REST FastAPI<br/>Endpoints spécialisés]
AUTH[Authentification JWT<br/>Sécurisation accès]
end
subgraph "Conteneur Python Apps"
STREAMLIT[Streamlit Apps<br/>Dashboard déployables]
AUTRES
end
VOLUMES[Volumes Docker<br/>Persistance données]
end
subgraph "Utilisateurs finaux"
DS[Data Scientist<br/>Analyse & modélisation]
EXPLOIT[Exploitants<br/>Suivi process]
end
subgraph "Données externes"
LABO[Analyses laboratoire<br/>Plan expérimentation]
ECO[Données économiques<br/>Prix, coûts]
end
AUTOMATES -->|MQTT| DB
DB -->|Extraction SQL| ETL
LABO --> ETL
ECO --> ETL
ETL --> BDD
BDD --> API
API --> PYTHON_ENV
API --> STREAMLIT
PYTHON_ENV --> JUPYTER,
BDD --> VOLUMES
ETL --> VOLUMES
API <--> DS
STREAMLIT <--> DS
STREAMLIT --> EXPLOIT
style DOCKER fill:#e3f2fd
style ETL fill:#e1f5fe
style BDD fill:#f3e5f5
style API fill:#e8f5e8
style PYTHON_ENV fill:#fff3e0
Formation intensive pour maîtriser la stack technique avant intervention
| Jour | Focus principal | Compétences cibles | Temps estimé | Livrables concrets | Validation acquis |
|---|---|---|---|---|---|
| J1 | Setup environnement cross-platform | Docker Mac/Windows, accès distant | 5h | Environnement Mac + accès Windows | Tests hello-world sur les 2 OS |
| J2 | FastAPI Foundation | API REST, endpoints | 6h | Mini-API fonctionnelle | 5 endpoints + doc auto |
| J3 | FastAPI Advanced | Sécurité, tests, validation | 6h | API sécurisée complète | JWT auth fonctionnel |
| J4 | Docker cross-platform | Compose Mac/Windows, volumes | 6h | Stack multi-conteneurs testée | Services communicants sur 2 OS |
| J5 | PostgreSQL + ETL | Base données, SQLAlchemy | 6h | Pipeline données complet | 100k lignes traitées |
| J6 | Data processing | Pandas, transformation | 5h | Simulateur base de donnée intermédiaire | Données réalistes générées |
| J7 | Sécurité avancée | JWT, middleware, tests | 4h | Système auth robuste | Tests sécurité passés |
| J8 | Streamlit dashboards | Visualisation, UI | 5h | Templates dashboard | 3 dashboards opérationnels |
| J9 | CLI et déploiement distant | Scripts cross-platform, RDP/SSH | 5h | Scripts déploiement distant | Deploy via accès distant OK |
| J10 | Tests cross-platform | Validation Mac/Windows | 4h | Tests compatibilité complète | Performance identique ±20% |
| J11 | Intégration finale | Tests E2E, documentation | 6h | Projet complet portfolio | Stack démo Mac + Windows |
| Tâche | Durée | Ressource | Action concrète | Critère de réussite |
|---|---|---|---|---|
| Docker Desktop Mac | 1h | docker.com/get-started | Installation + test | docker run hello-world |
| Python stack Mac | 1h | pip install | Env virtuel + packages | Import fastapi successful |
| Windows Server access | 1.5h | Microsoft Remote Desktop | RDP/SSH test connexion | Accès CLI Windows opérationnel |
| Docker Windows distant | 1h | Installation via RDP | Docker Desktop Windows | docker run hello-world distant |
| Git workflow setup | 0.5h | GitHub/GitLab | Repository cross-platform | Push/pull Mac↔Windows |
Validation J1 : Docker fonctionnel sur Mac ET accès Windows Server avec Docker
Tests cross-platform obligatoires :
# Mac
docker run hello-world
git push origin main
# Windows (via RDP/SSH)
docker run hello-world
git pull origin main| Tâche | Durée | Ressource | Projet pratique | Validation |
|---|---|---|---|---|
| Tutorial officiel | 2h | fastapi.tiangolo.com/tutorial | Suivre pas à pas | API localhost:8000 |
| Endpoints de base | 2h | Documentation FastAPI | 5 endpoints procédé industriel | GET/POST fonctionnels |
| Models Pydantic | 1h | Pydantic docs | Classes Temperature, Batch | Validation automatique |
| Documentation auto | 1h | OpenAPI/Swagger | Interface /docs | Swagger UI accessible |
Projet J2 : API "FakeIndustrial" avec endpoints :
GET /api/temperature/{reactor_id}
GET /api/batches
POST /api/batches
GET /api/health
GET /api/sensors/list| Tâche | Durée | Ressource | Implémentation | Test validation |
|---|---|---|---|---|
| JWT Authentication | 3h | FastAPI Security tutorial | Login + token generation | Auth middleware OK |
| Database integration | 2h | SQLAlchemy + FastAPI | Connexion SQLite | CRUD operations |
| Tests automatisés | 1h | TestClient FastAPI | Tests unitaires API | 100% endpoints testés |
Projet J3 : API sécurisée avec :
- Système login/logout
- Protection endpoints par JWT
- Tests automatisés complets
| Tâche | Durée | Ressource | Configuration | Résultat |
|---|---|---|---|---|
| Dockerfile cross-platform | 1.5h | Docker best practices | Multi-stage build + pathlib | Image < 200MB sur Mac/Windows |
| Docker Compose cross-OS | 2h | Compose documentation | Volumes compatibles Mac/Windows | 3 services up sur les 2 OS |
| Networking cross-platform | 1.5h | Docker networking | Communication inter-conteneurs | Services connectés identiquement |
| Performance comparison | 1h | Docker benchmarks | Tests Mac vs Windows | Performance documentée |
Projet J4 : Stack conteneurisée compatible Mac/Windows :
# docker-compose.yml - Version cross-platform
services:
api:
build: .
volumes:
# Syntaxe compatible Mac/Windows
- type: bind
source: .
target: /app
postgres:
volumes:
- postgres_data:/var/lib/postgresql/data
redis:
volumes:
- redis_data:/data
volumes:
postgres_data:
redis_data:Tests de validation obligatoires :
-
docker-compose upidentique sur Mac et Windows - Volumes persistants sur les deux OS
- API accessible localhost sur Mac et Windows Server
- Performance ±20% entre les deux plateformes
| Tâche | Durée | Ressource | Implémentation | Benchmark |
|---|---|---|---|---|
| PostgreSQL setup | 1h | PostgreSQL tutorial | Base conteneurisée | Connexion stable |
| SQLAlchemy ORM | 2h | SQLAlchemy docs | Models + migrations | Tables créées |
| Pipeline ETL | 2h | Pandas + SQLAlchemy | Extract-Transform-Load | 100k lignes < 30s |
| Optimisation requêtes | 1h | PostgreSQL performance | Index + EXPLAIN | Requêtes < 100ms |
Projet J5 : ETL Pipeline complet :
- Génération données capteurs (CSV)
- Transformation pandas
- Chargement bulk PostgreSQL
| Tâche | Durée | Ressource | Développement | Validation |
|---|---|---|---|---|
| Simulateur procédés | 3h | Pandas documentation | Générateur données réalistes | Données cohérentes |
| Validation Pydantic | 1h | Pydantic advanced | Schemas validation | 0% données invalides |
| Transformation avancée | 1h | Pandas cookbook | Agrégations, calculs dérivés | Métriques correctes |
Projet J6 : Simulateur données procédés industriel :
class ProcessSimulator:
def generate_process_data(days=30)
def generate_batch_data(batches=100)
def generate_experiments_data()| Tâche | Durée | Ressource | Implémentation | Test sécurité |
|---|---|---|---|---|
| JWT robuste | 2h | JWT.io + python-jose | Refresh tokens | Expiration gérée |
| Middleware sécurité | 1h | FastAPI middleware | CORS, rate limiting | Protection active |
| Tests sécurité | 1h | OWASP guidelines | Tests intrusion basiques | Vulnérabilités identifiées |
Projet J7 : Système authentification production-ready avec refresh tokens et protection OWASP
| Tâche | Durée | Ressource | Développement | Interface |
|---|---|---|---|---|
| Streamlit basics | 2h | 30days.streamlit.app | Tutorial complet | App fonctionnelle |
| Dashboard température | 1.5h | Plotly + Streamlit | Graphiques temps réel | Viz interactive |
| Dashboard lots | 1.5h | Streamlit components | Analyse batches | Filtres dynamiques |
Projet J8 : 3 templates dashboards :
- Monitoring température temps réel
- Analyse performance lots
- Suivi expérimentations
| Tâche | Durée | Ressource | Scripts | Automatisation |
|---|---|---|---|---|
| Scripts déploiement cross-platform | 2h | Bash + PowerShell | deploy-app.sh/.ps1 | Deploy Mac→Windows |
| Accès distant optimisé | 1h | RDP/SSH setup | Connexion automatisée | Accès fluide Windows Server |
| Gestion applications distantes | 1.5h | Docker CLI distant | manage-apps-remote.sh | Start/stop/logs distant |
| Synchronisation code | 0.5h | Git/rsync | sync-to-server.sh | Upload code automatisé |
Projet J9 : CLI déploiement distant complet :
# deploy-remote.sh - Mac vers Windows Server
#!/bin/bash
# Upload code vers serveur
rsync -avz --exclude='.git' ./ user@server:/app/
# Connexion SSH/RDP et déploiement
ssh user@server "cd /app && docker-compose up -d --build"
# Ou via RDP avec script PowerShell
# deploy-windows.ps1Tests validation déploiement distant :
- Code développé sur Mac déployé sur Windows Server
- Docker Compose fonctionnel via accès distant
- Scripts de gestion d'applications depuis Mac
- Logs accessibles en temps réel
| Tâche | Durée | Ressource | Tests | Validation |
|---|---|---|---|---|
| Compatibilité Docker | 1.5h | Docker testing | Compose Mac/Windows | Comportement identique |
| Performance comparison | 1h | Benchmarking tools | ETL Mac vs Windows | Performance ±20% |
| Networking cross-OS | 1h | Network testing | API connectivity | Même résultats |
| Documentation différences | 0.5h | - | README cross-platform | Guide déploiement |
Projet J10 : Suite de tests cross-platform complète
| Tâche | Durée | Ressource | Livrable | Portfolio |
|---|---|---|---|---|
| Tests end-to-end cross-platform | 2h | pytest | Pipeline Mac→Windows testé | 100% tests passés |
| Documentation déploiement | 2h | MkDocs/Sphinx | Guide Mac→Windows | Doc technique complète |
| Démo cross-platform | 2h | - | Présentation stack | Démo Mac + Windows |
Projet J11 : Stack complète cross-platform avec documentation déploiement
📁 industrial-api/
├── 🐳 docker-compose.yml
├── 🐍 app/
│ ├── main.py (FastAPI app)
│ ├── models.py (Pydantic models)
│ ├── database.py (SQLAlchemy)
│ └── auth.py (JWT system)
├── 🗄️ migrations/
└── 🧪 tests/
📁 data-pipeline/
├── 📊 etl/
│ ├── extract.py (Data extraction)
│ ├── transform.py (Pandas processing)
│ └── load.py (PostgreSQL loader)
├── 🎭 simulator/
│ └── DB_intermediaire_simulator.py
└── ⚡ performance/
└── benchmarks.py
📁 cross-platform-deployment/
├── 🚀 scripts/
│ ├── deploy-remote.sh (Mac → Windows)
│ ├── deploy-windows.ps1 (PowerShell)
│ ├── sync-to-server.sh (rsync/scp)
│ └── manage-remote-apps.sh
├── 📋 docker/
│ ├── docker-compose.yml (cross-platform)
│ ├── Dockerfile.cross-platform
│ └── volumes-config/
├── 📖 docs/
│ ├── mac-to-windows-deployment.md
│ ├── troubleshooting-cross-platform.md
│ └── performance-comparison.md
└── 🧪 tests/
└── cross-platform-validation.py
| Outil | URL | Priorité | Sections clés |
|---|---|---|---|
| FastAPI | fastapi.tiangolo.com | CRITIQUE | Tutorial + Security + Testing |
| Docker | docs.docker.com | CRITIQUE | Get Started + Compose |
| PostgreSQL | postgresql.org/docs | IMPORTANT | Tutorial + Performance |
| Streamlit | docs.streamlit.io | IMPORTANT | API Reference + Gallery |
| SQLAlchemy | docs.sqlalchemy.org | IMPORTANT | ORM Tutorial |
| Sujet | Ressource | Durée | Objectif |
|---|---|---|---|
| FastAPI Security | testdriven.io/blog/fastapi-jwt-auth | 1h | JWT implementation |
| Docker Compose | docker-curriculum.com | 2h | Multi-container apps |
| PostgreSQL Performance | use-the-index-luke.com | 1h | Query optimization |
| Streamlit Advanced | 30days.streamlit.app | 10x30min | Component mastery |
- Docker Compose avec 3+ services communicants
- API FastAPI avec 10+ endpoints + authentification JWT
- Pipeline ETL traitant 100k+ lignes en < 30 secondes
- 3 dashboards Streamlit connectés à API
- Scripts CLI de déploiement automatisé
- Tests automatisés avec couverture > 80%
- Documentation technique complète
- Repository GitHub public avec 3 projets
- README détaillé avec instructions setup
- Démo vidéo 15 minutes de la stack complète
- Architecture diagram de la solution
- Templates adaptables au contexte client
- Patterns de code réutilisables
- Scripts d'installation et configuration
- Documentation d'architecture détaillée
Objectif final : Transformation de l'intervention client de "développement from scratch" vers "adaptation et configuration de solutions existantes"