-
Notifications
You must be signed in to change notification settings - Fork 664
RayJob Volcano Integration #3972
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
Changes from 1 commit
6e4184a
973fe82
2ee7e8a
92e7d95
dd38daa
a33a3b7
42479c2
597e57d
a64c011
b8cb224
84d39f9
cf6b48b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,13 +78,23 @@ func (v *VolcanoBatchScheduler) handleRayJob(ctx context.Context, rayJob *rayv1. | |
| // MinMember intentionally excludes the submitter pod to avoid a startup deadlock | ||
| // (submitter waits for cluster; gang would wait for submitter). We still add the | ||
| // submitter's resource requests into MinResources so capacity is reserved. | ||
| if rayJob.Spec.SubmissionMode == rayv1.K8sJobMode || rayJob.Spec.SubmissionMode == rayv1.SidecarMode { | ||
| submitterResource := getSubmitterResource(rayJob) | ||
| totalResourceList = append(totalResourceList, submitterResource) | ||
| return v.syncPodGroup(ctx, rayJob, minMember, utils.SumResourceList(totalResourceList)) | ||
| } | ||
|
|
||
| func getSubmitterResource(rayJob *rayv1.RayJob) corev1.ResourceList { | ||
| if rayJob.Spec.SubmissionMode == rayv1.K8sJobMode { | ||
| submitterTemplate := common.GetSubmitterTemplate(&rayJob.Spec, rayJob.Spec.RayClusterSpec) | ||
| submitterResource := utils.CalculatePodResource(submitterTemplate.Spec) | ||
| totalResourceList = append(totalResourceList, submitterResource) | ||
| return utils.CalculatePodResource(submitterTemplate.Spec) | ||
| } else if rayJob.Spec.SubmissionMode == rayv1.SidecarMode { | ||
| submitterContainer := common.GetDefaultSubmitterContainer(rayJob.Spec.RayClusterSpec) | ||
| return corev1.ResourceList{ | ||
| corev1.ResourceCPU: submitterContainer.Resources.Requests[corev1.ResourceCPU], | ||
| corev1.ResourceMemory: submitterContainer.Resources.Requests[corev1.ResourceMemory], | ||
|
||
| } | ||
| } | ||
|
|
||
| return v.syncPodGroup(ctx, rayJob, minMember, utils.SumResourceList(totalResourceList)) | ||
| return corev1.ResourceList{} | ||
| } | ||
|
|
||
| func getAppPodGroupName(object metav1.Object) 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.
Do we need to do this for SidecarMode?
Uh oh!
There was an error while loading. Please reload this page.
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 think in SidecarMode, when calculating the head pod's resource, we will call the function
CalculatePodResource, and this func will iterate all containers in the head pod spec like thisfor _, container := range podSpec.Containers.so I think sidecar mode will work, but if we can get a screenshot about a test for sidecar mode I will appreciate it.
cc @win5923
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.
wait, @rueian is right.
when using sidecar mode, the
Min Resources'sCPUshoulde be3.5, but this is not correct here.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.
Thanks @rueian!
I’ve already added the check for SidecarMode. ae2941f