Skip to content

ci: probe namespace.so runners for KVM/kernel-dependent jobs - #3352

Closed
tomassrnka wants to merge 3 commits into
mainfrom
ci/namespace-kernel-probe
Closed

ci: probe namespace.so runners for KVM/kernel-dependent jobs#3352
tomassrnka wants to merge 3 commits into
mainfrom
ci/namespace-kernel-probe

Conversation

@tomassrnka

Copy link
Copy Markdown
Member

What

Follow-up to #3332 (Blacksmith attempt, blocked on their 6.6 kernel lacking UFFD_FEATURE_WP_ASYNC). This probes namespace.so runners as an alternative host for the jobs still on GitHub larger runners (orchestrator unit shards + integration tests ≈ 80% of paid CI minutes).

Per runner (x64 nscloud-ubuntu-24.04-amd64-8x16, arm64 nscloud-ubuntu-24.04-arm64-4x8):

  • uffd WP_ASYNC handshake — a compiled UFFDIO_API probe requesting the orchestrator's exact feature set (WP_ASYNC | EVENT_REMOVE | MISSING_HUGETLBFS). This is the check that would have failed on Blacksmith; requires kernel ≥ 6.7.
  • nbd driver (present / modprobe / linux-modules-extra fallback)
  • /dev/kvm (x64 verdict-gating), tun, cgroup2, hugepages, uffd sysctl, swapfile behavior
  • kernel version + config dump for the record

Green x64 job = all hard requirements met → the migration is flipping the same three runner labels as #3332 attempted.

Note: if jobs sit in "Waiting for a runner", the Namespace GitHub app isn't installed/enabled for this repo yet — that's step 0.

🤖 Generated with Claude Code

tomassrnka and others added 2 commits July 23, 2026 11:10
Checks everything that blocked or nearly blocked Blacksmith (closed PR
3332): uffd UFFD_FEATURE_WP_ASYNC via a real UFFDIO_API handshake (the
actual blocker - needs kernel >= 6.7), nbd driver availability, /dev/kvm,
hugepages, cgroup2, swap. Temporary; deleted once the verdict is in.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cla-bot cla-bot Bot added the cla-signed label Jul 23, 2026
@cursor

cursor Bot commented Jul 23, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
CI-only diagnostic workflow with read-only repo permissions; no application or infrastructure code changes.

Overview
Adds a temporary path-filtered PR workflow that runs on Namespace (nscloud) matrix runners to see if they can replace GitHub larger runners for orchestrator unit shards and integration tests. It logs kernel/device diagnostics, compiles and runs a userfaultfd probe that mirrors the orchestrator’s UFFDIO_API feature set (especially WP_ASYNC), validates nbd and /dev/kvm on x64, and smoke-tests hugepages, unprivileged uffd, and swap before a short pass/fail verdict. Intended to be removed once migration is decided.

Reviewed by Cursor Bugbot for commit 05ca3cb. Bugbot is set up for automated code reviews on this repo. Configure here.

grep -q . /proc/swaps && [ "$(wc -l < /proc/swaps)" -gt 1 ] && echo "swap already active" || {
sudo fallocate -l 256M /swapfile-probe && sudo chmod 600 /swapfile-probe && sudo mkswap /swapfile-probe && sudo swapon /swapfile-probe && sudo swapoff /swapfile-probe
}
echo "HOST_SMOKE_OK"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hugepage smoke skips allocation check

Medium Severity

The hugepage smoke writes nr_hugepages and then reports success without reading the value back. The kernel can accept that write while allocating fewer pages or none, so the job can still go green when hugepages are not actually available.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 84cf9dc. Configure here.

The first two runs queued while the Namespace app did not yet cover this
repo - workflow_job events are not re-delivered after access changes, so
a fresh push is needed. The 22.04 canary uses the exact label from their
docs in case the 24.04 labels are not offered.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 05ca3cb. Configure here.

echo "kernel=$(uname -r) NBD=$NBD_OK KVM=$KVM_OK (WP_ASYNC verdict is the uffd handshake step)"
$NBD_OK
# KVM is required on x64 only (no arm64 runner anywhere has it)
if [ "${{ matrix.arch }}" = "x64" ]; then $KVM_OK; fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict ignores failed NBD check

Medium Severity

The Verdict step runs under set -x only, so $NBD_OK does not fail the step when it expands to false. On x64 a later successful $KVM_OK masks it; on arm64 the trailing if always exits 0. A missing NBD device can still produce a green job.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 05ca3cb. Configure here.

@ValentaTomas
ValentaTomas force-pushed the main branch 2 times, most recently from 5aad415 to d71980e Compare July 25, 2026 22:53
tomassrnka added a commit that referenced this pull request Jul 30, 2026
Each compression config runs the whole suite on one runner, where
api/templates alone sets the wall clock: 853s of the 856s test step under
zstd1, because go test caps every package at -parallel=4. Splitting a config
across jobs is the only lever that moves that, so this adds the machinery.

scripts/select-tests.sh enumerates the top-level tests from the source tree
and bin-packs each package across the shards using recorded per-test times,
so every shard holds a slice of every package, a newly added test always
lands in exactly one shard, and the shards finish at roughly the same time.
update-test-weights.go refreshes the recorded times from a run's JUnit files.

SHARDS defaults to 1, so this changes nothing until someone turns the dial.
Measured at 4 shards the slowest job drops 20.1m -> 11.3m, but the
infra-tests pool only served ~6 concurrent runners, so the extra jobs spent
their savings queueing and end-to-end got worse. Raise SHARDS alongside more
capacity (#3352), not before.
@tomassrnka

Copy link
Copy Markdown
Member Author

Closing — not pursuing the namespace.so runner probe for now. The integration-suite speed-up landed via work reduction instead (#3462: 21.5m → 11.1m end-to-end, no extra runner capacity needed).

@tomassrnka tomassrnka closed this Jul 30, 2026
@tomassrnka
tomassrnka deleted the ci/namespace-kernel-probe branch July 30, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant