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:
+19
-1
@@ -3,7 +3,7 @@ services:
|
||||
build: .
|
||||
image: kuh-no-bowls:latest
|
||||
container_name: kuh-no-bowls-scraper
|
||||
restart: unless-stopped
|
||||
profiles: ["oneshot"]
|
||||
env_file: .env
|
||||
environment:
|
||||
LOG_PATH: /var/log/kuh-no-bowls/kuh-no-bowls.log
|
||||
@@ -13,6 +13,24 @@ services:
|
||||
networks:
|
||||
- services_net
|
||||
|
||||
# Hourly Open-Meteo weather -> knoebels."LZ_open_meteo_hourly".
|
||||
# Oneshot, run from cron. Default mode does the recent sync; pass --backfill
|
||||
# once to load history: docker compose --profile oneshot run --rm weather --backfill
|
||||
weather:
|
||||
build: .
|
||||
image: kuh-no-bowls:latest
|
||||
container_name: kuh-no-bowls-weather
|
||||
profiles: ["oneshot"]
|
||||
entrypoint: ["python", "-u", "weather_logger.py"]
|
||||
env_file: .env
|
||||
environment:
|
||||
LOG_PATH: /var/log/kuh-no-bowls/weather.log
|
||||
TZ: America/New_York
|
||||
volumes:
|
||||
- knb_logs:/var/log/kuh-no-bowls
|
||||
networks:
|
||||
- services_net
|
||||
|
||||
dashboard:
|
||||
build: .
|
||||
image: kuh-no-bowls:latest
|
||||
|
||||
Reference in New Issue
Block a user