Skip to content

[CI/Build] Restart k8s e2e engines that die during startup - #1196

Open
rahulssv-ibm wants to merge 1 commit into
vllm-project:mainfrom
rahulssv-ibm:ci/k8s-e2e-restart-dead-engine
Open

rahulssv-ibm wants to merge 1 commit into
vllm-project:mainfrom
rahulssv-ibm:ci/k8s-e2e-restart-dead-engine

Conversation

@rahulssv-ibm

Copy link
Copy Markdown

k8s-discovery-e2e-test keeps failing on and off, on PRs and on main (run 41551494154). roundrobin failed in 13 of the last 60 jobs that reached a deploy. #1134 made the cause visible and left the fix open:

  • On the first deploy of the job, at least one engine dies while LMCache allocates its pinned buffer: RuntimeError: cudaHostAlloc failed: 1.
  • The container doesn't exit, so only the startup probe can restart it. The probe allows about 615s (delay=15s period=10s #failure=60), and wait-for-pods.sh gives up at 600s. The restart never happens, so the test fails.

This PR lowers the probe budget to about 315s in values-08-roundrobin-routing.yaml, so the kubelet restarts a dead engine while the test is still waiting. An engine that never comes up still fails the test at 600s, with its log in the job output.

Follow-up to #1133.

Why this value

Time from Running to Ready for healthy engines, from the logs of those 60 jobs. Image pull and PVC bind happen before Running, and the probe doesn't count them.

Test Pods Slowest
roundrobin 98 158s
All tests 576 269s

A dead engine should recover at about 490s: about 5s to start, 315s of probing, up to 30s of termination grace and about 140s for the second startup. That is within the 600s wait.

Why only this file

Every cudaHostAlloc failure I could find was on the first deploy. In the 24 runs with usable engine logs, roundrobin failed 5 times and the later tests failed 0 of 72. values-07-prefix-routing.yaml has the same servingEngineSpec, so the position in the job matters, not the engine config.

What this doesn't do

  • It doesn't explain why the allocation fails. The first deploy starts right after docker build runs inside minikube, so memory pressure in the minikube container (see [Bugfix][CI] Fix k8s e2e engine OOM and raise test timeouts #1119) is my best guess, but I can't confirm it without the runner.
  • I expect the restart to succeed because later deploys on the same runner do, but I haven't seen a real restart. The current probe never gets the chance to fire.

Testing

  • helm template with this values file: the only rendered change is the engine's failureThreshold, from 60 to 30. The router probe doesn't change, and schema validation passes.
  • wait-for-pods.sh with a stubbed kubectl: an engine that goes through Error and CrashLoopBackOff and comes back exits 0. An engine that never comes up times out, prints cudaHostAlloc failed and exits 1.
  • I can't run the GPU job locally. This PR's own e2e run can show that healthy engines still start in time. Because the failure only shows up in about 1 of 5 runs, it takes several runs on main to confirm it's gone.
  • pre-commit run --files tests/assets/values-08-roundrobin-routing.yaml: pass.

  • Make sure the code changes pass the pre-commit checks.
  • Sign-off your commit by using -s when doing git commit
  • Try to classify PRs for easy understanding of the type of changes, such as [Bugfix], [Feat], and [CI].

On the first deploy of the k8s routing job, an engine can die with
"RuntimeError: cudaHostAlloc failed: 1" while LMCache allocates its pinned
buffer (vllm-project#1133). The container keeps running, so only the startup probe can
restart it. The probe allows about 615s and wait-for-pods.sh gives up at
600s, so the restart never happens and the test fails.

Lower failureThreshold to 30 in the roundrobin values, which is the first
deploy of the job. A dead engine is then restarted at about 315s and can
start again before the wait ends. An engine that never comes up still fails
the test.

Signed-off-by: Rahul <[email protected]>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a startupProbe with a failureThreshold of 30 to the round-robin routing test configuration to ensure containers are restarted if they fail during startup. The reviewer recommends explicitly defining initialDelaySeconds and periodSeconds in this configuration to prevent the test budget from silently changing if global defaults are modified.

Comment on lines +36 to +37
startupProbe:
failureThreshold: 30

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To make this test configuration robust and self-contained, it is highly recommended to explicitly define initialDelaySeconds and periodSeconds alongside failureThreshold. Currently, this configuration implicitly relies on the default values defined in helm/values.yaml (which are 15 and 10 respectively). If those global defaults are ever modified in the future, the total startup probe budget for this test could silently change, potentially exceeding the 600s timeout or causing premature failures. Explicitly setting them here guarantees a consistent 315s budget.

  startupProbe:
    initialDelaySeconds: 15
    periodSeconds: 10
    failureThreshold: 30

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant