Skip to content
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

add volcano gang-scheduler pg min resource calculation #566

Merged
merged 3 commits into from
Jun 16, 2023

Conversation

lowang-bh
Copy link
Member

@lowang-bh lowang-bh commented Jun 11, 2023

Fix #535

  1. add priorityClassLister in volcano podgroup controller
  2. update calculatePGMinResources for volcano podgroup
  3. add testcase about replicasOrder

Signed-off-by: lowang_bh <lhui_wang@163.com>
Copy link
Member

@tenzen-y tenzen-y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lowang-bh Thank you for creating this PR!

Comment on lines 173 to 177
// calculatePGMinResources calculate minResources for volcano podGroup
// default to total replicas
// ret: https://github.com/volcano-sh/volcano/blob/1933d46bdc4434772518ebb74c4281671ddeffa1/pkg/webhooks/admission/jobs/mutate/mutate_job.go#L168
// ref: https://github.com/volcano-sh/volcano/blob/1933d46bdc4434772518ebb74c4281671ddeffa1/pkg/controllers/job/job_controller_actions.go#L761
func (v *VolcanoCtrl) calculatePGMinResources(minMember *int32, mpiJob *kubeflow.MPIJob) *corev1.ResourceList {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't set minResources, does the volcano automatically calculate resources and fill out the PodGroup?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I test this it will not set minResources when it is empty. it will automatically calculate minResources just in a vcJob.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have raised an issue a few months ago about this to keep correspding with vcjob when handle other podgroups. volcano-sh/volcano#2791

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Thanks for the clarifications.
Can you update this comment?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about the latest?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I left a comment.

pkg/controller/podgroup.go Outdated Show resolved Hide resolved
Comment on lines 173 to 177
// calculatePGMinResources calculate minResources for volcano podGroup
// default to total replicas
// ret: https://github.com/volcano-sh/volcano/blob/1933d46bdc4434772518ebb74c4281671ddeffa1/pkg/webhooks/admission/jobs/mutate/mutate_job.go#L168
// ref: https://github.com/volcano-sh/volcano/blob/1933d46bdc4434772518ebb74c4281671ddeffa1/pkg/controllers/job/job_controller_actions.go#L761
func (v *VolcanoCtrl) calculatePGMinResources(minMember *int32, mpiJob *kubeflow.MPIJob) *corev1.ResourceList {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Thanks for the clarifications.
Can you update this comment?

pkg/controller/podgroup.go Outdated Show resolved Hide resolved
pkg/controller/podgroup.go Outdated Show resolved Hide resolved
pkg/controller/podgroup_test.go Outdated Show resolved Hide resolved
@tenzen-y
Copy link
Member

@lowang-bh Also, can you update the PR description?

Signed-off-by: lowang_bh <lhui_wang@163.com>
@lowang-bh
Copy link
Member Author

@lowang-bh Also, can you update the PR description?

Done

@tenzen-y
Copy link
Member

@terrytangyuan Can you approve CI?

Co-authored-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
Copy link
Member

@tenzen-y tenzen-y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! @lowang-bh Overall LGTM
/lgtm
/assign @alculquicondor

Copy link
Collaborator

@alculquicondor alculquicondor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alculquicondor

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot merged commit caa1112 into kubeflow:master Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider handling the minResources when using volcano as a gang scheduler
3 participants