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

fix nodenumber plugin to use Pod name instead of pod.spec.nodeName #132

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

YZ775
Copy link
Contributor

@YZ775 YZ775 commented Nov 14, 2024

What type of PR is this?

/kind bug

What this PR does / why we need it:

The nodeNumber plugin is intended to scores higher if the node name and pod name suffixes match.
But in implementation, it uses Pod's .Spec.nodeName not a .metadata.Name.
So PreScore allways return nothing, and therefore allways match=true in Score.

This PR fix this problem

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

change nodeNumber plugin to follow specification.

What are the benchmark results of this change?

after.txt
before.txt

❯ benchstat before.txt after.txt
goos: darwin
goarch: arm64
pkg: sigs.k8s.io/kube-scheduler-wasm-extension/internal/e2e/scheduler
cpu: Apple M1
                                      │  before.txt  │              after.txt              │
                                      │    sec/op    │    sec/op     vs base               │
Example_NodeNumber/Simple/New-8         497.5m ± 14%   506.5m ±  1%        ~ (p=0.394 n=6)
Example_NodeNumber/Simple/Run-8         177.8µ ± 30%   169.1µ ± 10%        ~ (p=0.310 n=6)
Example_NodeNumber/Simple_Log/New-8     531.7m ± 19%   501.5m ±  4%        ~ (p=0.310 n=6)
Example_NodeNumber/Simple_Log/Run-8     206.7µ ± 17%   213.9µ ± 19%        ~ (p=0.310 n=6)
Example_NodeNumber/Advanced/New-8        1.081 ± 12%    1.076 ±  5%        ~ (p=1.000 n=6)
Example_NodeNumber/Advanced/Run-8       62.07µ ±  4%   69.25µ ±  3%  +11.56% (p=0.002 n=6)
Example_NodeNumber/Advanced_Log/New-8    1.084 ± 80%    1.066 ±  4%        ~ (p=0.937 n=6)
Example_NodeNumber/Advanced_Log/Run-8   76.83µ ± 17%   79.26µ ±  2%        ~ (p=0.394 n=6)
geomean                                 9.265m         9.338m         +0.78%

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 14, 2024
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Nov 14, 2024
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Nov 15, 2024
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

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sanposhiho, YZ775

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 Nov 15, 2024
@k8s-ci-robot k8s-ci-robot merged commit b7b0d94 into kubernetes-sigs:main Nov 15, 2024
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/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants