-
Notifications
You must be signed in to change notification settings - Fork 1k
Add RayService interpreter & RayJob/RayCluster interpreter tests #7042
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @seanlaii, 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 introduces and enhances the resource interpretation capabilities for Ray.io custom resources within a Kubernetes environment. It provides new Lua-based interpretation rules for 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. 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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
The pull request introduces new resource interpreter customizations and associated test data for Ray.io API resources, specifically RayCluster, RayJob, and RayService. For RayCluster and RayJob, new test cases were added to interpretcomponent-test.yaml to cover various configurations of head and worker groups, including those with custom names, no explicit names, and zero replicas. The interprethealth-test.yaml files for both RayCluster and RayJob were significantly expanded to include comprehensive health interpretation scenarios, defining specific conditions for healthy and unhealthy states, such as head readiness, cluster provisioning, replica failures, job deployment status, and job completion status. For RayService, a new customizations.yaml file was added, defining Lua scripts for componentResource (extracting head and worker groups from rayClusterConfig), healthInterpretation (based on the Ready condition), statusAggregation (combining conditions, serve endpoints, and active/pending service statuses across multiple clusters), and dependencyInterpretation (identifying ConfigMaps, Secrets, ServiceAccounts, and PVCs from pod templates). Review comments highlight the need to correct a field name from applicationStatuses to ApplicationStatuses in the statusAggregation Lua script for RayService to ensure consistency with the Ray API specification and to remove temporary FIX comments.
...lt/thirdparty/resourcecustomizations/ray.io/v1/RayService/testdata/interprethealth-test.yaml
Show resolved
Hide resolved
...terpreter/default/thirdparty/resourcecustomizations/ray.io/v1/RayService/customizations.yaml
Outdated
Show resolved
Hide resolved
...terpreter/default/thirdparty/resourcecustomizations/ray.io/v1/RayService/customizations.yaml
Outdated
Show resolved
Hide resolved
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7042 +/- ##
=======================================
Coverage 46.55% 46.56%
=======================================
Files 700 700
Lines 48084 48091 +7
=======================================
+ Hits 22384 22392 +8
- Misses 24016 24017 +1
+ Partials 1684 1682 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f1ea2ee to
80c768a
Compare
|
/gemini review |
There was a problem hiding this 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 introduces comprehensive ResourceInterpreterCustomization definitions for RayService and expands existing ones for RayCluster and RayJob. For RayService, new Lua scripts are added to interpret components (head and worker groups with resource requests), aggregate status (combining conditions, serve endpoints, and application statuses from multiple clusters, handling upgrade scenarios), interpret health (based on the 'Ready' condition), and identify dependencies (ConfigMaps, Secrets, ServiceAccounts, PVCs) within the rayClusterConfig's pod templates. For RayCluster and RayJob, the AggregateStatus Lua scripts are updated to explicitly set desiredObj.spec = nil to prevent the spec from being included in aggregated status. Additionally, all three Ray resource types (RayCluster, RayJob, RayService) receive significantly expanded and clarified test cases for AggregateStatus, InterpretComponent, and InterpretHealth functions, covering various healthy and unhealthy states, single/multiple status items, and specific failure modes. A review comment points out an unused upgradeInProgress variable in the RayService health interpretation script, suggesting its removal for clarity.
...terpreter/default/thirdparty/resourcecustomizations/ray.io/v1/RayService/customizations.yaml
Show resolved
Hide resolved
80c768a to
83ce045
Compare
|
Thanks! |
| desiredObj.status = {} | ||
| end | ||
| desiredObj.spec = nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I feel this could be promoted. For aggregateStatus, the spec is useless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, and it is easier to write tests.
| image: rayproject/ray:2.9.0 | ||
| operation: InterpretHealth | ||
| output: | ||
| healthy: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you help add an empty line at the end of the file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, added.
| applicationStatuses: | ||
| api-service: | ||
| status: DEPLOYING | ||
| message: "API service is deploying on new cluster" No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, thanks for the review!
Signed-off-by: seanlaii <[email protected]>
83ce045 to
db198e2
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Which issue(s) this PR fixes:
Part of #6952
Special notes for your reviewer:
I only added the tests for aggregateStatus, component and health operations.
I can also help add the tests for dependency if needed.
Does this PR introduce a user-facing change?: