Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/testdata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,6 @@ jobs:
run: make testdata

- name: Check diff
run: git diff --exit-code -- .
run: | # Ignore file mode.
git config core.filemode false
git diff --exit-code -- .
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
gofumpt := mvdan.cc/gofumpt@v0.5.0
gosimports := github.com/rinchsan/gosimports/cmd/gosimports@v0.3.8
golangci_lint := github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0
golangci_lint := github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.5
tinygo_targets := examples/nodenumber/main.wasm examples/advanced/main.wasm examples/imagelocality/main.wasm guest/testdata/cyclestate/main.wasm guest/testdata/filter/main.wasm guest/testdata/score/main.wasm \
guest/testdata/bind/main.wasm guest/testdata/reserve/main.wasm guest/testdata/handle/main.wasm guest/testdata/permit/main.wasm \
internal/e2e/scheduler_perf/wasm/nodenumber/main.wasm
Expand Down
6 changes: 1 addition & 5 deletions examples/advanced/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@ module sigs.k8s.io/kube-scheduler-wasm-extension/examples/advanced
go 1.22.0

require (
github.com/wasilibs/nottinygc v0.4.0
sigs.k8s.io/kube-scheduler-wasm-extension/guest v0.0.0-00010101000000-000000000000
sigs.k8s.io/kube-scheduler-wasm-extension/kubernetes/proto v0.0.0-00010101000000-000000000000
)

require (
github.com/magefile/mage v1.14.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
)
require google.golang.org/protobuf v1.30.0 // indirect

replace sigs.k8s.io/kube-scheduler-wasm-extension/guest => ./../../guest

Expand Down
4 changes: 0 additions & 4 deletions examples/advanced/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/magefile/mage v1.14.0 h1:6QDX3g6z1YvJ4olPhT1wksUcSa/V0a1B+pJb73fBjyo=
github.com/magefile/mage v1.14.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
github.com/wasilibs/nottinygc v0.4.0 h1:h1TJMihMC4neN6Zq+WKpLxgd9xCFMw7O9ETLwY2exJQ=
github.com/wasilibs/nottinygc v0.4.0/go.mod h1:oDcIotskuYNMpqMF23l7Z8uzD4TC0WXHK8jetlB3HIo=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
Expand Down
Binary file modified examples/advanced/main.wasm
Binary file not shown.
38 changes: 37 additions & 1 deletion examples/advanced/plugin/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func Test_NodeNumber(t *testing.T) {
t.Fatalf("unexpected status: %v", status)
}

score, status := plugin.Score(state, nil, tc.nodeName)
score, status := plugin.Score(state, nil, testNodeInfo{name: tc.nodeName})
if status != nil {
t.Fatalf("unexpected status: %v", status)
}
Expand Down Expand Up @@ -173,3 +173,39 @@ func (t testPod) Spec() *protoapi.PodSpec {
func (t testPod) Status() *protoapi.PodStatus {
return nil
}

type testNodeInfo struct {
name string
}

func (t testNodeInfo) GetUid() string {
return ""
}

func (t testNodeInfo) GetName() string {
return t.name
}

func (t testNodeInfo) GetNamespace() string {
return ""
}

func (t testNodeInfo) GetResourceVersion() string {
return "v1"
}

func (t testNodeInfo) GetLabels() map[string]string {
return map[string]string{}
}

func (t testNodeInfo) GetAnnotations() map[string]string {
return map[string]string{}
}

func (t testNodeInfo) Node() proto.Node {
return nil
}

func (t testNodeInfo) ImageStates() map[string]*api.ImageStateSummary {
return nil
}
Binary file modified examples/imagelocality/main.wasm
Binary file not shown.
Binary file modified examples/nodenumber/main.wasm
Binary file not shown.
Binary file modified guest/testdata/bind/main.wasm
Binary file not shown.
Binary file modified guest/testdata/cyclestate/main.wasm
Binary file not shown.
Binary file modified guest/testdata/filter/main.wasm
Binary file not shown.
Binary file modified guest/testdata/handle/main.wasm
Binary file not shown.
Binary file modified guest/testdata/permit/main.wasm
Binary file not shown.
Binary file modified guest/testdata/reserve/main.wasm
Binary file not shown.
Binary file modified guest/testdata/score/main.wasm
Binary file not shown.
2 changes: 0 additions & 2 deletions internal/e2e/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ require (
github.com/labstack/echo v3.3.10+incompatible
github.com/stealthrocket/wzprof v0.1.5
github.com/tetratelabs/wazero v1.7.2
github.com/wasilibs/nottinygc v0.7.1
go.uber.org/zap v1.27.0
k8s.io/api v0.33.4
k8s.io/apimachinery v0.33.4
Expand Down Expand Up @@ -93,7 +92,6 @@ require (
github.com/json-iterator/go v1.1.12 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/labstack/gommon v0.4.0 // indirect
github.com/magefile/mage v1.14.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.11 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
Expand Down
4 changes: 0 additions & 4 deletions internal/e2e/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ github.com/labstack/echo v3.3.10+incompatible h1:pGRcYk231ExFAyoAjAfD85kQzRJCRI8
github.com/labstack/echo v3.3.10+incompatible/go.mod h1:0INS7j/VjnFxD4E2wkz67b8cVwCLbBmJyDaka6Cmk1s=
github.com/labstack/gommon v0.4.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8=
github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM=
github.com/magefile/mage v1.14.0 h1:6QDX3g6z1YvJ4olPhT1wksUcSa/V0a1B+pJb73fBjyo=
github.com/magefile/mage v1.14.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/mattn/go-colorable v0.1.11 h1:nQ+aFkoE2TMGc0b68U2OKSexC+eq46+XwZzWXHRmPYs=
Expand Down Expand Up @@ -205,8 +203,6 @@ github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyC
github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
github.com/wasilibs/nottinygc v0.7.1 h1:rKu19+SFniRNuSo5NX7/wxpSpXmMUmkcyt/YiWLJg8w=
github.com/wasilibs/nottinygc v0.7.1/go.mod h1:oDcIotskuYNMpqMF23l7Z8uzD4TC0WXHK8jetlB3HIo=
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
github.com/xiang90/probing v0.0.0-20221125231312-a49e3df8f510 h1:S2dVYn90KE98chqDkyE9Z4N61UnQd+KOfgp5Iu53llk=
Expand Down
6 changes: 1 addition & 5 deletions internal/e2e/guest/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@ module sigs.k8s.io/kube-scheduler-wasm-extension/internal/e2e/guest
go 1.22.0

require (
github.com/wasilibs/nottinygc v0.4.0
sigs.k8s.io/kube-scheduler-wasm-extension/guest v0.0.0-00010101000000-000000000000
sigs.k8s.io/kube-scheduler-wasm-extension/kubernetes/proto v0.0.0-00010101000000-000000000000
)

require (
github.com/magefile/mage v1.14.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
)
require google.golang.org/protobuf v1.30.0 // indirect

replace sigs.k8s.io/kube-scheduler-wasm-extension/guest => ./../../../guest

Expand Down
4 changes: 0 additions & 4 deletions internal/e2e/guest/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/magefile/mage v1.14.0 h1:6QDX3g6z1YvJ4olPhT1wksUcSa/V0a1B+pJb73fBjyo=
github.com/magefile/mage v1.14.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
github.com/wasilibs/nottinygc v0.4.0 h1:h1TJMihMC4neN6Zq+WKpLxgd9xCFMw7O9ETLwY2exJQ=
github.com/wasilibs/nottinygc v0.4.0/go.mod h1:oDcIotskuYNMpqMF23l7Z8uzD4TC0WXHK8jetlB3HIo=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
Expand Down
Binary file modified internal/e2e/scheduler_perf/wasm/nodenumber/main.wasm
Binary file not shown.
Loading