r/devops7 • u/Alternative_Pin9598 • 2d ago
One script, one chore: CI tries the cheapest runner pool first, so e2e OOMs twice per build before it lands on x86-large. One learning goal per job: 30 failed runs in 10 builds became 3 (real output)
Short one this week: one script, one chore, real output. (This sub is run by the SynapCores team.)
The chore
CI sends every job to the cheapest runner pool first and falls back to the next one when it fails. lint and unit pass on arm-small. Two never do: e2e runs out of memory on both 8 GB pools, and docker-integration's test image is amd64-only. So every build pays for 3 failed runs, and the e2e result lands 20 minutes late.
pools.csv says what each of 4 jobs does on each of 3 pools (cheapest first: arm-small, x86-small, x86-large). The failures:
SELECT job, pool, minutes, why FROM d10_pool_results WHERE passed = 0 ORDER BY job, pool
docker-integration arm-small 2 exec format error: the test image is amd64-only
e2e arm-small 11 OOM-killed: 8 GB runner
e2e x86-small 9 OOM-killed: 8 GB runnerToday: cheapest first, every build
$ python3 ciroute.py builds 1 10 fixed
build 1 7 runs, 3 failed docker-integration: arm-small > x86-small e2e: arm-small > x86-small > x86-large
...
builds 1-10 (fixed): 70 runs, 30 failed, 220 runner-minutes on failed runsThe usual fix is a hand-written pin per job, which someone has to edit when a pool breaks.
The payoff: one learning goal per job
The SynapCores step: each job in a build is a goal. The pools are its alternatives, cheapest first; the check is SQL (SELECT passed FROM d10_pool_results WHERE job = 'e2e' AND pool = 'arm-small' must return 1; here pools.csv stands in for real CI runs). From ciroute.py:
"task_type": "ci:" + job, # scores are kept per task_type: one per CI job
"learn": mode == "learn", # fixed: always the order below; learn: lead with the best-scoring pool
...
"action": on_pool(job, POOLS[0]), # cheapest pool first,
"alternatives": [on_pool(job, p) for p in POOLS[1:]], # the next one when the check fails
"acceptance": {"kind": "json_equals", "pointer": "/rows/0/0", "expected": 1}} # check: passed = 1The fixed run was these goals with learn off. With it on, SynapCores 2.5.1:
$ python3 ciroute.py builds 1 10 learn
build 1 7 runs, 3 failed docker-integration: arm-small > x86-small e2e: arm-small > x86-small > x86-large
build 2 4 runs, 0 failed
...
build 10 4 runs, 0 failed
builds 1-10 (learn): 43 runs, 3 failed, 22 runner-minutes on failed runsFrom build 2, e2e starts on x86-large and docker-integration on x86-small. What it learned, read back with SHOW AGENT POLICY (no LLM, 0 tokens):
ci:docker-integration sql:arm-small tries=1 score=-1.0 mean=-1.00
ci:docker-integration sql:x86-small tries=10 score=10.0 mean=1.00
ci:e2e sql:arm-small tries=1 score=-1.0 mean=-1.00
ci:e2e sql:x86-large tries=10 score=10.0 mean=1.00
ci:e2e sql:x86-small tries=1 score=-1.0 mean=-1.00
ci:lint sql:arm-small tries=10 score=10.0 mean=1.00
ci:unit sql:arm-small tries=10 score=10.0 mean=1.00Then a pool breaks
python3 ciroute.py break arm-small: a bad runner image, every job there fails in its first minute. Builds 11 to 20:
build 11 6 runs, 2 failed lint: arm-small > x86-small unit: arm-small > x86-small
build 12 4 runs, 0 failed
...
builds 11-20 (learn): 42 runs, 2 failed, 2 runner-minutes on failed runs
builds 11-20 (fixed): 90 runs, 50 failed, 130 runner-minutes on failed runslint and unit fail once on arm-small, then lead with x86-small. Nobody edited a pin:
ci:lint sql:arm-small tries=11 score=9.0 mean=0.82
ci:lint sql:x86-small tries=10 score=10.0 mean=1.00Over 20 builds: 80 failed runs and 350 runner-minutes with the fixed order, 5 and 24 with learn on. The 40 goals of builds 1 10 learn took 0.39 s on a Mac mini (Apple M4).
ciroute.py (stdlib only) and pools.csv are in the comments.
Free Community Edition: https://synapcores.com/download?utm_source=reddit&utm_medium=owned&utm_campaign=devops7-one-script-10
Quick one: do you pin CI jobs to runners by hand, or does something pick the runner for you?
1
u/Alternative_Pin9598 2d ago
The learning goal on its own, one concept per lesson: SQLv2 Lesson 6, "your first learning goal" (https://www.reddit.com/r/SQLv2/comments/1xtk5zn/).
ciroute.py, part 1 of 2 (standard library only; set
SC_URLandSC_TOKEN). Part 2,pools.csvand the run commands are in the reply below.