Repository navigation
scheduler_perf: create pods and PodGroups from the group ops - #143388
yashaggarwal85d wants to merge 2 commits into
Conversation
|
Hi @yashaggarwal85d. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: yashaggarwal85d 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 |
|
/ok-to-test /test pull-kubernetes-scheduler-perf /cc @iomarsayed |
e885c5e to
699e57f
Compare
|
/assign |
iomarsayed
left a comment
There was a problem hiding this comment.
Thanks for taking this. Here are my first set of comments.
| // It creates the configured number of PodGroups from a template and | ||
| // then waits for them to be visible in the scheduler's informer cache. | ||
| // This ensures that subsequent operations (like creating pods that reference these pod groups) won't fail due to cache lag. | ||
| // This ensures that the pods referencing these pod groups won't fail due to cache lag. |
There was a problem hiding this comment.
I think the old comment still applies, let's just change the word subsequent because it is not the most accurate anymore:
| // This ensures that the pods referencing these pod groups won't fail due to cache lag. | |
| // This ensures that dependent operations (like creating pods that reference these pod groups) won't fail due to cache lag. |
There was a problem hiding this comment.
Made the suggested change
| PodsPerGroup int | ||
| // PodsPerGroupParam is the name of the parameter that determines PodsPerGroup. | ||
| PodsPerGroupParam string | ||
| // Pods describes the pods that get created for these PodGroups once they are cached. | ||
| // Count and Namespace must not be set, they are derived from the PodGroups. | ||
| // podsPerGroup is passed to the pod template. | ||
| // Optional. | ||
| Pods *createPodsOp |
There was a problem hiding this comment.
Please let's rename this variable into the operation name: createPodsOp.
It will have a better reflection in configs and readability.
Also this field cannot be optional, It is not sensible to have a CPG tree without PodGroups for our scheduler perf tests.
Let's also add tests to ensure this field is present.
There was a problem hiding this comment.
Made the suggested change
| // Count and Namespace must not be set, they are derived from the hierarchy. | ||
| // parentLevel and childrenPodGroupsPerCPG are passed to the PodGroup template. | ||
| // Optional. | ||
| PodGroups *createPodGroups |
There was a problem hiding this comment.
Same comment, please let's rename this variable into the operation name: createPodGroupsOp.
It will have a better reflection in configs and readability.
Also this field cannot be optional, It is not sensible to have a CPG tree without PodGroups for our scheduler perf tests.
Let's also add tests to ensure this field is present.
There was a problem hiding this comment.
Renamed!
But For createPodGroups I kept it optional for now because dra/workloadresourceclaims and starvation still use createPodGroups on its own
| // This ensures that the PodGroups referencing these CompositePodGroups won't fail due to cache lag. | ||
| // If op.PodGroups is set, it then creates the leaf PodGroups. |
There was a problem hiding this comment.
| if cpg.TemplatePath == "" { | ||
| return fmt.Errorf("templatePath must be set") | ||
| } | ||
| if cpg.Pods == nil { |
There was a problem hiding this comment.
Once the operation field is not optional, this validation should be adjusted to return an error immediately.
| if err := cpg.isValid(false); err != nil { | ||
| return nil, err | ||
| } | ||
| if cpg.Pods != nil { |
There was a problem hiding this comment.
Once the operation field is not optional, we don't need this check anymore, where isValid() will check for it and fail immedaitely.
| if !allowParameterization && ccpg.ChildrenPodGroupsPerCPG < 1 { | ||
| return fmt.Errorf("childrenPodGroupsPerCPG must be greater than 0, got %d", ccpg.ChildrenPodGroupsPerCPG) | ||
| } | ||
| if ccpg.PodGroups != nil { |
There was a problem hiding this comment.
Same here: Once the operation field is not optional, this validation should be adjusted to return an error immediately.
There was a problem hiding this comment.
Done, it returns an error now if createPodGroupOp isn't set
e697a88 to
bab6463
Compare
|
Hey @iomarsayed, thanks for the review, I was making these changes and forgot to reply. Thanks for waiting. I have made some fixes as suggested. lemme reply to the comments as well |
|
In DRA, measurePods is a total that the pod template spreads round-robin with Mod.Index.PodGroupCount, so per-group creation would change which pods land in which group. Starvation runs a churn op between creating the PodGroup and the pods. Do you want me to move those over in this PR too, or keep it optional for those cases? |
bab6463 to
0340d75
Compare
|
/test pull-kubernetes-unit |
What type of PR is this?
/kind cleanup
/sig scheduling
/wg workload-aware-scheduling
What this PR does / why we need it:
Follow-up from #141706. createPodGroups now has an optional
pods(a createPods spec) andpodsPerGroup/podsPerGroupParam, and createCompositePodGroups has an optionalpodGroups. The nested op gets its count and namespace from the parent, andpodsPerGroup/parentLevel/childrenPodGroupsPerCPGare passed to its template. That lets us dropcountMultiplierParam, the$podGroupsCountand$parentLevelparams that createCompositePodGroups used to write into the workload params, andparams.set. All configs that used the old pattern are moved over. Standalone createPodGroups and createPods still work as before.Which issue(s) this PR is related to:
Fixes #143281
Special notes for your reviewer:
Ran
go test ./test/integration/scheduler_perf/and theTestSchedulerPerfintegration tests (short and non-short) for cpg, podgroup/..., default_preemption and workload_preemption.Does this PR introduce a user-facing change?
AI usage disclosure:
YES. This PR was written in part with the assistance of generative AI (drafting the change and migrating the configs). I reviewed and tested it, and I'm responsible for the changes.