golemcloud / golem

Golem is an open source durable computing platform that makes it easy to build and deploy highly reliable distributed systems.
https://learn.golem.cloud/
Apache License 2.0
530 stars 59 forks source link

Call component transformers when instantiating a component #1037

Open vigoo opened 3 weeks ago

vigoo commented 3 weeks ago

After https://github.com/golemcloud/golem/issues/1034 each specific component version has an ordered list of active plugins. Taking the only the component transformers from this list, when compiling and instantiating a component WASM, we have to apply these transformations in order to get a final WASM.

This needs to be done in worker-executor-base, with it will work properly even with the precompilation in the component compilation service.

Immutability

With this solution the set of active plugins are static for a given component version. This means that changing the plugin configuration will create a new component version, and by it automatically leaves the existing workers as they are, but new workers are created with the new configuration. This is also compatible with the existing compilation cache where we can apply the transformations and compile the WASM to native code and safely store that associated with a given component version.

What happens if the plugin itself changes, and it no longer emits the same transformed component? (Unlike with oplog processors, we don't have full control of this because the transfomers are external web hooks).

I propose the simplest solution for Golem 1.1: