Skip to content

Commit

Permalink
feat(library): Introduce WAMR
Browse files Browse the repository at this point in the history
Introduce WAMR (Wasm Micro Runtime) native application for Unikraft. The
version used is an older commit (pre-stable release): `bc762f`.

Add required files: `Kraftfile`, `Makefile.uk` and `README.md`.

The root filesystem (in `rootfs/`) provides the pre-built `main.wasm`
file, passed to as the `cmd` in `Kraftfile`.

Signed-off-by: Razvan Deaconescu <razvand@unikraft.io>
  • Loading branch information
razvand committed Oct 31, 2023
1 parent 8d5ee80 commit b6f2e4d
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
31 changes: 31 additions & 0 deletions library/wamrbc762f/Kraftfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
spec: v0.6

name: wamr

rootfs: ./rootfs

cmd: ["/main.wasm"]

unikraft:
version: stable
kconfig:
CONFIG_LIBRAMFS: 'y'
CONFIG_LIBUK9P: 'y'
CONFIG_LIBUKBUS: 'y'
CONFIG_LIBUKCPIO: 'y'
CONFIG_LIBUKDEBUG_ANSI_COLOR: 'y'
CONFIG_LIBUKLIBPARAM: 'y'
CONFIG_LIBVFSCORE_AUTOMOUNT_ROOTFS: 'y'
CONFIG_LIBVFSCORE_FSTAB: 'y'
CONFIG_LIBVFSCORE_ROOTFS_INITRD: 'y'

targets:
- qemu/x86_64
- qemu/arm64
- fc/x86_64
- fc/arm64

libraries:
musl: stable
lwip: stable
wamr: stable
1 change: 1 addition & 0 deletions library/wamrbc762f/Makefile.uk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$(eval $(call addlib,appmicropython))
15 changes: 15 additions & 0 deletions library/wamrbc762f/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# WAMR (Wasm Micro Runtime) Image

This directory contains the definition for the `unikraft.org/wamr` image.

To run this image, [install Unikraft's companion command-line toolchain `kraft`](https://unikraft.org/docs/cli) and then you can run:

```
kraft run unikraft.org/wamr:bc762f
```

Once executed you will get a "Hello, World!" message and one regarding a memory address.

## See also

- [How to run unikernels locally in Unikraft's Documentation](https://unikraft.org/docs/cli/running).
Binary file added library/wamrbc762f/rootfs/main.wasm
Binary file not shown.

0 comments on commit b6f2e4d

Please sign in to comment.