publishing: one canonical build venv; drift check; deploy-failure alerting

The poller's private venv (.docs-publisher/.venv-docs) diverged from the
canonical one twice, each time silently delaying a deploy. Consolidate:

- poll-watcher.sh builds with the ONE canonical venv
  (~/repos/docs/.venv-docs) while keeping its dedicated checkout (uncommitted
  edits in a working clone must never block or leak into a deploy).
- New drift check: publishing/ + mkdocs.yml are compared with the canonical
  checkout before every build; a mismatch fails the deploy loudly instead of
  shipping logic the canonical source cannot reproduce.
- Pre-deploy gate: build.sh --check-only verifies the pinned toolchain and
  every configured plugin (self-heals missing pins, fails loudly naming an
  unpinned plugin).
- Alerting: 3 consecutive deploy failures -> marker file + ONE Matrix message
  to the InferenceBot HQ room (hourly cap); counter resets on next success.
- The watcher re-execs itself when a deploy changed poll-watcher.sh, so the
  running loop always matches the deployed one.
- webhook receiver (dormant) repointed at the canonical venv too; unit files
  and README document the layout.
This commit is contained in:
inference-bot committed 2026-11-12 03:23:33 +00:00
1 parent 1691f79621
commit 20d384be87
5 files changed
+222 -21

No files matched your search

+15 -8
View File
@@ -1,7 +1,4 @@
# systemd units for the docs deploy automation (agent host).
#
# Two mechanisms, one job — keep https://docs.inference.coop/ in step with
# co-op/docs main:
# systemd unit for the docs auto-deploy poller (agent host).
#
# docs-deploy-poll.service ALWAYS ON. Polls Gitea every 60s; deploys on
# any change to main. Works with the agent
@@ -12,12 +9,21 @@
# panel allows inbound TCP to the agent host
# (the Gitea webhook is already registered).
#
# Install both:
# sudo cp publishing/poll-watcher.sh publishing/webhook-receiver.py /home/ubuntu/repos/docs/publishing/
# sudo cp publishing/docs-deploy-poll.service publishing/webhook-receiver.service /etc/systemd/system/
# Install:
# sudo cp publishing/docs-deploy-poll.service /etc/systemd/system/
# sudo systemctl daemon-reload
# sudo systemctl enable --now docs-deploy-poll
# sudo systemctl enable --now docs-deploy-webhook # when the port is open
#
# poll-watcher.sh itself needs NO manual copy: the service runs the copy in
# the dedicated checkout (/home/ubuntu/.docs-publisher), which git pull keeps
# at main on every deploy, and the watcher re-execs itself when a deploy
# changed it.
#
# ONE BUILD ENVIRONMENT: the poller builds from its own dedicated checkout
# (uncommitted edits in a working clone must never block or leak into a
# deploy) but with the ONE canonical venv, DOCS_CANONICAL_DIR/.venv-docs, and
# drift-checks its publishing/ tree against the canonical checkout before
# every build. See publishing/README.md.
[Unit]
Description=Inference docs: poll Gitea main and deploy to Surfer
@@ -28,6 +34,7 @@ Wants=network-online.target
User=ubuntu
WorkingDirectory=/home/ubuntu/.docs-publisher
Environment=DOCS_REPO_DIR=/home/ubuntu/.docs-publisher
Environment=DOCS_CANONICAL_DIR=/home/ubuntu/repos/docs
ExecStart=/bin/bash /home/ubuntu/.docs-publisher/publishing/poll-watcher.sh
Restart=on-failure
RestartSec=10