Skip to content

Allow configuration of wasmtime features #1004

@tanishiking

Description

@tanishiking

Currently, containerd-shim-wasmtime-v1 doesn't seem to be able to configure the underlying wasmtime runtime.

// Disable Wasmtime parallel compilation for the tests
// see https://github.com/containerd/runwasi/pull/405#issuecomment-1928468714 for details
config.parallel_compilation(!cfg!(test));
config.wasm_component_model(true); // enable component linking
config.async_support(true); // must be on
if use_pooling_allocator_by_default() {
let cfg = wasmtime::PoolingAllocationConfig::default();
config.allocation_strategy(wasmtime::InstanceAllocationStrategy::Pooling(cfg));
}
Self {
engine: wasmtime::Engine::new(&config)
.context("failed to create wasmtime engine")
.unwrap(),
cancel: CancellationToken::new(),

This limitation prevent us from running our Wasm OCI artifact, built from component binary that requires -W function-references,gc unable to run on the shim. (on k8s, it ends up with CrashLoopBackOff).

https://github.com/users/tanishiking/packages/container/package/scala-wasm-echo-server (Wasm OCI artifact built by wkg oci push from Wasm component binary that implements wasi:http/proxy)

https://github.com/scala-wasm/scala-wasm/tree/scala-wasm/examples/echo-server

Is there a way to configure wasmtime from runwasi?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions