Skip to content

Latest commit

 

History

History
956 lines (823 loc) · 67.2 KB

releasing.md

File metadata and controls

956 lines (823 loc) · 67.2 KB

Releasing

How Pithead is versioned and released (#44). The pipeline is implemented as scripts/release/release.sh. Run it from the build/test server with make release (preview a run with make release ARGS="--dry-run").

One product, one version

Pithead is versioned and released as a single product, not as individual components.

The components are upstream projects pinned and integrated, not authored here: p2pool (ARG P2POOL_VERSION), xmrig-proxy (ARG XMRIG_PROXY_VERSION), monerod (ARG MONERO_VERSION), and tari (ghcr.io/tari-project/minotari_node:v6.0.1-pre.0-mainnet, pinned by digest in docker-compose.yml). The first-party code is the dashboard plus the orchestration (pithead, docker-compose.yml, configs). The integration matrix validates the composed set. A release is one artifact with one version, one changelog, one upgrade path, and one "new version available" signal.

Trade-off: swapping a single component to a version not tested together is unsupported. You can override an ARG or image tag locally, but that combination is not a supported release.

Single source of truth

The product version lives in a top-level VERSION file: plain text, one line, SemVer. Nothing else hardcodes the version:

  • pithead reads it for tagging and upgrade.
  • The dashboard bakes it in for display (#58).
  • Released images carry it in the org.opencontainers.image.version OCI label.
  • The dashboard's pyproject.toml is kept in lockstep (packaging metadata only); a shell test fails if it drifts from VERSION.

NOTE: VERSION holds the last released version. Set it to the version you want to publish; the pyproject.toml metadata must match, enforced by the drift-guard test.

Component pins = an ingredients manifest

Every component stays pinned (build ARGs, commit refs and image tags). The pins are the ingredients lockfile of each product release, not independent releases:

  • The dashboard surfaces them as "what's inside vX.Y.Z" (component info is already shown).
  • Bumping any component, including a security patch such as a monerod CVE, is a normal stack release: bump the pin → cut a stack patch → re-run the integration gate → ship. The bundle ships re-tested.

For Caddy, update the digest in Compose, the Quadlet renderer, and its three fixtures together; the render parity test checks that they agree. Release preflight checks the Compose tag against the registry index, including on a dry run.

Noticing that a bump is available is a separate job from making one, and nothing did it until scripts/watch/pin-watch.sh. It runs weekly from .github/workflows/pin-watch.yml, compares each pin against the component's latest stable upstream release by numeric version and prerelease precedence, lists newer Tari prereleases separately for review without treating them as approved upgrades, checks whether each exact Go module raise still changes its pinned upstream graph, compares the vendored Tari gRPC schema with the pinned node's upstream tag, and keeps one tracking issue up to date. It reports and never bumps: a Tari or monerod minor can carry a one-time data migration, which is work to schedule rather than a pull request to merge. Dependabot covers the base images it can see and is set to ignore minor and major bumps on the component pins for the same reason.

Four pins that no Dependabot ecosystem can read are bumped by .github/workflows/pin-bump.yml, which runs daily and on workflow_dispatch (a dispatch defaults to a dry run that only reports). For each of the monero, p2pool and xmrig-proxy ARG pairs and the appliance's RIGFORGE_REF, scripts/watch/pin-bump.sh reads the latest stable upstream release, downloads the asset and refuses to go on unless its sha256 equals the digest GitHub publishes for it (Monero: the entry in hashes.txt, whose signature is not verified), then opens one dependencies-labelled PR per upstream version that moves the version and hash together, so a stale hash never lands. RIGFORGE_REF is resolved from the release tag to its commit. Monero only moves within its pinned minor: a release in a new minor is reported and never proposed, because that move stays a human decision (#1129). The Actions token opens these PRs, so they trigger no checks of their own: a maintainer pushes to the branch to start tiers 1 to 3, and the PR body names the tier4-e2e or tier4-kvm proof it needs before merge. A newer release supersedes the open PR for an older one of the same component, and a closed PR is taken as declined.

Advisories are the one thing the watch cannot see: monerod, p2pool and xmrig-proxy install sha256-verified static binaries with no package metadata, so the Trivy sweep reports no CVEs for them and the watch reports newer versions, not advisories (#4277). Bumping any of the three, by hand or from a pin-bump PR (whose body asks for it), checks the upstream release notes and security advisories for the new version, and records that check in the bump PR. The weekly report states the gap, so the duty travels with the stale row that triggers the bump.

Dependabot has no apt or apk ecosystem either, so the installed OS packages have their own watch. Each release attaches os-packages-<tag>.txt, one <image> <OSV ecosystem> <source package> <version> line per package in every published image (#4254). Every Monday .github/workflows/os-package-watch.yml runs scripts/watch/os-package-watch.py on the latest release's list: it asks OSV which recorded packages have an advisory that the distribution has fixed in a newer package, and opens or edits one issue labelled dependencies that lists them. Base images are pinned by digest, so shipping a fix means moving the listed image to a current base digest and package index and rebuilding it; the issue closes on the first weekly run whose release has no such package. A failed lookup is listed as unchecked, leaves the issue as it was and fails the run. A release cut before #4254 has no list, and the watch reports that instead.

The release ingredients manifest records the appliance's baked RigForge commit from RIGFORGE_REF in os/rootfs/Dockerfile alongside the stack component pins. The built-in miner's RigForge tree is baked at image build because nothing can be installed later: apt cannot run on the read-only root, and a read-write-remount install leaves its /etc state on the volatile overlay, where the first reboot breaks the compiler. One pin is not spelled as a version. The appliance pins RigForge by commit, so that a moved tag cannot change what is baked; the pin watcher resolves the latest release tag to the commit it names and compares the two commits. Comparing the commit against the tag directly would read stale for ever, including straight after a correct bump.

A lookup or version comparison that could not be made is reported as unchecked, never as current, and the run fails. The report carries the date of the last fully successful check, so a watcher that has stopped looks different from one with nothing to say.

The Monday sweep, and who reads it

CI runs a weekly CVE sweep on Mondays at 05:00 UTC from develop. It answers two questions with two jobs: build-images rebuilds the stack images from the branch and scans them, while os-rootfs.yml does the same for the appliance rootfs, so a fixable CVE is caught before a cut; sweep-shipped scans all six images already published, each tag resolved to a digest, so a CVE in the bytes users are running is caught after one.

A digest-pinned base can lag a published security fix until upstream rebuilds the image. The Alpine image builds name the base's openssl and musl packages in their apk upgrade list, and the Debian builds name packages such as apt and zlib1g in their install lists, so an installable fix lands on the next rebuild without an ignore (#1438, #3923, #3929).

The Tor image pins its apk package by ARG TOR_VERSION in build/tor/Dockerfile, because Alpine's repository would otherwise change the Tor in the image between builds with no commit here (#4125): the 0.4.9.17 bump changed state-file semantics and turned the tor-heal proof red. apk add refuses a pin the repository no longer carries, and the build then runs tor --version and fails unless it reports the pinned version. The Dockerfile also names the base's openssl and musl libs in --upgrade and installs netcat for the bootstrap healthcheck; it deliberately omits xxd, which busybox already provides (#1372). Alpine moves the pin: .github/workflows/tor-bump.yml runs daily, reads the tor package for the pinned Alpine branch, and when Alpine carries a newer one opens a dependencies-labelled PR against develop that edits only the pin (scripts/watch/tor-bump.sh, #4158) — the apk package no Dependabot ecosystem can see. Every bump, from the watcher or by hand, re-runs the tier4-kvm tor-heal phase before it merges: it is the live proof of Tor's state-file behaviour. The release notes name the shipped Tor in the tor pin row.

A scheduled run has no pull request, so nothing draws a person to its result. On 2026-08-17 the rebuild scan went red and nobody was told for seven days (#1377). scheduled-run-watch.yml is that run's reader. It runs every Monday at 08:00 UTC, enumerates every workflow with a declared schedule:, and reads each workflow's server-filtered scheduled-run history. The report marks a run LATE after 12 hours and MISSED after one full declared period. LATE is informational and MISSED is a reported finding; neither makes the watcher fail. A schedule with no history gets one full period from the commit that declared its cron before it can be MISSED. Every MISSED row names its nominal slot and links the runs that bound the gap; when the gap starts at the declaration boundary, it names that boundary and the first observed run. The issue also keeps the sweep result and its six most recent runs. Six rows rather than one because a single red says little and a streak says the gate has stopped being an instrument — the weekly link check was red for nine consecutive Mondays before anyone noticed (#1419).

It reports on every run, not only on failures. A notifier that speaks only when something breaks cannot be told apart from one that has died, so this one writes the issue whether the sweep passed or failed, and stamps the date of the last fully successful check. Its own run goes red only when the watch could not work out what happened: an unfinished sweep, a run history it could not read, and a failure whose jobs it could not name are all reported as unchecked, never as clean.

The watcher includes its own schedule in the table, but it cannot announce its own absence. A GitHub-wide schedule shutdown, including the 60-day inactivity case, stops both a target and its in-repository observer. The carried-forward successful-check stamp makes that gap readable to an observer outside GitHub. A bench nightly or developer tick is where that external assertion belongs; this workflow does not claim it (#1418).

Published images: GHCR, single-tag model

Images are published to GitHub Container Registry (ghcr.io/p2pool-starter-stack/*). Public images pull without a Docker Hub-style rate limit.

The stack is multi-container. Every stack image (pithead-dashboard, pithead-p2pool, pithead-xmrig-proxy, pithead-monero, pithead-tor) and the appliance rootfs (pithead-os-rootfs) is published, all tagged with the single product version. Compose references one ${STACK_VERSION} for the five images it runs. docker compose pull fetches that set with one knob, replacing the "git pull + rebuild" upgrade path. The version is the bundle, not the layers.

Release process

Releases are cut on a private build/test server that runs the full Monero and full Tari nodes (the integration-test environment from #54). A single entry point, make release (or pithead release), runs the pipeline. Nothing is promoted or published until every gate is green.

Use --allow-dirty with --dry-run to rehearse uncommitted changes. Every real release path requires a clean worktree so the approved commit is the bytes that are built and published. Before bundling, it rebuilds pithead from its slices and refuses a different generated artifact.

How to provision and harden that server, why end-to-end validation can't run on GitHub-hosted runners (and what does run free on every PR), and how bench-ci owns the release gate are covered in Release / Validation Server.

Branch mechanics

Releases are cut from develop. Land the release-prep commit (VERSION, pyproject.toml, and a draft CHANGELOG.md entry) as a normal PR. On the cut date, land a final cut commit on develop that refreshes the changelog for every included operator-visible change and sets its heading to the current UTC date. Run the pipeline with the final cut commit checked out: the tag lands on it, and release.sh then moves main to the tagged commit with a fast-forward push. main keeps its meaning — the last released commit — and stays an ancestor of develop by construction, so there is no back-merge and no post-release repair step (#1076; releases through v1.19.3 instead merged develop into main and back, and the back-merge was missed on v1.19.0). Commits that land on develop after the final cut commit sit ahead of main, the normal state between releases. release.sh warns (it does not abort) when the working tree is on any branch other than develop.

The release is pinned to the commit preflight read. Preflight refuses a tag that already exists locally or on origin, and refuses (outside --dry-run and PITHEAD_REHEARSAL=1, where it only warns) a version whose :vX.Y.Z image tag is already in the registry. Before building the bundle, publish refuses if HEAD is no longer the gated commit or the tree is dirty, and the tag is created with git tag -a "$TAG" "$GIT_COMMIT", so a git pull during the multi-hour gate cannot make the tag, images and bundle disagree.

That publish check runs after the images are promoted. If it stops a cut, rerunning release.sh is refused, because the :vX.Y.Z image tag now exists. Recover by hand instead. Check out the gated commit that the refusal names, and review git status --porcelain until it is empty (remove any files the release tests left behind). Nothing was tagged, and no manifest or bundle was built. Then run the remaining steps of publish() in scripts/release/bundle.sh from that commit: write_manifest, make_bundle, append_bundle_sha256 and, on a signed cut, sign_bundle; then tag the commit, push the tag, fast-forward main, and create the GitHub Release with the bundle, its signature and the manifest.

The fast-forward push cannot ride a PR: GitHub merges a PR by merge commit, squash, or rebase, each of which mints a new commit, and the point is that main gains no object the tag does not already name. The Main Branch ruleset requires PRs from everyone except organization admins, so release.sh relies on the same admin bypass the release's protected tag push already uses. If the push is refused, the script says so and prints the command to run by hand; the release itself is unaffected — main merely lags until an admin runs it.

Release-note prose that once lived in the main merge commit's body belongs in the GitHub Release notes, where operators actually read it. The branch model itself is in CONTRIBUTING.md.

Forward merges into release-line branches

develop carries the next patch release, and every security and bug fix lands there. A release-line branch named develop-vX.Y.Z, for example develop-v2.1.0, takes feature work for a later release only. After every patch release is published, forward-merge develop into each open release-line branch, so the cut commit and every fix on develop reach those lines.

The develop-v* branches carry the same protection as develop: the same required checks and adversarial-review status, one approving review, stale approvals dismissed, admins included, and no force-push or deletion. A direct push is refused, so a forward merge travels as a PR. Cut a forward/ branch from the target, merge develop into it, and push it:

git fetch origin develop develop-v2.1.0
git switch -c forward/develop-into-develop-v2.1.0 origin/develop-v2.1.0
git merge --no-ff origin/develop
git push origin forward/develop-into-develop-v2.1.0

Resolve conflicts on that branch. Version metadata takes develop's values: VERSION, the version line in dashboard/pyproject.toml, and the mining-dashboard entry in dashboard/uv.lock must equal develop's, or lifecycle end-to-end proofs on the release-line head fail on version skew (#3664). Until the forward merge lands, lifecycle and safety-backup proofs on a lagging release line wait for it: the seeded config.json carries the live stamp and is never rewritten.

Open the PR from the forward/ branch into the target. Never use develop itself as the head: conflict resolutions need a branch of their own, and a head that is develop changes under review every time develop moves. Once the checks, the review status, and the approval are on the head, merge with a merge commit:

gh pr merge <n> --merge

This is the one PR that is not squashed. A squash or rebase mints new commits, so develop never becomes an ancestor of the release line, and every later forward merge conflicts again on changes that were already merged. Merge commits are enabled on the repository for this case and the fold below only.

Folding a release line back into develop

When a release line's work moves onto develop, fold the line back with a merge commit, as develop-v2.0.3 was in #3959. First forward-merge develop into the line, so both sides carry the same version metadata and the line's [Unreleased] changelog entries already include develop's. Then cut a fold/ branch from develop, merge the line into it, and open the PR into develop:

git fetch origin develop develop-v2.0.5
git switch -c fold/develop-v2.0.5-into-develop origin/develop
git merge --no-ff origin/develop-v2.0.5
git push origin fold/develop-v2.0.5-into-develop

The result keeps develop's VERSION. Merge the PR with gh pr merge <n> --merge. The line then becomes an ancestor of develop, so the open PRs into the line retarget to develop with no rebase. Retarget them after the merge. The line branch is protected against deletion, so removing it is the owner's decision.

Pipeline: stage → smoke-test → promote

Ahead of stage 1, and outside the numbered pipeline the tool prints, release.sh runs one additional preflight check: the release status gate. When enabled it requires a successful commit status, under the context named by RELEASE_REQUIRED_STATUS_CONTEXT, on the exact release SHA, published by the GitHub App identified by RELEASE_REQUIRED_STATUS_APP_ID (that App's numeric id) and RELEASE_REQUIRED_STATUS_APP_SLUG (its slug). All three are settings with no defaults and may come from the release env file; when any one is set, all three are required. The gate is optional: with all three unset it skips with a log message, for a release lane that has not provisioned its status-publishing App yet. That skip is attested, not assumed — the manual attestation is then the only gate: before the cut, read the exact release SHA's status and job evidence by hand and record it in the release issue, as the e2e step below does. This repo's lane sets all three: context bench-ci/tier4, App pithead-bench-ci. The bench publishes that status only after its full tier-4 suite completes; a missing, failed, unreadable, or wrong-App status aborts the cut before anything is built. Dry runs enforce the lint/test toolchain on the run's effective PATH, just as a real cut does. A dry run still does not run make test or the integration matrix: it prints their commands. Under --dry-run the verdict is printed as a warning and the rehearsal continues, so a preview still runs end to end.

  1. Preflight: check the clean working tree, then build the git-ignored pithead executable from lib/pithead/*.sh; read the product version from the top-level VERSION file; confirm vX.Y.Z isn't already released; resolve the component pins into the ingredients manifest. The generated executable is copied into the release bundle; its source slices are not.

  2. Test gate (blocking): run the existing tests (make test: lint + dashboard pytest ≥ 80% + the pithead shell suite + compose validation) and the #54 integration matrix against the real nodes. Abort the release on any failure. See Pre-release gate.

  3. Build: build the five stack images with the pinned upstream versions baked in and OCI labels stamped (org.opencontainers.image.version = the VERSION value, source revision, etc.). The dashboard already reads PITHEAD_VERSION / git build-args for its header badge (#58); a release build must pass PITHEAD_RELEASE=1 (and PITHEAD_VERSION from VERSION) so the badge shows the clean vX.Y.Z rather than the dev · branch @ hash it shows for working-tree builds. Then build the appliance rootfs with that staged dashboard digest baked in. The rootfs builder receives PITHEAD_PIN_TAG=$STAGING_TAG and resolves all five first-party index digests from that tag, while the baked Compose references retain their version tags. Without an override, the builder resolves the version tag; an empty override uses that same default. Its push guard reads the exported rootfs and refuses any artifact carrying the debug SSH key. It records that tar's SHA-256; the production appliance image and RAUC bundle refuse any other export.

  4. Push to staging: push to a staging tag on GHCR (e.g. :vX.Y.Z-rc.N) and capture the immutable digests. Nothing user-facing points here yet. The digests exist only for this pipeline run: a failed run must start again and never recovers them from the mutable staging tag. The first pithead-os-rootfs push creates a private package because that is GHCR's default: change its visibility to public and start the release again; the smoke gate refuses promotion until an anonymous pull resolves to the captured digest.

  5. Staging smoke test (gate): pull each staged image back from GHCR. Verify the stack images report the release version in their OCI labels and carry every target platform (the v1.0.0 wrong-arch guard); verify the rootfs is amd64, stamped release, and carries no root SSH key. This validates the bytes actually pushed, not the local build — but it does not start a stack, which would collide with the release host's live deployment. A fuller functional run is opt-in: set RELEASE_SMOKE_CMD to a command to run during this stage, or point the #54 harness at the staged tag. Abort on failure. Then scripts/release/capture-packages.sh reads /etc/os-release and the dpkg or apk database out of each captured digest and records its installed source packages; a failed capture stops the release, and publish refuses to run without the list.

  6. Promote by digest: re-tag the exact digests just smoke-tested to :vX.Y.Z and :latest, then push. Promotion is by digest (no rebuild), so the released bundle is bit-for-bit what was validated. Same version on every image.

  7. Sign (#376): cosign-sign all six promoted digests and the install bundle with the key on the release server. See Signed releases.

  8. Publish GitHub Release: create the git tag vX.Y.Z, fast-forward main to the tagged commit (see Branch mechanics), write the release notes from the CHANGELOG.md entry matching the tag (including its Known issues section, excluding Unreleased and other versions). If the tag has no entry, warn on stderr and use the first non-Unreleased section; if the changelog is absent, use Pithead <TAG>. Attach release assets: a pinned docker-compose.yml / config bundle referencing ${STACK_VERSION}=vX.Y.Z, its detached signature (pithead.tar.gz.sig), plus the ingredients manifest (exact component versions + promoted image digests). The install bundle includes the generated CLI and top-level operator guides, but no source slices, appliance code, tests, developer docs, research, or image assets.

    When the version ships the appliance channel too, pass --draft. Published release assets are immutable — v1.18.0 shipped an asset that could not be amended and the whole version had to be withdrawn — and the appliance's .img.xz, .raucb, and checksum files are built, battery-tested and attached by hand after this stage (see appliance-release.md). Publishing before they are attached burns the tag. Draft first, attach both channels' artifacts, publish once.

    One nuance: the git tag itself is pushed at this stage, and the v* ruleset blocks re-pointing it — the draft protects the assets and the publish moment, not the version number. A hardware-battery failure after the DIY cut still spends the version, so do not start this stage until the appliance tree is believed final.

  9. Post-publish smoke (#459): run make release-smoke once against the just-published tag. It downloads the published bundle + images and verifies them for real, and — on the previous-release bench box — drives the real #59 upgrade. See Post-publish smoke test. This is the only step gated behind the publish, because it checks the published artifact, not a branch.

Rehearsing against a scratch registry

Set PITHEAD_REHEARSAL=1 and PITHEAD_REGISTRY to a non-production registry namespace. Rehearsal refuses the production namespace even with --dry-run. It runs every normal gate (preflight including signing, the release status gate, the test gate and smoke), promotes and signs the scratch images, then stops before publish: no git tag, GitHub Release or install bundle is published. Release runs, including draft releases, require the owner's sign-off.

For a registry other than ghcr.io, set PITHEAD_REGISTRY_USER and PITHEAD_REGISTRY_TOKEN if login is needed. The token goes to Docker on stdin; GitHub credentials and gh fallbacks apply only to ghcr.io. Without both scratch credentials, login is skipped with a warning and Docker's existing authentication is used. The rootfs anonymous-read check is skipped with a log message outside GHCR; all other smoke checks still run. A custom namespace without the rehearsal marker is allowed for a real cut, with a warning that the published bundle will name that registry.

Prepare registry trust on the release host. For a private CA or plain HTTP, set PITHEAD_BUILDKITD_CONFIG to a readable BuildKit daemon configuration file and choose a separate PITHEAD_BUILDX_BUILDER name. The configuration is used when creating that builder; an existing builder is never reconfigured. Promotion and inspection also select that builder when the configuration is set. Configure Docker daemon CA trust and cosign's SSL_CERT_FILE on the host as needed; the release script does not install certificates or change daemon configuration.

Registry reads allow 12 attempts with a 10-second delay by default; override with PITHEAD_REGISTRY_READ_RETRIES and PITHEAD_REGISTRY_READ_BACKOFF. Verification compares the parsed index digest exactly, including when inspect pads its fields. Registry writes allow 3 total attempts with an initial 10-second delay, doubled per retry up to 60 seconds. Set PITHEAD_REGISTRY_WRITE_RETRIES (1–10) and PITHEAD_REGISTRY_WRITE_BACKOFF (0–60 seconds) to tune writes. Only classified transient registry statuses (500, 502, 503, 504) and connection failures retry; authentication, missing manifests, invalid or mismatched digests and unclassified failures stop immediately. Rootfs retries repeat the push, not the build or export verification.

Pre-release gate (#54)

The #54 integration test matrix is a required, blocking pre-release gate. A release must not be promoted or published unless that matrix is green against the real Monero + Tari nodes. This is what makes every published version a single, validated bundle.

Two runs of the matrix are required, and the automated one is the smaller of the two:

  1. release.sh stage 2 runs the non-destructive --readiness assessment against the live stack. Set the harness arguments in the release env file or export them before make release:

    export RELEASE_INTEGRATION_ARGS="--local --dir <live-stack-dir> --readiness"

    --local / --dir point the harness at the box's live stack install, not the checkout — the same invocation the closing --check sweep below uses. Left unset, the cut aborts at stage 2 with run.sh's usage error. The assessment proves the box is fit to cut from — it does not mine, restart anything, or touch a rig.

  2. Before cutting, run the targeted end-to-end matrix on the release candidate with a borrowed loaner rig. release.sh never runs this leg — run it yourself, before make release:

    BENCH_HOST=<bench> MINER_HOST=<loaner-rig> tests/integration/e2e.sh <ref> --mode targeted

    This deploys the candidate to the bench's dedicated e2e checkout, repoints the rig at it (under the rig lock, with automatic restore of both), and proves what --readiness cannot: a real miner mining through the stack, the lifecycle phase (restart, apply secret-preservation, node-down failover), fail-closed auth, and the dashboard-to-rig write paths. Those write paths used to be reachable only under --mode matrix, so this mandated run never asked for them and the whole surface shipped unproven; the targeted run now requests them whenever a rig is borrowed. They need a rig with its control API enabled, and each leg says so and skips when it is missing — read the run's output rather than its exit code alone. The readiness gate does not satisfy this requirement; abort the release on any failure.

    A run that does not finish now unwinds its own writable-key changes (#1379). Each key is recorded when its write goes out and retired only when its revert is confirmed, and an EXIT trap restores whatever is still outstanding — so a Ctrl-C, a kill, an SSH drop or a cancelled job mid-leg puts max_temp_c, DONATION, watchdog_interval_min or pools back the way the run found it, by the same route that changed it. The unwind names every key it restores on stderr; a run that ends cleanly has nothing outstanding and says nothing.

    Two limits are worth knowing before you rely on it. The restore is best-effort: it dials the dashboard or the rig while the run is already dying, and if that dial fails there is nothing further it can do. And it cannot run at all if the shell never gets to exit — a kill -9, an OOM kill, or the box losing power. In either case the rig is left on a probe value, which is always a near neighbour of what it read off the rig, so nothing is damaged. If a run ended in one of those ways, read the rig's current values in Worker Inspect against what you expect and put a stray one back the same way. This is the same shape as --keep: what the run could not restore, it tells you about, and the rest is yours.

After deploying the published release to the bench, run the non-destructive live sweep as the closing check: tests/integration/run.sh --local --dir <stack-dir> --check. On a bench with no miners connected, add --no-mining-asserts (#905): the two mining assertions skip with a logged notice, and the sweep must then pass with zero failures — any failure is a regression. Without the flag, workers online and stratum total hashes fail on every miner-less bench and have to be eyeballed as "expected", which is exactly the tolerated-known-failure habit the flag exists to end.

Which gates are automated, and which are not

The release lane requires a successful bench-ci/tier4 status on its release SHA, and the main ruleset already requires the same context pinned to the bench-ci App's integration_id — both provisioned under #2237. The bench publishes that status after its full tier-4 suite; release.sh checks the exact SHA, context, App slug, and numeric App id before stage 1. release-gate.yml stays dispatch-only as an operator tool, because a self-hosted runner on a key-holding public-repo box is not registered. It previously carried a push: [main] trigger behind a repo variable nobody set, so every merge recorded a skipped run — and a skipped job is green, which made main display a passing live-node gate that had never once executed (#1048).

Rehearse the status gate on a develop SHA before the freeze, then repeat it on the final cut commit. The bench-ci publisher accepts main, release/*, or a tag as the job ref, not develop. Push release/<full-sha> at that same commit. Load the bench-ci environment and run the following commands in Bash from that checkout. Tiers 1–3 remain GitHub checks.

Before the cut, seed the provision baseline. The provision phase's migration legs (#3260, #3267) need an old image with the same VERSION as the candidate: an earlier develop build of this release, never the previous release. Pick the first develop commit that carries the new VERSION. On one KVM bench, add it to [retention] image_cache_pins and restart that runner while idle. Then submit a local_only tier4-kvm job with phases=["boot"] on that commit to that bench's endpoint. That job only has to publish the image: its verdict does not matter, and no job may wait on it with after, because a failed predecessor cancels its dependents. A pin protects the cached build only once bench-ci's retention sweep reports it held: the sweep refuses new holds while the bench is short of disk headroom, which includes any running KVM job, and the cache budget can then evict the unprotected baseline. Keep other KVM jobs off that bench until the sweep reports the pin held, and confirm the image cache still lists the commit right before submitting provision. The cut cannot seed itself: old_image needs a strictly older build.

Submit eight KVM jobs, each with a 240-minute timeout. A single phases=["all"] job exceeds that cap, and so does the boot group with provision.

  • Boot group: boot, update, install.
  • Rig group: the #1651 phases as the four splits the last three release gates ran — rig, rigmedia and media; fault and reset; image-upgrade; stack. In the 2.0.1 and 2.0.2 gates the combined seven-phase job failed one phase each time and reran all seven; the splits keep a rerun to its own phase. The rig/rigmedia/media split is submitted with require_complete (#3996): bench-ci appends --require-complete to each of its three phases, so a rig phase that skipped the accepted-share leg for want of the reserved Monero node fails the gate instead of concluding success, and rigmedia or media carry the same guard for any input they later start skipping on. The rig phase also missing-skips the card-render leg (#1867) on a harness host without node, so until bench-ci#2480 provisions it there, a rig/rigmedia/media job whose only failed row names that card-render row is the guard refusing a skip, not a candidate defect: read the row before blaming the tree.
  • Provision: provision and setup-defaults against the seeded baseline, pinned to the seeded bench.
  • Crossupdate: the update from the previous release, which is the path existing installs take, pinned to a bench that keeps that release's image.
  • Realupgrade: the opt-in realupgrade phase (#4193). It fetches the newest published appliance image older than the tag (its .sha256 verified), always patches a scratch copy offline (the dev signer appended to the RAUC keyring beside the release certificate, and /etc/pithead-variant set to debug), because the phase can only build a dev-signed debug candidate. A rerun of this phase therefore never boots the published image unmodified: the unmodified signed-release boot is proved by the provision and crossupdate jobs on signed artefacts. It ages the guest through the dashboard, upgrades it through the dashboard to the exact-SHA candidate, then soaks for 10 minutes with one extra reboot and runs the hard-reset negative control. It is one job (62 minutes in bench job 787, under the 240-minute cap); it is the single payload the recipe submits (the candidate is built once; the guest is provisioned twice, for the upgrade/soak and for the negative control); if a measured run needs more, submit realupgrade-main (upgrade and soak) and realupgrade-negctl (the negative control) as two jobs, which makes nine KVM jobs and nine payloads in this recipe; list both job IDs in the e2e job's after and read ten jobs, not nine, at the e2e gate.

Set four inputs first: BASELINE_SHA, the seeded baseline; PROVISION_BENCH_URL, the API base of the bench that pins it; PREVIOUS_RELEASE_SHA, from git rev-parse "vX.Y.Z^{commit}" for the previous release; and CROSSUPDATE_BENCH_URL, the API base of a bench that keeps that release's image. Keep the SHA, ref and returned job IDs for the final e2e submission:

set -euo pipefail
: "${BASELINE_SHA:?full SHA of the seeded baseline}"
: "${PROVISION_BENCH_URL:?API base of the bench that pins BASELINE_SHA}"
: "${PREVIOUS_RELEASE_SHA:?full SHA of the previous release}"
: "${CROSSUPDATE_BENCH_URL:?API base of a bench that keeps the previous release image}"
SHA=$(git rev-parse HEAD) # run from the final develop commit
REF=release/${SHA}
git push origin "${SHA}:refs/heads/$REF"
KVM_BOOT_KEY=$(uuidgen)
printf 'KVM boot group idempotency key: %s\n' "$KVM_BOOT_KEY"
KVM_BOOT_ID=$(jq -n --arg sha "$SHA" --arg ref "$REF" --arg key "$KVM_BOOT_KEY" \
  '{repo:"pithead",commit:$sha,ref:$ref,tier:"tier4-kvm",options:{phases:["boot","update","install"]},timeout_minutes:240,submitted_by:"release/devops",note:"release KVM boot group",idempotency_key:$key}' \
  | curl -fsS -X POST "$BENCH_CI_URL/jobs" -H 'Content-Type: application/json' --data-binary @- | jq -er '.job.id')
KVM_RIG_KEY=$(uuidgen)
printf 'KVM rig/rigmedia/media split idempotency key: %s\n' "$KVM_RIG_KEY"
KVM_RIG_ID=$(jq -n --arg sha "$SHA" --arg ref "$REF" --arg key "$KVM_RIG_KEY" \
  '{repo:"pithead",commit:$sha,ref:$ref,tier:"tier4-kvm",options:{phases:["rig","rigmedia","media"],require_complete:true},timeout_minutes:240,submitted_by:"release/devops",note:"release KVM rig split",idempotency_key:$key}' \
  | curl -fsS -X POST "$BENCH_CI_URL/jobs" -H 'Content-Type: application/json' --data-binary @- | jq -er '.job.id')
KVM_FAULT_KEY=$(uuidgen)
printf 'KVM fault/reset split idempotency key: %s\n' "$KVM_FAULT_KEY"
KVM_FAULT_ID=$(jq -n --arg sha "$SHA" --arg ref "$REF" --arg key "$KVM_FAULT_KEY" \
  '{repo:"pithead",commit:$sha,ref:$ref,tier:"tier4-kvm",options:{phases:["fault","reset"]},timeout_minutes:240,submitted_by:"release/devops",note:"release KVM fault/reset split",idempotency_key:$key}' \
  | curl -fsS -X POST "$BENCH_CI_URL/jobs" -H 'Content-Type: application/json' --data-binary @- | jq -er '.job.id')
KVM_IMGUP_KEY=$(uuidgen)
printf 'KVM image-upgrade split idempotency key: %s\n' "$KVM_IMGUP_KEY"
KVM_IMGUP_ID=$(jq -n --arg sha "$SHA" --arg ref "$REF" --arg key "$KVM_IMGUP_KEY" \
  '{repo:"pithead",commit:$sha,ref:$ref,tier:"tier4-kvm",options:{phases:["image-upgrade"]},timeout_minutes:240,submitted_by:"release/devops",note:"release KVM image-upgrade split",idempotency_key:$key}' \
  | curl -fsS -X POST "$BENCH_CI_URL/jobs" -H 'Content-Type: application/json' --data-binary @- | jq -er '.job.id')
KVM_STACK_KEY=$(uuidgen)
printf 'KVM stack split idempotency key: %s\n' "$KVM_STACK_KEY"
KVM_STACK_ID=$(jq -n --arg sha "$SHA" --arg ref "$REF" --arg key "$KVM_STACK_KEY" \
  '{repo:"pithead",commit:$sha,ref:$ref,tier:"tier4-kvm",options:{phases:["stack"]},timeout_minutes:240,submitted_by:"release/devops",note:"release KVM stack split",idempotency_key:$key}' \
  | curl -fsS -X POST "$BENCH_CI_URL/jobs" -H 'Content-Type: application/json' --data-binary @- | jq -er '.job.id')
KVM_PROV_KEY=$(uuidgen)
printf 'KVM provision idempotency key: %s\n' "$KVM_PROV_KEY"
KVM_PROV_ID=$(jq -n --arg sha "$SHA" --arg ref "$REF" --arg key "$KVM_PROV_KEY" --arg base "$BASELINE_SHA" \
  '{repo:"pithead",commit:$sha,ref:$ref,tier:"tier4-kvm",options:{phases:["provision","setup-defaults"],old_image_commit:$base},local_only:true,timeout_minutes:240,submitted_by:"release/devops",note:"release KVM provision",idempotency_key:$key}' \
  | curl -fsS -X POST "$PROVISION_BENCH_URL/jobs" -H 'Content-Type: application/json' --data-binary @- | jq -er '.job.id')
KVM_CROSS_KEY=$(uuidgen)
printf 'KVM crossupdate idempotency key: %s\n' "$KVM_CROSS_KEY"
KVM_CROSS_ID=$(jq -n --arg sha "$SHA" --arg ref "$REF" --arg key "$KVM_CROSS_KEY" --arg prev "$PREVIOUS_RELEASE_SHA" \
  '{repo:"pithead",commit:$sha,ref:$ref,tier:"tier4-kvm",options:{phases:["crossupdate"],old_image_commit:$prev},local_only:true,timeout_minutes:240,submitted_by:"release/devops",note:"release KVM crossupdate",idempotency_key:$key}' \
  | curl -fsS -X POST "$CROSSUPDATE_BENCH_URL/jobs" -H 'Content-Type: application/json' --data-binary @- | jq -er '.job.id')
KVM_REAL_KEY=$(uuidgen)
printf 'KVM realupgrade idempotency key: %s\n' "$KVM_REAL_KEY"
KVM_REAL_ID=$(jq -n --arg sha "$SHA" --arg ref "$REF" --arg key "$KVM_REAL_KEY" \
  '{repo:"pithead",commit:$sha,ref:$ref,tier:"tier4-kvm",options:{phases:["realupgrade"]},timeout_minutes:240,submitted_by:"release/devops",note:"release KVM realupgrade",idempotency_key:$key}' \
  | curl -fsS -X POST "$BENCH_CI_URL/jobs" -H 'Content-Type: application/json' --data-binary @- | jq -er '.job.id')
printf 'KVM jobs: %s %s %s %s %s %s %s %s @%s\n' "$KVM_BOOT_ID" "$KVM_RIG_ID" "$KVM_FAULT_ID" \
  "$KVM_IMGUP_ID" "$KVM_STACK_ID" "$KVM_PROV_ID" "$KVM_CROSS_ID" "$KVM_REAL_ID" "$SHA"

Read all eight completed KVM jobs' full status, logs, artifacts and evidence. Require success, zero failed rows and a reason for every skip. These jobs run before e2e, so an e2e failure cannot cancel their battery proof. A failed KVM group prevents the final e2e gate from running.

Every KVM job is bound to the exact tag SHA. SHA is the commit that will be tagged; a job whose commit differs from it is not evidence for the release, however recently it passed. Any change after the battery, including a digest re-pin or a version bump, makes the whole KVM set stale: rerun the boot group, the four rig-group splits, provision, crossupdate and realupgrade on the new SHA and read them again before submitting e2e. Crossupdate, provision and realupgrade rerun after any post-battery change, because the update path they prove is the one a digest re-pin or version bump alters. release.sh refuses to publish unless the tag SHA itself carries a successful bench-ci/tier4 status from the configured App, but that check reads only the status on the release commit and never the KVM jobs' commit fields (require_release_status_gate in scripts/release/preflight.sh). Confirming the rerun before publishing is therefore a procedural step the operator verifies, not a tool enforcement. The 2.0.2 release shipped one commit after the commit its crossupdate and provision jobs proved (#3911). Each job is capped at 240 minutes.

The update fault leg (update phase, leg 5) installs a bundle whose dashboard healthcheck fails through the dashboard's own update door, so the in-flight flag is armed. After the fallback it requires the flag's blocking list to name the dashboard container and the served banner module to carry its Blocked by: clause. Both slots of that phase are built from one tree, so they share a version and pithead-boot writes no rolled_back verdict there; the verdict itself is asserted by the realupgrade phase (#3911, #4193), whose slots differ. On any failure the job keeps the failed boot's pithead-boot journal, the verdict JSON, grubenv and the doctor output in pithead-os-serial.log.leg5-evidence and prints it, bounded, to the job log.

Immediately before submitting e2e, have Devops prepare the canonical payout wallet on every bench eligible for this e2e leg. Submit wallet-prepare with empty options to each owning bench's endpoint, using its exact canonical checkout SHA, and inspect its rows and wallet-preparation.json: catch-up, authenticated RPC/configured identity, graceful save, persisted advancement and ordinary reopening must pass. Until bench-ci#1113 is deployed, that tier's missing exit record makes its conclusion unreliable; use the rows and artifact as the owner ruled. bench-ci#1114 owns enabling and proving these fixtures and the retained onion baseline across the eligible fleet. The e2e leg cannot be pinned to the prepared bench. Keep nightly lifecycle runs off those benches until this e2e job starts: uninstall removes the wallet fixture. If preparation or that scheduling window is unavailable, stop before submitting e2e.

Use targeted until the frozen SHA includes the harness fix from #3026; then set E2E_MODE=matrix. Keep the real rig in the run. Only the owner may authorize no_rig after reviewing failures confined to rigforge-control harness rows. The final e2e job alone requests the aggregate status, with the boot group, the four rig-group splits and realupgrade in after. A bench resolves after only against its own jobs, and the provision and crossupdate jobs belong to their pinned benches, so the block first refuses to submit unless both of those completed with success:

for leg in "$PROVISION_BENCH_URL/jobs/$KVM_PROV_ID" "$CROSSUPDATE_BENCH_URL/jobs/$KVM_CROSS_ID"; do
  curl -fsS "$leg" | jq -e '.job.status == "completed" and .job.conclusion == "success"' >/dev/null
done
E2E_MODE=targeted
E2E_KEY=$(uuidgen)
printf 'e2e idempotency key: %s\n' "$E2E_KEY"
jq -n --arg sha "$SHA" --arg ref "$REF" --arg key "$E2E_KEY" --arg mode "$E2E_MODE" \
  --argjson boot "$KVM_BOOT_ID" --argjson rig "$KVM_RIG_ID" --argjson fault "$KVM_FAULT_ID" \
  --argjson imgup "$KVM_IMGUP_ID" --argjson stack "$KVM_STACK_ID" --argjson real "$KVM_REAL_ID" \
  '{repo:"pithead",commit:$sha,ref:$ref,tier:"tier4-e2e",options:{mode:$mode},after:[$boot,$rig,$fault,$imgup,$stack,$real],status_gate:true,submitted_by:"release/devops",note:"release status gate",idempotency_key:$key}' \
  | curl -fsS -X POST "$BENCH_CI_URL/jobs" -H 'Content-Type: application/json' --data-binary @- | jq -er '.job.id'

Read the completed e2e job's full status, log, artifacts and evidence. All nine jobs must carry the same SHA and ref. A failed or cancelled leg cannot yield a successful aggregate status. Confirm the exact commit's newest bench-ci/tier4 status is success and its creator is the configured App before running release.sh; record all nine job IDs and the SHA in the release issue. Remove a rehearsal branch after confirming its status with git push origin --delete "$REF". If a submission is refused, stop and report it to bench-ci; retain its printed idempotency key for a retry.

Gate When Run by Blocking
make test (tiers 1–3) + make lint every PR CI yes
Bench full tier-4 suite (bench-ci/tier4) before release.sh stage 1 bench-ci yes
make test again, on the release box release.sh stage 2 the cut yes
#54 live matrix, --readiness release.sh stage 2 the cut yes
Targeted e2e with a borrowed rig before make release you yes — by policy, not by code
Release signing environment + pinned verifier release.sh stage 1 the cut yes
Staged-image smoke (pull back, check version) release.sh stage 5 the cut yes
release-smoke (real cosign, real #59 upgrade) after publish you no — the assets already exist
release-gate.yml tier-4 live matrix never — unclaimable until a runner registers for [self-hosted, pithead-release] nobody no
Live --check sweep on the bench after deploy you no

The two human-run rows are policy, not automation: the release is not finished until they are green.

Signed releases

Every promoted image digest and the install bundle carry a cosign key signature (#376). The private key lives only on the release server (COSIGN_KEY / COSIGN_PASSWORD, provisioned once — see Release / Validation Server › The release signing key); the public key is committed at the repo root as cosign.pub and ships inside every release bundle, next to pithead. Signing is key-based, not Sigstore keyless: releases are cut from a private box with no CI OIDC identity, and --tlog-upload=false keeps release activity out of the public transparency log — which is why verification passes --private-infrastructure (images) / --insecure-ignore-tlog (the bundle blob). Signatures pin the promoted manifest-list digests — the exact bytes the smoke stage validated — never a mutable tag.

Signing is mandatory to publish, because it is mandatory to consume (#960, #1108). Once cosign.pub is committed it ships in every bundle, so every install from that release on refuses a release with no pithead.tar.gz.sig. A cut made on a box with no key therefore does not produce a degraded release — it produces one every one-click upgrade in the field rejects, and GitHub release assets are immutable, so the signature can never be attached afterwards. That is how v1.18.0 shipped unsigned and had to be withdrawn and re-cut. Preflight now aborts the cut instead, naming what is missing; --unsigned is the explicit, loud way to publish one anyway. The check runs on --dry-run too and only the signing itself is skipped, so a rehearsal reports the decision the real cut will make — it used to sit inside the dry-run guard and could only ever print "signing OFF".

Preflight also proves the pinned verifier before anything is built (#1084): it pulls COSIGN_IMAGE, signs a probe blob with this box's key, verifies it through the container, and requires a tampered blob to be refused. That round trip catches a digest that no longer pulls, an image that is not the cosign it claims to be, and a committed cosign.pub that is no longer the public half of COSIGN_KEY — each of which would otherwise surface as signature verification failed on every install, which reads as tampering rather than as our own pin having moved.

The verifier image is declared once, as the FROM line of build/cosign/Dockerfile, by tag and digest, where Dependabot bumps it. scripts/build-pithead.sh writes the digest reference, without the tag, into COSIGN_IMAGE in the generated pithead; scripts/cosign-image.sh prints the same reference for the live-upgrade and fixture scripts. A second literal anywhere else fails the tier-1 signing test.

The digest is the security control, not housekeeping. Verifying release images by first pulling a verifier is itself an unverified pull. Pinned by digest, a hostile registry can serve only those exact bytes or fail the pull. On a tag it could serve a cosign that exits 0 on everything and turn the gate off. Treat a bump as a supply-chain change: review the Dependabot PR, and the preflight round trip above must pass on it.

pithead verifies before it changes anything:

  • pithead upgrade on a release install with cosign.pub present verifies all five first-party images (cosign verify --key cosign.pub --private-infrastructure) and aborts on the first failure. Nothing is pulled or restarted.
  • The dashboard upgrade (#59) additionally fetches pithead.tar.gz.sig and verifies the downloaded bundle against the key already on disk before extracting a byte. The new bundle's own cosign.pub is never the trust anchor for its own verification, so a malicious bundle cannot vouch for itself; a key rotation reaches installs through a bundle signed with the previous key.
  • Verification fails closed. With cosign.pub present, a bad signature, a stripped pithead.tar.gz.sig, or an image the bundle does not pin by digest each abort the upgrade with a message naming the fix. Only an install with no cosign.pub at all — older than the first signed release — proceeds unverified, with a warning saying exactly that; pithead doctor reports the state.
  • The verifier is a container, not a host binary (#1072): cosign_run invokes a digest-pinned cosign image with the install dir mounted read-only. Operators install nothing, and cosign never appears in the prerequisites. Requiring it on the host made signing a hidden dependency that no prerequisite listed and no dependency check installed — a fresh bundle install dead-ended at first up, and every install cut before signing engaged hit the same wall on its first signed upgrade, after the download and the extract. The release box is the exception: it signs, so it keeps a real pinned cosign (see release-server.md).
  • Source checkouts skip verification: locally built images are unsigned by design.

What the signature does and does not prove: it proves the artifact was produced by the holder of the release key, so a re-pointed GHCR tag, a tampered registry, or a swapped GitHub release asset fails verification. It cannot protect against a compromise of the release server itself, which holds the key and cuts the releases.

Verifying a release

pithead upgrade runs the checks automatically, with no cosign install on the host — it calls a digest-pinned cosign image. To verify by hand instead, use a cosign of your own (pinned install: release-server.md) against the committed cosign.pub:

# An image (repeat per image, or pin the digest from the ingredients manifest):
cosign verify --key cosign.pub --private-infrastructure \
    ghcr.io/p2pool-starter-stack/pithead-dashboard:vX.Y.Z

# The install bundle:
curl -fsSLO https://github.com/p2pool-starter-stack/pithead/releases/download/vX.Y.Z/pithead.tar.gz.sig
cosign verify-blob --key cosign.pub --signature pithead.tar.gz.sig --insecure-ignore-tlog=true pithead.tar.gz

Releases before v1.18.1 are unsigned — that is the first cut whose bundle shipped a pithead.tar.gz.sig, because it is the first tag containing the committed cosign.pub; verification gates every release from it on. If an upgrade sent you here saying cosign is not installed, read the next section — that box needs the host binary once, not a manual verify.

Upgrading an install older than v1.19.1

The verifier became a container in v1.19.1 (#1072). Before that it was a host binary, and an upgrade is driven by the code the box is already running — so an install still on v1.18.1 or v1.19.0 checks command -v cosign on its next one-click upgrade and refuses when the binary is absent:

  • v1.19.0 refuses unconditionally: "cosign is not installed on the host…"
  • v1.18.1 refuses when cosign.pub is present: "cosign.pub is present but cosign is not installed on the host…"

cosign has no apt package, so this is not something an operator can resolve from the message alone — and containerising the verifier does not help the boxes that have not taken the upgrade yet. This bit a production install on 2026-08-15.

The escape path, once per box:

  1. Install the pinned cosign v2.6.3 binary on the host — the snippet in Release / Validation Server › The release signing key. v2.6.3 is the version this project pins and tests. A current cosign v3 also works for this verify — proven with v3.1.3 against real bundles: it accepts the flags these releases pass (--signature with a deprecation warning, --insecure-ignore-tlog=true unchanged) and still refuses a tampered bundle. The v3 breakage that motivated the original "not the newest" warning is in the release box's signing flags (--tlog-upload), not the operator's verify — so a box that already has a v3 binary needs nothing done.
  2. Retry the upgrade from the dashboard. It now passes the old guard, verifies the bundle, and lands on a release whose verifier is the container.
  3. From the next upgrade on the host binary is unused and can be removed.

pithead doctor on v1.19.1 and later answers this before an upgrade rather than during one: it reports whether the pinned verifier image is present, and names the pre-fetch command if it is not. On the older versions doctor cannot report it, which is why it is written here.

Proven on the bench, 2026-08-21. Driven end to end on disposable installs actually running each tag. With no cosign on PATH, v1.19.0 rejected with its exact message above before any network dial; v1.18.1 dialled the release API first (over the stack's own Tor) and then rejected with its own message — a Tor failure on that leg reads as "could not reach the GitHub release API" instead, so retry rather than reinstalling anything. With cosign v2.6.3 back on PATH, both installs completed the one-click upgrade onto v1.19.3, and each upgraded install then ran a full down/up cycle with no host cosign visible — all five images verified by the pinned container. Two behaviours worth knowing before reading them as new walls: the request must name the current latest tag (the runner re-derives it host-side and refuses anything else), and a ten-minute throttle stamp is claimed by some attempts that end rejected — a retry inside that window reports "attempted less than 10 minutes ago" until the stamp ages out.

Post-publish smoke test (#459)

Two features can't be tested before merge, because both need a published release to exist: the #376 cosign verification and the #59 one-click upgrade. The tier-4 matrix tests a branch, not a published artifact, so the pre-merge tests only ever see a fake cosign. Right after make release publishes, run scripts/release/release-smoke.sh once to verify the real thing:

make release-smoke                                     # verify the just-published version
make release-smoke ARGS="--upgrade /srv/code/previous" # + drive the real #59 upgrade

It runs two phases:

  • Real cosign verify. Downloads the published pithead.tar.gz (+ .sig) and the five :vX.Y.Z images and verifies them against the committed cosign.pub. A good signature must pass; a byte-changed bundle must be refused (this is what proves the check is real, not the pre-merge fake); the bundle's own VERSION must equal the tag (the #376 rollback guard); and an unrelated key must be refused. If the release is unsigned — every release before v1.18.1 predates the committed key, and a deliberate --unsigned cut ships without a signature (an unconfigured box aborts the cut instead; see Release / Validation Server › The release signing key) — that is reported plainly and the phase is skipped. It never reports a signed pass for an unsigned release. This phase needs only gh auth and network; run it anywhere.
  • Real #59 upgrade (--upgrade DIR). On a box still running the previous release, it enqueues the exact upgrade intent the dashboard writes into the #33 control spool, runs the host control runner, and asserts the install upgrades cleanly to the published tag over the real download → verify → rollback-guard → extract → pithead upgrade path. This is destructive to that box's stack: run it on the previous-release bench box (stack up, dashboard.control enabled), never on the release host. The one leg it doesn't drive is the browser → dashboard hop (the dashboard container writing the intent), which is unit-covered (#33/#59) and confirmed by clicking the button once by hand.

Conventions

  • Versioning: Semantic Versioning (vMAJOR.MINOR.PATCH), single source of truth in the top-level VERSION file. pithead reads it for tagging/upgrade; the dashboard reads it for display (#58).
  • Changelog: hand-curated CHANGELOG.md following Keep a Changelog + SemVer, with GitHub's auto-generated PR list as a supplement in the release body. (Chosen over Conventional-Commits / release-please automation because the commit style here is human, issue-referencing summaries; curated notes read better for users, and automation can come later if a commit convention is adopted.)
  • Patches: security and component bumps ship as normal patch releases, re-validated through the same gate.
  • Host ports: a release that adds a host-published ports: entry to docker-compose.yml must call it out as upgrade-blocking in the release notes — a host where something else already binds that port fails pithead upgrade at compose up, after images are pulled and config is re-rendered.

Withdrawing a bad release

A published vX.Y.Z tag is immutable: an active tag ruleset blocks deleting or re-pointing any v* tag, so a released version number can never be re-cut — the v1.6.0 withdrawal burned that number for good. When a published release turns out broken:

  1. Supersede it: bump VERSION and cut the next patch through the full gate. Promotion re-points :latest at the good digests.
  2. Edit the bad GitHub Release's notes to a "Superseded by the next patch — do not use" warning, and say so in CHANGELOG.md (the 1.0.0 tombstone and the 1.6.1 "Supersedes 1.6.0" header are the precedents).
  3. Operators already on the bad version roll back per Operations › The deploy-box layout.

Install & upgrade

  • Install: download the release's compose bundle (or git checkout vX.Y.Z) → ./pithead setup. Images are pulled from GHCR; no local build.
  • Upgrade: the dashboard shows "vX.Y.Z available" (#59) → run ./pithead upgrade → it pulls the new single-tagged images and recreates only what changed.
  • Every published version is one immutable, #54-validated bundle; release notes list what's inside and what changed.

Status

What exists today:

  • ✅ Top-level VERSION file (single source of truth).

  • ✅ CHANGELOG.md (Keep a Changelog + SemVer, with an Unreleased section).

  • ✅ This document.

  • ✅ The #54 integration test suite: the live config-matrix gate against real nodes (tests/integration/, make test-integration). See Integration Testing.

  • ✅ The dashboard version badge (#58): VERSION + git build-args baked into the dashboard image (env + OCI labels); shows vX.Y.Z on releases and dev · branch @ hash otherwise.

  • ✅ The release pipeline, scripts/release/release.sh (make release). Implements the full preflight → test gate (make test + the #54 matrix, blocking) → build (OCI labels + PITHEAD_RELEASE=1) → stage to :vX.Y.Z-rc.N → smoke-verify the pushed images → promote-by-digest to :vX.Y.Z + :latest → publish the GitHub Release. It generates the ingredients manifest (promoted digests + upstream pins) and a pinned install bundle as release assets, never starts the live stack on the build host, and never prints the registry token. Preview any run with make release ARGS="--dry-run".

  • ✅ Signed releases (#376): the pipeline cosign-signs the promoted digests + the bundle, pithead upgrade and the dashboard upgrade verify against the committed cosign.pub and fail closed. See Signed releases.

  • ✅ Installed OS packages recorded per release (#4254): the GitHub Release carries os-packages-<tag>.txt, the ingredients manifest counts each image's packages, and a weekly watch checks the list against OSV and keeps one dependencies issue of the packages with fixed advisories.

  • ✅ Pull-based install: ${STACK_VERSION} wired through docker-compose.yml. Each first-party service now carries an image: ${PITHEAD_REGISTRY:-…}/pithead-<svc>:${STACK_VERSION:-dev} ref alongside its build:. pithead picks build-vs-pull automatically: a source checkout (the image Dockerfiles are present) builds locally and tags :dev with --pull never, after pulling any missing third-party image that has no build context (#2654); a release install (the bundle ships no Dockerfiles, just pithead + VERSION + compose + the config templates + the ./build runtime mounts) resolves STACK_VERSION to vX.Y.Z and pulls the published images (--pull missing; upgrade forces a re-pull). Override with PITHEAD_REGISTRY / PITHEAD_PULL. So a release is now cp config.minimal.json config.json && ./pithead setup, no local build.

Remaining:

  • ⬜ The dashboard "new version available" update warning (#59), which builds on the version badge. Tracked separately.

NOTE: before the first real release, choose the first published version. Set VERSION (the pyproject.toml metadata follows it, enforced by the drift-guard test) and confirm the GHCR image namespace (scripts/release/release.sh defaults to ghcr.io/p2pool-starter-stack/pithead-*; override with PITHEAD_REGISTRY / PITHEAD_IMAGE_PREFIX).