mirror of
https://github.com/nexu-io/open-design.git
synced 2026-10-27 09:51:12 +01:00
ci: add cost-sensitive runner tiering (#4764)
* test persistent contabo runner poc * test persistent runner web workspace poc * test persistent runner local cache setup * test persistent runner aggressive setup poc * test persistent runner web postinstall profile * test restore stable persistent runner poc * test keep persistent runner web tests default * test route persistent poc to zxiyun runner * test relax web vitest timeout on persistent poc * test harden web vitest cases for persistent runner * test add runner perf probe * test isolate runner perf probe dispatch * test pin runner perf probe node * test expand runner perf probe matrix * ci: route heavy jobs through runner modes * ci: keep web workspace tests on blacksmith * test: update web runner mode assertion * ci: route cost-sensitive runner tiers * ci: move preflight to hosted runner * ci: downshift blacksmith ui runners to 4vcpu * test: fix file viewer timeout after merge * ci: route e2e vitest to hosted default * ci: centralize runner profile selection * test: type runner profile assertions * ci: route e2e vitest to default blacksmith * ci: remove runner experiment probes * test: restore postinstall guard coverage Generated-By: looper 0.9.10+codex.autoclean (runner=fixer, agent=codex) * test: cover postinstall script contract * test: move postinstall guard to e2e --------- Co-authored-by: Looper <looper@noreply.github.com>
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
GITHUB_HOSTED = ["ubuntu-24.04"]
|
||||
CONTABO_CONTROL = ["self-hosted", "Linux", "X64", "od-persistent-ci", "od-ci-hot-poc"]
|
||||
BLACKSMITH_4V = ["blacksmith-4vcpu-ubuntu-2404"]
|
||||
|
||||
|
||||
def compact_json(value):
|
||||
return json.dumps(value, separators=(",", ":"))
|
||||
|
||||
|
||||
def normalize_mode(raw_mode):
|
||||
mode = (raw_mode or "default").strip().lower()
|
||||
if mode in {"default", "performance", "economic"}:
|
||||
return mode
|
||||
return "default"
|
||||
|
||||
|
||||
def resolve_profiles(mode):
|
||||
hosted_or_blacksmith = BLACKSMITH_4V if mode == "performance" else GITHUB_HOSTED
|
||||
blacksmith_default = GITHUB_HOSTED if mode == "economic" else BLACKSMITH_4V
|
||||
contabo_control = CONTABO_CONTROL if mode == "default" else GITHUB_HOSTED
|
||||
|
||||
return {
|
||||
"mode": mode,
|
||||
"github_hosted": GITHUB_HOSTED,
|
||||
"contabo_control": contabo_control,
|
||||
"hosted_or_blacksmith": hosted_or_blacksmith,
|
||||
"blacksmith_default": blacksmith_default,
|
||||
}
|
||||
|
||||
|
||||
def main():
|
||||
profiles = resolve_profiles(normalize_mode(os.environ.get("OD_CI_RUNNER_MODE")))
|
||||
output_path = os.environ.get("GITHUB_OUTPUT")
|
||||
lines = [
|
||||
f"{key}={value if isinstance(value, str) else compact_json(value)}"
|
||||
for key, value in profiles.items()
|
||||
]
|
||||
|
||||
if output_path:
|
||||
with Path(output_path).open("a", encoding="utf-8") as output:
|
||||
for line in lines:
|
||||
output.write(f"{line}\n")
|
||||
else:
|
||||
for line in lines:
|
||||
print(line)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user