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

How to distribute wasm plugins? #48

Closed utam0k closed 10 months ago

utam0k commented 10 months ago

Is it outside the scope of this project to consider a standard distribution method for the wasm plugins? How about thinking about standardizing this to take advantage of Wasm's portability potential?

I came up with the idea based on OCI Artifacts of having the scheduler bring it from some configuration file at startup. There should be more complex considerations such as priorities. But as a simple one, I can have an example configuration file like this.

sanposhi/good-plugin:v1.0.0
utam0k/nice-value-plugin:v0.01

And bring them in using OCI Artifacts.

The author of the plugin will also distribute it using the same OCI Artifacts. This would be a familiar approach for Cloud Native. It's still a rough idea in my mind, but it's interesting.

We should think about whether we want the media type to be wasm or something unique. However, it should be considered further down the road.

For reference, there is a similar movement in containerd. https://github.com/containerd/containerd/pull/8699

I would like to know the reaction of the community. It may not be necessary to consider this right now. However, I believe that making it easy to use plug-ins with the best of WASM will make this project a success.

codefromthecrypt commented 10 months ago

I think the general idea is to support multiple ways, via URL, similar to istio

In practice, I found a lot of people were using configmaps to distribute proxy wasm, regardless of recommendations. It is likely that the minimum wasm binary size when we are done will be more than 1MB and less than 2MB.

I found only one occurrance of anyone using OCI in github for proxy-wasm, perhaps because it is more complicated than normal http ref, as well the layer type is not compressed.

TL'DR' We'll first support the most widely used and easiest, which is file and http refs. I think a container image style would add value, as you could host static files your wasm might need. However, http would happen next.

codefromthecrypt commented 10 months ago

ps I think that this is a duplicate of #27, so that one is likely the better to follow for updates. I think we won't be ready for a couple weeks to progress this topic. Meanwhile, if you don't mind closing this in favor of #27, much appreciated!

utam0k commented 10 months ago

If this issue put this option in your head, I am satisfied. Thank you.