Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(examples): Introduce chDB Go as example #25

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

razvand
Copy link

@razvand razvand commented Dec 3, 2023

Introduce chDB Go as binary compatibility run. Install chDB and build a Go application using Dockerfile. Then run it with the base kernel images from ../../kernels/.

Add typical files for a bincompat app:

  • Kraftfile: build / run rules, including pulling the base image
  • Dockerfile: filesystem, including binary and libraries
  • Makefile: used to generate the root filesystem from the Dockerfile rules
  • README.md: instructions to set up, build and run the application
  • config.yaml: configuration file to generate scripts to the application
  • src/: Go implementation

config.yaml is used to generate run scripts using the ../../utils/bincompat/generate.py script.

The kernels in ../../kernels are generated by running the ../../utils/bincompat/base-build-all.sh script while inside the ../../library/base/ directory.

razvand and others added 10 commits November 21, 2023 17:41
Introduce SQLite native application for Unikraft.

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

The root filesystem (in `rootfs/`) provides a database file (`music.db`)
that is to be queried with `query.sql`. The querying is defined as the
`cmd` in `Kraftfile`. The `build.sql` script is used to generate the
`music.db` database file.

Signed-off-by: Razvan Deaconescu <[email protected]>
Introduce Lua 5.4.4 native application for Unikraft.

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

The root filesystem (in `rootfs/`) provides the `helloworld.lua` file,
passed to as the `cmd` in `Kraftfile`.

Signed-off-by: Razvan Deaconescu <[email protected]>
Introduce HTTP reply native C application for Unikraft. This is a simple
HTTP server that provides the same HTML reply for each request.

Add required files: `Kraftfile`, implementation in `main.c`,
`Makefile.uk` and `README.md`.

Signed-off-by: Razvan Deaconescu <[email protected]>
Following the merge of kraftkit#945, without specifying the `--all`
flag, the host architecture and platform are detected and used to reduce
the output.  In this CI/CD context, we wish to show all variants which
requires the use of this flag.  Without this flag, the GitHub Actions
workflow fails as it cannot determine the host platform.

Signed-off-by: Alexander Jung <[email protected]>
Add script to start and setup the BuildKit container. This is required
for Dockerfile root filesystems present in the Kraftfile.

Signed-off-by: Razvan Deaconescu <[email protected]>
…uildkit

feat(utils): Add script to start BuildKit container

Reviewed-by: Stefan Jumarea <[email protected]>
Approved-by: Stefan Jumarea <[email protected]>
This is a classic build of base / ELF Loader that doesn't use embedded
initramdisk and that doesn't automount the root filesystem. The root
filesystem is to be passed as a boot option via `vfs.fstab` with an
initial ramdisk. The full option is would be

```
vfs.fstab=[ "initrd:/:initrd:::" ]
```

Signed-off-by: Razvan Deaconescu <[email protected]>
…no-embed

feat(library): Introduce build of base / ELF Loader w/o embedded initrd

Reviewed-by: Mihnea Firoiu <[email protected]>
Reviewed-by: Stefan Jumarea <[email protected]>
Approved-by: Stefan Jumarea <[email protected]>
Use `base` branch to build the base (i.e. App ELF Loader) image. Also
use `stable` for LWIP. And add crash and debugging information.

All chanages go into the `Kraftfile` for the base build.

Signed-off-by: Razvan Deaconescu <[email protected]>
@razvand razvand added the enhancement New feature or request label Dec 3, 2023
@razvand razvand force-pushed the razvand/examples/chdb-go branch 2 times, most recently from d040d8b to 18bc8ad Compare December 3, 2023 18:46
Currently the `utils/start-buildkitd.sh` was starting the BuildKit
container if the container didn't exist. It didn't start it in case it
was stopped.

This commit fixes this, by looking if the container exists and then
starting it.

Signed-off-by: Razvan Deaconescu <[email protected]>
The common `README.md` file in the `examples/` directory contains common
instruction for setting up, configuring, building, running, using and
testing applications stored in subdirectories. Specific instructions are
to be handled by individual `README.md` file in each application /
example subdirectory.

Signed-off-by: Razvan Deaconescu <[email protected]>
Add script that builds all variants of base kernels, i.e. ELF Loader app
images: QEMU / Firecracker, simple / strace-printing / debug-printing.

Kernels are outputed in the `kernels/` top-level directory to be linked
in application directories.

Signed-off-by: Razvan Deaconescu <[email protected]>
Introduce Python script to generate run scripts for bincompat use cases.
Add base `docker.Makefile` to be included for Docker-based builds.

Script is to be run from corresponding bincompat app directory in
examples:

```
../../utils/bincompat/generate.py
```

Application directories must define the `config.yaml` file with required
variables: `networking`, `accel`, `memory` etc.

Running it generates the following files:

* `kraft-run*.sh`: script to run with KraftKit
* `run-qemu*.sh`: script to run with QEMU
* `run-fc*.sh`: script to run with Firecracker
* `fc*.json`: Firecracker configuration files

Signed-off-by: Razvan Deaconescu <[email protected]>
Introduce an HTTP C++ Boost server as binary compatibility run. Build
server as static PIE application using `Dockerfile`. Then run it with
the `base` kernel images from `../../kernels/`.

Add typical files for a bincompat app:

* `Kraftfile`: build / run rules, including pulling the `base` image
* `Dockerfile`: filesystem, including binary and libraries
* `Makefile`: used to generate the root filesystem from the `Dockerfile`
  rules
* `README.md`: instructions to set up, build and run the application
* `config.yaml`: configuration file to generate scripts to the
  application
* `http_server.cpp`: the C++ Boost HTTP server

`config.yaml` is used to generate run scripts using the
`../../utils/bincompat/generate.py` script.

The kernels in `../../kernels` are generated by running the
`../../utils/bincompat/base-build-all.sh` script while inside the
`../../library/base/` directory.

Signed-off-by: Razvan Deaconescu <[email protected]>
Copy link
Member

@StefanJum StefanJum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In Progress
Status: In Progress
Development

Successfully merging this pull request may close these issues.

3 participants