nri icon indicating copy to clipboard operation
nri copied to clipboard

API to reload plugins

Open saschagrunert opened this issue 1 year ago • 2 comments

The feature would be a Reload API to be able to reload gRPC and Wasm plugins. I assume this can be done in two parts, because the problem domain is somehow different.

Wasm plugins can be reloaded by detecting binary changes on disk and then restarting the in-memory service. This would come with a new dependency like fsnotify.

gRPC plugins would have to re-establish the connection to the server, probably by dropping active client connections.

Thoughts?

saschagrunert avatar Dec 12 '24 09:12 saschagrunert

The feature would be a Reload API to be able to reload gRPC and Wasm plugins. I assume this can be done in two parts, because the problem domain is somehow different.

Wasm plugins can be reloaded by detecting binary changes on disk and then restarting the in-memory service. This would come with a new dependency like fsnotify.

gRPC plugins would have to re-establish the connection to the server, probably by dropping active client connections.

Thoughts?

I think (as long as the WASM runtime does not keep plugins mmapped, which it does not seem to be doing) this could be a way of doing updates of WASM plugins. For native binary plugins, I think an explicit unlink/remove is required before a new version can be installed. So if we choose this method of updating, maybe for uniformity we should require WASM binaries to be first removed, so we could extend this later to cover native binaries as well.

klihub avatar Dec 12 '24 13:12 klihub

gRPC plugins would have to re-establish the connection to the server, probably by dropping active client connections.

Related: https://github.com/containerd/nri/issues/167

samuelkarp avatar May 23 '25 21:05 samuelkarp