~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/hud

A remote MCP server that shows atproto records as interactive UI inside MCP Apps hosts

0
0

Each push to main deploys hud.place

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/hud:deploy/hud-place

Each push to main now deploys hud.place. The deploy runs on the trusted runner (ci.knotless.dev), builds on the grain box through a forced-command key, swaps the container, and checks /_health.

Claude Opus 5.5 · medium

What changes

The deploy. .knotless/workflows/deploy.yml runs on each push to main, on ci.knotless.dev only, with superseded: finish. It sends git archive of the commit to the grain box, where the forced command hud-deploy (hetzner-infra's services/hud/hud-deploy.sh) builds hud:build-<sha>. Then hud-deploy up keeps the running image as hud:before, makes the candidate hud:current, runs docker compose up -d --wait in /etc/hud, and checks the container runs that commit. The run then waits for https://hud.place/_health to answer ok.

The image. The Dockerfile mounts cargo's registry and target/ as BuildKit caches and takes CARGO_BUILD_JOBS, so a deploy compiles HUD's own crates and not their dependencies, with four jobs beside production.

Why

hud.place was deployed by hand with hetzner-infra's up.sh. This follows group-host's deploy on the same box. HUD_DEPLOY_KEY is sealed to ci.knotless.dev for refs/heads/main only, and the box takes it only for hud-deploy, so a leaked key can't open a shell.

It doesn't wait for main's checks. Main lands only through the merge queue, whose batch runs every check on the tree that lands. after: can't see checks filed by another runner, and a step can't read a private repository's checks.

How it was checked

  • hud-deploy build of this branch's commit on the box: cold cargo cache, 322s in total (the cargo build took 4m 09s).
  • The deploy key runs drop and refuses id.
  • ci.knotless.dev now has an OAuth session and reads this repository. Its log shows a pass over chadtmiller.com/hud.
  • node harness/docs.mjs.
  • hud-deploy up and the workflow itself run for the first time when this lands.

Shortcomings

  • hud-deploy up has only a single rollback image (hud:before), and HUD is down for the few seconds compose takes to recreate the container. Caddy's lb_try_duration holds requests during that gap.
  • hetzner-infra's side (hud-deploy.sh, install-deploy.sh, up.sh building through hud-deploy) is on its branch hud/deploy and isn't merged yet. The box already runs it.
Approved

This pull adds .knotless/workflows/deploy.yml, which deploys hud.place on each push to main. It runs only on ci.knotless.dev, uses superseded: finish, and gets the deploy key through the pinned ssh-key step with the box's host key pinned. It sends a git archive of the commit to the box's forced command to build, then brings the build up and polls /_health. The Dockerfile now keeps cargo's registry and target/ in BuildKit cache mounts. Because a cache mount isn't saved in the image layer, it copies the binary out to /usr/local/bin/hud, and the runtime stage copies it from there. That part is right. AGENTS.md and docs/running.md both describe the deploy, as the repository asks.

I checked:

  • The box heredoc ends up at column 0 once YAML strips the block's indentation.
  • ssh-key writes ~/.ssh/id_ed25519, the key ssh uses by default, and its known_hosts entry matches the bare IP in HUD_BOX.
  • /_health answers exactly ok, so the loop's comparison works.
  • A bare ARG CARGO_BUILD_JOBS with no value given leaves cargo's default of every core.

I found nothing that needs to change. One small point, which I can't confirm from here: the deploy step relies on the runner running each step with sh -e. If it doesn't, a failed box up would leave the old container serving, the health check would see its ok, and the run would report the deploy as passed. Writing box up || exit 1 (or set -e at the top) makes it safe either way.

As the body says, hud-deploy up and the workflow itself first run when this lands, so watch that first run on main.

.knotless/workflows/deploy.ymlline 57
git archive --format=tar "$KNOTLESS_RUN_SHA" | box build
- name: deploy
run: |
box up
review.knotless.dev

Can't tell from here whether steps run with sh -e. If they don't, a failing box up falls through to the health loop. The old container still answers ok, so the deploy would pass when it failed. box up || exit 1 closes that whichever way it is.

Merged as 616ee2e