Stream: git-wasmtime

Topic: wasmtime / issue #8784 Proposal for Configuration File Su...


view this post on Zulip Wasmtime GitHub notifications bot (Jun 12 2024 at 17:28):

Mossaka opened issue #8784:

Thanks for filing a feature request! Please fill out the TODOs below.

Feature

Wasmtime's configurability is flexible such as the pooling allocation strategy or enable/disable parallel compilation. However, this configurations can also be programmatically set using the wasmtime::Config struct. I am proposing to add support for a configuration file that Wasmtime can consume.

Benefit

Services (such as containerd wasmtime-shim) that uses wasmtime APIs to compile and execute Wasm components today rely on environment variables to configure Wasmtime engine. Whether it is to disable parallel compilation or change the pooling allocation strategy. With the huge number of configuration options that wasmtime provides, it is difficult for users and service providers to maintain these dynamic configuration options. We suggest using a TOML or YAML file for the configuration file due to their readability.

Implementation

  1. Parsing Configuration File:
    Implement a parser to read and deserialize the configuration file into a wasmtime::Config struct.

  2. Applying Configuration:
    Extend the wasmtime::Config struct with methods to apply settings from the deserialized configuration.

Alternatives

Interestingly, wasmtime CLI has a config command in which you can use it to create a new config.

$ wasmtime config new
Successfully created a new configuration file at '/home/mossaka/.config/wasmtime/config.toml'.

However, this config command is used ONLY for cache configuration, which is a tiny fraction of the total configuration options that wasmtime provides.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 12 2024 at 17:28):

Mossaka edited issue #8784:

Feature

Wasmtime's configurability is flexible such as the pooling allocation strategy or enable/disable parallel compilation. However, this configurations can also be programmatically set using the wasmtime::Config struct. I am proposing to add support for a configuration file that Wasmtime can consume.

Benefit

Services (such as containerd wasmtime-shim) that uses wasmtime APIs to compile and execute Wasm components today rely on environment variables to configure Wasmtime engine. Whether it is to disable parallel compilation or change the pooling allocation strategy. With the huge number of configuration options that wasmtime provides, it is difficult for users and service providers to maintain these dynamic configuration options. We suggest using a TOML or YAML file for the configuration file due to their readability.

Implementation

  1. Parsing Configuration File:
    Implement a parser to read and deserialize the configuration file into a wasmtime::Config struct.

  2. Applying Configuration:
    Extend the wasmtime::Config struct with methods to apply settings from the deserialized configuration.

Alternatives

Interestingly, wasmtime CLI has a config command in which you can use it to create a new config.

$ wasmtime config new
Successfully created a new configuration file at '/home/mossaka/.config/wasmtime/config.toml'.

However, this config command is used ONLY for cache configuration, which is a tiny fraction of the total configuration options that wasmtime provides.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 12 2024 at 17:35):

fitzgen commented on issue #8784:

Extending the existing cache-config TOML for general Wasmtime options makes sense to me.

We probably want to refactor our config and CLI and (now) TOML code such that there is one source of truth that automatically makes knobs for each configurable thing in all those various places.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 12 2024 at 17:42):

Mossaka edited issue #8784:

Feature

Wasmtime offers flexible configurability through options like the "pooling allocation strategy" and "parallel compilation", which can be set programmatically using the wasmtime::Config struct. To simplify this process and enhance usability, I propose adding support for a configuration file that Wasmtime can consume. This would enable users to configure the engine using a straightforward and centralized file format.

Benefit

Services (such as containerd wasmtime-shim) that uses wasmtime APIs to compile and execute Wasm components today rely on environment variables to configure Wasmtime engine. Whether it is to disable parallel compilation or change the pooling allocation strategy. With the huge number of configuration options that wasmtime provides, it is difficult for users and service providers to maintain these dynamic configuration options. We suggest using a TOML or YAML file for the configuration file due to their readability.

Implementation

  1. Parsing Configuration File:
    Implement a parser to read and deserialize the configuration file into a wasmtime::Config struct.

  2. Applying Configuration:
    Extend the wasmtime::Config struct with methods to apply settings from the deserialized configuration.

Alternatives

Interestingly, wasmtime CLI has a config command in which you can use it to create a new config.

$ wasmtime config new
Successfully created a new configuration file at '/home/mossaka/.config/wasmtime/config.toml'.

However, this config command is used ONLY for cache configuration, which is a tiny fraction of the total configuration options that wasmtime provides.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 12 2024 at 20:02):

pchickey commented on issue #8784:

This seems like a good idea to me - thanks @Mossaka. Agreed with Nick.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 13 2024 at 17:41):

Mossaka commented on issue #8784:

Thanks, I might get someone to help with this or do it myself.


Last updated: Dec 23 2024 at 13:07 UTC