Skip to content

rbgs support pod group policy#107

Merged
Syspretor merged 1 commit intosgl-project:mainfrom
nightmeng:fix/rbgs-support-pod-group
Nov 20, 2025
Merged

rbgs support pod group policy#107
Syspretor merged 1 commit intosgl-project:mainfrom
nightmeng:fix/rbgs-support-pod-group

Conversation

@nightmeng
Copy link
Copy Markdown
Contributor

Ⅰ. Motivation

  • Fix the bug where a RoleBasedGroupSet with podGroupPolicy creates RoleBasedGroups that do not inherit that policy, so PodGroup metadata never reaches the RoleBasedGroup and gang scheduling breaks.

Ⅱ. Modifications

  • In the RoleBasedGroupSet reconciler, detect whether podGroupPolicy is set on the RBGS and, if so, propagate the field to every generated RoleBasedGroup so it can correctly handle PodGroup creation.

Ⅲ. Does this pull request fix one issue?

NONE

Ⅳ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.

  • No new tests; the change is a small wiring fix and is already covered by existing RBGS/RBG e2e flows.

Ⅴ. Describe how to verify it

  • Deploy the updated controller, create an RBGS that specifies podGroupPolicy, and confirm each resulting RoleBasedGroup now contains the same podGroupPolicy.
  • Observe via kubectl get podgroup (or Volcano equivalent) that PodGroups are created/updated for each RoleBasedGroup.
  • Remove the RBGS and ensure the associated RoleBasedGroups and PodGroups are garbage collected.

VI. Special notes for reviews

  • Double-check that the propagation only happens when the RBGS actually specifies podGroupPolicy, to avoid altering RoleBasedGroups that do not need it.

Checklist

  • NONE

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @nightmeng, 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 resolves a critical bug concerning the inheritance of podGroupPolicy within the RoleBasedGroupSet (RBGS) controller. Previously, when an RBGS was configured with a podGroupPolicy, this policy was not being correctly passed down to the individual RoleBasedGroup (RBG) instances it created. This oversight prevented the PodGroup metadata from reaching the RBGs, thereby disrupting gang scheduling functionality. The changes introduce a direct propagation of the podGroupPolicy from the RBGS template to the RBG specification during creation, ensuring that all generated RBGs correctly inherit and apply the necessary policy for proper gang scheduling.

Highlights

  • Bug Fix: Addresses an issue where a RoleBasedGroupSet (RBGS) with a podGroupPolicy failed to propagate this policy to its generated RoleBasedGroups (RBG), which caused gang scheduling to break.
  • Policy Propagation: Ensures that the podGroupPolicy defined in an RBGS's template is correctly inherited by each newly created RoleBasedGroup, allowing PodGroup metadata to reach the RBGs.
  • Minimal Change: The modification is a small wiring fix within the RBGS reconciler, specifically in the function responsible for creating new RoleBasedGroups, ensuring proper data flow.
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
Copy Markdown

@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 correctly addresses a bug where the podGroupPolicy from a RoleBasedGroupSet was not being propagated to the RoleBasedGroup it creates. The change ensures this policy is now included when new RoleBasedGroup objects are generated. I have one suggestion to improve the robustness of the implementation by using a deep copy for the spec, which will prevent potential future issues related to shared data.

Comment thread internal/controller/workloads/rolebasedgroupset_controller.go
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug where RoleBasedGroupSet's podGroupPolicy field was not being propagated to child RoleBasedGroup objects, breaking gang scheduling functionality. The fix adds PodGroupPolicy field propagation when creating new RoleBasedGroups from the RoleBasedGroupSet template.

Key changes:

  • Propagate PodGroupPolicy field from RoleBasedGroupSet template to RoleBasedGroup spec during creation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Syspretor
Copy link
Copy Markdown
Collaborator

/lgtm
/approve

@Syspretor
Copy link
Copy Markdown
Collaborator

@nightmeng Thanks for this contribution!

@Syspretor Syspretor merged commit 3659382 into sgl-project:main Nov 20, 2025
10 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.

4 participants