Repository navigation
docs(kep): propose workload-aware scheduling for SparkApplication - #3154
RobuRishabh wants to merge 3 commits into
Conversation
|
[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 |
There was a problem hiding this comment.
🟡 Changes recommended
KEP metadata uses a non-standard sentinel value (replaces: "NA") that should be an empty list (or omitted) to avoid breaking or confusing KEP tooling/automation.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR adds a design KEP proposing Kubernetes-native Workload-Aware Scheduling (WAS) support for SparkApplication via a new optional .spec.scheduling API, aligning Spark Operator’s scheduling model with Kubernetes KEP-6089 and related ecosystem direction.
Changes:
- Add a full KEP document describing the proposed
.spec.schedulingAPI surface, defaulting/validation, lifecycle/cleanup, and phased implementation plan. - Add KEP metadata (
kep.yaml) for proposal tracking and review routing.
File summaries
| File | Description |
|---|---|
| proposals/2962-workload-aware-scheduling/README.md | New KEP document detailing API shape, controller/lifecycle design, validation, and rollout plan for native WAS. |
| proposals/2962-workload-aware-scheduling/kep.yaml | New KEP metadata file (title, number, authors, reviewers, links, feature gate). |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
72b8938 to
395033c
Compare
|
This is awesome, thank you for driving this @RobuRishabh! |
|
@andreyvelich: GitHub didn't allow me to request PR reviews from the following users: mm4tt, helayoty. Note that only kubeflow members and repo collaborators can review this PR, and authors cannot review their own PRs. DetailsIn response to this:
Instructions 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/test-infra repository. |
7ee6b9d to
3dda693
Compare
|
One thing worth checking before Phase 0. I looked at the runtime shape in If that shape carries into the version you pin, the per-
Smaller: the RBAC block grants |
36d0e0c to
2b5605b
Compare
|
Hi @sxivansx thanks for the review. Agreed on Phase 0 must pin the exact served API before implementation. This KEP targets Kubernetes v1.37+ and
Phase 0 will bump k8s.io/api / component-helpers to the v1.37+ stack and compile workloadbuilder against those types, IMO we should not implement against the v1alpha1 wire shape in today’s go.mod. |
tariq-hasan
left a comment
There was a problem hiding this comment.
Hi @RobuRishabh! I have added comments inline on the KEP.
|
Hi @andreyvelich @vjanelle @vikas-saxena02 @alimaredia @shruthis4 @nabuskey @vara-bonthu @venkomirisetti @dineshkumar181094 @jacobsalway @tarekabouzeid please review this proposal. Thank You |
| ### Future Goals | ||
|
|
||
| 1. Define dynamic-allocation semantics in a separate KEP. | ||
| 2. Enable topology constraints, DRA resource claims, and disruption modes as upstream APIs mature. |
There was a problem hiding this comment.
I would go ahead and add support for this now in alpha.
Its what we did for JobSet/Job and its not really that much more of a lift.
There was a problem hiding this comment.
Thanks we aligned with Andrey on the TrainJob/JobSet API approach (extensible .spec.scheduling wrapper so CPG/multi-leaf can land without a break).
For behavior, alpha still keeps exactly one executor leaf: Spark has one executor group today, driver stays outside the gang (deadlock), and nabuskey preferred not putting CPG into this phase-1 surface while there’s only one group. Happy to revisit pulling more into alpha if reviewers want the extra lift now.
40600d1 to
a1021bd
Compare
|
Thanks @RobuRishabh, the second-round revision is a big step forward. The alpha I've left 5 inline comments. Summary, in priority order:
Happy to go through any of these at the next Spark Operator community call if that's easier than async. |
|
Hmm so spec.scheduling is new. But we already have similar sounding fields like spec.batchScheduler, spec.batchSchedulerOptions, and schedulerName. So we'd have 4 similar sounding fields. Very confusing. Each SparkApplication maps to one root Workload containing one or more PodGroupTemplates. The alpha implementation should enforce exactly one executor PodGroupTemplate because currently Spark supports exactly one executor group. Spark may decide to be more flexible in the future. We should be prepared for that. In our repo, the order (driver pod first ALWAYS, then executors). The executors should be placed in a pod group(s) created by the operator. So this is where CompositePodGroup could be useful. However, I would not put this in this spec. As of right now, it's not useful because there's exactly one group. As for ownership, in an ideal world, both Spark and the operator must not independently create PodGroups. I honestly don't know if this going to be true in the future. In our ideal world, the operator is the sole owner of PodGroups. |
Thanks @nabuskey this is helpful. Taking the points in order: Four similarly named fields For this alpha KEP I’m keeping:
Full unification under One Workload, one executor PodGroupTemplate in alpha Driver first, then executors / CompositePodGroup Ownership I’ll fold the unify-as-future + “one template now / N later” + operator-owned PodGroups wording into the next KEP revision. |
a1021bd to
0bb2f3e
Compare
I disagree. We are introducing a new field that sounds very very similar to the fields mentioned. What I care the most is the surface at which users operate. The scheduler options are confusing as-is imo. We need a concrete plan for deprecating and moving them under the new field instead of Future Goal / Open Question. |
@nabuskey ok so help me out here, I’d like your guidance on the target shape so I don’t invent the wrong nesting:
|
spec:
scheduling:
schedulingPolicy:
gang: {}
batchScheduler:
name: volcano # volcano | yunikorn
queue: default
priorityClassName: high
resources: {}
Also note that the doc is quite a bit convoluted with duplication. |
Thanks @nabuskey this is very clear to lock in. I’ll treat it as the plan. Few quick confirmations:
Once you confirm these, I’ll update the KEP with this as the written migration plan (and slim the doc). |
- Align the proposal with KEP-6089 and current Kubernetes APIs. - Clarify alpha scope, API evolution, validation, lifecycle, and RBAC. - Document template injection, scheduler conflicts, retries, and suspend cleanup. - Defer Kueue coordination and mirrored scheduling status. - Track the scheduling API separately in PR kubeflow#3230. Signed-off-by: roburishabh <roburishabh@outlook.com>
Pin alpha API to schedulingPolicy.{basic|gang} (Spark-owned, no user
minCount), webhook feature-gates plus reconcile backstop, invalidation
for .spec.scheduling changes, membership delete-then-fail, and admission
deadline semantics. Note forward-compatible multi-leaf/CPG extension
without shipping it in alpha; add reviewers in kep.yaml.
Signed-off-by: roburishabh <roburishabh@outlook.com>
Signed-off-by: roburishabh <roburishabh@outlook.com>
0bb2f3e to
bcab2c8
Compare
Part of #2962.
Design-only PR for Kubernetes-native Workload-Aware Scheduling (WAS) in Spark Operator. It adds KEP-2962 proposing a top-level
SparkApplication.spec.schedulingAPI aligned with KEP-6089, kubernetes/enhancements#6342, and the Kubeflow Trainer KEP.Summary
Workloadobjects via upstreamworkloadbuilder..spec.schedulingpreserves current behavior;SparkApplicationWorkloadAwareSchedulingdefaults to disabled.PodGroup, avoiding the cluster-mode bootstrap deadlock.minCountis controller-computed from Spark's resolved initial executor count; users express scale throughexecutor.instances/sparkConf.Workloadper SparkApplication; eachstatus.submissionIDgets an isolated attempt-scopedPodGroup.scheduling.k8s.io/v1building blocks from #6342 over v1.36 prototype wire types).Alpha vs upstream beta: "Alpha" here is the Spark Operator feature stage (
kep.yamlstage: alpha, gate off by default, narrow MVP). It does not mean KEP-6089 stays alpha — reusable building blocks are graduating to beta via #6342 for Kubernetes v1.38.The KEP is restructured to match the Trainer layout and includes API examples, validation tables, lifecycle semantics, RBAC, graduation criteria, alternatives, and seven Mermaid diagrams (architecture, compile path, sequence, ownership, bootstrap deadlock, and lifecycle).
Thanks to @Rajadi16 for prototype work in #3093, #3113, and #3116. Those PRs are credited as implementation evidence; this PR asks the community to agree on the durable API and lifecycle before implementation continues.
Review focus
Highest-value feedback:
scheduling: {}defaulting (Basic vs Gang), CRD surface area, and behavior when a deployment-level default batch scheduler is also configured..spec.schedulingin alpha.Test plan
proposals/2962-workload-aware-scheduling/README.mdandkep.yaml.workloadbuilder.References