Add Open-Meteo hourly weather pipeline + queue/weather view

Backfills knoebels."LZ_open_meteo_hourly" from 2024-05-15 (start of queue
collection) and keeps it current. Imperial units; timestamps stored as naive
America/New_York to line up with the rest of the knoebels schema.

- weather_logger.py: --backfill uses the ERA5 Archive API; default mode does a
  self-healing recent sync via the Forecast API (past_days=7, upsert on conflict)
- docker-compose.yml: add `weather` oneshot service (also align scraper to its
  live `oneshot` profile)
- systemd/knb-weather.{service,timer}: nox user timer, every 6h (linger enabled)
- queries/dm_knb_queue_weather.sql: dm_knb_queue_weather view joining the full
  queue-time series to hourly weather (hour-bucketed), with a WMO code decode

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
wes
2026-06-01 10:38:01 -04:00
co-authored by Claude Opus 4.8
parent f7e0042ef8
commit 5c09528df7
5 changed files with 299 additions and 1 deletions
+14
View File
@@ -0,0 +1,14 @@
[Unit]
Description=Knoebels Open-Meteo hourly weather sync (one-shot)
After=docker.service network-online.target
Wants=network-online.target
[Service]
Type=oneshot
WorkingDirectory=/home/nox/docker/kuh-no-bowls
# `compose run` activates the service regardless of its compose profile.
# Default (no args) = recent sync (Forecast API, past_days=7, self-healing).
# One-time history load was done manually with: ... run --rm weather --backfill
ExecStart=/usr/bin/docker compose run --rm weather
StandardOutput=append:/home/nox/docker/kuh-no-bowls/cron-logs/weather-cron.log
StandardError=append:/home/nox/docker/kuh-no-bowls/cron-logs/weather-cron.log
+12
View File
@@ -0,0 +1,12 @@
[Unit]
Description=Run the Knoebels weather sync every 6 hours
[Timer]
# Every 6 hours (00/06/12/18 ET). past_days=7 means each run refreshes the
# last week, so a missed run self-heals and provisional values get refined.
OnCalendar=*-*-* 00/6:00:00
Persistent=true
RandomizedDelaySec=300
[Install]
WantedBy=timers.target