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

Expand simulator plugin to allow arbitrary processing before/after execution of Filter, Score and NormalizeScore #128

Merged
merged 39 commits into from
May 10, 2022

Conversation

196Ikuchil
Copy link
Contributor

@196Ikuchil 196Ikuchil commented Mar 2, 2022

What type of PR is this?

/kind feature

What this PR does / why we need it:

  • We expand this simulator plugin to allow arbitrary processing before/after execution of Filter, Score and NormalizeScore.
  • Implement WithPluginNameOption that allows us to name these plugins.
  • Implement WithWeightOption that allows us to set plugin weight by this option.

Which issue(s) this PR fixes:

Fixes #125

Special notes for your reviewer:

/label tide/merge-method-squash

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 2, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @196Ikuchil. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. label Mar 2, 2022
@k8s-ci-robot k8s-ci-robot requested a review from sanposhiho March 2, 2022 17:17
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Mar 2, 2022
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 3, 2022
@196Ikuchil
Copy link
Contributor Author

196Ikuchil commented Mar 3, 2022

@sanposhiho
We have changed course significantly since yesterday's check.
And since this PR had some conflicts, I did force-push.

The current changes are

  • Move the wrappedplugin to new wrappledplugin.go.
  • Implement three interfaces in wrappledplugin.go.
  • Insert these into the logic.
  • Insert storing process of these results.
  • Run go generate.

}

// apply mocks base method
func (m *MockOption) apply(arg0 *options) {
Copy link
Contributor Author

@196Ikuchil 196Ikuchil Mar 3, 2022

Choose a reason for hiding this comment

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

I ran

//go:generate mockgen -destination=./mock/$GOFILE -source=$GOFILE store, filterPluginExtender, scorePluginExtender, normalizeScorePluginExtender

https://github.com/kubernetes-sigs/kube-scheduler-simulator/pull/128/files#diff-88e5e83973b677bd5a4adc7d8450d0981ba9d1a6a69db4f84bbc67ee6bdb2492R12

I think my implementation way is not good. Could you give me some advice?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe resolve. Fix it tonight.

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Mar 4, 2022
@196Ikuchil 196Ikuchil changed the title [WIP]Expand simulator plugin to allow arbitrary processing before/after execution of Filter, Score and NormalizeScore Expand simulator plugin to allow arbitrary processing before/after execution of Filter, Score and NormalizeScore Mar 5, 2022
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 5, 2022
@196Ikuchil
Copy link
Contributor Author

/assign @sanposhiho

Copy link
Member

@sanposhiho sanposhiho left a comment

Choose a reason for hiding this comment

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

Thanks. Some small nits.

scheduler/plugin/wrappedplugin.go Outdated Show resolved Hide resolved
scheduler/plugin/wrappedplugin.go Outdated Show resolved Hide resolved
scheduler/plugin/wrappedplugin.go Outdated Show resolved Hide resolved
scheduler/plugin/wrappedplugin.go Outdated Show resolved Hide resolved
scheduler/plugin/wrappedplugin.go Outdated Show resolved Hide resolved
Comment on lines 83 to 94

func WithExtendersOption(opt *Extenders) Option {
return extendersOption(*opt)
}

func WithPluginNameOption(opt *string) Option {
return pluginNameOption(*opt)
}

func WithWeightOption(opt *int32) Option {
return weightOption(*opt)
}
Copy link
Member

Choose a reason for hiding this comment

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

Could you add brief explanations for each options?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the reviews!
I added new comments for these options.

scheduler/plugin/wrappedplugin_test.go Outdated Show resolved Hide resolved
196Ikuchil and others added 7 commits April 30, 2022 14:46
Co-authored-by: Kensei Nakada <handbomusic@gmail.com>
Co-authored-by: Kensei Nakada <handbomusic@gmail.com>
Co-authored-by: Kensei Nakada <handbomusic@gmail.com>
Co-authored-by: Kensei Nakada <handbomusic@gmail.com>
Co-authored-by: Kensei Nakada <handbomusic@gmail.com>
Co-authored-by: Kensei Nakada <handbomusic@gmail.com>
Copy link
Member

@sanposhiho sanposhiho left a comment

Choose a reason for hiding this comment

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

small nits

scheduler/plugin/wrappedplugin.go Outdated Show resolved Hide resolved
scheduler/plugin/wrappedplugin.go Show resolved Hide resolved
196Ikuchil and others added 3 commits May 10, 2022 20:30
Co-authored-by: Kensei Nakada <handbomusic@gmail.com>
Co-authored-by: Kensei Nakada <handbomusic@gmail.com>
@196Ikuchil
Copy link
Contributor Author

@sanposhiho Fixed✋

Copy link
Member

@sanposhiho sanposhiho left a comment

Choose a reason for hiding this comment

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

Nice work 🎉
/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 10, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 196Ikuchil, sanposhiho

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 10, 2022
@k8s-ci-robot k8s-ci-robot merged commit a7c02e4 into kubernetes-sigs:master May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expand simulator plugin to allow arbitrary processing before/after execution of Filter, Score...etc
3 participants