[rayapp] rayapp: split stdout and stderr tailwriter#473
Conversation
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refactors the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request refactors the runAnyscaleCLI function to explicitly separate stdout and stderr streams. Previously, both streams were combined, which could lead to issues when parsing structured output from stdout if stderr contained warnings or other messages. The updated implementation now captures stdout and stderr into distinct buffers, returning only the stdout content for parsing while still displaying both streams to the terminal. If the command fails, the stderr content is now included in the returned error message. Corresponding test cases have been updated, and a new test TestRunAnyscaleCLI_StderrNotInOutput was added to verify that stderr content does not interfere with the returned stdout.
sai-miduthuri
left a comment
There was a problem hiding this comment.
Everything else looks good except for the handling of stdout and stderr in the case of err != nil.
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
rayapp/anyscale_cli.go — Split the single tailWriter into separate
stdoutBuf and stderrBuf. Only stdout is returned as the parsed output.
On error, stderr is included in the error message for diagnostics.
rayapp/anyscale_cli_test.go — Updated the "command fails with stderr"
test case to expect stderr content in the error string instead of in
the returned output. Added TestRunAnyscaleCLI_StderrNotInOutput that
verifies a [WARNING] on stderr doesn't leak into the parsed output.
Tested locally with rayapp test service-intro on anyscale==0.26.81
partial log of successful anyscale cli commands with [WARNING] messages
(anyscale +58.9s) Workspace 'expwrk_jegme97wcmdsmg9pejnp184eqd' reached target state, exiting >>> anyscale workspace_v2 push --name service-intro-20260324182301 --local-dir /tmp/template_zip4143637084 [WARNING] A newer version of the Anyscale CLI is available. Your current version is 0.26.81. The latest version is 0.26.91. To avoid issues accessing Anyscale`s API, upgrade to the latest version by running `pip install --upgrade anyscale`. Detected files that exist in the destination but not in the source. The files will not be deleted by default. You can add '--delete' option to delete the files: .anyscaleignore >>> anyscale workspace_v2 run_command --name service-intro-20260324182301 unzip -o service-intro.zip [WARNING] A newer version of the Anyscale CLI is available. Your current version is 0.26.81. The latest version is 0.26.91. To avoid issues accessing Anyscale`s API, upgrade to the latest version by running `pip install --upgrade anyscale`. Archive: service-intro.zip inflating: README.ipynb inflating: README.md inflating: assets/service-logs.png inflating: assets/service-overview.png inflating: assets/service-replicas.png inflating: assets/service-rollout.png inflating: main.py >>> anyscale workspace_v2 push --name service-intro-20260324182301 --local-dir /tmp/test_zip1617622678 [WARNING] A newer version of the Anyscale CLI is available. Your current version is 0.26.81. The latest version is 0.26.91. To avoid issues accessing Anyscale`s API, upgrade to the latest version by running `pip install --upgrade anyscale`. Detected files that exist in the destination but not in the source. The files will not be deleted by default. You can add '--delete' option to delete the files: assets/service-rollout.png assets/service-replicas.png assets/service-overview.png assets/service-logs.png assets/ service-intro.zip main.py README.md README.ipynb .anyscaleignore >>> anyscale workspace_v2 run_command --name service-intro-20260324182301 unzip -o tests.zip [WARNING] A newer version of the Anyscale CLI is available. Your current version is 0.26.81. The latest version is 0.26.91. To avoid issues accessing Anyscale`s API, upgrade to the latest version by running `pip install --upgrade anyscale`. Archive: tests.zip inflating: tests.sh >>> anyscale workspace_v2 run_command --name service-intro-20260324182301 timeout 900 bash -c 'bash tests.sh' [WARNING] A newer version of the Anyscale CLI is available. Your current version is 0.26.81. The latest version is 0.26.91. To avoid issues accessing Anyscale`s API, upgrade to the latest version by running `pip install --upgrade anyscale`.