← Back to Pull requests

feat(api): add MinMember configuration for workload scheduling #3093

Open
unknown opened this pull request with 348 lines diff across 4 files
View on GitHub
unknown unknown commented on Aug 14, 2026 11:29 UTC
Author

Part of #2962

Purpose of this PR

Adds the preparatory API surface for the upcoming native Kubernetes Workload/PodGroup (scheduling.k8s.io/v1alpha2) batch-scheduler backend. No user-facing behavior change in this release — the workload scheduler name is not yet registered.

Proposed changes:

  • api/v1beta2: add PodSchedulingGroup type and SchedulingGroup field on SparkPodSpec, plus MinMember field on BatchSchedulerConfiguration. SchedulingGroup is operator-managed (set by the workload scheduler backend); MinMember is an optional user override for the gang minCount.

  • internal/webhook: add validateWorkloadSchedulerFields() that rejects user-set schedulingGroup fields and emits a warning when batchSchedulerOptions.queue is set with batchScheduler=workload (queue has no effect on the Workload API). Table-driven unit tests included.

  • charts: add scheduling.k8s.io RBAC rule (workloads, podgroups) gated on new controller.batchScheduler.workload.enable Helm value (default false).

  • Generated: deepcopy, CRD schemas (both SparkApplication and ScheduledSparkApplication), OpenAPI spec, Python SDK models.
  • Change Category

  • Bugfix (non-breaking change which fixes an issue)

  • Feature (non-breaking change which adds functionality)

  • Breaking change (fix or feature that could affect existing functionality)

  • Documentation update
  • Rationale

    Unblocks the follow-up workload scheduler backend PR by landing API types, webhook validation, and RBAC first, as additive plumbing with zero behavior change for existing Volcano/YuniKorn/kube-scheduler paths. workload is not yet a registered scheduler name, so none of this is reachable by users yet.

    Checklist

  • I have conducted a self-review of my own code.

  • I have updated documentation accordingly. (N/A — user docs land in a follow-up PR)

  • I have added tests that prove my changes are effective or that my feature works.

  • Existing unit tests pass locally with my changes.
  • Additional Notes

  • Diff is ~490 lines, above the original ~110–144 estimate — the delta is entirely generated surface: OpenAPI spec (swagger.json), Python SDK client models, and CRD schema for ScheduledSparkApplication (which embeds the same pod spec, so it needed regen too, not just SparkApplication). No hand-written logic beyond the types/webhook/RBAC changes above.

  • RBAC is gated behind a new controller.batchScheduler.workload.enable values flag (default false) rather than granted unconditionally, since no scheduler backend consumes it until the follow-up PR.

  • make manifests/make generate re-run; generated diffs (deepcopy, OpenAPI, CRDs, Python SDK) included and verified against source types.
  • Diff: 348 lines (+261 / -87) across 4 files Reviewer: RobuRishabh Review duration: 72673m
    All Vouch review confidence checks passed
    Residual risk 0.40 = Change Risk (0.73) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.73 · 348 lines diff across 4 files
    0.73
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    44%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.350
    Shallow Review Depth shallow_review_depth
    0.344
    Sensitive Paths sensitive_paths
    0.073
    Real PR Conversation Timeline
    1 comments
    "Review active on #3093"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: medium confidence: 44.7% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 72.6% (HIGH) · Higher = larger blast radius
    72.6%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 44.7% · Lower = rushed or shallow review
    44.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 40.2% · Moderate risk
    40.2%