kubernetes-sigs / kube-scheduler-wasm-extension

All the things to make the scheduler extendable with wasm.
Apache License 2.0
83 stars 16 forks source link

Port NodeNumberPlugin from kube-scheduler-simulator and consolidate testdata #60

Closed codefromthecrypt closed 9 months ago

codefromthecrypt commented 9 months ago

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

This begins a port NodeNumberPlugin from kube-scheduler-simulator.

This also inlines tests formerly in the examples directory so that the directory only contains code likely to be used.

Next, to reduce future maintenance, this also completes the logic underpinning plugin type assertions with coarse grained features, as otherwise it is a cartesian product of thousands of types.

Finally, this consolidates to only benchmark top-level examples, as it shows the real number to drive down and eliminates the chance of a half-hour benchmark over similar results.

Which issue(s) this PR fixes:

NONE

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

What are the benchmark results of this change?

goos: darwin
goarch: arm64
pkg: sigs.k8s.io/kube-scheduler-wasm-extension/internal/e2e
BenchmarkExample_NodeNumber/New-12                18      64160595 ns/op
BenchmarkExample_NodeNumber/New-12                19      63456697 ns/op
BenchmarkExample_NodeNumber/New-12                18      63693097 ns/op
BenchmarkExample_NodeNumber/New-12                18      63560113 ns/op
BenchmarkExample_NodeNumber/New-12                18      63810428 ns/op
BenchmarkExample_NodeNumber/New-12                18      63957285 ns/op
BenchmarkExample_NodeNumber/Run-12             23043         51786 ns/op
BenchmarkExample_NodeNumber/Run-12             23161         51404 ns/op
BenchmarkExample_NodeNumber/Run-12             23209         51270 ns/op
BenchmarkExample_NodeNumber/Run-12             23342         51468 ns/op
BenchmarkExample_NodeNumber/Run-12             23334         51074 ns/op
BenchmarkExample_NodeNumber/Run-12             23288         51255 ns/op
PASS
ok      sigs.k8s.io/kube-scheduler-wasm-extension/internal/e2e  18.911s
codefromthecrypt commented 9 months ago

@sanposhiho ok finally ready!

k8s-ci-robot commented 9 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: codefromthecrypt, 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: - ~~[OWNERS](https://github.com/kubernetes-sigs/kube-scheduler-wasm-extension/blob/main/OWNERS)~~ [codefromthecrypt,sanposhiho] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment