Skip to content

feat(role): read each node's link medium on its host and report it - #204

Merged
Mearman merged 2 commits into
mainfrom
feat/role-link-medium
Nov 3, 2026
Merged

Mearman merged 2 commits into
mainfrom
feat/role-link-medium

Conversation

@Mearman

@Mearman Mearman commented Nov 3, 2026

Copy link
Copy Markdown
Member

The role controller ranks hosts wired before Wi-Fi, but a node in a container or a VM can only see its own virtual interface: every Docker node read unknown, and a node in a Colima VM would read its virtio NIC as wired whatever the Mac uses. This reads the medium on the host and carries it through to fleet-role-status.

The cluster role reads it in each run that publishes the voter labels (tasks/link.yml, files/node-link.sh) and passes it to k3s as github-runner.exadev.com/link beside them. On a Mac with a bridged Colima profile it is the medium of the interface network.interface names, from the hardware port networksetup -listallhardwareports lists it under (Wi-Fi is wifi, a port named for Ethernet or LAN is wired, anything else unknown); for any other Mac runtime, and on Linux, it is the medium of the interface the default route leaves by, on Linux from its /sys/class/net entry. Read by hand against the fleet's Macs, the reader gives wifi for m1's en0 (the interface its node profile is bridged to) and wired for the mini's.

The probe now sources the same reader, reports the label's value when its node has one and its own interface's otherwise, and says which (link_source); the controller puts both in the status and names the link in its log. The ARC role passes the label's name and checks it is a label key distinct from the voter labels.

Turning this on for a fleet that already publishes the voter labels adds one label, so its first run recreates each Docker node and restarts each native one, as any label change does.

The values are wired, wifi and unknown, the vocabulary the probe and the controller's ranking already use.

Tests: tests/unit/test_node_link.py (the macOS reader against stand-ins for networksetup and route, and tasks/link.yml through the role for a bridged, a shared and a non-Colima Mac and a Linux host), the probe's label precedence in test_fleet_role_probe.py, the label in the Docker and native configurations, the ARC role's checks, and the role_controller mesh scenario now asserting that every probe reports the label the role published.

Refs #201
Refs #184

A node in a container or a VM sees only its own virtual interface,
so the role controller's probe cannot tell a Mac's Wi-Fi from its Ethernet.
The role now reads the medium on the host itself, in every run that publishes
the voter labels, and passes it to k3s as github-runner.exadev.com/link
(wired, wifi or unknown) beside them.

On a Mac with a bridged Colima profile the medium is that of the interface
network.interface names, mapped through the hardware port networksetup
lists it under; on any other Mac runtime, and on Linux, it is that of the
interface the default route leaves by, on Linux from its /sys/class/net entry.
files/node-link.sh does the reading so that the probe can share it.
…e with

The probe reads its node's github-runner.exadev.com/link label from the
nodes it already lists each sample and reports that medium, falling back to
its own interface's only when the node has no such label: a k3s container's
veth reads unknown, and a VM's virtio NIC reads wired over a Mac's Wi-Fi.
Each sample says which it used (link_source), and the controller carries both
into fleet-role-status and names the link in its log.

The probe now sources the cluster role's link reader from the image rather
than keeping its own copy, and the ARC role passes the label's name
(github_runner_arc_role_controller_link_label, from the cluster role's) to it
and checks it is a label key distinct from the voter labels.
@Mearman
Mearman marked this pull request as ready for review November 3, 2026 18:36
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ⚠️ Failed 2026-11-03T18:36:33.438600Z
We couldn’t complete this review. Comment @codex security review to try again.
bc99623 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins.

@Mearman
Mearman merged commit 06f8977 into main Nov 3, 2026
37 checks passed
@Mearman
Mearman deleted the feat/role-link-medium branch November 3, 2026 18:36
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 2.29.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant