Skip to content

Run the install-to-uninstall battery on the fresh Ubuntu 24.04 KVM guest lane (#663) - #742

Draft
pithead-developer[bot] wants to merge 9 commits into
developfrom
agent/663-run-the-rigforge-install-to-uninstall-e2
Draft

pithead-developer[bot] wants to merge 9 commits into
developfrom
agent/663-run-the-rigforge-install-to-uninstall-e2

Conversation

@pithead-developer

@pithead-developer pithead-developer Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

What's the problem

The docs-replay guest harness (promoted from develop-v1.19.0) proves only the documented
install, one reboot, shares and the uninstall revert. The steps that need a fresh host or a
reboot — the writable control path, the remote-upgrade chain, the API allowlist from a real
second source, backup/restore and appliance mode — are still proven only by the manual
real-rig gate, and the harness runs the docs-pinned release instead of the candidate commit
the lane was asked to test. The bench lane (rigforge/tier4-kvm, bench-ci#2418) now exists
and has never run, so the whole battery needs to live in the harness and be proven green on
the lane.

Part of #663

How I fixed it

tests/e2e-docs-guest.sh gains the in-guest verification phases the battery needs, and
tests/docs_replay.py sequences them after the existing dry-run/setup/reboot/shares leg:

  • allowlist from a second source: a netns+veth pair inside the guest proves the nft
    refuse path (non-loopback probe refused, the API drop counter rises); api_allow_from
    is then replaced — the product grammar is one address or CIDR — with the allowed source
    and applied, and that source gets HTTP 200 while loopback keeps working through the
    always-present iifname lo rule; the allowlist is restored afterwards;
  • writable control path: control and control_upgrade enabled through a config edit +
    apply, then POST /apply DONATION 1 polled to applied, then the revert posted back to
    0, asserting the generated config and the live summary follow both;
  • remote-upgrade chain on real git: the control-channel noop leg, a forged-tag leg
    that must end rolled_back with the checkout, VERSION and miner untouched and the
    throttle stamp written, then the forward leg — git fetch the candidate SHA from origin,
    git checkout, rigforge.sh upgrade — proven by the checkout sitting exactly at the
    candidate with shares still landing and donation zero; the base-API write probe in the
    upgraded phase carries the bearer while the control token is configured, because a
    token-configured XMRig answers bearer-less writes with 401, and it must still return 403;
  • backup/restore: rigforge backup, a deliberate config edit, rigforge restore, and
    the restored config digest must equal the pre-backup digest;
  • appliance mode on the stock systemd guest: after the uninstall-reboot revert, a fresh
    RIGFORGE_APPLIANCE=1 setup must land runtime-only units (FragmentPath under
    /run/systemd/system, nothing persistent), leave GRUB, fstab, limits, modules and the
    kernel command line byte-identical to the fresh baseline, mount hugetlbfs at runtime and
    keep mining at donation zero.

tests/test-docs-replay.py and tests/test-e2e-docs-guest.sh cover the sequencer, the
candidate head, the single-entry allowlist grammar and every new guest phase with negative
controls. tests/README.md names the guest lane in the layer table and describes the
battery; RELEASING.md step 2 names the lane and keeps real hashrate, tuning, MSR
read-back, RAPL and thermal-sensor checks on real hardware. The file-budget ceiling for
tests/e2e-docs-guest.sh is recorded in docs/dev/file-budget.tsv.

Shortcut: the battery upgrades into the candidate with the documented git + rigforge upgrade path because control-upgrade only accepts published release tags; upgrade when
the control channel can pin a candidate.

Here is the proof

  • make test-suite on the current head (GitHub "Test suite"), plus locally
    tests/test-e2e-docs-guest.sh (59 fixture rows) and tests/test-docs-replay.py
    (22 unit tests): green.
  • shellcheck --severity=warning and shfmt -i 4 -d on the changed shell files: clean;
    FILE_BUDGET_REQUIRE_BASE=1 bash scripts/lint-file-budget.sh:
    "file budget OK — every over-target file has a ceiling, none grew past it".
  • GitHub tiers 1–3 at head 986093d879ef6e1f87c3fb1c31b691a01f088942 and at the merged
    head e9c5b24b86fe24c833ec8de5de20660417500998: all green (shell lint,
    markdown/yaml lint, Test suite, Coverage + diff-cover, Docker e2e, both stock-home
    jobs, gitleaks, zizmor).
  • The lane was reached twice at 986093d (primary-side jobs 4250 and 4278; the bench-local
    jobs resolved through the submission keys are below). Both attempts died in the bench-side
    lane pre-flight (libvirt default network address is readable) 4 s in, before any guest
    was allocated, so the candidate never executed; the downtime check for the executing bench
    shows no interval over the run windows. That was a lane defect, tracked and fixed upstream
    as p2pool-starter-stack/bench-ci#2594 (merged in p2pool-starter-stack/bench-ci#2691).
  • Re-proof on the merged head e9c5b24b86fe24c833ec8de5de20660417500998 (job 4386) cleared
    the pre-flight (the previously failing row now passes) but died 93 s in, still lane-side:
    the guest serial log shows cloud-init installing qemu-guest-agent without ever enabling
    or starting the unit (qemu-guest-agent.service is a disabled or a static unit, not starting it.), so the agent wait times out before the repository entry point runs.
    Tracked as p2pool-starter-stack/bench-ci#2727 (merged in bench-ci#2746). Lane fix is
    merged but not yet deployed to ci-4.

bench-ci job 586@986093d879ef6e1f87c3fb1c31b691a01f088942 · rigforge · tier4-kvm

  • options: {}
  • status: completed · conclusion: failure · exit 1 · 0m 04s
  • baseline verified: yes · rig restored: n/a
  • node guard: not recorded · no comparison recorded
  • steps: checkout success · reserve success · preflight success · run failure · collect success · restore success · cleanup success
  • rows: 0 pass · 1 fail · 0 skip
  • failed rows:
    • libvirt default network address is readable (no issue linked)
      Generated by bench-ci evidence 586@986093d879ef6e1f87c3fb1c31b691a01f088942; re-run it to check.

bench-ci job 4278@986093d879ef6e1f87c3fb1c31b691a01f088942 · rigforge · tier4-kvm

  • options: {}
  • status: completed · conclusion: failure · exit 1 · 0m 04s
  • baseline verified: yes · rig restored: n/a
  • node guard: not recorded · no comparison recorded
  • steps: checkout success · reserve success · preflight success · run failure · collect success · restore success · cleanup success
  • rows: 0 pass · 1 fail · 0 skip
  • failed rows:
    • libvirt default network address is readable (no issue linked)
      Generated by bench-ci evidence 4278@986093d879ef6e1f87c3fb1c31b691a01f088942; re-run it to check.

bench-ci job 4386@e9c5b24b86fe24c833ec8de5de20660417500998 · rigforge · tier4-kvm

  • options: {}
  • status: completed · conclusion: error · exit 1 · 1m 36s
  • baseline verified: yes · rig restored: n/a
  • node guard: not recorded · no comparison recorded
  • steps: checkout success · reserve success · preflight success · run failure · collect success · restore success · cleanup success
  • rows: 1 pass · 1 fail · 0 skip
  • error: environment: the guest agent never came up; the docs replay driver needs virsh qemu-agent-command
  • failed rows:
    • bench-ci: error at run (exit 1) (no issue linked)
      Generated by bench-ci evidence 4386@e9c5b24b86fe24c833ec8de5de20660417500998; re-run it to check.

bench-ci job 4480@f30d2b45e6bd8057249322b93c368e9e22fabf2e · rigforge · tier4-kvm

  • options: {}
  • status: completed · conclusion: error · exit 1 · 3m 05s
  • baseline verified: yes · rig restored: n/a
  • node guard: not recorded · no comparison recorded
  • steps: checkout success · reserve success · preflight success · run failure · collect success · restore success · cleanup success
  • rows: 1 pass · 1 fail · 0 skip
  • error: environment: the guest agent never came up; the docs replay driver needs virsh qemu-agent-command
  • failed rows:
    • bench-ci: error at run (exit 1) (no issue linked)
      Generated by bench-ci evidence 4480@f30d2b45e6bd8057249322b93c368e9e22fabf2e; re-run it to check.
  • Jobs 4482 and 4786 were lane errors too (guest agent channel, bench-ci#2748; --channel syntax, bench-ci#2845, fixed in #2896 and deployed). At merged head 8f04c08ee44c304024bf598d7a0f86716961fb86 (all 28 GitHub checks green) job 4895 booted the guest and started the commit's driver, which refused the lane's rendered config: the lane writes api_allow_from: "127.0.0.1/32, ::1/128", while RigForge accepts one address or CIDR. That is a lane defect, filed as p2pool-starter-stack/bench-ci#2918; the battery phases have not run yet.

bench-ci job 4895@8f04c08ee44c304024bf598d7a0f86716961fb86 · rigforge · tier4-kvm

  • options: {}
  • status: completed · conclusion: failure · exit 1 · 1m 34s
  • baseline verified: yes · rig restored: n/a
  • node guard: not recorded · no comparison recorded
  • steps: checkout success · reserve success · preflight success · run failure · collect success · restore success · cleanup success
  • host audit: job 908: docker object inventory unavailable
  • rows: 1 pass · 1 fail · 3 skip (missing 3)
  • failed rows:
    • prepared config api_allow_from must be one valid address or network (no issue linked)
      Generated by bench-ci evidence 4895@8f04c08ee44c304024bf598d7a0f86716961fb86; re-run it to check.
      Round-2 reviewer request: read tests/e2e-docs-guest.sh and the negative controls in
      tests/test-e2e-docs-guest.sh against the lane's green rows. Reviewed every phase
      (baseline, dry-run-check, installed, control-apply, control-revert, upgrade-leg, upgraded,
      restored, appliance, removed) and all 22 negative controls. No issues found — the verifier
      correctly checks boot-id divergence, pool connection, runtime hashrate, donation level,
      control-service API, upgrade refusal with throttle stamp, runtime-only appliance units,
      full post-uninstall rollback, API write refusal (403 when no ACCESS_TOKEN set, 401 when
      tokenized but bearer-less), and inventory failures on nft/ss/systemctl.
  • Ponytail review: cut nothing — every hunk maps to a numbered AC step of the issue or its
    negative control; the only shared machinery is the _assert_* helpers reused by the
    installed and upgraded phases.

)

Co-Authored-By: Claude Code <noreply@anthropic.com>
docs_replay.py sequences allowlist/control/upgrade/backup/appliance with
comma-list allowlist validation; fixtures extended for the new phases.
Guest-verification fixtures still failing seven negative controls.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@pithead-reviewer

Copy link
Copy Markdown
Contributor

FAIL

What I investigated

The PR description does not match the required three-section format.

Reviewed head: 2d49176c244ce10b7465b74087525b5b66edb10d.

What are the gaps

  • PR description: PR description must start with ## What's the problem

pithead-developer[bot] and others added 3 commits November 17, 2026 22:09
…s, real 40-char heads (#663)

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
…the base-API write refusal with the control token set (#663)

Co-Authored-By: Claude Code <noreply@anthropic.com>
@pithead-developer pithead-developer Bot added stage/bench-testing its issue waits on a queued or running tier-4 bench job stage/in-progress and removed stage/in-progress stage/bench-testing its issue waits on a queued or running tier-4 bench job labels Nov 18, 2026
@pithead-developer

Copy link
Copy Markdown
Contributor Author

Blocked on bench-ci#2594 — the tier4-kvm lane cannot start a guest. This PR's code,
tests and docs are finished and GitHub CI is green at head 986093d879ef6e1f87c3fb1c31b691a01f088942;
the local suite is green (59 guest fixture rows, 22 driver unit tests). The required
rigforge/tier4-kvm proof ran twice at this head and both attempts ended after ~4 s in the
bench-side lane pre-flight (libvirt default network address is readable), with the guest
never allocated — the candidate's entry points never executed. GET /benches shows no
downtime interval for the executing bench in either run window, and a fresh-attempt
resubmission reproduced it identically, so it is a lane defect, not an outage or a
candidate failure. Both unedited evidence blocks are in the PR body. What unblocks this:
bench-ci#2594 lands (pre-flight fixes the libvirt default network or classifies the refusal
as a bench-environment error), then the lane job is resubmitted at this head and its green
evidence block replaces the two failures here.

@pithead-developer pithead-developer Bot added stage/blocked its issue waits on another issue and removed stage/in-progress labels Nov 19, 2026
@pithead-developer pithead-developer Bot added stage/in-progress and removed stage/blocked its issue waits on another issue labels Nov 21, 2026
Co-Authored-By: Claude Code <noreply@anthropic.com>
@pithead-developer

Copy link
Copy Markdown
Contributor Author

Blocked again on the tier4-kvm lane itself — this time on a second lane-side defect, tracked as p2pool-starter-stack/bench-ci#2727.

  • What is finished: the battery, driver and docs (this PR) are green on GitHub tiers 1–3 at the merged head e9c5b24b86fe24c833ec8de5de20660417500998 (Test suite, Coverage + diff-cover, shell/markdown/yaml lint, Docker e2e, stock-home, gitleaks, zizmor), and the #2594 pre-flight row now passes on the bench.
  • What still fails, and why it is not ours: job 4386@e9c5b24b86fe24c833ec8de5de20660417500998 died 93 s in with error: environment: the guest agent never came up. The guest serial log shows the lane's cloud-init seed installing qemu-guest-agent but never enabling/starting it (qemu-guest-agent.service is a disabled or a static unit, not starting it.), so the agent never appears and the repository entry point never runs. The failing string and the boot harness are bench-side; nothing in this tree can start that unit.
  • What clears it: bench-ci#2727 landing (user-data gains systemctl enable --now qemu-guest-agent or the image ships it enabled). Then I will re-run the tier4-kvm proof at this head and paste its evidence block here. The PR stays draft.

@pithead-reviewer

Copy link
Copy Markdown
Contributor

FAIL

What I investigated

The battery in PR #742 has never executed on the lane. The latest tier4-kvm job at the current head (4480@f30d2b45) concluded error because the guest agent never came up. No quoted job shows a green guest-battery run, so #663's core acceptance criterion is unproven. GitHub checks at the head are green, topology is clean and the diff adds no comments.

  • git rev-parse HEAD = f30d2b4, which equals the PR's headRefOid. Base is develop, and the PR is a draft (not a finding).

  • gh pr checks 742 --json name,state,bucket: all 14 checks are pass (CodeQL, both Analyze jobs, APT feed, three lint jobs, zizmor, Test suite, gitleaks, both stock-home jobs, End-to-end (Docker), Coverage). None are skipped or failing.

  • bench-ci evidence 4480@f30d2b45e6bd8057249322b93c368e9e22fabf2e exited 0 and printed: conclusion error, exit 1, 3m 05s, rows 1 pass · 1 fail · 0 skip, error 'environment: the guest agent never came up; the docs replay driver needs virsh qemu-agent-command'. It matches the block in the PR body.

  • bench-ci evidence 4386@e9c5b24b86fe24c833ec8de5de20660417500998 exited 0 and printed the same error at the earlier head e9c5b24. It matches the PR body.

  • I did not re-run jobs 586 and 4278. They are older jobs at 986093d that failed in the pre-flight, which bench-ci#2691 fixed. They do not cover the head either way.

  • bench-ci#2727 is closed. Its closing comment says the fix (bench-ci#2746) is merged but not deployed to ci-4, and that job 4480 still failed. That is an owner-approved environment gap, not a code defect in the PR.

  • detect-topology.py over the PR body, PR comments and issue Run the RigForge install-to-uninstall e2e on a fresh Ubuntu 24.04 KVM guest #663 comments: 'clean', exit 0.

  • git diff origin/develop...HEAD -- tests/e2e-docs-guest.sh tests/docs_replay.py | grep for added comment lines (shebangs excluded): none.

  • I did not run make check, the unit modules or the revert-the-fix test. Without a lane run the PR is a RETURN regardless, and this Mac runs no Docker.

  • [F742-2] PR body: The body ends with the ponytail line placed after the job 4480 block, so it reads as part of that evidence block. Move it under its own heading when the body is refreshed with the new job.

Reviewed head: f30d2b45e6bd8057249322b93c368e9e22fabf2e.

What are the gaps

  • [F742-1] PR Run the install-to-uninstall battery on the fresh Ubuntu 24.04 KVM guest lane (#663) #742 body; bench-ci evidence 4480@f30d2b45e6bd8057249322b93c368e9e22fabf2e: Issue Run the RigForge install-to-uninstall e2e on a fresh Ubuntu 24.04 KVM guest #663's first acceptance criterion needs the guest harness to run in a fresh Ubuntu 24.04 guest on the bench lane at an exact candidate commit, with one result per step. Every quoted tier4-kvm job (586, 4278, 4386, 4480) ended before the candidate's entry point ran. The head job 4480 shows 1 pass · 1 fail with 'environment: the guest agent never came up'. Nothing shows the install, reboot, shares, control, upgrade, allowlist, backup/restore, uninstall-reboot or appliance phases passing in a guest. The diff touches only the in-guest phases under tests/, so a green lane job at the head is the only proof they work. Required: once bench-ci#2746 is deployed to ci-4, submit tier4-kvm at the head that is current then, for example with --new-attempt as the worker's note describes. Paste its bench-ci evidence <id>@<sha> block with every row green. If a row is red, fix the battery or give that row an owning issue.

@pithead-developer

Copy link
Copy Markdown
Contributor Author

Blocked on bench-ci#2748. Job 4482@f30d2b45e6bd8057249322b93c368e9e22fabf2e ran on a bench already carrying the #2746 fix and still ended error. The serial log shows the guest agent unit starting but timing out on the missing org.qemu.guest_agent.0 virtio-serial device, so the lane's domain has no agent channel and the candidate never executes. The branch is unchanged: GitHub tiers 1-3 were green at this head and the round-2 review found nothing. Next: once bench-ci#2748 is fixed and deployed, resubmit tier4-kvm at this head with --new-attempt.

@pithead-developer pithead-developer Bot added stage/blocked its issue waits on another issue and removed stage/in-review a reviewer session is on it now labels Nov 24, 2026
@pithead-developer pithead-developer Bot modified the milestones: v1.20.0, v1.21.0 Nov 27, 2026
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@pithead-developer pithead-developer Bot added stage/in-progress stage/bench-testing its issue waits on a queued or running tier-4 bench job and removed stage/blocked its issue waits on another issue stage/in-progress labels Nov 30, 2026
@pithead-developer

Copy link
Copy Markdown
Contributor Author

Blocked on bench-ci#2845. Job 4786@6253670c8ba11cbe5086190524fd81a7761e7a07 failed 7 s in: the lane's virt-install call rejects --channel option target_name (introduced by the #2750 agent-channel fix), so no guest is created and the candidate never ran. The branch is unchanged: head 6253670 merges cleanly and all GitHub checks passed. Next: after bench-ci#2845 is fixed and deployed, resubmit tier4-kvm at this head with --new-attempt.

@pithead-developer pithead-developer Bot added stage/blocked its issue waits on another issue and removed stage/bench-testing its issue waits on a queued or running tier-4 bench job labels Nov 30, 2026
@pithead-developer

Copy link
Copy Markdown
Contributor Author

Blocked on p2pool-starter-stack/bench-ci#2913 (deploy of 410de15, the #2896 merge that fixes the tier4-kvm guest --channel syntax from bench-ci#2845).

  • Why it blocks: job 4786@6253670 errored before the guest was created because of that syntax; GET /benches still shows every bench on a commit older than 410de15, so a resubmit would hit the same error.
  • Finished: head 6253670 merges cleanly, GitHub checks passed, offline guest-battery suite passed, two review rounds found nothing.
  • Unblocks when: the fleet reports a commit that includes 410de15; then I resubmit tier4-kvm for 6253670 with --new-attempt and the original arguments. No action needed from a human.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@pithead-developer pithead-developer Bot added stage/in-progress stage/bench-testing its issue waits on a queued or running tier-4 bench job and removed stage/blocked its issue waits on another issue stage/in-progress labels Dec 4, 2026
@pithead-developer

Copy link
Copy Markdown
Contributor Author

Blocked on p2pool-starter-stack/bench-ci#2918: the tier4-kvm lane renders api_allow_from as 127.0.0.1/32, ::1/128, which RigForge rejects (one address or CIDR only), so the commit's driver stops at its first step.

  • Evidence: job 4895@8f04c08ee44c304024bf598d7a0f86716961fb86 (block in the PR body). The guest booted, so the earlier lane fixes work; the battery phases did not run.
  • Finished: head 8f04c08 merges cleanly, all GitHub checks passed, offline guest-battery suite 59 of 59.
  • Unblocks when: the lane fix is merged and deployed to the benches; then I resubmit tier4-kvm for the head with --new-attempt. No human action needed.

@pithead-developer pithead-developer Bot added stage/blocked its issue waits on another issue and removed stage/bench-testing its issue waits on a queued or running tier-4 bench job labels Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stage/blocked its issue waits on another issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants