





















@@ -5,26 +5,32 @@ import { appendFileSync } from "node:fs";
55export const RUNNER_LABELS = {
66runner_4vcpu_ubuntu: {
77fallback: "ubuntu-24.04",
8+family: "ubuntu-2404",
89primary: "blacksmith-4vcpu-ubuntu-2404",
910},
1011runner_8vcpu_ubuntu: {
1112fallback: "ubuntu-24.04",
13+family: "ubuntu-2404",
1214primary: "blacksmith-8vcpu-ubuntu-2404",
1315},
1416runner_16vcpu_ubuntu: {
1517fallback: "ubuntu-24.04",
18+family: "ubuntu-2404",
1619primary: "blacksmith-16vcpu-ubuntu-2404",
1720},
1821runner_16vcpu_windows: {
1922fallback: "windows-2025",
23+family: "windows-2025",
2024primary: "blacksmith-16vcpu-windows-2025",
2125},
2226runner_6vcpu_macos: {
2327fallback: "macos-latest",
28+family: "macos-latest",
2429primary: "blacksmith-6vcpu-macos-latest",
2530},
2631runner_12vcpu_macos: {
2732fallback: "macos-latest",
33+family: "macos-latest",
2834primary: "blacksmith-12vcpu-macos-latest",
2935},
3036};
@@ -60,10 +66,19 @@ export function selectRunnerLabels({
6066 queueThreshold = DEFAULT_QUEUE_THRESHOLD,
6167} = {}) {
6268const selected = {};
69+const queuedCountsByFamily = {};
70+for (const [label, count] of Object.entries(queuedCountsByLabel)) {
71+const family = Object.values(RUNNER_LABELS).find((runner) => runner.primary === label)?.family;
72+if (family) {
73+queuedCountsByFamily[family] = (queuedCountsByFamily[family] ?? 0) + count;
74+}
75+}
6376for (const [outputName, label] of Object.entries(RUNNER_LABELS)) {
6477const queuedCount = queuedCountsByLabel[label.primary] ?? 0;
78+const familyQueuedCount = queuedCountsByFamily[label.family] ?? 0;
6579selected[outputName] =
66-!canonicalRepository || (fallbackEnabled && queuedCount >= queueThreshold)
80+!canonicalRepository ||
81+(fallbackEnabled && (queuedCount >= queueThreshold || familyQueuedCount >= queueThreshold))
6782 ? label.fallback
6883 : label.primary;
6984}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。