Skip to content

[rayapp] adding --nightly flag to test against nightly ray images#461

Open
elliot-barn wants to merge 4 commits intomainfrom
elliot-barn-rayapp-test-nightly
Open

[rayapp] adding --nightly flag to test against nightly ray images#461
elliot-barn wants to merge 4 commits intomainfrom
elliot-barn-rayapp-test-nightly

Conversation

@elliot-barn
Copy link
Collaborator

@elliot-barn elliot-barn commented Mar 17, 2026

adding --nightly flag to test against nightly ray images
when --nightly flag is provided the templates build_id/image_uri will get overridden in the following cases:

cluster_env type Example Result
build_id (ray) anyscaleray2501-py311 Converts to anyscale/ray:nightly-py311
image_uri (ray) anyscale/ray:2.34.0-py311 Converts to anyscale/ray:nightly-py311
image_uri (non-ray) anyscale/myimage:2.37.0-py311 Skipped with log
byod.docker_image us-docker.pkg.dev/.../template:2.51.1 Skipped with log

ex nightly image tags
anyscale/ray:nightly-py312

Tested

Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 enhances the rayapp test command by introducing a --nightly flag. This flag enables the testing of templates against the latest nightly Ray images, providing a streamlined way to ensure compatibility with cutting-edge Ray builds. The changes include parsing the new flag, adapting the image URI resolution process to target nightly versions, and incorporating necessary validation to handle incompatible configurations gracefully.

Highlights

  • New --nightly flag: Introduced a new --nightly boolean flag for the rayapp test command, allowing users to test against nightly Ray images.
  • Nightly image URI conversion: Implemented logic to automatically convert standard Ray image URIs (e.g., anyscale/ray:2.44.0-py311) to their nightly equivalents (e.g., anyscale/ray:nightly-py311) when the --nightly flag is used.
  • Mutual exclusivity and validation: Added validation to ensure that the --ray-version and --nightly flags cannot be used simultaneously. Also, checks were added to prevent --nightly from being used with BYOD (Build Your Own Docker) cluster environments or non-Ray image URIs.
  • Conditional Ray version argument: Modified the createEmptyWorkspace function to only append the --ray-version argument if the specified Ray version is not 'nightly', preventing conflicts when using nightly images.

🧠 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.

Changelog
  • rayapp/anyscale_cli_workspace_v2.go
    • Modified createEmptyWorkspace to conditionally add --ray-version only if the version is not 'nightly'.
  • rayapp/rayapp/main.go
    • Added a new --nightly boolean flag to the test command's flag set.
    • Updated calls to RunAllTemplateTests and RunTemplateTest to pass the new nightly flag.
    • Included the --nightly flag in the command-line usage printout.
  • rayapp/template.go
    • Added a new regular expression nightlyTagRe to match nightly tags in image URIs.
    • Updated extractRayVersionFromImageURI to return 'nightly' if a nightly tag is detected in the image URI.
    • Introduced overrideClusterEnvNightly function to convert a cluster environment's image URI to its nightly equivalent.
    • Added convertImageURIToNightly helper function to replace the version portion of an image URI with 'nightly'.
  • rayapp/template_test.go
    • Added new test cases for convertImageURIToNightly to verify correct image URI conversion to nightly tags.
    • Included new test cases for overrideClusterEnvNightly to ensure proper nightly image URI overriding for BuildID and ImageURI based cluster environments.
    • Added a test case to confirm that overrideClusterEnvNightly returns an error for BYOD cluster environments.
  • rayapp/template_test_runner.go
    • Modified the signatures of RunAllTemplateTests and RunTemplateTest to accept a nightly boolean parameter.
    • Updated the runTemplateTestsWithFilter function signature to include the nightly parameter.
    • Implemented a check in runTemplateTestsWithFilter to ensure --ray-version and --nightly are mutually exclusive.
    • Introduced a needsOverride boolean to simplify conditional logic for version/nightly overrides.
    • Added error handling and logging for BYOD cluster environments and non-Ray image URIs when --nightly is active.
    • Modified the logic to conditionally call overrideClusterEnvNightly or overrideClusterEnvRayVersion based on the nightly flag.
  • rayapp/template_test_runner_test.go
    • Updated all existing calls to runTemplateTestsWithFilter to include the new nightly parameter, typically set to false.
    • Added new test cases for TestRunTemplateTestsWithNightlyOverride to verify correct image URI overriding when the --nightly flag is used.
    • Included test cases to confirm that TestRunTemplateTestsWithNightlyOverride correctly errors on BYOD images and non-Ray images.
    • Added a test case to verify that runTemplateTestsWithFilter returns an error when both --nightly and --ray-version are specified.
Activity
  • The pull request introduces a new feature to test against nightly Ray images.
  • The author, elliot-barn, implemented the --nightly flag and associated logic.
  • The changes include modifications to core application logic, command-line parsing, and template processing.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

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

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 effectively introduces a --nightly flag for testing against nightly Ray images. The implementation is solid, with good validation for mutually exclusive flags and comprehensive new tests for the added functionality. My main feedback is around the error handling strategy. Currently, the process fails immediately if an incompatible template is found when using --nightly with test all. I've suggested a change to collect these errors and continue testing other templates for a better user experience. Overall, this is a great addition.

Comment on lines +165 to +171
if nightly {
return fmt.Errorf(
"template %q uses BYOD cluster env, "+
"which is not compatible with --nightly",
t.Name,
)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Returning an error here will cause the entire test run to fail if a single template is incompatible with the --nightly flag. When running tests for all templates, it would be better to treat this as a failure for this specific template and continue with the others. Consider collecting these configuration errors and reporting them all at the end, similar to how test failures are aggregated in the failed slice.

Comment on lines +190 to +196
if nightly {
return fmt.Errorf(
"template %q image_uri %q is not a ray image, "+
"which is not compatible with --nightly",
t.Name, t.ClusterEnv.ImageURI,
)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Similar to the BYOD check, returning an error here will stop the entire test run. When running against all templates, it would be more user-friendly to collect this as a configuration error for this template and continue testing other compatible templates.

Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
@elliot-barn elliot-barn removed the request for review from sai-miduthuri March 17, 2026 18:17
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
Comment on lines +57 to +62
if nightlyTagRe.MatchString(imageURI) {
// Nightly images don't need --ray-version; the version
// is embedded in the image URI tag.
} else {
args = append(args, "--ray-version", rayVersion)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The "empty-if" block seems a bit clunky. Can we have a log message or just turn it into a if !nightlyTagRe.MatchString(imageURI) with a comment explaining why we don't want to provide the --ray-version arg?

Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
Comment on lines +190 to 200
var env *ClusterEnv
if nightly {
env, err = overrideClusterEnvNightly(t.ClusterEnv)
} else {
env, err = overrideClusterEnvRayVersion(t.ClusterEnv, rayVersion)
}
if err != nil {
return fmt.Errorf("override ray version for %q: %w", t.Name, err)
}
t.ClusterEnv = env
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we have a validation after this to check that the replacement succeeded, and that the new image URI is not the same as the old image URI?

Or else, can we have a validation within the overrideClusterEnv* functions to check that t.ClusterEnv's image actually has a version that matches the regex we replace? Trying to catch edge cases such as template configs written to use latest versions or something like that.

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.

2 participants