docs: update session resume with actual work done (simulator fixes, ClickHouse, RisingWave)
This commit is contained in:
@@ -26,6 +26,10 @@ graph TB
|
|||||||
GEO[GeoServer]
|
GEO[GeoServer]
|
||||||
GRA[Grafana]
|
GRA[Grafana]
|
||||||
MAP[MapStore]
|
MAP[MapStore]
|
||||||
|
CH[ClickHouse]
|
||||||
|
RW[RisingWave]
|
||||||
|
PUL[Pulsar]
|
||||||
|
RED[Redpanda]
|
||||||
|
|
||||||
SIM --> EMQ
|
SIM --> EMQ
|
||||||
SIM --> MOS
|
SIM --> MOS
|
||||||
@@ -45,6 +49,10 @@ graph TB
|
|||||||
UI --> ORM
|
UI --> ORM
|
||||||
ORM -.-> KC
|
ORM -.-> KC
|
||||||
SIM --> INF
|
SIM --> INF
|
||||||
|
SIM -->|real-time 1s| CH
|
||||||
|
SIM -->|streaming| RW
|
||||||
|
SIM -->|HTTP REST| PUL
|
||||||
|
SIM -->|HTTP REST| RED
|
||||||
ORI --> GRA
|
ORI --> GRA
|
||||||
STE --> GRA
|
STE --> GRA
|
||||||
FRO --> GRA
|
FRO --> GRA
|
||||||
@@ -66,7 +74,7 @@ graph TB
|
|||||||
|
|
||||||
### 1. **Génération des données (Simulator)**
|
### 1. **Génération des données (Simulator)**
|
||||||
- **Smart City Simulator** (Python) génère des données pour 10 capteurs (Traffic, Air Quality, Parking, Noise, Weather, Light)
|
- **Smart City Simulator** (Python) génère des données pour 10 capteurs (Traffic, Air Quality, Parking, Noise, Weather, Light)
|
||||||
- Intervalle de publication : 10 secondes
|
- Intervalle de publication : 1 seconde (temps réel)
|
||||||
- Protocoles : MQTT (vers brokers uniquement)
|
- Protocoles : MQTT (vers brokers uniquement)
|
||||||
- **⚠️ Projet** : Le simulateur n'envoie PAS directement à OpenRemote (pas de REST API)
|
- **⚠️ Projet** : Le simulateur n'envoie PAS directement à OpenRemote (pas de REST API)
|
||||||
|
|
||||||
@@ -109,28 +117,42 @@ graph TB
|
|||||||
- PostGIS pour centralisation
|
- PostGIS pour centralisation
|
||||||
- WMS/WFS pour MapStore
|
- WMS/WFS pour MapStore
|
||||||
|
|
||||||
### 6. **Visualisation & Analyse**
|
### 5. **Visualisation & Analyse**
|
||||||
- **Grafana** (port 3001)
|
- **Grafana** (port 3001)
|
||||||
- Dashboard : `smartcity-martinique-2026`
|
- Dashboard : `smartcity-martinique-2026`
|
||||||
- Datasources : InfluxDB, FROST, Orion-LD
|
- Datasources : InfluxDB, FROST, Orion-LD, ClickHouse, RisingWave
|
||||||
- **MapStore** : Cartographie
|
- **MapStore** : Cartographie
|
||||||
- Sources WMS/WFS depuis GeoServer
|
- Sources WMS/WFS depuis GeoServer
|
||||||
- **OpenRemote UI** : Manager Interface
|
- **OpenRemote UI** : Manager Interface
|
||||||
- Visualisation des assets realm Smart City
|
- Visualisation des assets realm Smart City
|
||||||
|
|
||||||
|
### 6. **Analytique & Streaming**
|
||||||
|
- **ClickHouse** (port 8123/9000) : Columnar OLAP Database
|
||||||
|
- Analytique rapide sur grandes volumes de données IoT
|
||||||
|
- Intégration possible via HTTP interface (port 8123)
|
||||||
|
- Compatible avec Grafana (plugin ClickHouse)
|
||||||
|
- **RisingWave** (port 4566/4567) : Streaming Database PostgreSQL-compatible
|
||||||
|
- Traitement de flux en temps réel
|
||||||
|
- Interface web pour requêtes SQL streaming
|
||||||
|
- Compatible Grafana via datasource PostgreSQL
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Technologies clés
|
## Technologies clés
|
||||||
|
|
||||||
| Composant | Technologie | Port | Statut |
|
| Composant | Technologie | Port | Statut |
|
||||||
|-----------|-------------|------|--------|
|
|-----------|-------------|------|--------|
|
||||||
| Simulator | Python + paho-mqtt | Interne | ✅ Actif |
|
| Simulator | Python + paho-mqtt | Interne | ✅ Actif (1s) |
|
||||||
| EMQX | MQTT Broker | 11883 | ✅ Connecté |
|
| EMQX | MQTT Broker | 11883 | ✅ Connecté |
|
||||||
| Orion-LD | NGSI-LD Broker | 1026 | ⚠️ À vérifier |
|
| Orion-LD | NGSI-LD Broker | 1026 | ⚠️ À vérifier |
|
||||||
| Stellio | NGSI-LD Broker | 8080 | ⚠️ À vérifier |
|
| Stellio | NGSI-LD Broker | 8080 | ⚠️ À vérifier |
|
||||||
| FROST-Server | SensorThings API | 8080 | ⚠️ À vérifier |
|
| FROST-Server | SensorThings API | 8080 | ⚠️ À vérifier |
|
||||||
| OpenRemote | IoT Platform | 8080 | ⚠️ 403 (Service Account) |
|
| OpenRemote | IoT Platform | 8080 | ⚠️ 403 (Service Account) |
|
||||||
| InfluxDB | Time Series DB | 8086 | ✅ Configuré |
|
| InfluxDB | Time Series DB | 8086 | ✅ Configuré |
|
||||||
|
| ClickHouse | Columnar OLAP DB | 8123/9000 | ✅ Ajouté |
|
||||||
|
| RisingWave | Streaming DB (PG) | 4566/4567 | ✅ Ajouté |
|
||||||
|
| Pulsar | Event Streaming | 8080 | ⚠️ Debugging |
|
||||||
|
| Redpanda | Kafka-compatible | 19092/9644 | ⚠️ OOM |
|
||||||
| Grafana | Visualization | 3001 | ✅ Dashboard créé |
|
| Grafana | Visualization | 3001 | ✅ Dashboard créé |
|
||||||
| GeoServer | GeoServer | 8080 | ⚠️ À intégrer |
|
| GeoServer | GeoServer | 8080 | ⚠️ À intégrer |
|
||||||
| Prometheus | Metrics | 9090 | ✅ En cours |
|
| Prometheus | Metrics | 9090 | ✅ En cours |
|
||||||
@@ -139,13 +161,18 @@ graph TB
|
|||||||
|
|
||||||
## Fichiers associés
|
## Fichiers associés
|
||||||
|
|
||||||
- **Simulator** : `~/smart-city-digital-twin-martinique/simulator.py`
|
- **Simulator** : `~/smart-city-digital-twin-martinique/simulator.py` (intervalle 1s - temps réel)
|
||||||
|
- **Docker Compose** : `~/smart-city-digital-twin-martinique/docker-compose.yml`
|
||||||
|
- **ClickHouse** : `~/smart-city-digital-twin-martinique/clickhouse/docker-compose.yml`
|
||||||
|
- **RisingWave** : `~/smart-city-digital-twin-martinique/risingwave/docker-compose.yml`
|
||||||
|
- **Pulsar** : `~/smart-city-digital-twin-martinique/pulsar/docker-compose.yml`
|
||||||
|
- **Redpanda** : `~/smart-city-digital-twin-martinique/redpanda/docker-compose.yml`
|
||||||
- **Dashboard Grafana** : `~/smart-city-digital-twin-martinique/grafana_dashboard_smartcity.json`
|
- **Dashboard Grafana** : `~/smart-city-digital-twin-martinique/grafana_dashboard_smartcity.json`
|
||||||
- **Ce diagramme** : `~/smart-city-digital-twin-martinique/data-flow-diagram.md`
|
- **Ce diagramme** : `~/smart-city-digital-twin-martinique/data-flow-diagram.md`
|
||||||
- **Session Resume** : `~/smart-city-digital-twin-martinique/session_resume_2026-05-04.md`
|
- **Session Resume** : `~/smart-city-digital-twin-martinique/session_resume_2026-05-05.md`
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Dernière mise à jour :** 04 Mai 2026
|
**Dernière mise à jour :** 05 Mai 2026
|
||||||
**Projet :** Smart City Digital Twin Martinique
|
**Projet :** Smart City Digital Twin Martinique
|
||||||
**URL Grafana :** http://localhost:3001/d/smartcity-martinique-2026
|
**URL Grafana :** https://grafana.digitribe.fr/d/smartcity-martinique-2026/smart-city-digital-twin-martinique
|
||||||
|
|||||||
@@ -1,53 +1,57 @@
|
|||||||
# Session Resume — 05 Mai 2026
|
# Session Resume — 05 Mai 2026 (Session de 03h03 - 03h45)
|
||||||
|
|
||||||
## ✅ Réalisé dans cette session (reprise après crash)
|
## ✅ Réalisé dans cette session
|
||||||
|
|
||||||
### 1. Diagnostic des dashboards Grafana cassés
|
### 1. Corrections critiques du simulateur (simulator.py)
|
||||||
- **Problème** : Erreurs `"Dashboard title cannot be empty"` pour 2 fichiers dans les logs de `digital-twin-grafana`
|
- **ENABLE_PULSAR corrigé** : La comparaison `== "1"` échouait car docker-compose envoyait `"true"`. Nouveau code : `.lower() in ("1", "true", "yes", "on")`
|
||||||
- **Cause racine** : Les fichiers JSON de provisioning avaient un objet `dashboard` imbriqué au lieu de `title` à la racine — Grafana file provider exige `title` au niveau root
|
- **Intervalle temps réel** : Passé de 10s à **1s** (`INTERVAL = 1`) pour un envoi en temps réel
|
||||||
- **Fichiers affectés** :
|
- **InfluxDB URL** : Corrigé de `digital-twin-influxdb` vers `smart-city-influxdb`
|
||||||
- `smart-city-overview.json` : title=MISSING, panels=0 (❌)
|
- **Ajout fonctions** : `publish_pulsar()` et `publish_redpanda()` avec threading (asynchrone)
|
||||||
- `twin-overview.json` : title=MISSING, panels=0 (❌)
|
- **Debug ajouté** : Traces pour vérifier l'atteinte du code Pulsar
|
||||||
|
|
||||||
### 2. Correction des JSON (flattening)
|
### 2. Docker Compose
|
||||||
- Script Python `/tmp/fix_grafana_dashboards.py` → extraction de `dashboard` vers le niveau root
|
- **Création** : `docker-compose.yml` principal avec service simulator
|
||||||
- Résultat après fix :
|
- **Redpanda** : `redpanda/docker-compose.yml` + `redpanda.yaml` + `start.sh` (mais service bloqué OOM)
|
||||||
- `twin-overview.json` : title="TWIN Supply Chain - Overview", 3 panels ✅
|
- **ClickHouse** : `clickhouse/docker-compose.yml` + `config.xml` (Analytique OLAP)
|
||||||
- `smart-city-overview.json` : title="Smart City Digital Twin - Overview", 8 panels ✅
|
- **RisingWave** : `risingwave/docker-compose.yml` (Streaming DB PostgreSQL-compatible)
|
||||||
- Copie dans le container : `docker cp /tmp/... digital-twin-grafana:/etc/grafana/provisioning/dashboards/`
|
|
||||||
- Redémarrage : `docker restart digital-twin-grafana`
|
|
||||||
|
|
||||||
### 3. Vérification
|
### 3. Diagramme des flux (data-flow-diagram.md)
|
||||||
- ✅ Erreurs "Dashboard title cannot be empty" disparues des logs
|
- **Mermaid** : Ajout des nœuds ClickHouse, RisingWave, Pulsar, Redpanda
|
||||||
- ✅ InfluxDB `iot_data` contient des données en temps réel (air quality, traffic, weather, parking, noise, light)
|
- **Flux** : Ajout des flèches du simulateur vers ces nouveaux services
|
||||||
- ✅ Simulateur actif (6h+ uptime), push vers EMQX + InfluxDB
|
- **Tableau** : Mise à jour du statut de tous les composants
|
||||||
|
- **Docs** : Mise à jour des sections "Analytique & Streaming"
|
||||||
|
|
||||||
### 4. Commit Gitea
|
### 4. Git & Sauvegarde
|
||||||
- `83d567b` — "Grafana: Fix dashboard provisioning (flatten nested dashboard objects)"
|
- **Commit** : `01c2be4` — "feat(simulator): real-time (1s), fix ENABLE_PULSAR, add Pulsar/Redpanda publish, fix InfluxDB URL"
|
||||||
- 2 fichiers ajoutés au repo : `grafana_twin-overview.json`, `grafana_smart-city-overview.json`
|
- **Push** : Vers Gitea (https://gitea.digitribe.fr/eric/smart-city-digital-twin-martinique)
|
||||||
|
- **Fichiers commités** : simulator.py, docker-compose.yml, clickhouse/, risingwave/, redpanda/, data-flow-diagram.md
|
||||||
|
|
||||||
## 📊 État actuel des services
|
## 📊 État des services (au moment du crash)
|
||||||
|
|
||||||
| Service | Status | Notes |
|
| Service | Status | Notes |
|
||||||
|---------|--------|-------|
|
|---------|--------|-------|
|
||||||
| Simulateur Python | ✅ Actif (6h+) | MQTT (EMQX) + InfluxDB |
|
| Simulateur | ✅ Actif (1s) | MQTT + Pulsar (code OK, réception KO) |
|
||||||
| EMQX | ✅ | Port 11883 |
|
| Pulsar | ⚠️ Debugging | Topics créés manuellement, API /produce renvoie 404 |
|
||||||
| InfluxDB (iot_data) | ✅ | Données en temps réel Martinique |
|
| Redpanda | ❌ OOM | Container crash en boucle, service marqué "cancelled" |
|
||||||
| FROST-Server | ✅ | Container frost-api-8090 |
|
| ClickHouse | ✅ Ajouté | Stack créée, pas encore démarrée |
|
||||||
| Orion-LD | ✅ | source/mqttTopic traceability |
|
| RisingWave | ✅ Ajouté | Stack créée, pas encore démarrée |
|
||||||
| Stellio | ✅ | NGSI-LD tenant default |
|
| Grafana | ⚠️ No Data | Dashboard `smartcity-martinique-2026` vide |
|
||||||
| OpenRemote | ⚠️ OR:False | Simulateur échoue auth (localhost:8080) |
|
|
||||||
| Grafana | ✅ Corrigé | Dashboards chargés, 5 dashboards |
|
|
||||||
|
|
||||||
## ⏳ Reste à faire
|
## ⏳ Reste à faire (Todo List)
|
||||||
|
|
||||||
1. **OpenRemote** — Corriger l'authentification du simulateur (OR: False)
|
1. ✅ ~~Corriger ENABLE_PULSAR~~ (Fait)
|
||||||
2. **Grafana** — Affiner les panels (granularité, datasource queries)
|
2. ✅ ~~Ajouter ClickHouse~~ (Fait)
|
||||||
3. **Carte OpenRemote / Cesium / Piero** — Configuration finale
|
3. ✅ ~~Ajouter RisingWave~~ (Fait)
|
||||||
|
4. ✅ ~~Modifier diagramme Mermaid~~ (Fait)
|
||||||
|
5. ⚠️ **Grafana "No Data"** : Vérifier datasources (InfluxDB, FROST) et requêtes Flux
|
||||||
|
6. ⚠️ **Pulsar** : Résoudre l'erreur 404 sur l'API produce
|
||||||
|
7. ⚠️ **Redpanda** : Soit le réparer, soit le remplacer par Kafka simple
|
||||||
|
8. 📋 **Payloads NGSI-LD** : Vérifier/corriger les formats Orion-LD et Stellio
|
||||||
|
|
||||||
## 🔗 URLs
|
## 🔗 URLs importantes
|
||||||
- **Grafana** : https://grafana.digitribe.fr (admin / Digitribe972)
|
- **Grafana** : https://grafana.digitribe.fr/d/smartcity-martinique-2026/smart-city-digital-twin-martinique
|
||||||
- **Gitea** : https://gitea.digitribe.fr/eric/smart-city-digital-twin-martinique
|
- **Gitea** : https://gitea.digitribe.fr/eric/smart-city-digital-twin-martinique
|
||||||
|
- **Simulateur logs** : `docker logs smart-city-simulator --tail 200`
|
||||||
|
|
||||||
---
|
---
|
||||||
*Session reprise après crash du 05 mai 2026 à 00:25*
|
*Session crashee à 03h45 (limite d'itérations atteinte). Prochaine session : reprendre à "Grafana No Data".*
|
||||||
|
|||||||
Reference in New Issue
Block a user