Skip to content

Commit

Permalink
feat(base): Introduce base (ELFLoader) to library (#11)
Browse files Browse the repository at this point in the history
Approved-by: Alexander Jung <[email protected]>
  • Loading branch information
nderjung authored Dec 12, 2023
2 parents 836edee + a59288d commit e0ae7d8
Show file tree
Hide file tree
Showing 3 changed files with 167 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/library-base.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: library/base

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

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

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

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

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

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

- 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/base:latest
push: true
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ kraft pkg ls --apps --update

| Status | Image |
|-|-|
| [![](https://github.com/unikraft/catalog/actions/workflows/library-base.yaml/badge.svg)](https://github.com/unikraft/catalog/actions/workflows/library-base.yaml) | [`unikraft.org/base:latest`](library/base) |
| [![](https://github.com/unikraft/catalog/actions/workflows/library-helloworld.yaml/badge.svg)](https://github.com/unikraft/catalog/actions/workflows/library-helloworld.yaml) | [`unikraft.org/helloworld:latest`](library/helloworld) |
| [![](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/nginx/1.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/python/3.10) |
Expand Down
93 changes: 93 additions & 0 deletions library/base/Kraftfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
spec: v0.6

template:
source: https://github.com/unikraft/app-elfloader.git
version: stable

unikraft:
source: https://github.com/unikraft/unikraft.git
version: staging
kconfig:
CONFIG_APPELFLOADER_ARCH_PRCTL: 'y'
CONFIG_APPELFLOADER_BRK: 'y'
CONFIG_APPELFLOADER_CUSTOMAPPNAME: 'y'
CONFIG_APPELFLOADER_STACK_NBPAGES: 128
CONFIG_APPELFLOADER_VFSEXEC_EXECBIT: 'n'
CONFIG_APPELFLOADER_VFSEXEC: 'y'
CONFIG_HAVE_PAGING_DIRECTMAP: 'y'
CONFIG_HAVE_PAGING: 'y'
CONFIG_LIBDEVFS_AUTOMOUNT: 'y'
CONFIG_LIBDEVFS_DEV_NULL: 'y'
CONFIG_LIBDEVFS_DEV_STDOUT: 'y'
CONFIG_LIBDEVFS_DEV_ZERO: 'y'
CONFIG_LIBDEVFS: 'y'
CONFIG_LIBISRLIB: 'y'
CONFIG_LIBPOSIX_ENVIRON_ENVP0: "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
CONFIG_LIBPOSIX_ENVIRON_ENVP1: "LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/lib"
CONFIG_LIBPOSIX_ENVIRON_ENVP2: "HOME=/"
CONFIG_LIBPOSIX_ENVIRON: 'y'
CONFIG_LIBPOSIX_EVENTFD: 'y'
CONFIG_LIBPOSIX_FDIO: 'y'
CONFIG_LIBPOSIX_FDTAB: 'y'
CONFIG_LIBPOSIX_FUTEX: 'y'
CONFIG_LIBPOSIX_MMAP: 'y'
CONFIG_LIBPOSIX_NETLINK: 'y'
CONFIG_LIBPOSIX_PIPE: 'y'
CONFIG_LIBPOSIX_POLL: 'y'
CONFIG_LIBPOSIX_PROCESS_CLONE: 'y'
CONFIG_LIBPOSIX_SOCKET: 'y'
CONFIG_LIBPOSIX_SYSINFO: 'y'
CONFIG_LIBPOSIX_TIME: 'y'
CONFIG_LIBPOSIX_TIMERFD: 'y'
CONFIG_LIBPOSIX_UNIXSOCKET: 'y'
CONFIG_LIBPOSIX_USER_GID: 0
CONFIG_LIBPOSIX_USER_GROUPNAME: "root"
CONFIG_LIBPOSIX_USER_UID: 0
CONFIG_LIBPOSIX_USER_USERNAME: "root"
CONFIG_LIBPOSIX_USER: 'y'
CONFIG_LIBRAMFS: 'y'
CONFIG_LIBSYSCALL_SHIM_HANDLER_ULTLS: 'y'
CONFIG_LIBSYSCALL_SHIM_HANDLER: 'y'
CONFIG_LIBSYSCALL_SHIM_LEGACY_VERBOSE: 'y'
CONFIG_LIBSYSCALL_SHIM: 'y'
CONFIG_LIBUKALLOCPOOL: 'y'
CONFIG_LIBUKBLKDEV_SYNC_IO_BLOCKED_WAITING: 'y'
CONFIG_LIBUKBLKDEV: 'y'
CONFIG_LIBUKBOOT_BANNER_MINIMAL: 'y'
CONFIG_LIBUKBOOT_HEAP_BASE: '0x400000000'
CONFIG_LIBUKCPIO: 'y'
CONFIG_LIBUKFALLOC: 'y'
CONFIG_LIBUKMPI: 'n'
CONFIG_LIBUKSIGNAL: 'y'
CONFIG_LIBUKVMEM_DEFAULT_BASE: '0x0000001000000000'
CONFIG_LIBUKVMEM_DEMAND_PAGE_IN_SIZE: 12
CONFIG_LIBUKVMEM_PAGEFAULT_HANDLER_PRIO: 4
CONFIG_LIBUKVMEM: 'y'
CONFIG_LIBVFSCORE_AUTOMOUNT_ROOTFS: 'n'
CONFIG_LIBVFSCORE_FSTAB: 'y'
CONFIG_LIBVFSCORE_NONLARGEFILE: 'y'
CONFIG_OPTIMIZE_DEADELIM: 'y'
CONFIG_OPTIMIZE_LTO: 'y'
CONFIG_PAGING: 'y'
CONFIG_STACK_SIZE_PAGE_ORDER: 4 # 128 * 4K = 512K
CONFIG_UKPLAT_KSP_SIZE: 32768
CONFIG_UKPLAT_MEMREGION_MAX_COUNT: 64

# Debug options
CONFIG_KVM_DEBUG_VGA_CONSOLE: 'n'
CONFIG_KVM_KERNEL_VGA_CONSOLE: 'n'
CONFIG_LIBUKDEBUG_CRASH_SCREEN: 'n'
CONFIG_LIBUKDEBUG_ENABLE_ASSERT: 'n'
CONFIG_LIBUKDEBUG_PRINT_TIME: 'n'

# CONFIG_LIBSYSCALL_SHIM_STRACE: 'y'
# CONFIG_LIBUKDEBUG_PRINTD: 'y'
# CONFIG_LIBUKDEBUG_PRINTK_INFO: 'y'

libraries:
lwip: staging
libelf: stable

targets:
- fc/x86_64
- qemu/x86_64

0 comments on commit e0ae7d8

Please sign in to comment.