Skip to content

fix: stop nok8s standup at the first container failure and roll back what launched - #1757

Merged
mengmeiye merged 1 commit into
llm-d:mainfrom
UgaTheDev:fix/nok8s-standup-rollback
Aug 11, 2026
Merged

mengmeiye merged 1 commit into
llm-d:mainfrom
UgaTheDev:fix/nok8s-standup-rollback

Conversation

@UgaTheDev

Copy link
Copy Markdown
Contributor

A nok8s standup that fails on vllm-0 still pulls and starts epp and envoy, and leaves them running on the host.

step_06_nok8s_deploy.py:82-97 iterates every container, accumulating into errors, and only returns once all of them have been attempted. There is no rollback of what already launched. Because epp and envoy use --network host, they then hold 9002/9003/9090/8081, so the next standup attempt trips the preflight's own host-ports-in-use warning. Recovery works (teardown --methods nok8s), but the docs only mention it under "Ports busy", not as a required step after a failed standup.

This stops at the first launch failure and removes what was already started before returning.

The ordering matters and the issue calls it out: rollback must not destroy the evidence. Logs for launched containers are dumped before anything is removed, so the failure is still diagnosable afterward. _dump_logs is already best-effort (check=False, OSError swallowed), so the dump cannot make the failure path worse.

Two regression tests, both verified to fail before the change: one that the loop stops and rolls back, one that logs are captured before removal. Full suite matches the pre-existing baseline on main.

Note this touches step_06_nok8s_deploy.py, as does #1719 (readiness-timeout log dumping) and my #1756. The changes are in different functions, but whichever lands last will want a quick rebase.

Fixes #1702

@mengmeiye

Copy link
Copy Markdown
Collaborator

Hi @UgaTheDev Thank you for the PR! Can you fix the ruff-format CI error and the conflicts? Thanks!

A container that failed to start was recorded in errors and the loop kept
going, so a failed vllm-0 still pulled and started epp and envoy. Nothing
removed the containers already launched, and because epp and envoy run with
--network host they held ports 9002/9003/9090/8081, tripping the preflight
host-port check on the next standup.

Return on the first launch failure instead of collecting errors across every
container, and remove whatever was already up before returning. The same
rollback runs when readiness times out, which left containers behind for the
same reason.

Container logs are dumped before removal: rm -f destroys them and a failed
standup is exactly when they are needed. The rollback itself is best-effort
so it cannot mask the failure that triggered it.

Signed-off-by: Kush Zingade <[email protected]>
@UgaTheDev
UgaTheDev force-pushed the fix/nok8s-standup-rollback branch from e52beba to df6afef Compare August 11, 2026 06:17
@mengmeiye
mengmeiye merged commit 68472da into llm-d:main Aug 11, 2026
29 checks passed
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.

nok8s: A failed nok8s standup leaves containers running and keeps launching the rest of the stack after the first failure

2 participants