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

support postfilter plugin #75

Merged
merged 1 commit into from
Nov 26, 2023
Merged

Conversation

Gekko0114
Copy link
Member

@Gekko0114 Gekko0114 commented Oct 28, 2023

What type of PR is this?

/kind feature
/kind api-change

What this PR does / why we need it:

Support postfilter plugin

Which issue(s) this PR fixes:

Part of #72

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Support postfilter plugin

What are the benchmark results of this change?

goos: darwin
goarch: amd64
pkg: sigs.k8s.io/kube-scheduler-wasm-extension/internal/e2e/scheduler
cpu: Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
                                      │  before.txt  │              after.txt               │
                                      │    sec/op    │    sec/op      vs base               │
Example_NodeNumber/Simple/New-4         198.7m ± 79%    222.6m ± 16%        ~ (p=0.310 n=6)
Example_NodeNumber/Simple/Run-4         475.3µ ± 40%    767.4µ ± 41%  +61.46% (p=0.041 n=6)
Example_NodeNumber/Simple_Log/New-4     189.3m ±  0%    209.4m ± 31%  +10.59% (p=0.015 n=6)
Example_NodeNumber/Simple_Log/Run-4     348.7µ ± 31%    411.6µ ± 18%        ~ (p=0.132 n=6)
Example_NodeNumber/Advanced/New-4       217.4m ±  2%    417.0m ± 34%  +91.86% (p=0.002 n=6)
Example_NodeNumber/Advanced/Run-4       79.20µ ±  1%    95.36µ ± 34%  +20.40% (p=0.002 n=6)
Example_NodeNumber/Advanced_Log/New-4   216.7m ±  1%    257.8m ± 39%  +18.94% (p=0.002 n=6)
Example_NodeNumber/Advanced_Log/Run-4   95.40µ ±  2%   131.44µ ± 18%  +37.77% (p=0.002 n=6)
geomean                                 6.213m          8.169m        +31.50%

@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. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 28, 2023
@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Oct 28, 2023
Makefile Outdated Show resolved Hide resolved
scheduler/plugin/mask.go Outdated Show resolved Hide resolved
@Gekko0114
Copy link
Member Author

Hi @sanposhiho ,

Though this is a draft, I have some questions.
Could you answer my comments above?
Thanks,

guest/api/types.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 29, 2023
@Gekko0114 Gekko0114 force-pushed the postfilter branch 2 times, most recently from f340750 to 02eb28d Compare October 31, 2023 07:50
@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 Nov 4, 2023
@Gekko0114 Gekko0114 force-pushed the postfilter branch 7 times, most recently from 323abb6 to 21d8397 Compare November 7, 2023 23:52
@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Nov 19, 2023
@Gekko0114 Gekko0114 force-pushed the postfilter branch 2 times, most recently from a88785c to 3bfbab0 Compare November 19, 2023 08:52
@Gekko0114
Copy link
Member Author

@sanposhiho ,
Thanks for your comments!
Fixed or replied. PTAL again

@Gekko0114 Gekko0114 force-pushed the postfilter branch 4 times, most recently from 6830418 to 6354c6d Compare November 23, 2023 02:30
guest/testdata/cyclestate/main.go Outdated Show resolved Hide resolved
guest/testdata/cyclestate/main.go Outdated Show resolved Hide resolved
guest/testdata/cyclestate/main.go Outdated Show resolved Hide resolved
guest/testdata/cyclestate/main.go Outdated Show resolved Hide resolved

func (statePlugin) PreScore(state api.CycleState, pod proto.Pod, _ proto.NodeList) *api.Status {
if unsafe.Pointer(pod.Spec()) != unsafe.Pointer(podSpec) {
panic("didn't cache pod from post-filter")
Copy link
Member

Choose a reason for hiding this comment

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

Also, this cache for pod should always be stored at pre-fiter.

guest/api/types.go Outdated Show resolved Hide resolved
guest/api/types.go Outdated Show resolved Hide resolved
@Gekko0114 Gekko0114 force-pushed the postfilter branch 2 times, most recently from efd0979 to a9a8130 Compare November 24, 2023 11:27
@Gekko0114
Copy link
Member Author

Thanks for your review, @sanposhiho !
Fixed it, PTAL again.

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.

Perfection, it's a huge step, thanks!

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 26, 2023
@sanposhiho
Copy link
Member

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 26, 2023
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.

one nit

guest/api/types.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 26, 2023
@Gekko0114
Copy link
Member Author

@sanposhiho ,
Thanks, fixed it. PTAL

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.

/lgtm
/approve
/unhold

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Nov 26, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Gekko0114, 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 merged commit 3c8342a into kubernetes-sigs:main Nov 26, 2023
6 checks passed
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/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API 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. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants