Wasmtime#

The module enables integration with the Wasmtime runtime for executing WASM code, adding a number of runtime-specific directives to the wasm_modules context.

In our repositories, the module is built dynamically and is available as a separate package named angie-module-wasmtime.

Configuration Example#

wasm_modules {

    wasmtime_stack_size 8k;

    wasmtime_enable_wasi on;

    load fft_transform.wasm id=fft;
}

Directives#

wasmtime_enable_wasi#

Syntax

wasmtime_enable_wasi on | off;

Default

wasmtime_enable_wasi on;

Context

wasm_modules

Enables or disables the use of WebAssembly System Interface APIs that provide basic POSIX-like functionality to WASM modules running on Angie.

Note

Angie-specific APIs can be whitelisted using the load directive.

wasmtime_stack_size#

Syntax

wasmtime_stack_size size;

Default

wasmtime_stack_size 8k;

Context

wasm_modules

Sets the max_wasm_stack value to a specific size, thus limiting the maximum amount of stack space available for executing WASM code.