DWD-Pipeline: Dauer-Container mit 5-Min-Schleife statt DSM-Cron
DSM-Aufgabenplaner kann minimal stuendlich (Rene) — Container laeuft jetzt dauerhaft (restart: unless-stopped) mit interner Schleife (loop.sh, idle = sh+sleep, Python/GDAL nur waehrend des Laufs). Einmal 'up -d --build', ueberlebt Reboots. make_radar_tiles.py ist idempotent, Fehler brechen die Schleife nicht.
This commit is contained in:
parent
e6558b64d3
commit
6565d6a999
3 changed files with 23 additions and 4 deletions
|
|
@ -11,5 +11,9 @@ RUN ARCH=$([ "$TARGETARCH" = "arm64" ] && echo arm64 || echo x86_64) && \
|
|||
rm /tmp/pmtiles.tar.gz && pmtiles version || true
|
||||
|
||||
COPY make_radar_tiles.py /app/make_radar_tiles.py
|
||||
COPY loop.sh /app/loop.sh
|
||||
RUN chmod +x /app/loop.sh
|
||||
WORKDIR /app
|
||||
CMD ["python3", "/app/make_radar_tiles.py"]
|
||||
# Dauerbetrieb mit interner 5-Min-Schleife (DSM-Aufgabenplaner kann nur stündlich).
|
||||
# Einmal-Lauf weiterhin möglich: docker compose run --rm dwd-radar python3 /app/make_radar_tiles.py
|
||||
CMD ["/app/loop.sh"]
|
||||
|
|
|
|||
12
tools/dwd-radar/loop.sh
Normal file
12
tools/dwd-radar/loop.sh
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/sh
|
||||
# Endlos-Schleife statt Cron: Der DSM-Aufgabenplaner kann minimal stündlich (René 2026-06-08),
|
||||
# die RV-Läufe kommen aber alle 5 Minuten. Der Container läuft daher dauerhaft (restart:
|
||||
# unless-stopped) und schläft zwischen den Läufen — idle ist nur die sh+sleep (winzig),
|
||||
# Python/GDAL leben nur während des Laufs. make_radar_tiles.py ist idempotent
|
||||
# (gleicher Lauf vorhanden → sofort fertig), Fehler brechen die Schleife nicht.
|
||||
INTERVAL="${INTERVAL_S:-300}"
|
||||
echo "DWD-Radar-Loop: alle ${INTERVAL}s (INTERVAL_S zum Ändern)"
|
||||
while true; do
|
||||
python3 /app/make_radar_tiles.py || echo "Lauf fehlgeschlagen — nächster Versuch in ${INTERVAL}s"
|
||||
sleep "$INTERVAL"
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue