Skip to content

fix(k8s): bound the test workers and log the command of a step - #2809

Merged
dan-petty merged 11 commits into
mainfrom
fix/2806-runner-memory-and-command-log
Oct 31, 2026
Merged

dan-petty merged 11 commits into
mainfrom
fix/2806-runner-memory-and-command-log

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

What

An implement Job was killed by the kernel (OOM) at its 4 Gi memory limit. Its log did not name the command that used the memory. This change fixes both faults.

  • The runner pod sets PYTEST_XDIST_AUTO_NUM_WORKERS=2, equal to its CPU limit. pytest-xdist counts the CPUs of the node, not of the pod. On a node with 48 CPUs, -n logical started 48 workers of about 280 MB each in a pod with 2 CPUs. The shell of a step and the isolated child of devops ci both keep the variable.
  • The memory limit of the runner is 8 Gi. The request stays at 4 Gi. 8 Gi is twice the peak of the killed pod, and it fits the smallest node of the cluster.
  • The Job log now writes Tool call: <tool>, started: <command> before a command runs, so a killed call leaves its cause. The line shows the program and its first arguments. It hides secrets, the value of each name=value argument that is not a number, and each argument with a space.

Why

The work of the killed step was lost, and the log gave no cause. The pod limit was not the root cause: the worker count was.

The command that the killed pod ran is not proven. The acceptance criteria for the named command and for a Job that stays under the limit stay open until the next Job runs with these settings. The proposal records the evidence.

Closes #2806

…og hides values (#2806)

The isolated child environment drops PYTEST_XDIST_AUTO_NUM_WORKERS, so the pytest of
devops ci counted the CPUs of the node again. The variable joins the allowlist.

The command line of the Job log hid a value only by its form. It now keeps the name of
name=value and hides the value unless it is a number, and it hides free text.
The limit is 8 Gi, twice the peak of the killed pod, so a pod on a node with 15.5 Gi
cannot starve it. The docs name the worker bound as a variable of the shell.
@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/k8s Kubernetes commands, Helm charts, pods, services, and policies labels Oct 30, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Test results

  • Fail-to-pass (uv run devops ci fail-to-pass --base origin/main): 27 tests failed on base and pass on the branch (711 passed in 4 test files, 0 errors).
  • Full uv run devops ci: every check passes except audit. uv audit reports 5 known vulnerabilities in graphql-core 3.3.0 and pyasn1 0.6.4. This change does not touch uv.lock. I filed an issue through devops roadmap intake.
  • The test check took 5 m 22 s (322 s) on a host that ran other agents in parallel.

Review findings

Fixed:

  • The worker bound did not reach the pytest of devops ci. PYTEST_XDIST_AUTO_NUM_WORKERS is now in DEFAULT_ALLOWED_ENV_VARS, with a test and a requirement in subprocess-environment.
  • The log line showed secrets that have no form (name=value, a header, a dotted key). The line now keeps the name and hides the value unless it is a number, and it hides each argument with a space. The line keeps the real name of a flag such as --api-key.
  • The spec of roadmap-implement-job, k8s/README.md and docs/ROUTINE_TASKS.md now name the worker bound as an exception to "no variable of the job".
  • The 12 Gi limit had no measure behind it and could place a burst on a 15.5 Gi node. The limit is now 8 Gi, twice the peak of the killed pod, and the proposal says so.
  • The manifest comment now says "10 Jobs".
  • The proposal states that the command and the Job on fix(config): devops config unset stops with a TypeError for a key that a YAML merge key gives #2656 are not proven, and that acceptance criteria 1 and 2 stay open.
  • Two requirement texts were over 500 characters. I split the log requirement in two and shortened the job requirement.

Not fixed:

  • A node selector for the large nodes. The lower limit fits every node, so a selector needs a second change and gives no gain here.
  • A secret as a bare word with no form (for example the word after git commit -m with no space) can still show in the line. The design records this risk.

@dan-petty
dan-petty marked this pull request as ready for review October 31, 2026 00:21
…y-and-command-log

# Conflicts:
#	openspec/specs/roadmap-implement-step/spec.md
@dan-petty
dan-petty merged commit 2314ef9 into main Oct 31, 2026
19 checks passed
@dan-petty
dan-petty deleted the fix/2806-runner-memory-and-command-log branch October 31, 2026 01:04
dan-petty pushed a commit that referenced this pull request Oct 31, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.23.0](v0.22.7...v0.23.0)
(2026-10-31)


### Features

* **review:** confirm finding on human VERIFIED verdict
([#2813](#2813))
([26203af](26203af)),
closes [#2414](#2414)
* **roadmap:** intake runs in triage lane on devops-triage model
([#2816](#2816))
([35e6172](35e6172)),
closes [#1534](#1534)
* **roadmap:** link candidate from source as a sub-issue
([#2812](#2812))
([aee2c85](aee2c85)),
closes [#2035](#2035)
* **service:** each subscribed webhook event runs its scoped update
([#2811](#2811))
([0564c08](0564c08)),
closes [#1533](#1533)


### Bug Fixes

* **k8s:** bound the test workers and log the command of a step
([#2809](#2809))
([2314ef9](2314ef9)),
closes [#2806](#2806)
* **roadmap:** a step may not lose a test that existed
([#2807](#2807))
([7d104a5](7d104a5)),
closes [#2804](#2804)
* **security:** lock graphql-core at 3.3.1 and pyasn1 at 0.6.5
([#2814](#2814))
([8234a83](8234a83)),
closes [#2808](#2808)


### Code Refactoring

* **ai:** seams and fakes for Valkey, Qdrant and embedder
([#2815](#2815))
([1e03417](1e03417)),
closes [#1317](#1317)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/k8s Kubernetes commands, Helm charts, pods, services, and policies type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(k8s): the implement runner Job is OOMKilled at 4 Gi with no command in its log

1 participant