Skip to content

build(updates): package host updater artifacts - #838

Merged
mcharles-square merged 1 commit into
mainfrom
codex/one-click-updates-04-release-packaging
Aug 6, 2026
Merged

build(updates): package host updater artifacts#838
mcharles-square merged 1 commit into
mainfrom
codex/one-click-updates-04-release-packaging

Conversation

@mcharles-square

@mcharles-square mcharles-square commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Reviewable diff: +129/-2 across 5 files (excludes generated, test, and story files).

Summary

Packages the host updater into amd64 and arm64 deployment artifacts, publishes paired SHA-256 sidecars, and includes the hardened systemd unit plus narrow socket overlay required by the merged Fleet API bridge. The host binary is statically linked and verified before packaging, while release publication fails closed unless both architecture bundles and correctly bound checksums are present. These assets remain dormant until installer activation lands in #839.

Stack: Prerequisites #841#842#843#844#845#835#836#837 are merged. This is 4/6, and its diff is relative to main. Remaining descendants are #839#840: #839 installs and activates these assets, while #840 exposes one-click execution in the client.

How it works

The artifact workflow builds a CGO-disabled fleet-updater on each native architecture runner, rejects dynamically linked output, and verifies the embedded version. The server artifact carries that binary into the deployment bundle, where it is placed beside its systemd unit and a Compose overlay that exposes only the updater Unix-socket directory to fleet-api.

Before upload, the workflow verifies the bundle checksum and required updater paths. Stable/RC and nightly publishers then require both amd64 and arm64 pairs, regenerate the expected sidecar for each explicit bundle, and compare the complete digest-and-filename line before creating or updating a GitHub release. The service unit preserves the socket directory inode across stops and restarts, remains available through Docker outages, and gives an in-progress activation enough bounded time to drain safely.

flowchart LR
  B["Build static fleet-updater per architecture"] --> V["Verify ELF linkage and embedded version"]
  V --> S["Server artifact"]
  S --> D["Deployment bundle with unit and socket overlay"]
  D --> C["Verify required paths and SHA-256 sidecar"]
  C --> A["Upload amd64 and arm64 artifacts"]
  A --> P["Release/nightly publisher re-verifies each explicit pair"]
Loading

Areas of the code involved

Area / package / file What changed Why it matters for review
.github/workflows/proto-fleet-artifact-build.yml Builds and validates the static updater, packages runtime assets, creates and checks sidecars Review architecture naming, static-host portability, and the bundle contract
.github/workflows/release.yml, nightly-builds.yml Require both architecture pairs and bind each sidecar to its explicit bundle before publication Prevents partial, mismatched, or swapped release assets
deployment-files/docker-compose.updater.yaml Mounts only the read-only updater socket directory into fleet-api Security boundary preventing Docker-socket exposure
deployment-files/updater/proto-fleet-updater.service Defines hardening, soft Docker ordering, bounded activation drain, and runtime-directory preservation Review root-service permissions, recovery, and lifecycle behavior

Key technical decisions & trade-offs

  • Build the host updater with CGO_ENABLED=0 and inspect its ELF headers, avoiding host glibc coupling at the cost of requiring pure-Go dependencies.
  • Publish same-name .sha256 sidecars and compare their full content against each explicit amd64/arm64 bundle, keeping updater discovery deterministic and failing closed on partial or swapped artifacts.
  • Treat SHA-256 sidecars as corruption and pairing checks, not independent publisher authentication; the GitHub release origin remains the trust anchor, while separately pinned release signing is intentionally out of scope.
  • Use KillMode=mixed with a 50-minute stop bound so systemd signals the daemon first and preserves the updater's 45-minute activation safety window.
  • Preserve the runtime directory across service stops and restarts so Docker's bind mount stays attached to the socket directory inode.
  • Soft-order the updater after Docker instead of requiring Docker continuously; trigger-time preflight remains the authority for daemon readiness.
  • Keep packaging separate from activation so this PR remains merge-safe; installation and enablement are isolated in feat(updates): bootstrap host updater installs #839.

Testing & validation

  • go test ./cmd/fleet-updater ./internal/updater
  • CGO-disabled build and embedded-version smoke check
  • Host profile, HA profile, and complete non-interactive upgrade-safety harnesses
  • Base plus updater Compose rendering
  • Workflow/Compose YAML parsing, positive checksum-pair simulation, swapped-sidecar rejection, required-path checks, and git diff --check
  • Pre-push client typecheck plus server and plugin lint hooks; final review-fix push reran server lint

End-to-end deployment artifact assembly is not run by PR CI; the reusable workflow executes only for release and nightly builds. The new in-workflow assertions make that explicit path fail before publication, but a real release/nightly run remains the integration coverage.

@github-actions github-actions Bot added the github_actions Pull requests that update GitHub Actions code label Jul 30, 2026
@github-actions github-actions Bot added the review-policy: needs-review Managed by the Review Policy workflow. label Jul 30, 2026
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown

🔐 Codex Security Review

Note: This is an automated security-focused code review generated by Codex.
It should be used as a supplementary check alongside human review.
False positives are possible - use your judgment.

Scope summary

  • Reviewed pull request diff only (1eab1dbe2bed41b1c1b19ca125b507f70d3dfe39...82e774c5564219aa3ffb0ef1665acee25505c209, exact PR three-dot diff)
  • Model: gpt-5.6-sol

💡 Click "edited" above to see previous reviews for this PR.


Review Summary

Overall Risk: NONE

Findings

No concrete security, correctness, or reliability findings were identified in the authoritative PR diff.

Notes

The reviewed changes package and publish the host updater, its systemd unit, Compose overlay, and filename-bound SHA-256 sidecars. No authentication, database, pool configuration, or protobuf changes are present.


Generated by Codex Security Review |
Triggered by: @mcharles-square |
Review workflow run

@mcharles-square
mcharles-square force-pushed the codex/one-click-updates-04-release-packaging branch from d698793 to ca0365b Compare July 31, 2026 15:44
@mcharles-square
mcharles-square force-pushed the codex/one-click-updates-04-release-packaging branch from ca0365b to 748016a Compare July 31, 2026 16:08
@mcharles-square
mcharles-square force-pushed the codex/one-click-updates-04-release-packaging branch 2 times, most recently from 1323503 to 660dafd Compare July 31, 2026 18:27
@mcharles-square
mcharles-square force-pushed the codex/one-click-updates-04-release-packaging branch from 660dafd to 06e92a1 Compare July 31, 2026 18:30
Base automatically changed from codex/one-click-updates-03-fleet-api-bridge to main August 5, 2026 18:16
@mcharles-square
mcharles-square force-pushed the codex/one-click-updates-04-release-packaging branch from 06e92a1 to f0c1aed Compare August 5, 2026 18:43
@mcharles-square
mcharles-square marked this pull request as ready for review August 5, 2026 18:43
@mcharles-square
mcharles-square requested a review from a team as a code owner August 5, 2026 18:43
Copilot AI lite review requested due to automatic review settings August 5, 2026 18:43

Copilot AI 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.

Pull request overview

This PR extends Proto Fleet’s release/nightly deployment artifacts to include the host updater payload and supporting runtime assets, along with SHA-256 checksum sidecars. It does so by updating the artifact-build workflow to build/validate/package the updater and by updating release/nightly publishing workflows to upload and verify the paired checksum files; the added systemd unit and Compose overlay are included in the deployment bundle but remain dormant until downstream installer activation.

Changes:

  • Build and package a statically linked fleet-updater per architecture into the deployment bundle, and emit proto-fleet-<version>-<arch>.tar.gz.sha256 sidecars.
  • Require and verify both amd64 and arm64 bundle+checksum pairs before publishing release/nightly assets.
  • Add a hardened systemd unit and a narrow Docker Compose overlay that mounts only the updater socket directory read-only into fleet-api.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
deployment-files/updater/proto-fleet-updater.service Adds the systemd service definition with hardening and bounded stop behavior for activation drain.
deployment-files/docker-compose.updater.yaml Adds an overlay that injects the updater socket path env var and mounts only /run/proto-fleet-updater read-only into fleet-api.
.github/workflows/release.yml Verifies deployment bundle checksum sidecars exist and pass, and uploads .sha256 assets alongside bundles.
.github/workflows/proto-fleet-artifact-build.yml Builds/validates a static updater binary, packages it and its runtime assets into the deployment bundle, and generates/verifies checksum sidecars.
.github/workflows/nightly-builds.yml Verifies deployment bundle checksum sidecars exist and pass, and publishes/uploads .sha256 assets alongside bundles for nightlies.

Comment thread .github/workflows/release.yml Outdated
Comment thread deployment-files/updater/proto-fleet-updater.service Outdated
@github-actions github-actions Bot added review-policy: human-approved Managed by the Review Policy workflow. and removed review-policy: needs-review Managed by the Review Policy workflow. labels Aug 5, 2026
@mcharles-square
mcharles-square force-pushed the codex/one-click-updates-04-release-packaging branch from f0c1aed to 82e774c Compare August 6, 2026 03:59
@github-actions github-actions Bot added review-policy: needs-review Managed by the Review Policy workflow. and removed review-policy: human-approved Managed by the Review Policy workflow. labels Aug 6, 2026
@mcharles-square
mcharles-square merged commit 4659f7e into main Aug 6, 2026
141 of 145 checks passed
@mcharles-square
mcharles-square deleted the codex/one-click-updates-04-release-packaging branch August 6, 2026 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code review-policy: needs-review Managed by the Review Policy workflow.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants