Skip to content

[Feature] Remove AddMetadataToPod in BatchScheduler interface #4097

@win5923

Description

@win5923

Search before asking

  • I had searched in the issues and found no similar feature requirement.

Description

Replace the RayCluster-only method AddMetadataToPod with AddMetadataToChildResource to support RayJob and future CRDs. This simplifies scheduler integration and future extensibility.

// BatchScheduler manages submitting RayCluster pods to a third-party scheduler.
type BatchScheduler interface {
// Name corresponds to the schedulerName in Kubernetes:
// https://kubernetes.io/docs/tasks/extend-kubernetes/configure-multiple-schedulers/
Name() string
// DoBatchSchedulingOnSubmission handles submitting the RayCluster/RayJob to the batch scheduler on creation / update
// For most batch schedulers, this results in the creation of a PodGroup.
DoBatchSchedulingOnSubmission(ctx context.Context, object metav1.Object) error
// AddMetadataToPod enriches the pod with metadata necessary to tie it to the scheduler.
// For example, setting labels for queues / priority, and setting schedulerName.
// This function will be removed once Rayjob Volcano scheduler integration is completed.
AddMetadataToPod(ctx context.Context, rayCluster *rayv1.RayCluster, groupName string, pod *corev1.Pod)
// AddMetadataToChildResource enriches the child resource (batchv1.Job, rayv1.RayCluster) with metadata necessary to tie it to the scheduler.
// For example, setting labels for queues / priority, and setting schedulerName.
AddMetadataToChildResource(ctx context.Context, parent metav1.Object, child metav1.Object, groupName string)
}

Use case

No response

Related issues

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions