fix(selfhost): add default memory limit to the runner compose service - #3913
Conversation
The runner service (--profile runners) was the sole service in docker-compose.yml with no deploy.resources.limits, despite the file's own comment documenting a confirmed production incident: uncapped runner containers starving the main app under load. Give it the same operator-overridable memory-limit default every other service already has, and extend the resource-limits test so this can't regress. Closes #3893
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3913 +/- ##
=======================================
Coverage 93.58% 93.58%
=======================================
Files 358 358
Lines 34342 34342
Branches 12570 12570
=======================================
Hits 32138 32138
Misses 1580 1580
Partials 624 624 🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-07 06:47:57 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Summary
runnerservice (--profile runners) was the sole service indocker-compose.ymlwith nodeploy.resources.limits— every other resource-risky service (gittensory, redis, postgres, qdrant, ollama, browserless, rees, prometheus, grafana, loki, tempo) already has an operator-overridable memory default.docker-compose.override.ymlCPU-priority pattern — opt-in and CPU-only, never memory.deploy.resources.limits.memory: "${RUNNER_MEM_LIMIT:-2g}", documentedRUNNER_MEM_LIMITin.env.example, and extended the resource-limits regression test'sEXPECTED_LIMITSmap so this can't silently regress again.cpu_shares/cpus) as the existing opt-in override pattern — that genuinely needs per-host sizing (vCPU count, runner replica count), unlike memory, which can have a safe universal default like every sibling service.Found via a fresh performance/scalability/accuracy hardening audit of the self-host ORB stack. Tracked under #1667.
Scope
docker-compose.yml— memory limit forrunner.env.example— documentRUNNER_MEM_LIMITtest/unit/selfhost-compose-resource-limits.test.ts— coverrunnerinEXPECTED_LIMITSValidation
npm run typechecknpm run selfhost:env-reference:checknpx vitest run test/unit/selfhost-compose-resource-limits.test.ts test/unit/docker-compose-override-example.test.ts— all greengit diff --checkcleanSafety
src/**change, no secrets. Default is additive-only (a cap that didn't exist before); existing deployments get a safe 2g ceiling they can raise via.envif needed.Closes #3893