Repository navigation
Add per-attempt logs for managed vLLM - #19167
Conversation
…er99/unsloth into r19167 # Conflicts: # studio/backend/tests/test_managed_engine_logs.py [skip ci]
|
@codex review |
1 similar comment
|
@codex review |
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
[skip ci]
…er99/unsloth into r19167 # Conflicts: # studio/backend/tests/test_managed_engine_logs.py [skip ci]
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…9278) ## Problem `studio/backend/tests/test_log_bounds.py::TestFamiliesAreBounded::test_a_new_family_cannot_be_added_unnoticed` fails on main in the backend `(Python 3.13, g-l)` shard: ``` AssertionError: new log families: vllm ``` ## Cause #19167 (per-attempt logs for managed vLLM) added `"vllm": ("logs/vllm", "vllm-*.log")` to `MANAGED_ENGINE_LOG_FAMILIES` while #19276 was adding the review gate for those families. Both merged, so the gate reports the new family as unreviewed. That is what the gate is for: a new log family is a decision about disk growth. ## Review The family is bounded. #19167 writes vLLM attempt logs through `ManagedEngineLog.open`, which prunes the family's glob after opening each file. `test_a_managed_engine_log_prunes_its_family_on_open[vllm]` (added in #19276, parametrised over `MANAGED_ENGINE_LOG_FAMILIES`) runs that path: - it fills a temp studio home with `DEFAULT_KEEP + 5` old `vllm-*.log` files and opens a new one; - it checks that exactly `DEFAULT_KEEP` remain, that the new one is kept, and that the oldest is gone. It passes. ## Fix Add `vllm` to the reviewed list in `test_a_new_family_cannot_be_added_unnoticed`. ## Verification - `test_log_bounds.py`: 7 passed. The cases include `test_a_managed_engine_log_prunes_its_family_on_open[sglang]` and `[vllm]`. - On main, `test_a_new_family_cannot_be_added_unnoticed` fails with the error above.
#19296) ## Problem `studio/backend/tests/test_managed_engine_readiness_poll.py` fails on main (6 of 9 tests) and on every PR based on it, for example #19284 and #19285, which do not touch Studio: ``` > child_env["WSL_UTF8"] = "1" E TypeError: 'NoneType' object does not support item assignment ``` ## Cause Two PRs merged within an hour of each other, each green on its own base: - #19167 added `vllm` to `MANAGED_ENGINE_LOG_FAMILIES`, so a vLLM start now captures logs and, on the WSL path, sets `child_env["WSL_UTF8"] = "1"` on the environment `_wsl_command` returns (the SGLang half of this came in #19166). - #19242 added this test file. Its `_wsl_command` stub returned `(command, None)`, and its base predated #19167, so vLLM did not capture logs there and the `None` was never touched. The code is right: the real `_wsl_command` always returns `wsl_host.guest_command(...)`, whose second element is the `wsl.exe` environment dict, and `test_managed_engine_logs.py` already stubs it with `dict(os.environ)`. The stub was the part that did not match the contract. ## Fix - The stub returns `dict(os.environ)`, the same shape the real launcher hands back. - The fixture sets `UNSLOTH_STUDIO_HOME` to `tmp_path`, since the vLLM start now opens a per-attempt log under the Studio home and the tests should not write into the real one. No product code changes. ## Verification - `tests/test_managed_engine_readiness_poll.py`: 9 passed (6 failed on main before the change). - Reverting only the stub's return value back to `None` brings back the same 6 failures. - `test_managed_engine_logs.py`, `test_engine_ports.py` and this file together: 50 passed; this file under `-n 4`, 3 repeats: 27 passed.
Depends on #19166. Review the five-file vLLM diff. Both PRs target upstream main, so GitHub also shows the shared SGLang changes here until the dependency lands. If #19166 is squash-merged, this branch will need a rebase.
Enable per-attempt logging for managed vLLM using the shared capture and Settings viewer. Each process launch gets its own redacted log, including automatic retries for Mamba limits and drafter compatibility. A failure's View logs action keeps pointing to the corresponding attempt after a retry.
Verification
29 backend checks passed and two were skipped. All 74 frontend checks and frontend type checking passed. Real vLLM runs exercised startup failure, successful retry, exact failed-log lookup, and unload on Windows using the private WSL guest and with Unsloth running inside WSL. macOS and AMD checks were simulated. Bare-metal Linux was not exercised.
Screenshots
Settings > Logs, with two SGLang and two vLLM attempt logs placed in the Studio home. Before (merge base), the picker lists only the server log. After, it groups the SGLang and vLLM attempts under their own headings.