Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Latest commit

 

History

History
62 lines (42 loc) · 2.21 KB

README.md

File metadata and controls

62 lines (42 loc) · 2.21 KB

wasm-poc

Table of Contents

Summary

A collection showcasing how to generate WASM from various programming languages and execute the WASM code using a WASM runtime.

NOTE: HTTP services might be hard to compile since socket support might not yet be available in Wasi. Therefore search in following link for socket support. Optionally check further projects:

References

How to use

simple-rust sample

Run following commands:

cd samples/simple-rust

# when wanting to utilize wasmer as WebAssembly runtime 
docker build -t simple-rust-wasm-app-with-wasmer:stable -f Dockerfile.wasmer . 
docker run --rm simple-rust-wasm-app-with-wasmer:stable bash -c "wasmer run simple-rust.wasm"

# when wanting to utilize wasmtime as WebAssembly runtime 
docker build -t simple-rust-wasm-app-with-wasmtime:stable -f Dockerfile.wasmtime . 
docker run --rm simple-rust-wasm-app-with-wasmtime:stable bash -c "wasmtime run simple-rust.wasm"

simple-go sample

Run following commands:

cd samples/simple-go
docker build -t simple-go-wasm-app-with-wasmtime:stable .
docker run --rm simple-go-wasm-app-with-wasmtime:stable bash -c "wasmtime run output.wasm"

simple-rust-service

Run following commands to spin up a serverless application powered by WebAssembly:

cd samples/simple-rust-service
# Update in the `spin.toml` the cargo command
spin build # Build WebAssembly file
spin up # Run serverless HTTP service powered by WebAssembly

NOTE: Spin was installed in and utilized with Ubuntu WSL