containerd / runwasi

Facilitates running Wasm / WASI workloads managed by containerd
Apache License 2.0
1.02k stars 84 forks source link

feat(wasmtime): support wasm components #401

Closed Mossaka closed 6 months ago

Mossaka commented 8 months ago

This PR adds wasm components support to the wasmtime shim which enables it with the component-model feature on. The component loading, linking and execution has a different set of APIs than the wasm module one. I used wasmparser to determine if a byte array is a wasm module or a wasm component, and then dispatch to two different paths.

To finish this work completely, I hope to add some integration tests

As a follow up PR, I hope to add wasmtime serve functionality to the wasmtime shim so that we have HTTP capability for the shim.

Closes #384

jsturtevant commented 8 months ago

Not needed as part of this but we will also need a way to compose together multiple components?

Mossaka commented 7 months ago

This PR is ready to review. Could you PTAL? @jsturtevant ?

Mossaka commented 7 months ago

I am looking for a full fleged wasip2 Command component for testing purposes, but failed to find any existing ones. Asked this question in the Zulipchat: https://bytecodealliance.zulipchat.com/#narrow/stream/219900-wasi/topic/Looking.20for.20a.20wasip2.20component.20for.20testing.20purposes/near/405901766

Mossaka commented 7 months ago

Added a new commit to support wasi:cli/command world that exports a run function.

jsturtevant commented 6 months ago

needs some linter fixes