ci: keep runner fallback label specific

This commit is contained in:
Peter Steinberger
2026-05-07 01:45:19 +01:00
parent a8801350d8
commit d3fc1985fe
3 changed files with 5 additions and 14 deletions

View File

@@ -103,7 +103,7 @@ gh workflow run full-release-validation.yml --ref main -f ref=<branch-or-sha>
| `blacksmith-6vcpu-macos-latest` | `macos-node` on `openclaw/openclaw`; forks fall back to `macos-latest` |
| `blacksmith-12vcpu-macos-latest` | `macos-swift` on `openclaw/openclaw`; forks fall back to `macos-latest` |
Canonical-repo CI keeps Blacksmith as the default runner path. During `preflight`, `scripts/ci-runner-labels.mjs` checks recent queued and in-progress Actions runs for queued Blacksmith jobs. If a specific Blacksmith label already has queued jobs, downstream jobs that would use that label fall back to the matching GitHub-hosted runner (`ubuntu-24.04`, `windows-2025`, or `macos-latest`) for that run only. If the API probe fails, no fallback is applied.
Canonical-repo CI keeps Blacksmith as the default runner path. During `preflight`, `scripts/ci-runner-labels.mjs` checks recent queued and in-progress Actions runs for queued Blacksmith jobs. If a specific Blacksmith label already has queued jobs, downstream jobs that would use that exact label fall back to the matching GitHub-hosted runner (`ubuntu-24.04`, `windows-2025`, or `macos-latest`) for that run only. Other Blacksmith sizes in the same OS family stay on their primary labels. If the API probe fails, no fallback is applied.
## Local equivalents

View File

@@ -66,19 +66,10 @@ export function selectRunnerLabels({
queueThreshold = DEFAULT_QUEUE_THRESHOLD,
} = {}) {
const selected = {};
const queuedCountsByFamily = {};
for (const [label, count] of Object.entries(queuedCountsByLabel)) {
const family = Object.values(RUNNER_LABELS).find((runner) => runner.primary === label)?.family;
if (family) {
queuedCountsByFamily[family] = (queuedCountsByFamily[family] ?? 0) + count;
}
}
for (const [outputName, label] of Object.entries(RUNNER_LABELS)) {
const queuedCount = queuedCountsByLabel[label.primary] ?? 0;
const familyQueuedCount = queuedCountsByFamily[label.family] ?? 0;
selected[outputName] =
!canonicalRepository ||
(fallbackEnabled && (queuedCount >= queueThreshold || familyQueuedCount >= queueThreshold))
!canonicalRepository || (fallbackEnabled && queuedCount >= queueThreshold)
? label.fallback
: label.primary;
}

View File

@@ -10,7 +10,7 @@ describe("scripts/ci-runner-labels.mjs", () => {
});
});
it("falls back within backed-up Blacksmith runner families", () => {
it("falls back only for backed-up Blacksmith runner labels", () => {
expect(
selectRunnerLabels({
queuedCountsByLabel: {
@@ -21,8 +21,8 @@ describe("scripts/ci-runner-labels.mjs", () => {
}),
).toMatchObject({
runner_4vcpu_ubuntu: "ubuntu-24.04",
runner_8vcpu_ubuntu: "ubuntu-24.04",
runner_16vcpu_ubuntu: "ubuntu-24.04",
runner_8vcpu_ubuntu: "blacksmith-8vcpu-ubuntu-2404",
runner_16vcpu_ubuntu: "blacksmith-16vcpu-ubuntu-2404",
runner_16vcpu_windows: "blacksmith-16vcpu-windows-2025",
});
});