Skip to content

feat(runners): the runner release lane, the platform's version pins and release endpoints, and self-update with an opt-out (task #217) - #676

Merged
NOX73 merged 12 commits into
developfrom
feature/runner-release-lane-self-update
Nov 10, 2026
Merged

NOX73 merged 12 commits into
developfrom
feature/runner-release-lane-self-update

Conversation

@NOX73

@NOX73 NOX73 commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Task #217 (Runners 10), DESIGN.md §14 and §15 row 10.

What changed

The platform's pins. config/runner_release.yml is loaded into Settings.runners.release and read through Runners::Release, which validates it at boot (an invalid file fails boot). It holds protocol_supported, min_version, recommended_version, download_url (the asset URL template) and the SHA-256 of each binary. As committed it pins protocol [1] and no minimum, no recommendation and no binary, because runner-v0.1.0 is not tagged yet. A follow-up PR pins 0.1.0 and its digests.

The gateway.

  • GET /runner/v1/releases/:version/:os-:arch answers 302 to the pinned asset, with X-Aixle-Runner-Sha256 from the pins. GET /runner/v1/releases/:version/checksums returns the same digests as JSON. Both are public (no token, no protocol headers). Anything unpinned is 404 not_found, and a malformed version or platform is 400 invalid_request (schemas/v1/releases.params.json).
  • register refuses a runner below min_version with 400 runner_version_unsupported. The message names the minimum, and the registration token is not spent.
  • X-Aixle-Runner-Protocol is checked against protocol_supported. X-Aixle-Runner-Version must now be strict SemVer 2.0 (Runners::Version, ordered by SemVer precedence), as PROTOCOL.md said it would once the skew policy was built.
  • When GET /runner/v1/ops has no ops to return, its answer carries update: {version, sha256} (decision 2). The update is computed after the wait, and only when all of these hold: the machine is registered, it holds no session, the request's version is below recommended_version, and the binary for the machine's os/arch is pinned. It is never sent when the runner's config.auto_update is false or the machine registered with auto_update: false.
  • New column runner_environments.auto_update (default true). register takes an optional boolean auto_update.

The runner (Go).

  • internal/update: self-update. It runs only while no session container exists, only towards a newer version, and never with the machine's opt-out. It reads the checksums and the redirect from its own platform URL, and requires the three digests (update, checksums, redirect) to agree. It downloads into the directory of the running binary and checks the file with update.Verify, the hook that checks only the digest until releases are signed. Only then does it rename the file over the binary atomically and exit with code 4. A tampered download is deleted, the old binary keeps running, and the same version is retried at most once an hour.
  • configure --no-auto-update sends auto_update: false and keeps the opt-out in the credentials file.
  • service install creates /var/lib/aixle-runner/bin, owned by the aixle-runner user, and installs the binary there instead of the root-owned /usr/local/bin (decision 3). The unit's ExecStart points there and the unit has Restart=always.
  • New aixle-runner version command, which the lane uses to check the stamped version.
  • Protocol client: PollOps returns Poll{Ops, Update}, and there are new Checksums and Release calls (the 302 is not followed). runner_version_unsupported is classified as "update aixle-runner".
  • The Go conformance test drives the release endpoints. It now fails for a fixture of which no exchange is driven, unless gatewayOnly lists it with a reason; the list is empty.

The image and the lane.

  • docker/runner/Dockerfile is the published image. It copies in the binaries the lane built, so the image and the release asset are the same binary. It runs as a non-root user and runs nothing at build time.
  • .github/workflows/runner-release.yml is not in this PR, because agents cannot push .github/workflows/. It is attached to task feat(llm-calls): inline LLM calls view (#371) #217 as runner-release.patch for Alex to apply. A runner-v* tag runs vet and tests, builds both static binaries with the version stamped in, writes checksums.txt, checks the binaries and the image, pushes ghcr.io/aixlehq/aixle-runner:X.Y.Z and creates a GitHub Release (--latest=false). Run by workflow_dispatch, it is a dry run that builds and checks but pushes and releases nothing (decision 4). The v* filters of images.yml and release.yml do not match runner-v*, and runner-v* does not match v*.

Docs.

  • PROTOCOL.md §1 (strict SemVer, pinned protocols), §3 (new refusal), §5.1 (auto_update, the minimum), §5.4 (update), the new §5.6 and §5.7, and §7 (skew policy).
  • Fixtures README: the new release_pins setup step.
  • releasing.md gains "Runner compatibility" and "Releasing the runner".
  • DESIGN.md row 10 is marked done with decisions 1 to 4. §14.1, §14.2, §14.4, §6.3, §9.7 and §2.2 now describe what was built, and §14.4 says where the binary lives.

Fixtures

  • New: releases/redirect, releases/checksums, releases/not_pinned, register/below_min_version, register/no_auto_update, ops/update_offered.
  • Changed: headers/invalid_runner_version now refuses 01.2.3, 1.2.3-01 and 1.2.3-...

How to test

  • Go: cd runner && gofmt -l . && go vet ./... && go test -race ./...
  • Rails: bin/rails test test/services/runners test/integration/runner_gateway_releases_test.rb test/integration/runner_gateway_test.rb test/integration/runner_gateway_operations_test.rb test/integration/runner_protocol_conformance_test.rb test/integration/process_mode_routes_test.rb
  • The verification round on Coder (the lane's dry run, and self-update between two local builds) comes after code review, as the task says.

Comment thread docs/operations/releasing.md Resolved
Comment thread docker/runner/Dockerfile Resolved
Comment thread test/services/runners/release_test.rb Resolved
Comment thread app/services/runners/release.rb Resolved
Comment thread runner/internal/update/update.go Resolved
aixle-com[bot]
aixle-com Bot previously approved these changes Nov 9, 2026

@aixle-com aixle-com Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at head 0147488 against DESIGN.md §14 / §15 row 10, the task's decisions 1 to 4, and the project conventions. No blocking issues. Four [Recommendation] and two [Note] comments are inline, one of them about the attached runner-release.yml patch.

Comment thread app/services/runners/release.rb Resolved
Comment thread runner/internal/protocol/client.go Resolved
Comment thread runner/internal/update/update.go Resolved
Comment thread runner/internal/version/semver.go Resolved
@aixle-com
aixle-com Bot dismissed their stale review November 9, 2026 14:33

Approval withdrawn

…ease-lane-self-update

# Conflicts:
#	db/schema.rb
- update.DownloadTimeout is 2 minutes; DESIGN.md 14.4 says a session
  assigned during an update starts after the restart (no reservation)
- the release requests carry neither protocol header, and the Go
  conformance harness checks each header's presence or absence
- a download_url template that format cannot fill in fails boot
- a runner version over 255 characters is invalid_registration before
  the min_version refusal
- the published image sets AIXLE_RUNNER_NO_SELF_UPDATE=1
- the parsed pins are memoized; a test sends real pins through the
  Config gem
- renumber the auto_update migration, which collided with develop's

Signed-off-by: Alex <[email protected]>
Comment thread runner/cmd/aixle-runner/main.go Resolved
Comment thread runner/internal/cli/host.go Resolved
aixle-com[bot]
aixle-com Bot previously approved these changes Nov 10, 2026

@aixle-com aixle-com Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review round 2 at 26256f3: every Fix CR round 1 thread is addressed or answered per Alex's decisions. No [Must] findings. I left 1 [Recommendation] and 1 [Note], both non-blocking.

Comment thread runner/internal/update/update.go Resolved
Comment thread docs/operations/releasing.md Resolved
@aixle-com
aixle-com Bot dismissed their stale review November 10, 2026 09:39

Approval withdrawn

- The release endpoints answer Cache-Control: no-store before validation,
  so the 400 and 404 refusals carry it too (PROTOCOL.md §2).
- The update offer is {version, sha256}: the runner builds its release
  requests from its own platform URL, so url is dropped.
- configure treats AIXLE_RUNNER_NO_SELF_UPDATE as --no-auto-update.
- The host runner computes its effective self-update flag once.

Signed-off-by: Alex <[email protected]>
Comment thread app/services/runners/release.rb Resolved

@aixle-com aixle-com Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review round 3 at 1c381927: approved. All Fix CR round 2 decisions are implemented, with tests and fixtures. I added 1 [Recommendation] (the PR description still documents update.url) and 1 [Note] (Offer#platform is unused in production). Neither blocks the merge.

Comment thread app/services/runners/release.rb Resolved
Comment thread runner/internal/update/update.go Resolved
Signed-off-by: Rozhnov Alexandr <[email protected]>
@NOX73
NOX73 force-pushed the feature/runner-release-lane-self-update branch from 42b3939 to e39cae0 Compare November 10, 2026 15:38
@NOX73
NOX73 merged commit 476c722 into develop Nov 10, 2026
29 of 31 checks passed
@NOX73
NOX73 deleted the feature/runner-release-lane-self-update branch November 10, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant