Skip to content

scheduler: add 'none' scheduler_type to skip PodGroup creation#976

Draft
jiaenren wants to merge 1 commit into
mainfrom
jiaenr/default-scheduler-exp
Draft

scheduler: add 'none' scheduler_type to skip PodGroup creation#976
jiaenren wants to merge 1 commit into
mainfrom
jiaenr/default-scheduler-exp

Conversation

@jiaenren

@jiaenren jiaenren commented May 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Implements Option C from #936: a new BackendSchedulerType.NONE that skips PodGroup CR creation and runs pods on the K8s default scheduler — removing the kai-scheduler hard dependency for workflows that don't need gang scheduling.

  • BackendSchedulerType accepts 'none' in addition to 'kai'.
  • get_k8s_object_factory() returns the base K8sObjectFactory(scheduler_name) for NONE. The base class already does what 'none' needs:
    • no PodGroup CR (just pods)
    • scheduler_name written to pod.spec.schedulerName
    • no scheduler resource CRDs (queues, topologies)
    • priority_supported / topology_supported return False
  • openapi.json + UI generated types mirror the new enum value.

15 lines of code change across 5 files. The default behavior (scheduler_type='kai') is unchanged.

Test plan

OETF scenario test (in the internal harness, not part of this PR) exercises the path end-to-end on KIND:

  1. POST /api/configs/backend/default with scheduler_type='none', scheduler_name='default-scheduler'.
  2. Submit validation/workflow/serial_workflow.yaml.
  3. Expect COMPLETED.
  4. addCleanup restores the original backend config.

TDD verification on oetf:deploy --env kind --build-local:

Run State Result
pass-on-good full Option C PASS (workflow completes; no PodGroup CR is created)
fail-on-bad enum + factory branch reverted FAIL with 422 Input should be 'kai' (the exact symptom from #936)
pass-on-good (re-verify) fix restored PASS

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added support for a "none" backend scheduler option. When selected, pod scheduling uses the Kubernetes default scheduler instead of gang-scheduling, allowing for more flexible resource allocation configurations.

Adds `BackendSchedulerType.NONE` so workflows can run on the K8s default
scheduler without a kai-scheduler dependency. With `scheduler_type='none'`,
the base K8sObjectFactory writes `scheduler_name` to `pod.spec.schedulerName`
and skips PodGroup CR creation, scheduler resource CRDs (queues, topologies),
and priority/topology features — exactly Option C from #936.

Mirrors the new enum value into the generated UI types.

Resolves #936.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jiaenren jiaenren requested a review from a team as a code owner May 8, 2026 08:12
@coderabbitai

coderabbitai Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: d61d2377-dd6a-4c31-8d8a-d9ece1613272

📥 Commits

Reviewing files that changed from the base of the PR and between 01a90b5 and 3e3baa2.

📒 Files selected for processing (5)
  • src/ui/openapi.json
  • src/ui/src/lib/api/generated.ts
  • src/ui/src/mocks/generated-mocks.ts
  • src/utils/connectors/postgres.py
  • src/utils/job/kb_objects.py

📝 Walkthrough

Walkthrough

This PR extends the backend scheduler type system from kai to include none. The change propagates through the OpenAPI schema, generated TypeScript client types, Python enum definition, and scheduler factory implementation to support Kubernetes scheduling without gang-scheduler/PodGroup features.

Changes

Add NONE scheduler type support

Layer / File(s) Summary
API Contract
src/ui/openapi.json
OpenAPI schema enum extends BackendSchedulerType to include "none" alongside "kai".
Generated Client Types
src/ui/src/lib/api/generated.ts, src/ui/src/mocks/generated-mocks.ts
TypeScript generated API types and mock constants reflect the new none scheduler option in BackendSchedulerType.
Backend Scheduler Type Definition
src/utils/connectors/postgres.py
Python BackendSchedulerType enum adds NONE = 'none' member with documentation explaining behavior without gang-scheduler/PodGroup creation.
Scheduler Factory Implementation
src/utils/job/kb_objects.py
get_k8s_object_factory() adds explicit conditional branch for BackendSchedulerType.NONE to return base K8sObjectFactory with provided scheduler_name, replacing the prior unconditional error for unsupported scheduler types.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A scheduler type called "none" hops in,
No gang-gangs, no PodGroups—how light and slim!
Through schemas and types, the change does spring,
K8s default scheduling: the simplest thing! 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately and concisely describes the main change: adding a 'none' scheduler type to skip PodGroup creation, which aligns with the core objective of supporting Kubernetes default scheduler without gang-scheduler dependencies.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jiaenr/default-scheduler-exp

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented May 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 25.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.53%. Comparing base (01a90b5) to head (3e3baa2).

Files with missing lines Patch % Lines
src/utils/job/kb_objects.py 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #976      +/-   ##
==========================================
- Coverage   44.53%   44.53%   -0.01%     
==========================================
  Files         218      218              
  Lines       28537    28540       +3     
  Branches     4260     4261       +1     
==========================================
+ Hits        12708    12709       +1     
- Misses      15208    15210       +2     
  Partials      621      621              
Flag Coverage Δ
backend 45.42% <25.00%> (-0.01%) ⬇️
ui 34.60% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/utils/connectors/postgres.py 71.50% <100.00%> (+0.01%) ⬆️
src/utils/job/kb_objects.py 77.95% <0.00%> (-0.85%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jiaenren jiaenren marked this pull request as draft May 11, 2026 19:24
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.

1 participant