From b6f2e4d0a3777ac2f9dd39dc4f39c1143697ca66 Mon Sep 17 00:00:00 2001 From: Razvan Deaconescu Date: Tue, 31 Oct 2023 13:22:10 +0200 Subject: [PATCH] feat(library): Introduce WAMR 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 --- library/wamrbc762f/Kraftfile | 31 ++++++++++++++++++++++++++++ library/wamrbc762f/Makefile.uk | 1 + library/wamrbc762f/README.md | 15 ++++++++++++++ library/wamrbc762f/rootfs/main.wasm | Bin 0 -> 1388 bytes 4 files changed, 47 insertions(+) create mode 100644 library/wamrbc762f/Kraftfile create mode 100644 library/wamrbc762f/Makefile.uk create mode 100644 library/wamrbc762f/README.md create mode 100644 library/wamrbc762f/rootfs/main.wasm diff --git a/library/wamrbc762f/Kraftfile b/library/wamrbc762f/Kraftfile new file mode 100644 index 00000000..da4fcbf5 --- /dev/null +++ b/library/wamrbc762f/Kraftfile @@ -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 diff --git a/library/wamrbc762f/Makefile.uk b/library/wamrbc762f/Makefile.uk new file mode 100644 index 00000000..ee212de3 --- /dev/null +++ b/library/wamrbc762f/Makefile.uk @@ -0,0 +1 @@ +$(eval $(call addlib,appmicropython)) diff --git a/library/wamrbc762f/README.md b/library/wamrbc762f/README.md new file mode 100644 index 00000000..3838e625 --- /dev/null +++ b/library/wamrbc762f/README.md @@ -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). diff --git a/library/wamrbc762f/rootfs/main.wasm b/library/wamrbc762f/rootfs/main.wasm new file mode 100644 index 0000000000000000000000000000000000000000..40d2b082773246a4df38984ea64518a45f392bc4 GIT binary patch literal 1388 zcmZ`(OKTKC5U#53d1Pn7K}3Rj=+Ov!2og0kx_a0?C>}&Xf55tlv$C6g&W;HYadHZkQ!|KRaqSq&%iBLHhS-!G@D{c5zR%UOR~PWKnb{k_o(AZv{J!>TO3W73}v zCX@L-ptU6ZMKzk$LlE9?@v>fdOUyy$)iEKWNMe*Ah~k86Gbd-W5@&izNu)#TO{Ogb*ed`|P|f;mZZaT#T!K%pk!Gslw` z6qllA>?8uebC-Q#=t0kHJAGl=I$b7S^ z+B&>opg0Ya?E(Z@(prg%E6!`XZq`+SN?NfZD^~29h=W)`sUTC(Cf7lQ|1n&W-@_z5HD)&abn+vKM`5;}O+Nu}lk}?q literal 0 HcmV?d00001