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): Add Caddy example #14

Closed
wants to merge 12 commits into from

Conversation

razvand
Copy link
Contributor

@razvand razvand commented Nov 17, 2023

Add example for Caddy. It pulls and runs the Caddy Unikraft runtime from the registry. Custom configuration and files can be added to the data/ directory.

@razvand razvand added the enhancement New feature or request label Nov 17, 2023
@razvand razvand requested a review from nderjung November 17, 2023 10:27
@razvand razvand force-pushed the razvand/examples/caddy-2.7 branch 6 times, most recently from b8eeda8 to 48accd4 Compare December 3, 2023 18:53
razvand and others added 7 commits December 16, 2023 00:31
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]>
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]>
…ildkitd

fix(utils): Start BuildKit container if it was stopped

Reviewed-by: Mihnea Firoiu <[email protected]>
Approved-by: Stefan Jumarea <[email protected]>
Update `Kraftfile` configuration for `base` to use `staging`
branches for all repositories (`unikraft`, `app-elfloader`, `lwip`,
`libelf`).

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]>
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]>
@razvand razvand force-pushed the razvand/examples/caddy-2.7 branch from 48accd4 to af75214 Compare December 19, 2023 09:28
razvand and others added 5 commits December 19, 2023 20:39
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]>
feat(utils): Introduce bincompat generator script

Reviewed-by: Mihnea Firoiu <[email protected]>
Approved-by: Stefan Jumarea <[email protected]>
Add `README.maintainers.md`. This 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.

Currently, instructions are used for binary compatible (bincompat)
applications.

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

feat(readme): Add README for maintainers

Reviewed-by: Mihnea Firoiu <[email protected]>
Approved-by: Stefan Jumarea <[email protected]>
Introduce Caddy as binary compatibility run. Build Caddy 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
* `hosts`, `Caddyfile`: required Caddy configuration files

`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]>
@razvand razvand force-pushed the razvand/examples/caddy-2.7 branch from af75214 to fe9892b Compare December 20, 2023 07:33
@razvand
Copy link
Contributor Author

razvand commented Mar 9, 2024

This was solved by #93

@razvand razvand closed this Mar 9, 2024
@razvand razvand deleted the razvand/examples/caddy-2.7 branch March 19, 2024 10:40
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
None yet
Development

Successfully merging this pull request may close these issues.

3 participants