nri
nri copied to clipboard
Drop tinygo requirement
Fixes https://github.com/containerd/nri/issues/140
main is not called anymore with a WASI reactor.
https://github.com/containerd/nri/blob/82c65a7af0df946a547cd934370e950bb289d9ee/plugins/wasm/plugin.go#L27-L29
You need to use init() instead.
https://github.com/knqyf263/go-plugin/blob/7819d6147c952d109df10990fe555029aff6c3bc/examples/host-function-library/plugin/plugin.go#L13-L18
Note that main() is still needed for Go to compile Wasm modules.
mainis not called anymore with a WASI reactor.https://github.com/containerd/nri/blob/82c65a7af0df946a547cd934370e950bb289d9ee/plugins/wasm/plugin.go#L27-L29
You need to use
init()instead. https://github.com/knqyf263/go-plugin/blob/7819d6147c952d109df10990fe555029aff6c3bc/examples/host-function-library/plugin/plugin.go#L13-L18Note that
main()is still needed for Go to compile Wasm modules.
Yes, thank you now it works when vendoring the NRI into CRI-O. :+1:
@knqyf263 CI is green now, do we want to cut a new go-plugin release first?
@saschagrunert Thanks for testing it out. I'll cut a new release.
@saschagrunert Is this something that would be important to get behind an NRI tag, so we could pull it in on the CRI-O side ?
If it is, then maybe one alternative would be to branch off a 0.9 release branch and merge this there, but keep if off main until all parties involved/affected are content with moving to go 1.24 as the minimum version.
If it is, then maybe one alternative would be to branch off a 0.9 release branch and merge this there, but keep if off main until all parties involved/affected are content with moving to go 1.24 as the minimum version.
I think that's a valuable solution, yes. We will move to go 1.24 in the future in any case.
A build tag will not work with the go module requirements if I think about it, because go modules are not tag aware. Means we need the go 1.24 requirement independently of any build constraints.
@klihub do you have a new base branch where I could rebase on?
@klihub do you have a new base branch where I could rebase on?
No, sorry, not yet.
I think this can be rebased on main now. containerd will also move to 1.24 for our next release (2.2).
@saschagrunert Now we could rebase this and try to get it merged. I tried to do that, but I was hasty with my push (to your original source branch, argh... sorry :see_no_evil:) and now I can't figure out what I screwed up compared to your saved original branch, or if it is something extra that the additions since the base branch of that tree would require, since the WASM plugin compiles in your original but not in the updated version.
@saschagrunert Now we could rebase this and try to get it merged. I tried to do that, but I was hasty with my push (to your original source branch, argh... sorry 🙈) and now I can't figure out what I screwed up compared to your saved original branch, or if it is something extra that the additions since the base branch of that tree would require, since the WASM plugin compiles in your original but not in the updated version.
@saschagrunert I think I managed to figure it out now... will update with a fixed branch.
@klihub thank you!
The matrix for go still includes 1.23.9 but during the setup for that version in switches to 1.24.3 instead.. thus we end up using 1.24.3 twice in CI..
I removed that version from the matrix.
nit because this can be said for all the plugins.. TODO: need some readme docs for the WASM implementation... linking to https://github.com/knqyf263/go-plugin docs if nec..; explanation of special pkg/api; something for the plugin; and a test would be nice.
Yeah I can follow-up on docs and tests.