Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

ci(ubicloud): refuse a full gate outside eu-central-h1; another location needs --lanes and says it is not gate evidence

garrytan4c11d9dfd5ab
diff --git a/scripts/ci-ubicloud.ts b/scripts/ci-ubicloud.ts
index 25ea877627..11560216b2 100755
--- a/scripts/ci-ubicloud.ts
+++ b/scripts/ci-ubicloud.ts
@@ -11,7 +11,9 @@
* `ubi-runner.sh usage`; 4 when the quota is busy)
* --size SIZE Ubicloud size (default standard-16)
* --slots N concurrent work slots per VM (default: half of --size's vCPUs)
- * --location LOC Ubicloud location (default eu-central-h1)
+ * --location LOC Ubicloud location (default eu-central-h1). A full gate
+ * runs only there; another location needs --lanes and
+ * is a diagnostic run, never gate evidence
* --image IMAGE boot image (default: UBI_CI_IMAGE, else stock Ubuntu 24.04);
* gbrain-ci@latest is the prebaked machine image
* scripts/ubicloud/build-ci-image.sh builds
@@ -86,6 +88,8 @@ const COMMITTED_WEIGHTS = join(ROOT, "scripts/ubicloud/weights.json");
const LOCAL_WEIGHTS = join(ROOT, ".context/ci-ubicloud/weights.json");
const ALL_LANES = ["gitleaks", "verify", "serial", "slow", "unit", "pg-arms", "e2e"] as const;
const BATCH_TIMEOUT_MS = 20 * 60 * 1000;
+// Test timeouts and the mined shard weights are calibrated on this location's VMs.
+const GATE_LOCATION = "eu-central-h1";
// Items this heavy are the run's long poles: spread them one per VM so two of
// them never compete for the same VM's CPUs.
const HEAVY_MS = 60_000;
@@ -122,7 +126,7 @@ function parseArgs(argv: string[]): Opts {
vms: 0,
size: "standard-16",
slots: 0,
- location: "eu-central-h1",
+ location: GATE_LOCATION,
image: process.env.UBI_CI_IMAGE || "stock",
lanes: new Set(ALL_LANES),
diff: false,
@@ -150,6 +154,7 @@ function parseArgs(argv: string[]): Opts {
else usage(`unknown argument ${arg}`);
}
for (const lane of opts.lanes) if (!(ALL_LANES as readonly string[]).includes(lane)) usage(`unknown lane ${lane}`);
+ if (opts.location !== GATE_LOCATION && !argv.includes("--lanes")) usage(`a full gate runs only in ${GATE_LOCATION}. Test timeouts and the mined shard weights are calibrated there; on 2026-10-19 us-east-a2 ran about half as fast and timed out tests that pass in ${GATE_LOCATION}, so a full run in ${opts.location} is not gate evidence. Wait for ${GATE_LOCATION} capacity or run bun run ci:local (and report it as local). To run a diagnostic subset in ${opts.location}, pass --lanes.`);
if (!Number.isInteger(opts.ttlHours) || opts.ttlHours < 0 || opts.ttlHours > 8760) usage("--ttl-hours must be a whole number of hours from 0 (no expiry) to 8760");
if (!Number.isInteger(opts.vms) || opts.vms < 0 || (opts.vms === 0 && argv.includes("--vms"))) usage("--vms must be a positive integer");
// One slot per two vCPUs: the whole corpus still fits inside the longest
@@ -616,6 +621,7 @@ async function main() {
exitCode = 1;
}
console.log(exitCode === 0 ? `\n[ci-ubicloud] All checks passed in ${clock()}.` : `\n[ci-ubicloud] FAILED after ${clock()}.`);
+ if (opts.location !== GATE_LOCATION) console.log(`[ci-ubicloud] diagnostic run in ${opts.location}: not gate evidence (a full gate runs only in ${GATE_LOCATION}).`);
process.exit(exitCode);
}
diff --git a/scripts/ubicloud/README.md b/scripts/ubicloud/README.md
index 57de8efec4..4a29fe9318 100644
--- a/scripts/ubicloud/README.md
+++ b/scripts/ubicloud/README.md
@@ -174,7 +174,11 @@ VM). The decision is logged (`fleet: project VMs hold 192 vCPUs, ceiling 448:
10 VM(s) × 16 vCPUs (burst maximum 10)`). The 64 vCPUs above the ceiling are
headroom for the managed GitHub runners `usage` can't see. When usage can't
be read, or the project is busy, the run takes the default. Slots default to
-one per two vCPUs (`--slots`); `--size` and `--location` pick the VM shape. A VM that the quota refuses fails
+one per two vCPUs (`--slots`); `--size` picks the VM shape. A full gate runs only in
+`eu-central-h1` (the default `--location`): test timeouts and the mined shard weights are calibrated on
+its VMs, and on 2026-10-19 two full gates in `us-east-a2` ran about half as fast and timed out tests that
+pass there. Another `--location` is refused unless `--lanes` names a diagnostic subset, whose summary
+says it is not gate evidence. A VM that the quota refuses fails
to provision and the run continues on the VMs that did start, so a busy
project shrinks the fleet instead of failing. The runner prints the refusal
(needed, used and maximum vCPUs) with the project's VMs and vCPUs per owner;
diff --git a/test/scripts/ci-ubicloud-schedule.test.ts b/test/scripts/ci-ubicloud-schedule.test.ts
index afb4cde330..b3e07c0475 100644
--- a/test/scripts/ci-ubicloud-schedule.test.ts
+++ b/test/scripts/ci-ubicloud-schedule.test.ts
@@ -1,11 +1,12 @@
// ci-ubicloud-schedule.test.ts — the Ubicloud fan-out's work queue:
// weighting (trusted tables first, lane p75 fallback), heaviest-first
// same-lane batching with a draining batch target, marker-log parsing, burst
-// fleet sizing from `ubi-runner.sh usage`, and the explicit-file seams the
-// ci:local wrappers expose for it.
+// fleet sizing from `ubi-runner.sh usage`, the explicit-file seams the
+// ci:local wrappers expose for it, and the gate-location refusal (a full gate
+// outside eu-central-h1 is refused before any VM is requested).
import { describe, expect, it } from "bun:test";
-import { execFileSync } from "node:child_process";
+import { execFileSync, spawnSync } from "node:child_process";
import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { join, resolve } from "node:path";
@@ -181,3 +182,33 @@ describe("explicit-file seams in the ci:local wrappers", () => {
for (const file of exclusive) expect(all).toContain(file);
});
});
+
+describe("gate location", () => {
+ const run = (...args: string[]) => {
+ const env = { ...process.env };
+ delete env.UBICLOUD_API_KEY;
+ delete env.UBICLOUD_API_TOKEN;
+ const r = spawnSync("bun", [join(REPO_ROOT, "scripts/ci-ubicloud.ts"), ...args], { cwd: REPO_ROOT, env, encoding: "utf8" });
+ return { status: r.status, stderr: r.stderr };
+ };
+ const credentialRefusal = "UBICLOUD_API_KEY (or UBICLOUD_API_TOKEN) is not set";
+
+ it("refuses a full gate outside eu-central-h1 before asking for credentials or VMs", () => {
+ for (const args of [["--location", "us-east-a2"], ["--location", "eu-north-h1", "--diff"]]) {
+ const r = run(...args);
+ expect(r.status).toBe(2);
+ expect(r.stderr).toContain("a full gate runs only in eu-central-h1");
+ expect(r.stderr).toContain("is not gate evidence");
+ expect(r.stderr).not.toContain(credentialRefusal);
+ }
+ });
+
+ it("lets the default location and an explicit diagnostic subset elsewhere through to the credential check", () => {
+ for (const args of [[], ["--location", "eu-central-h1"], ["--location", "us-east-a2", "--lanes", "gitleaks"]]) {
+ const r = run(...args);
+ expect(r.status).toBe(2);
+ expect(r.stderr).toContain(credentialRefusal);
+ expect(r.stderr).not.toContain("a full gate runs only in");
+ }
+ });
+});