diff --git a/deploy/systemd/astrape-oracle.service b/deploy/systemd/astrape-oracle.service new file mode 100644 index 0000000..7faf4d0 --- /dev/null +++ b/deploy/systemd/astrape-oracle.service @@ -0,0 +1,19 @@ +[Unit] +Description=Astrape Energy Oracle Forecast Snapshots +After=network-online.target +Wants=network-online.target + +[Service] +Type=simple +User=gibil +Group=gibil +WorkingDirectory=/srv/astrape +Environment=PYTHONUNBUFFERED=1 +Environment=PYTHONDONTWRITEBYTECODE=1 +Environment=ASTRAPE_ORACLE_POLL_SECONDS=300 +ExecStart=/srv/astrape/.venv/bin/python -m astrape_oracle.scripts.daemons.oracle_daemon +Restart=always +RestartSec=10 + +[Install] +WantedBy=multi-user.target diff --git a/deploy/systemd/astrape-usage-tcn-training.service b/deploy/systemd/astrape-usage-tcn-training.service new file mode 100644 index 0000000..199a50a --- /dev/null +++ b/deploy/systemd/astrape-usage-tcn-training.service @@ -0,0 +1,22 @@ +[Unit] +Description=Astrape Usage TCN Adaptive Training +After=network-online.target +Wants=network-online.target + +[Service] +Type=oneshot +User=gibil +Group=gibil +WorkingDirectory=/srv/astrape +Environment=PYTHONUNBUFFERED=1 +Environment=PYTHONDONTWRITEBYTECODE=1 +# This host is a Xeon E5-2650 v2: no AVX2, no FMA. Torch dispatches kernels it +# cannot execute and dies with SIGILL inside Adam, so force the scalar path. +# The real fix is external_tcn on a GPU host; this keeps the local run alive +# until the scheduler is pointed at it. +Environment=ATEN_CPU_CAPABILITY=default +# Training competes with a 5-second Modbus poll on 8 cores. Leave headroom. +Environment=OMP_NUM_THREADS=4 +Environment=MKL_NUM_THREADS=4 +Nice=10 +ExecStart=/srv/astrape/.venv/bin/python -m astrape_oracle.scripts.tcn.schedule diff --git a/deploy/systemd/astrape-usage-tcn-training.timer b/deploy/systemd/astrape-usage-tcn-training.timer new file mode 100644 index 0000000..9babec2 --- /dev/null +++ b/deploy/systemd/astrape-usage-tcn-training.timer @@ -0,0 +1,11 @@ +[Unit] +Description=Run Astrape Usage TCN Adaptive Training Nightly + +[Timer] +OnCalendar=*-*-* 03:20:00 +Persistent=true +RandomizedDelaySec=20m +Unit=astrape-usage-tcn-training.service + +[Install] +WantedBy=timers.target diff --git a/deploy/systemd/astrape-weather-forecast.service b/deploy/systemd/astrape-weather-forecast.service new file mode 100644 index 0000000..7ca5576 --- /dev/null +++ b/deploy/systemd/astrape-weather-forecast.service @@ -0,0 +1,19 @@ +[Unit] +Description=Astrape Weather Forecast Ingest +After=network-online.target +Wants=network-online.target + +[Service] +Type=simple +User=gibil +Group=gibil +WorkingDirectory=/srv/astrape +Environment=PYTHONUNBUFFERED=1 +Environment=PYTHONDONTWRITEBYTECODE=1 + +ExecStart=/srv/astrape/.venv/bin/python -m astrape_oracle.scripts.daemons.weather_forecast_daemon +Restart=always +RestartSec=10 + +[Install] +WantedBy=multi-user.target diff --git a/deploy/systemd/astrape-weather-station.service b/deploy/systemd/astrape-weather-station.service new file mode 100644 index 0000000..ac42e55 --- /dev/null +++ b/deploy/systemd/astrape-weather-station.service @@ -0,0 +1,20 @@ +[Unit] +Description=Astrape Local Weather Station Ingest +After=network-online.target +Wants=network-online.target + +[Service] +Type=simple +User=gibil +Group=gibil +WorkingDirectory=/srv/astrape +Environment=PYTHONUNBUFFERED=1 +Environment=PYTHONDONTWRITEBYTECODE=1 +Environment=ECOWITT_GW3000_HOST=10.24.88.176 +Environment=ECOWITT_GW3000_POLL_SECONDS=60 +ExecStart=/srv/astrape/.venv/bin/python -m astrape_oracle.scripts.daemons.weather_station_daemon +Restart=always +RestartSec=10 + +[Install] +WantedBy=multi-user.target