Skip to content

Allow configuration of wasmtime features #431

@tanishiking

Description

@tanishiking

containerd-shim-spin currently constructs the underlying Wasmtime engine from spin_core::Config::default() and immediately creates the engine, and there seems no way to override the runtime configuration.

async fn compiler() -> Option<SpinCompiler> {
let mut config = spin_core::Config::default();
Some(SpinCompiler(
wasmtime::Engine::new(config.wasmtime_config()).unwrap(),
))
}

https://github.com/spinframework/spin/blob/a794d6e7a514af693f8779c4dfe9f59f391118d0/crates/core/src/lib.rs#L82-L199

This prevents us (scala-wasm/scala-wasm that uses GC, EH, and CM) from running our binary on spin shim.


I'm not very sure how should we design the configuration passing to wasmtime for spin:

There's a same issue in runwasi containerd/runwasi#1004 and I prototyped a feature containerd/runwasi#1105 that shim reads env variable in TOML format and give it to underlying wasmtime. And this way, we can configure wasmtime at the deployment site (not on cluster configuration). But not sure this applies to spin as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions