diff --git a/deploy/telemetry-plane/README.md b/deploy/telemetry-plane/README.md index 1beada1..00b72b9 100644 --- a/deploy/telemetry-plane/README.md +++ b/deploy/telemetry-plane/README.md @@ -20,10 +20,23 @@ The normalizer exposes a read-only normalized telemetry adapter on Timescale credentials, and Timescale is not published on a host port. The normalizer uses a separate `missioncore_normalizer` database role with only `SELECT`, `INSERT`, `UPDATE`, and bounded retention `DELETE` on the telemetry -hypertable. Raw telemetry older than 30 days is removed at most once per day by the -normalizer. This stays compatible with the Apache-licensed Timescale image without +hypertable. Raw telemetry older than 30 days is removed in batches of at most +1000 rows per minute, on a separate connection/thread (2s statement / 250ms lock +deadline). Retention never runs inside the MQTT callback. This stays compatible +with the Apache-licensed Timescale image without depending on the Timescale License retention scheduler. +The 1 GiB database container explicitly sets 128 MiB shared buffers and 64 MiB +maintenance memory. The HA image's automatic tuning sees the Docker VM instead +of this container limit; do not inherit its multi-GiB defaults. + +For a memory-constrained local repair, `compose.source.yaml` mounts the reviewed +normalizer source read-only into the **existing** image. Set +`MISSIONCORE_NORMALIZER_SOURCE` to the absolute `normalizer.py` path, pass both +Compose files and the existing private `--env-file` / `--project-directory`, and +use `up -d --no-deps --no-build normalizer`. This is an explicit local source +override, not a rebuilt portable image. Normal restart/reboot retains the mount. + The stack is one deployment contour, not one multi-process container. Keeping broker, normalizer and database in separate containers preserves independent health checks, least-privilege boundaries and rollback while Compose provides one operator lifecycle: @@ -136,6 +149,24 @@ globally unique because Mosquitto ACL ownership is username-based. ## Worker agent +MQTT outputs use `startup_error_behavior="retry"`, with a 2000-metric buffer and +the configured flush interval. A missing broker at agent startup must not end +the service. See [Telegraf's startup policy](https://docs.influxdata.com/telegraf/v1/configuration/plugin-options/). +If Docker lost a published listener while the saved LAN address is unchanged, +the explicit broker Apply action reconciles that listener; a telemetry GET never +restarts infrastructure. Node connectivity does not prove a profile is ready. + +The streaming profile can export one bounded (8 KiB) current observation using +`--telemetry-snapshot /telemetry/current.json`, with `/telemetry` mounted to +`C:\ProgramData\NDC\MissionCore\telemetry-agent\perception` on Worker. The existing +collector reads it with a 5s freshness limit and forwards it over the same MQTT +pipeline topic. It overrides the legacy service only when explicitly present; +an expired/broken file reports unavailable rather than relabeling a legacy model. +The publisher runs independently from heartbeat/inference and never renews a +lease, grants GPU ownership, or qualifies real-time. Queue memory includes active +input and decoder scratch. Stage timings are unavailable until actually measured. +No camera, point cloud, model result, MQTT secret, or motor command goes here. + Worker 006 uses the official Windows Telegraf distribution as the host service `NDC Mission Core Telemetry Agent`. Install or update it with: diff --git a/docs/OBSERVATORY_REALTIME_PROFILES_EXECPLAN.md b/docs/OBSERVATORY_REALTIME_PROFILES_EXECPLAN.md index 1893fc7..ed26c20 100644 --- a/docs/OBSERVATORY_REALTIME_PROFILES_EXECPLAN.md +++ b/docs/OBSERVATORY_REALTIME_PROFILES_EXECPLAN.md @@ -1,8 +1,10 @@ # Observatory: четыре этапа создания полного real-time Perception-профиля -Дата: 2026-09-01; обновлено 2026-09-02 16:52 МСК. **Этап 1 закрыт; этап 2 в работе. Десятый инкремент: реальные host GPU/Docker observations подключены к полному профилю.** Одноразовые запросы, separate read-only reply mount, локальное время запроса вместо времени прибытия ответа. Docker inventory scope задан явно; native host/WSL process coverage не доказан. Задержка ответа на2.2s вызвала WAIT/resync без перезапуска четырёх resident-процессов. Далее внешний data-plane/auth/recovery и standalone packaging; этапы3–4 не начаты. +Дата: 2026-09-01; обновлено 2026-09-02 17:37 МСК. **Этап 1 закрыт; этап 2 в работе. Инкремент 11: восстановлен существующий System/Worker telemetry plane и добавлен независимый экспорт состояния streaming runtime.** Код `c570f7d`, `2ef8c08`. Исправлены остановка Telegraf при недоступном MQTT, потерянная публикация порта, превышающие лимит контейнера настройки PostgreSQL и блокирующая ingest очистка истории. CPU-only переходы running → waiting → synchronizing → running прошли через реальный агент/Timescale. Это observability, не новый внешний sensor data-plane; следующий пункт остаётся binary stream/auth/recovery между приложением и Worker, затем standalone packaging. Этапы3–4 не начаты. -Последний код `61cbdb3`; 404 focused tests PASS, Ruff/format/mypy PASS. Normal exact raw128/128, 50 real observations, p95/p99 91.157/97.946ms. При задержке host reply:102 обработанных +26 учтённых пропусков, resume seq50, прежние PID/lease сохранены; p95/p99 принятых кадров88.643/91.236ms. Между последней старой и первой свежей scene2.719s — отдельная метрика доступности. Оба измерения условны для временных штатных clocks2610/10251MHz, не доказывают overhead regression или общий real-time. Auto clocks/services восстановлены, временные collector/container/lease отсутствуют. Исходные sensor gaps, auto-clock FAIL, непроверенные native-host inventory, network и standalone остаются. +104 Python tests, 703 frontend tests, typecheck и production build PASS. Полный frontend проверен последовательно на CPU Worker из-за Mac memory pressure=2; собранный UI установлен на canonical8000. Визуальная приёмка по `mission-core-product-ui` отложена до освобождения памяти, не объявлена пройденной. Расширен существующий Worker, без новых страниц и без product profile/registry cutover. MQTT outage/startup проверен с сохранением PID9268; CPU canary сохранил lease generation1 и освободил его после завершения. Evidence `.runtime/worker-telemetry-20260902T1422Z/manifest.json`, SHA-256 `825b1d8035dbf907b2b731d35ede4c5742b81e653a6f24670f4775981f853492`. + +Предыдущий модельный замер `61cbdb3`: 404 focused tests PASS, Ruff/format/mypy PASS. Normal exact raw128/128, 50 real observations, p95/p99 91.157/97.946ms. При задержке host reply:102 обработанных +26 учтённых пропусков, resume seq50, прежние PID/lease сохранены; p95/p99 принятых кадров88.643/91.236ms. Между последней старой и первой свежей scene2.719s — отдельная метрика доступности. Оба измерения условны для временных штатных clocks2610/10251MHz, не доказывают overhead regression или общий real-time. В инкременте11 модели не запускались; overhead нового observability exporter пока не измерен на полном графе. Исходные sensor gaps, auto-clock FAIL, непроверенные native-host inventory, network и standalone остаются. Текущий evidence: [отчёт этапа 1](../experiments/perception/PERCEPTION_STREAM_STAGE1_2026-09-01.md), [ADR 0049](adr/0049-stream-first-perception-profiles.md), [candidate manifest](../config/perception/k1-perception-ddrnet39-rfdetr-tgs-prototype-v1.json). Запрет full-source preload закреплён в новом контракте; старый batch materializer пока не удалён и продуктовый путь не переключён. diff --git a/docs/adr/0049-stream-first-perception-profiles.md b/docs/adr/0049-stream-first-perception-profiles.md index 4005177..236b340 100644 --- a/docs/adr/0049-stream-first-perception-profiles.md +++ b/docs/adr/0049-stream-first-perception-profiles.md @@ -704,6 +704,18 @@ the end-to-end interval. ## Evidence and remaining stage-1 work +### Operator telemetry is not runtime authority (2026-09-02) + +Reuse System/Worker and the existing Telegraf → MQTT → Timescale route for +operator observability. A profile may export one bounded 8 KiB current snapshot +at 1 Hz to the host collector, independently from controller heartbeat/model +work. Missing or stale observations are unavailable, never fabricated idle, +loaded-model readiness, per-stage timing or real-time qualification. Agent +restart/reconnection and database retention must not block inference. The faster +Worker-local readiness/inventory channel remains separate; MQTT/Timescale/UI +cannot renew a lease or authorize GPU/vehicle activity. This observability +integration does not constitute the external camera/points binary data plane. + See `experiments/perception/PERCEPTION_STREAM_STAGE1_2026-09-01.md` for measured component results, bounded validation, Worker maintenance and remaining gates. Neither this ADR nor passing synthetic contract tests marks the new runtime ready. diff --git a/experiments/perception/PERCEPTION_STREAM_STAGE1_2026-09-01.md b/experiments/perception/PERCEPTION_STREAM_STAGE1_2026-09-01.md index aa5b344..ec7a1c6 100644 --- a/experiments/perception/PERCEPTION_STREAM_STAGE1_2026-09-01.md +++ b/experiments/perception/PERCEPTION_STREAM_STAGE1_2026-09-01.md @@ -2256,3 +2256,50 @@ manifest/analysis/проверки скопированы на Worker. На Mac packaging. Host filesystem channel не выдаётся за внешний сетевой transport. Native-host inventory, quality, physical-live и vehicle control остаются отдельными непройденными границами; registry/UI не переключены, этапы3–4 не начаты. + +## Этап2, инкремент11: existing Worker observability — 2026-09-02 17:37 МСК + +Код `c570f7d` / `2ef8c08`. По запросу владельца восстановлен существующий +System/Worker, не создана отдельная страница. Telegraf завершался при MQTT startup +failure; у брокера исчез host binding. После восстановления доставки выявлен +Timescale OOM: shared_buffers3490MB/maintenance1745MB внутри1024MiB container, +а retention DELETE выполнялся в MQTT callback. Исправлены memory settings, +ретенция1000rows/60s в отдельном thread с2s deadline и MQTT startup retry. +Тот же volume/credentials сохранены; broker остаётся на прежнем частном LAN bind. +На Mac использован явный read-only normalizer source override, не Docker build. + +`RuntimeTelemetryPublisher`: один файл≤8KiB,1Hz, отдельный daemon вне heartbeat, +snapshot state/profile/input phase/pauses/processes/буферы. Существующий Telegraf +collector читает его с5s TTL; metrics идут через прежний pipeline topic. Экспорт +не предоставляет lease/GPU authority и не переносит camera/cloud/results/secrets. +Настоящие stage timings не заменены числами из lifecycle heartbeat. +UI показывает частоты SM/VRAM, waiting/resync, не утверждает ready/idle при +unavailable; HTTP timeout/error очищает старый snapshot, polling продолжается. + +104 Python tests, Ruff/mypy PASS. Frontend: architecture4, typecheck,703unit, +production build PASS последовательно на Worker Windows/Node24.13.1 CPU. +Fixture дополнен пропущенным plugin.manifest.json; Vite warning больше не +интерпретируется PowerShell wrapper как build error. Canonical8000 обслуживает +новый dist, предыдущий сохранён. Browser QA по `mission-core-product-ui` отложен: +Mac memory pressure2 и swap≈7.1GiB. Визуальный PASS не заявлен. + +CPU-only canary36s: running→waiting→synchronizing→running, сохранённые Timescale +samples всех состояний; API trace видит синхронизацию и восстановленный running. +Lease generation1,360 renewals,input epoch generation1,0export errors,clean stop. +Не было GPU/model children или sensor network stream. Отдельный reconnect: +Telegraf перезапущен без MQTT, через18s остаётся Running, после возврата брокера +сохранил PID9268 и возобновил ingest. Первый checker упал на временном health503, +finally восстановил broker; исправленный повтор PASS, ошибка проверки не скрыта. + +Источник/exporter, установленный Telegraf config, frontend adapter и dist hashes +Worker↔Mac совпали. Evidence14 files: +`.runtime/worker-telemetry-20260902T1422Z/manifest.json`, SHA-256 +`825b1d8035dbf907b2b731d35ede4c5742b81e653a6f24670f4775981f853492`. +CPU container/isolated lease удалены, canary snapshot перенесён в evidence; +Telegraf/telemetry plane healthy. Frigate/Ollama exited/restart=no. Final GPU: +977MiB,0%,auto210/405MHz,450W. Legacy perception404/restart loops не объявлены +исправленными. Новый full-model latency/overhead benchmark не выполнялся. + +Этап2 остаётся открыт: после визуального acceptance продолжить внешний bounded +binary data-plane/auth/recovery, затем standalone image. Этапы3–4 не начаты; +расширение System/Worker не означает интеграцию нового профиля в Observatory.