Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

refactor PodGroup control with more generic design #185

Closed
wants to merge 5 commits into from

Conversation

zw0610
Copy link
Member

@zw0610 zw0610 commented Jan 26, 2022

To support scheduler-plugins/coscheduling, this pr refactors the podgroup-related code.

Addressing: kubeflow/training-operator#1518

Test PR: kubeflow/training-operator#1526

@zw0610
Copy link
Member Author

zw0610 commented Jan 27, 2022

test pr with kubeflow training-operator for this common pr: kubeflow/training-operator#1526

@@ -469,7 +456,7 @@ func (jc *JobController) createNewPod(job interface{}, rt string, index int, spe
return nil
}

func isNonGangSchedulerSet(replicas map[apiv1.ReplicaType]*apiv1.ReplicaSpec) bool {
func isAnotherGangSchedulerSet(replicas map[apiv1.ReplicaType]*apiv1.ReplicaSpec, gangSchedulerName string) bool {
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps something like isCustomSchedulerSet?

Copy link
Member Author

Choose a reason for hiding this comment

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

sounds better.

"k8s.io/apimachinery/pkg/util/intstr"
)

type PGFillSpecFunc func(object metav1.Object) error
Copy link
Member

Choose a reason for hiding this comment

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

Spell out PG?

Copy link
Member Author

Choose a reason for hiding this comment

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

PodGroup. Maybe FillPodGroupSpecFunc will be more illustrative.

@@ -191,7 +193,7 @@ func (jc *JobController) ReconcileJobs(
return err
}

if jc.Config.EnableGangScheduling {
if jc.Config.EnableGangScheduling() {
Copy link
Member

Choose a reason for hiding this comment

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

Is this typo or intentional?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is intentional. Because this PR is expanding the gang-scheduler options, instead of adding another field for the name of gang-scheduler, Config only stores the name of gang-scheduler. The EnableGangScheduling() method returns false if None is set for the name of the gang-scheduler, otherwise it returns true.

@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign gaocegege for approval by writing /assign @gaocegege in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@tenzen-y
Copy link
Member

I take over this PR.

@tenzen-y
Copy link
Member

@zw0610 We can close this PR since #203 is merged.

@zw0610
Copy link
Member Author

zw0610 commented Jan 21, 2023 via email

@google-oss-prow google-oss-prow bot closed this Jan 21, 2023
@google-oss-prow
Copy link

@zw0610: Closed this PR.

In response to this:

/close

On Sat, Jan 21, 2023 at 23:02 Yuki Iwai @.***> wrote:

@zw0610 https://github.com/zw0610 We can close this PR since #203
#203 is merged.


Reply to this email directly, view it on GitHub
#185 (comment), or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AK7V6IW7FWRX7JWUCUOTPDDWTP3ATANCNFSM5M3H4B3A
.
You are receiving this because you were mentioned.Message ID:
@.***>

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants