Skip to content

Commit 09eeffc

Browse files
committed
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 <razvand@unikraft.io>
1 parent a6b47e9 commit 09eeffc

File tree

5 files changed

+124
-0
lines changed

5 files changed

+124
-0
lines changed
+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: library/wamrbc76sf
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *' # Everyday at 12AM
6+
7+
push:
8+
branches: [main]
9+
paths:
10+
- 'library/wamr/bc762f/**'
11+
- '.github/workflows/library-wamrbc762f.yaml'
12+
13+
pull_request:
14+
types: [opened, synchronize, reopened]
15+
branches: [main]
16+
paths:
17+
- 'library/wamr/bc762f/**'
18+
- '.github/workflows/library-wamrbc762f.yaml'
19+
20+
jobs:
21+
build:
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
include:
26+
- plat: qemu
27+
arch: x86_64
28+
- plat: qemu
29+
arch: arm64
30+
- plat: fc
31+
arch: x86_64
32+
- plat: fc
33+
arch: arm64
34+
35+
runs-on: ubuntu-latest
36+
37+
steps:
38+
- uses: actions/checkout@v3
39+
40+
- name: Build WAMR-bc762f
41+
uses: unikraft/kraftkit@staging
42+
with:
43+
loglevel: debug
44+
workdir: library/wamr/bc762f
45+
runtimedir: /github/workspace/.kraftkit
46+
plat: ${{ matrix.plat }}
47+
arch: ${{ matrix.arch }}
48+
push: false
49+
output: oci://index.unikraft.io/unikraft.org/wamr:bc762f
50+
51+
- name: Archive OCI digests
52+
uses: actions/upload-artifact@v3
53+
with:
54+
name: oci-digests-${{ matrix.arch }}-${{ matrix.plat }}
55+
path: ${{ github.workspace }}/.kraftkit/oci/digests
56+
if-no-files-found: error
57+
58+
push:
59+
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
60+
needs: [ build ]
61+
runs-on: ubuntu-latest
62+
63+
steps:
64+
- uses: actions/checkout@v3
65+
66+
- name: Login to OCI registry
67+
uses: docker/login-action@v2
68+
with:
69+
registry: index.unikraft.io
70+
username: ${{ secrets.REG_USERNAME }}
71+
password: ${{ secrets.REG_TOKEN }}
72+
73+
- name: Retrieve, merge and push OCI digests
74+
uses: ./.github/actions/merge-oci-digests
75+
with:
76+
name: index.unikraft.io/unikraft.org/wamr:bc762f
77+
push: true

library/wamr/bc762f/Kraftfile

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
spec: v0.6
2+
3+
name: wamr
4+
5+
rootfs: ./rootfs
6+
7+
cmd: ["/main.wasm"]
8+
9+
unikraft:
10+
version: stable
11+
kconfig:
12+
CONFIG_LIBRAMFS: 'y'
13+
CONFIG_LIBUK9P: 'y'
14+
CONFIG_LIBUKBUS: 'y'
15+
CONFIG_LIBUKCPIO: 'y'
16+
CONFIG_LIBUKDEBUG_ANSI_COLOR: 'y'
17+
CONFIG_LIBUKLIBPARAM: 'y'
18+
CONFIG_LIBVFSCORE_AUTOMOUNT_ROOTFS: 'y'
19+
CONFIG_LIBVFSCORE_FSTAB: 'y'
20+
CONFIG_LIBVFSCORE_ROOTFS_INITRD: 'y'
21+
22+
targets:
23+
- qemu/x86_64
24+
- qemu/arm64
25+
- fc/x86_64
26+
- fc/arm64
27+
28+
libraries:
29+
musl: stable
30+
lwip: stable
31+
wamr: stable

library/wamr/bc762f/Makefile.uk

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$(eval $(call addlib,appmicropython))

library/wamr/bc762f/README.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# WAMR (Wasm Micro Runtime) Image
2+
3+
This directory contains the definition for the `unikraft.org/wamr` image.
4+
5+
To run this image, [install Unikraft's companion command-line toolchain `kraft`](https://unikraft.org/docs/cli) and then you can run:
6+
7+
```
8+
kraft run unikraft.org/wamr:bc762f
9+
```
10+
11+
Once executed you will get a "Hello, World!" message and one regarding a memory address.
12+
13+
## See also
14+
15+
- [How to run unikernels locally in Unikraft's Documentation](https://unikraft.org/docs/cli/running).

library/wamr/bc762f/rootfs/main.wasm

1.36 KB
Binary file not shown.

0 commit comments

Comments
 (0)