kubernetes-sigs / kube-scheduler-wasm-extension

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

add protobuf definition and generated Golang code which is buildable with TinyGo #7

Closed sanposhiho closed 12 months ago

sanposhiho commented 12 months ago

What type of PR is this?

/kind feature

What this PR does / why we need it:

add protobuf definition + generated Golang protobuf code which is buildable with TinyGo. We cannot use the proto definitions in kubernetes/api because it depends on many stuff which aren't buildable with TinyGo. (Hopefully, it'll be buildable in the future version of TinyGo.)

The protobuf definition is generated from https://github.com/nytimes/openapi2proto with the patch. And use google.golang.org/protobuf/cmd/protoc-gen-go for Golang code generation.

As you see in ./kubernetes/proto/go.mod, it only depends on google.golang.org/protobuf, which is buildable with TinyGo.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE
sanposhiho commented 12 months ago

/cc @codefromthecrypt

k8s-ci-robot commented 12 months ago

@sanposhiho: GitHub didn't allow me to request PR reviews from the following users: codefromthecrypt.

Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to [this](https://github.com/kubernetes-sigs/kube-scheduler-wasm-extension/pull/7#issuecomment-1556085961): >/cc @codefromthecrypt Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
codefromthecrypt commented 12 months ago

Maybe you can add a test that shows hot to do the following flow? This will help make sure it still works. The test may need to be in the plugin module, in order to avoid leaking v1 deps to the guest.

k8s-ci-robot commented 12 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)~~ [sanposhiho] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
codefromthecrypt commented 12 months ago

I made notes on #6 and not sure how much of https://github.com/kubernetes-sigs/kube-scheduler-wasm-extension/pull/7#issuecomment-1556129351 is needed. Basically, first thing is to make sure we can build tinygo wasm which reads it. For some reason my laptop doesn't respond when trying to build, both 0.27 and dev version of tinygo.

codefromthecrypt commented 12 months ago

In #6 I added code to generate the MarshallVT functions

sanposhiho commented 12 months ago

It's included in #6.

/close

k8s-ci-robot commented 12 months ago

@sanposhiho: Closed this PR.

In response to [this](https://github.com/kubernetes-sigs/kube-scheduler-wasm-extension/pull/7#issuecomment-1560542121): >It's included in #6. > >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
k8s-ci-robot commented 12 months ago

PR needs rebase.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.