Skip to content

Commit

Permalink
feat(library): Introduce Lua (#6)
Browse files Browse the repository at this point in the history
Approved-by: Alexander Jung <[email protected]>
  • Loading branch information
nderjung authored Oct 27, 2023
2 parents 361ba41 + e7c9364 commit f53b665
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 0 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/library-lua5.4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: library/lua5.4

on:
schedule:
- cron: '0 0 * * *' # Everyday at 12AM

push:
branches: [main]
paths:
- 'library/lua5.4/**'
- '.github/workflows/library-lua5.4.yaml'

pull_request:
types: [opened, synchronize, reopened]
branches: [main]
paths:
- 'library/lua5.4/**'
- '.github/workflows/library-lua5.4.yaml'

jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- plat: qemu
arch: x86_64
- plat: qemu
arch: arm64
- plat: fc
arch: x86_64
- plat: fc
arch: arm64

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Build lua5.4
uses: unikraft/kraftkit@staging
with:
loglevel: debug
workdir: library/lua5.4
runtimedir: /github/workspace/.kraftkit
plat: ${{ matrix.plat }}
arch: ${{ matrix.arch }}
push: false
output: oci://index.unikraft.io/unikraft.org/lua:5.4

- name: Archive OCI digests
uses: actions/upload-artifact@v3
with:
name: oci-digests-${{ matrix.arch }}-${{ matrix.plat }}
path: ${{ github.workspace }}/.kraftkit/oci/digests
if-no-files-found: error

push:
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
needs: [ build ]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Login to OCI registry
uses: docker/login-action@v2
with:
registry: index.unikraft.io
username: ${{ secrets.REG_USERNAME }}
password: ${{ secrets.REG_TOKEN }}

- name: Retrieve, merge and push OCI digests
uses: ./.github/actions/merge-oci-digests
with:
name: index.unikraft.io/unikraft.org/lua:5.4
push: true
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ kraft pkg ls --apps --update
| [![](https://github.com/unikraft/catalog/actions/workflows/library-nginx1.15.yaml/badge.svg)](https://github.com/unikraft/catalog/actions/workflows/library-nginx1.15.yaml) | [`unikraft.org/nginx:1.15`](library/nginx1.15) |
| [![](https://github.com/unikraft/catalog/actions/workflows/library-python3.10.yaml/badge.svg)](https://github.com/unikraft/catalog/actions/workflows/library-python3.10.yaml) | [`unikraft.org/python:3.10`](library/python3.10) |
| [![](https://github.com/unikraft/catalog/actions/workflows/library-redis7.0.yaml/badge.svg)](https://github.com/unikraft/catalog/actions/workflows/library-redis7.0.yaml) | [`unikraft.org/redis:7.0`](library/redis7.0) |
| [![](https://github.com/unikraft/catalog/actions/workflows/library-lua5.4.yaml/badge.svg)](https://github.com/unikraft/catalog/actions/workflows/library-lua5.0.yaml) | [`unikraft.org/lua:5.4`](library/lua5.4) |
33 changes: 33 additions & 0 deletions library/lua5.4/Kraftfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
spec: v0.6

name: lua

rootfs: ./rootfs

cmd: ["/helloworld.lua"]

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
lua:
version: stable
kconfig:
CONFIG_LUA_MAIN_FUNCTION: 'y'
1 change: 1 addition & 0 deletions library/lua5.4/Makefile.uk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$(eval $(call addlib,applua))
15 changes: 15 additions & 0 deletions library/lua5.4/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Lua 5.4 Image

This directory contains the definition for the `unikraft.org/lua:5.4` 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/lua:5.4
```

Once executed you will get a "Hello, World!" message.

## See also

- [How to run unikernels locally in Unikraft's Documentation](https://unikraft.org/docs/cli/running).
1 change: 1 addition & 0 deletions library/lua5.4/rootfs/helloworld.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print("Hello, World!")

0 comments on commit f53b665

Please sign in to comment.