Skip to content

Commit 813ce81

Browse files
authored
Group ARC runners by mt-* label on runners HUD (#8097)
Runners with names like `mt-l-x86aavx2-189-704-a10g-8-c8z6d-runner-4q77c` were all collapsing into the `unknown` bucket on https://hud.pytorch.org/runners/pytorch. OSDC runners for some reason are registered on GitHub with `labels: []` and `os: "unknown"` (checked by running `orgs/pytorch/actions/runners` API directly). The label-based grouping in `getRunnerGroupLabel` has nothing to match on, and the existing name-based fallback only recognizes dotted prefixes (ROCm-style), so every ARC pod fell through to `unknown`. Fix: parse the runner name. ARC pod names always have the shape `<scaleset>-<replicaset-hash>-runner-<pod-hash>`, where `<scaleset>` is also what workflows put after `runs-on:` and what is stored in `torchci/lib/arcRunnerMapping.ts`. A new fallback regex `^(mt-.+)-[a-z0-9]+-runner-[a-z0-9]+$` strips the suffix and returns the scaleset, so all pods in the same scaleset now group together. Today only the `mt-` (Meta) provider prefix is in active use. A `TODO` is left to expand to other providers (`lf/am/in/nv/ib`) and the `c-` canary prefix once those fleets come online. The scaleset format is documented in [pytorch/ci-infra:osdc/docs/runner_naming_convention.md](https://github.com/pytorch/ci-infra/blob/main/osdc/docs/runner_naming_convention.md): ``` [c-]{provider}-[rel-]{os}-[b]{arch}{vendor}{features}-{vcpu}-{memory}[-{gpu}[-{n}]] ``` Also drive-by: the search bar now trims leading/trailing whitespace before filtering, so a stray space no longer breaks results.
1 parent f237260 commit 813ce81

2 files changed

Lines changed: 19 additions & 4 deletions

File tree

torchci/lib/runnerUtils.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ export interface RunnersApiResponse {
3232
export function getRunnerGroupLabel(runner: RunnerData): string {
3333
const labelNames = runner.labels.map((label) => label.name);
3434

35-
// Find labels with "." (excluding any that end with ".runners") or starting with "macos-"
35+
// Find labels with "." (excluding any that end with ".runners") or
36+
// starting with "macos-".
3637
// Why have such funky logic? We have many labels on our runners today, but this
3738
// is what's common in all the ones that jobs actually use.
3839
const validLabels = labelNames.filter(
@@ -55,6 +56,19 @@ export function getRunnerGroupLabel(runner: RunnerData): string {
5556
// but use naming conventions like: linux.rocm.gpu.gfx942.1-xxxx-runner-xxxxx
5657
const runnerName = runner.name;
5758

59+
// ARC/OSDC runners register with empty labels and pod names of the form
60+
// <scaleset>-<replicaset-hash>-runner-<pod-hash>, e.g.
61+
// mt-l-x86aavx2-189-704-a10g-8-c8z6d-runner-4q77c. We want to group by the
62+
// scaleset prefix (mt-l-x86aavx2-189-704-a10g-8), which is also what
63+
// workflows put after `runs-on:`. The scaleset name format is documented at
64+
// pytorch/ci-infra:osdc/docs/runner_naming_convention.md
65+
// TODO: today only "mt-" (Meta) is in active use; expand to other providers
66+
// (lf/am/in/nv/ib) and the "c-" canary prefix when those fleets come online.
67+
const arcMatch = runnerName.match(/^(mt-.+)-[a-z0-9]+-runner-[a-z0-9]+$/i);
68+
if (arcMatch) {
69+
return arcMatch[1];
70+
}
71+
5872
// Look for dotted prefixes before "-" followed by random suffix
5973
const namePatterns = [
6074
/^([a-z]+\.[a-z0-9.]+)-[a-z0-9]+/i, // linux.rocm.gpu.gfx942.1-xxxx

torchci/pages/runners/[org].tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,10 @@ export default function RunnersPage() {
161161
const filteredAndSortedGroups = useMemo(() => {
162162
let groups = runnersData?.groups || [];
163163

164-
// Filter based on search term
165-
if (searchTerm) {
166-
const term = searchTerm.toLowerCase();
164+
// Filter based on search term (ignore leading/trailing whitespace)
165+
const trimmedSearch = searchTerm.trim();
166+
if (trimmedSearch) {
167+
const term = trimmedSearch.toLowerCase();
167168
groups = groups.filter(
168169
(group) =>
169170
group.label.toLowerCase().includes(term) ||

0 commit comments

Comments
 (0)