Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dorkamotorka/wasmcontainers
https://github.com/dorkamotorka/wasmcontainers
Last synced: 16 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/dorkamotorka/wasmcontainers
- Owner: dorkamotorka
- Created: 2023-11-17T10:05:34.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-10T10:52:28.000Z (12 months ago)
- Last Synced: 2024-01-10T12:03:28.207Z (12 months ago)
- Language: Python
- Size: 63.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Running WASM on K8s (WIP)
"Wanna be" running WASM on K8s - but probably first try it on Docker Desktop (still in Beta ATM)
## Prerequisites
Follow `emscripten` install instruction [here](https://emscripten.org/docs/getting_started/downloads.html).
To be able to run it using Docker, please follow the instructions [here](https://docs.docker.com/desktop/wasm/).
## Deployments
### Native
Compile your C code and run it using:
```
gcc hello.c -o hello.out
./hello.out
```### Wasm
NOTE: `./emcc` script can be found in `emsdk/emscripten` directory.
```
./emcc hello.c -o hello.wasm
```Then you can run WASM script using WasmEdge runtime:
```
wasmedge --enable-all-statistics hello.wasm
```### In Docker
First build the `Dockerfile` and push the images using the following commands:
```
docker build -t /hello-world-c -f Dockerfile .
docker push /hello-world-c# WASM in Container
docker buildx build --platform wasi/wasm -t /hello-world-wasm .
docker push /hello-world-wasm
```Then simply run the following command:
```
docker run /hello-world-c# Just for testing - not used for benchmarking
docker run \
--runtime=io.containerd.wasmedge.v1 \
--platform=wasi/wasm \
/hello-world-wasm
```