-
Notifications
You must be signed in to change notification settings - Fork 543
support scheduler plugins #3612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
support scheduler plugins #3612
Conversation
55d376d
to
a054ab9
Compare
@kevin85421 Hi, Please have a look when you have time. Thanks! |
@KunWuLuan can you resolve the conflict? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure your PR can run successfully. I tried to run your PR but it failed to create PodGroup
.
You also need to update the following places
kuberay/helm-chart/kuberay-operator/values.yaml
Lines 49 to 76 in 75ea7ae
# Enable customized Kubernetes scheduler integration. If enabled, Ray workloads will be scheduled # by the customized scheduler. # * "enabled" is the legacy option and will be deprecated soon. # * "name" is the standard option, expecting a scheduler name, supported values are # "default", "volcano", and "yunikorn". # # Note: "enabled" and "name" should not be set at the same time. If both are set, an error will be thrown. # # Examples: # 1. Use volcano (deprecated) # batchScheduler: # enabled: true # # 2. Use volcano # batchScheduler: # name: volcano # # 3. Use yunikorn # batchScheduler: # name: yunikorn # batchScheduler: # Deprecated. This option will be removed in the future. # Note, for backwards compatibility. When it sets to true, it enables volcano scheduler integration. enabled: false # Set the customized scheduler name, supported values are "volcano" or "yunikorn", do not set # "batchScheduler.enabled=true" at the same time as it will override this option. name: "" if config.BatchScheduler == volcano.GetPluginName() || config.BatchScheduler == yunikorn.GetPluginName() { - Add a sample config named
ray-cluster.kube-scheduler.yaml
toray-operator/config/samples/
folder
Follow-up:
ray-operator/controllers/ray/batchscheduler/scheduler-plugins/scheduler_plugins.go
Outdated
Show resolved
Hide resolved
ray-operator/controllers/ray/batchscheduler/scheduler-plugins/scheduler_plugins.go
Outdated
Show resolved
Hide resolved
ray-operator/controllers/ray/batchscheduler/scheduler-plugins/scheduler_plugins.go
Outdated
Show resolved
Hide resolved
Hi, I have update the helm chart and make sure it works in my local environment. Please have a look when you have time.Thanks |
34d3f44
to
a8048b0
Compare
metadata: | ||
name: test-podgroup-0 | ||
labels: | ||
ray.io/gang-scheduling-enabled: "true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should be using ray.io/* labels for any of the scheduler integrations. The label prefix should be specific to the integration (see other examples with Volcano, Yunikorn and Kueue)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, ray.io/gang-scheduling-enabled
is used in the sample of yunikorn, and ray.io/scheduler-name: volcano
is used when we need to use volcano.
And these labels are defined here:
kuberay/ray-operator/controllers/ray/utils/constant.go
Lines 35 to 37 in 75a63a5
RaySchedulerName = "ray.io/scheduler-name" | |
RayPriorityClassName = "ray.io/priority-class-name" | |
RayClusterGangSchedulingEnabled = "ray.io/gang-scheduling-enabled" |
We didn't create a new label for new scheduler.
if !k.isGangSchedulingEnabled(rc) { | ||
return nil | ||
} | ||
replica := int32(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why start at 1? Is it for the head pod? If so can you add a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is for the head pod.
// AddMetadataToPod adds essential labels and annotations to the Ray pods | ||
// the scheduler needs these labels and annotations in order to do the scheduling properly | ||
func (k *KubeScheduler) AddMetadataToPod(_ context.Context, app *rayv1.RayCluster, groupName string, pod *corev1.Pod) { | ||
// when gang scheduling is enabled, extra annotations need to be added to all pods |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
annotations or labels?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made the mistakes. Thanks.
|
||
// AddMetadataToPod adds essential labels and annotations to the Ray pods | ||
// the scheduler needs these labels and annotations in order to do the scheduling properly | ||
func (k *KubeScheduler) AddMetadataToPod(_ context.Context, app *rayv1.RayCluster, groupName string, pod *corev1.Pod) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/app/cluster
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please explain the comment? Thank you!
// when gang scheduling is enabled, extra annotations need to be added to all pods | ||
if k.isGangSchedulingEnabled(app) { | ||
// the group name for the head and each of the worker group should be different | ||
pod.Labels[KubeSchedulerPodGroupLabelKey] = app.Name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should PodGroups be scheduled at the worker group level or RayCluster level? I feel like worker group level could make more sense in some cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the head is not available, the workers will be blocked, this is unacceptable for my customers. So I think the head should be checked with the workers.
Please also resolve conflicts. We now use single |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also need to add permission for creating PodGroup
here
rules: |
Signed-off-by: kunwuluan <[email protected]>
update ValidateBatchSchedulerConfig() update helm chart Rename the function. Signed-off-by: kunwuluan <[email protected]>
… start the operator. Signed-off-by: kunwuluan <[email protected]>
a8048b0
to
21f4f88
Compare
# 4. Use PodGroup | ||
# batchScheduler: | ||
# name: kube-scheduler | ||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also need to update L53 to
# "default", "volcano", "yunikorn", and "kube-scheduler".
func TestCalculateDesiredResources(t *testing.T) { | ||
a := assert.New(t) | ||
|
||
cluster := createTestRayCluster(1) | ||
|
||
totalResource := utils.CalculateDesiredResources(&cluster) | ||
|
||
// 256m * 3 (requests, not limits) | ||
a.Equal("768m", totalResource.Cpu().String()) | ||
|
||
// 256Mi * 3 (requests, not limits) | ||
a.Equal("768Mi", totalResource.Memory().String()) | ||
|
||
// 2 GPUs total | ||
a.Equal("2", totalResource.Name("nvidia.com/gpu", resource.BinarySI).String()) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are you testing here? It seems that you didn't test anything specific to the kube scheduler plugin.
Please also install |
I discussed this with @MortalHappiness offline. Since this PR still requires some work before it can be merged, I’ve removed the |
325c140
to
54f786f
Compare
54f786f
to
7c572f7
Compare
Signed-off-by: KunWuLuan <[email protected]>
7c572f7
to
1e40ceb
Compare
Support PodGroup of scheduler-plugins
#3611
Checks