Repository navigation
Description
Problem
On 2026-11-16 the kubelet evicted the implement runner pod of #3648 (devops-cli-implement-devops-cli-3648-ff7ce1-ssxws, v0.161.0) after 2 h 7 min and 25.8M tokens: Usage of EmptyDir volume "home" exceeds the limit "4Gi". (event Evicted, 08:05:32Z). The runner is PID 1 and ignored the SIGTERM, so the kubelet killed it at the end of the grace period (ExceededGracePeriod, exit 137, container reason Error). Its memory was 0.8 to 2.7 GB in the last 12 minutes (peak 6.5 GB at 07:50Z), far below the 8Gi limit.
Two defects:
- The home volume is too small for a run that reaches the test-strength check.
k8s/devops/cronjob-runner.yamlgiveshome(clone, worktree, venv, uv cache)sizeLimit: 4Gi, measured on 2026-10-29 as 1.1 GB for the venv and the cache (feat(roadmap): run the implement job as a cluster Job #2698). Since fix(roadmap): the strength check sets a denied env key #5892 (v0.160.0) the strength check runsuv run mutmut runin the worktree, and mutmut 3 copies the trees of[tool.mutmut](source_paths = ["src/devops_cli"]and the tests) intomutants/. The agent of feat(roadmap): explain and inbox show the state of a stopped item #3648 was reading mutmut's source at 08:03Z, two minutes before the eviction. - The Service classes the eviction as
oom.src/devops_cli/roadmap/failure.py:219maps exit 137 toFailureClass.OOMwith the actionraise_limit(a memory limit). The pod status saidEvictedwith the volume message, and the container reason wasError, notOOMKilled. A retry with more memory fails the same way.
Expected behavior
- A run that reaches the strength check fits in the home volume: measure the size of
mutants/for a typical change, and size the volume (and the containerephemeral-storagelimit) with a margin, or make the check use less space (for example removemutants/after the run, or copy only what the targets need). - A pod that the kubelet evicts gets a class from the pod status (
reason: Evictedand its message), not from the exit code, and the stop comment names the volume and its limit. Exit 137 isoomonly when the container reason isOOMKilled.
Test first: a pod status with reason: Evicted, an ephemeral-storage message and exit 137 gives a class that is not oom.
Related
- fix(roadmap): the strength check sets a denied env key #5892 / fix(roadmap): the strength check sets a denied env key #5887 (the strength check runs again), feat(roadmap): new tests of an implementation are checked for strength #3051, feat(roadmap): run the implement job as a cluster Job #2698, fix(roadmap): a deploy resets the runner memory limit to 8Gi #5484 (runner memory limit).
Proposed design
Problem statement
The kubelet evicted the implement runner pod of #3648 because the home emptyDir volume (4Gi) overflowed during the strength check. mutmut copies its source paths and the tests into mutants/, and the copy exceeded the volume. The failure classifier also maps exit 137 to FailureClass.OOM with the action raise_limit, so a retry with more memory fails the same way. The change sizes the volume for the measured peak, removes mutants/ after the run, and classifies a failure from the pod status before the exit code.
Acceptance criteria
Requirement: Eviction is not OOM
The failure classifier SHALL read the pod reason and message before the exit code.
Scenario: Evicted pod with exit code 137
- WHEN a pod status has reason
Evicted, an ephemeral-storage message and exit code 137 - THEN the classifier returns a class that is not
FailureClass.OOM
Requirement: OOM needs the container reason
The failure classifier SHALL return FailureClass.OOM for exit code 137 only when the container reason is OOMKilled.
Scenario: Exit code 137 with container reason Error
- WHEN the exit code is 137 and the container reason is
Error - THEN the classifier returns a class that is not
FailureClass.OOM
Requirement: Stop comment names the volume
The stop comment of an evicted pod SHALL name the evicted volume and its limit.
Scenario: Home volume eviction
- WHEN the pod status reason is
Evictedand the message isUsage of EmptyDir volume "home" exceeds the limit "4Gi". - THEN the stop comment contains
homeand4Gi
Requirement: Eviction action is not raise_limit
The action of an evicted pod SHALL not be raise_limit.
Scenario: Action of an eviction
- WHEN the classifier returns the class of an evicted pod
- THEN the action of the class is not
raise_limit
Requirement: Strength check removes mutants
The strength check SHALL remove the mutants/ directory after the run.
Scenario: No mutants directory after the run
- WHEN the strength check ends, with success or failure
- THEN no
mutants/directory remains in the worktree
Requirement: Home volume covers the measured peak
The runner manifest SHALL size the home volume for the measured peak of the strength check plus 1 GiB.
Scenario: Manifest covers the measured peak
- WHEN the test reads the measured peak and the manifest
- THEN the
homesizeLimitis at least the peak plus 1 GiB, and the containerephemeral-storagelimit is at least the sum of the emptyDir sizeLimits plus 1 GiB
Requirement: Mutants copy excludes the virtual environment
The [tool.mutmut] configuration SHALL not list the virtual environment or the uv cache in also_copy.
Scenario: Mutants config of the worktree
- WHEN the test reads
pyproject.toml - THEN
also_copylists no.venvpath and no uv cache path
Existing Tool Considered
No alternatives check has run. No open, maintained tool or library covers this need: the change edits the project's own k8s/devops/cronjob-runner.yaml and src/devops_cli/roadmap/failure.py. The written cost is about 30k tokens to build the classifier and the manifest change with tests, about 5k tokens a month to keep and fix them, and about half a working day.
Key questions
- Which source decides the failure class of a runner pod?: The pod status decides first: its
reason, its message and the container's terminated reason. The exit code decides only when the pod status gives no class. Exit code 137 isoomonly when the container reason isOOMKilled. (best practice) [sources: src/devops_cli/roadmap/failure.py:219, src/devops_cli/models/k8s.py:120, tests/k8s/test_k8s_models.py:184, docs/guidelines/kubernetes.md:37]- Chosen: Pod status first. The kubelet writes
Evictedand the volume message in the pod status, and the exit code cannot tell an eviction from an OOM kill. - Rejected: Exit code map only. Exit code 137 covers an eviction and a SIGKILL, so the map labels the eviction as
oom. - Rejected: Container reason only. An eviction sets no
OOMKilledreason, and the pod reason and message carry the volume and its limit.
- Chosen: Pod status first. The kubelet writes
- How should the runner home volume fit the strength check?: Measure the peak of the strength check in the runner. Set the
homesizeLimitto the peak plus 1 GiB, and the containerephemeral-storagelimit to the sum of the emptyDir limits plus 1 GiB. Removemutants/after the run. Keep the virtual environment and the uv cache out ofmutants/. (best practice) [sources: k8s/devops/cronjob-runner.yaml, docs/guidelines/kubernetes.md:37, pyproject.toml]- Rejected: Raise the limits with no measurement. A guessed limit can overflow again, and a large emptyDir risks a node-pressure eviction (T9).
- Rejected: Only remove mutants after the run. The run needs the copy while it runs, so cleanup after the run does not lower the peak.
- Chosen: Measure the peak, remove mutants, and exclude the venv and cache. It lowers the peak and sets a limit with a stated margin.
- Where does the change record the measured peak?: The change records the measured peak as a constant in the test that checks the manifest, and in the comment of the
homevolume. (best practice) [sources: k8s/devops/cronjob-runner.yaml]- Chosen: Manifest comment and test constant. The limit and its reason stay together, and the test enforces the margin.
- Rejected: A new document. It splits the limit from its reason.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 16, 2026
The runner pod was evicted and the job failed, and the misclassification causes retries that fail the same way.Both concern runner Job resource limits, but #3193 sizes memory and CPU from the plan while the candidate sizes the home volume for mutmut and fixes a failure-classification bug.devops-cli-service commentedon Nov 16, 2026
Waiting for the alternatives check to run. The next refine round looks at the item again after the check records a verdict.
chore(main): release 0.162.0 (#5953)
devops-cli-service commentedon Nov 16, 2026
Released in v0.162.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.162.0
devops-cli-service commentedon Nov 16, 2026
Live since 2026-11-16 11:49 UTC