Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal for Configuration File Support in Wasmtime #8784

Open
Mossaka opened this issue Jun 12, 2024 · 3 comments
Open

Proposal for Configuration File Support in Wasmtime #8784

Mossaka opened this issue Jun 12, 2024 · 3 comments

Comments

@Mossaka
Copy link
Member

Mossaka commented Jun 12, 2024

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.

@fitzgen
Copy link
Member

fitzgen commented Jun 12, 2024

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.

@pchickey
Copy link
Contributor

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

@Mossaka
Copy link
Member Author

Mossaka commented Jun 13, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants