ci: install each published build into the paseo host mount #31

Merged
sam merged 1 commit from ci/install-into-paseo-mount into main 2026-10-12 20:36:31 +00:00
Collaborator

What

Adds a step to .forgejo/workflows/build.yml that installs the build this run just published into the host directory the paseo container runs brainless from.

Why

sam/pi-deploy is moving brainless out of the paseo image: the container runs the binary bind-mounted from the host at /opt/brainless (mount of data/brainless, added in pi-deploy PR #73). That makes a brainless update a file replacement instead of an image rebuild — but the replacement has to happen somewhere. pi-deploy's deploy workflow does it when that repository is pushed; this step does it when this one is pushed, which is the moment a new binary exists. The daemon spawns brainless once per agent session, so the next session runs it, with no container restart and no interrupted turn.

How

  • Runs after the existing publish step, so the bytes installed are exactly the bytes the rolling latest release serves.
  • Installs with a rename: brainless is normally running and Linux refuses to open a running executable for writing (ETXTBSY); a rename also leaves sessions already running on the bytes they started with.
  • Requires a non-trivial ELF before replacing anything (same bar as pi-deploy's scripts/update-brainless.sh), so a broken build cannot put a stub in the container.
  • Skips with a message when /home/sam/git/sam/pi-deploy is absent, i.e. on any runner other than this Pi's (the linux:host runner is shared, and this path is the same one the pi-deploy deploy workflow already relies on).

Verified

  • The step body run against a scratch directory with four inputs: a real 64,529,187-byte ELF installed 0755 with its sha256 reported; a re-run installed again; a 12-byte file and a 2 MB non-ELF file each exited 1 and left the previously installed binary untouched; an absent mount path printed the skip and exited 0.
  • Both changed workflow files parse with a real YAML parser, with the expected step lists.

Coupling

This hardcodes one host path into this repository's CI. That is the trade for not polling: this repository knows exactly when a new binary exists, and the runner already has the path mounted. If pi-deploy's mount moves, this step silently skips (it only tests for the directory), so the pi-deploy script remains the path that always works.

## What Adds a step to `.forgejo/workflows/build.yml` that installs the build this run just published into the host directory the paseo container runs brainless from. ## Why `sam/pi-deploy` is moving brainless out of the paseo image: the container runs the binary bind-mounted from the host at `/opt/brainless` (mount of `data/brainless`, added in pi-deploy PR #73). That makes a brainless update a file replacement instead of an image rebuild — but the replacement has to happen somewhere. pi-deploy's deploy workflow does it when *that* repository is pushed; this step does it when *this* one is pushed, which is the moment a new binary exists. The daemon spawns brainless once per agent session, so the next session runs it, with no container restart and no interrupted turn. ## How - Runs after the existing publish step, so the bytes installed are exactly the bytes the rolling `latest` release serves. - Installs with a rename: brainless is normally running and Linux refuses to open a running executable for writing (`ETXTBSY`); a rename also leaves sessions already running on the bytes they started with. - Requires a non-trivial ELF before replacing anything (same bar as pi-deploy's `scripts/update-brainless.sh`), so a broken build cannot put a stub in the container. - Skips with a message when `/home/sam/git/sam/pi-deploy` is absent, i.e. on any runner other than this Pi's (the `linux:host` runner is shared, and this path is the same one the pi-deploy deploy workflow already relies on). ## Verified - The step body run against a scratch directory with four inputs: a real 64,529,187-byte ELF installed `0755` with its sha256 reported; a re-run installed again; a 12-byte file and a 2 MB non-ELF file each exited 1 and left the previously installed binary untouched; an absent mount path printed the skip and exited 0. - Both changed workflow files parse with a real YAML parser, with the expected step lists. ## Coupling This hardcodes one host path into this repository's CI. That is the trade for not polling: this repository knows exactly when a new binary exists, and the runner already has the path mounted. If pi-deploy's mount moves, this step silently skips (it only tests for the directory), so the pi-deploy script remains the path that always works.
The paseo container no longer bakes brainless into its image: it runs the
binary bind-mounted from the host at /opt/brainless (see
/home/sam/git/sam/pi-deploy/docker-compose.yml, which mounts
data/brainless there, and its scripts/update-brainless.sh). Adding this step
after the publish closes the loop, so a push to main reaches the agents without
waiting for a pi-deploy deploy: the daemon spawns brainless once per agent
session, so the next session executes the new binary.

The install is a rename, never an overwrite of the running file: brainless is
normally in use, and Linux refuses to open a running executable for writing
(ETXTBSY); renaming also leaves sessions already running on the bytes they
started with. The binary must be a non-trivial ELF before it replaces anything,
the same bar pi-deploy's own update script enforces, so a failed build cannot
put a stub in the container.

The step is a no-op where the pi-deploy tree is not mounted, which is any
runner other than this Pi's; the runner is shared, and on the Pi the repository
is mounted at the same absolute path the deploy workflow already uses.
sam merged commit 3944d353a0 into main 2026-10-12 20:36:31 +00:00
sam deleted branch ci/install-into-paseo-mount 2026-10-12 20:36:31 +00:00
Sign in to join this conversation.
No reviewers
No labels
code-review
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sam/brainless!31
No description provided.