Repository navigation
Conversation
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 improves GKE JobSet scheduling by refining how exclusive-topology annotations are applied. By switching to 'kubernetes.io/hostname' for single-node jobs, it prevents unnecessary pod anti-affinity across entire node pools, thereby improving resource utilization and scheduling flexibility for single-node workloads. Highlights
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 the 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 counterproductive. 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 updates the GKE manifest generation logic to dynamically set the 'exclusive-topology' annotation based on the number of nodes per slice. Specifically, it uses 'kubernetes.io/hostname' for single-node slices and 'cloud.google.com/gke-nodepool' for multi-node slices, while omitting the annotation entirely for dynamic or static slicing. The changes include updates to the manifest generator, the corresponding template, and comprehensive unit tests to verify the annotation logic across various configurations. I have no feedback to provide as the implementation is clear and well-tested.
|
LGTM , one nit comment. |
083bd3b to
89fa4e9
Compare
0365d22
into
GoogleCloudPlatform:develop
Summary
When generating GKE
JobSetmanifests without dynamic or static sub-slicing (!opts.IsDynamicSlicing && !opts.IsStaticSlicing),prepareJobSetTemplateDatapreviously setalpha.jobset.sigs.k8s.io/exclusive-topology: cloud.google.com/gke-nodepoolunconditionally, andpathways_jobset.tmplhardcodedalpha.jobset.sigs.k8s.io/exclusive-topology: cloud.google.com/gke-nodepoolon theworkerreplicatedJob.For single-host slice topologies (
NodesPerSlice <= 1, such as TPU2x2x1,1x1, or single-node GPU/CPU jobs), each slice replica consists of a single pod on a single host. On clusters where multiple independent single-host nodes are grouped into a shared multi-node GKE node pool, settingexclusive-topology: cloud.google.com/gke-nodepoolcauses the JobSet controller to inject pod anti-affinity across the entirecloud.google.com/gke-nodepooldomain—blocking concurrent single-node jobs or multi-sliceNodesPerSlice == 1jobs from scheduling onto the remaining free hosts in that node pool.Changes
pkg/orchestrator/gke/manifest_generator.go(prepareJobSetTemplateData):alpha.jobset.sigs.k8s.io/exclusive-topology: kubernetes.io/hostnamewhenopts.NodesPerSlice <= 1(and neither dynamic nor static sub-slicing is active).alpha.jobset.sigs.k8s.io/exclusive-topology: cloud.google.com/gke-nodepoolwhenopts.NodesPerSlice > 1.pkg/orchestrator/gke/templates/pathways_jobset.tmpl:alpha.jobset.sigs.k8s.io/exclusive-topology: cloud.google.com/gke-nodepoolannotation on theworkerreplicatedJob with{{.ExclusiveTopologyAnnotation}}(guarded by{{- if .ExclusiveTopologyAnnotation }}).pkg/orchestrator/gke/manifest_generator_test.go:TestGenerateGKEManifest_ExclusiveTopologyandTestGeneratePathwaysManifest_ExclusiveTopology) verifyingexclusive-topologybehavior for single-node slices (NodesPerSlice <= 1), multi-node slices (NodesPerSlice > 1), dynamic slicing, and static slicing.