Files
astrape-oracle/deploy/systemd/astrape-usage-tcn-training.service
T
rpotter6298 09e7155b47 Set PYTHONSAFEPATH=1 in the units
The repos now sit directly under /srv/astrape, which is also every unit's
WorkingDirectory. Python prepends the working directory to sys.path for
'python -m', so the gibil checkout at /srv/astrape/gibil was shadowing the
installed package: the repo root has no __init__.py, so 'gibil' resolved as a
namespace portion with __file__ None, and submodules only resolved because a
namespace path recomputes itself on access.

Everything is installed into the venv, so nothing needs the working directory
on sys.path. WorkingDirectory still matters for env/ and models/.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-30 14:33:25 +02:00

29 lines
1.2 KiB
Desktop File

[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
# WorkingDirectory is /srv/astrape, which also holds the gibil checkout. Without
# this, Python prepends the working directory to sys.path and the repo root
# /srv/astrape/gibil shadows the installed package as a namespace portion --
# gibil.__file__ becomes None and imports work only by accident. All code is
# installed into the venv, so nothing needs the working directory on sys.path.
Environment=PYTHONSAFEPATH=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