Commit Graph
5 Commits
Author SHA1 Message Date
aiongg 8a688a2260 Leader election for the runner and the periodic chores on Postgres
Two copies of the runner or of the periodic chores can run on one Postgres database: the copy that holds the
role's session-level advisory lock leads, the other waits as a standby and takes over when the leader's
session ends. A new leader moves the role's epoch and fences its writes, and those of its jobs, to it: every
write transaction checks the epoch after the writer lock, so writes of a leader that lost its lock fail. The
old leader kills its jobs and exits when its lock connection fails or a check of the lock fails. A standby
runner answers /readyz with 503; /healthz/checks gains runner-leader and periodic-leader. The periodic loop
moves to deploy/periodic.sh, run by autocraft-server periodic.
2026-11-22 15:12:23 +00:00
aiongg 776d59c758 Run every process on AUTOCRAFT_DB_URL: the dashboard, runner, worker threads and job processes open dbTarget() (job processes get dbEnv(), only the variable that names the database); the GitHub identity read uses the process handle in read transactions on Postgres; AUTOCRAFT_DATA_DIR (default: the SQLite file's directory; the image sets /data) holds reference documents, artifacts and the item snapshot; lock files are named by dbLockName(); the item snapshot, backup.sh, the predeploy snapshot and the periodic loops say that Postgres has no SQLite snapshot instead of succeeding; db.attempt(fn) runs fn under a savepoint on Postgres so a caught statement error leaves the write usable 2026-11-21 18:08:33 +00:00
aiongg 72b1a4edfa One instance-wide GitHub identity (box account or GitHub App) replaces the per-repo identity and the login-app variable; app keys are read again when the keys file changes 2026-11-08 20:56:53 +00:00
aiongg 4aef9eac62 Backup schedule from the newest snapshot, job log carry-over, local environments disabled at cut-over, account directories by id, disk sizing and runner hardening 2026-11-08 00:29:59 +00:00
aiongg 554398d7b6 Add a Docker Compose stack and a VPS runbook; list the files and settings a systemd install keeps 2026-11-08 00:19:12 +00:00