mirror of
https://github.com/zvx-echo6/central.git
synced 2026-08-26 09:21:36 +00:00
Central - data hub spine. Adapters -> NATS/JetStream -> archive.
- Python 88.6%
- HTML 9.4%
- CSS 1.2%
- Shell 0.6%
- PLpgSQL 0.2%
central-migrate invocations were run via bare `cen "$VENV/bin/central-migrate"`, which does not set the working directory or source the EnvironmentFile that the systemd unit provides. This caused the pre-flight --check to fail during the v0.14.6 deploy with `PermissionError: [Errno 13] Permission error: '.env'` because central-migrate tried to read .env from the caller's cwd instead of /opt/central, and the DB DSN was missing. The daemons themselves are unaffected — they always get WorkingDirectory= /opt/central and EnvironmentFile=/etc/central/central.env from systemd. The deploy script is the only place that invoked central-migrate outside that context. Fix: add ENV_FILE=/etc/central/central.env to the config block and a cen_migrate() helper that wraps every central-migrate call with: sudo -u central bash -c "cd /opt/central && set -a && . /etc/central/central.env && set +a && /opt/central/.venv/bin/central-migrate <args>" Replace all four bare invocations (--check preflight, --dry-run, apply, --check post-deploy) with cen_migrate. Exit-code propagation is unchanged — bash -c forwards the inner exit status, so set -e / the ERR trap still fires on non-zero exits. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| docs | ||
| etc-templates | ||
| scripts | ||
| sql | ||
| src/central | ||
| systemd | ||
| tests | ||
| .gitattributes | ||
| .gitignore | ||
| .python-version | ||
| CHANGELOG.md | ||
| LICENSE | ||
| pyproject.toml | ||
| README.md | ||
| uv.lock | ||
Central
Central is the data hub spine for the Echo6 infrastructure. Adapters normalize upstream sources into a canonical event shape, publish CloudEvents to NATS/JetStream, and archive to TimescaleDB for historical query. Single-LXC deployment.
Status
Operational (v0.14.6) — deployed on utility CT 104 (central.echo6.mesh).
~22 adapters live across traffic, wildfire, weather, space-weather, hydrology, earthquakes, avalanche, disasters, and satellite. CloudEvents published to NATS/JetStream, archived to TimescaleDB/PostGIS. FastAPI + HTMX GUI/API on :8000.
Three systemd units on a single LXC:
central-supervisor— adapter lifecycle managercentral-archive— NATS consumer persisting events to TimescaleDBcentral-gui— FastAPI + HTMX web interface / API (:8000)
Architecture
- Python 3.12 (uv-managed)
- NATS + JetStream for live event bus
- TimescaleDB + PostGIS for archive and geospatial query
- One supervisor process managing adapter lifecycle
- One archive consumer process persisting events to TimescaleDB
- Both processes systemd-managed
Testing
See docs/test-database.md for test database setup.
License
MIT. See LICENSE.