bincompat-traefik3.0: Add bincompat Traefik example - #119
Open
andrei-popovici-dev wants to merge 1 commit into
Open
bincompat-traefik3.0: Add bincompat Traefik example#119andrei-popovici-dev wants to merge 1 commit into
andrei-popovici-dev wants to merge 1 commit into
Conversation
Add `bincompat-traefik3.0/` directory: - `Dockerfile`: Used to build rootfs - `fc.x86_64.json`: Firecracker config - `config.yml`: Traefik config - `README.md`: usage instructions Signed-off-by: Andrei Razvan Popovici <popovici.andrei2002@yahoo.com>
There was a problem hiding this comment.
Pull request overview
This PR adds a new bincompat-traefik3.0/ example demonstrating how to build and run Traefik v3.0.0 as a Linux ELF binary on Unikraft via the elfloader-net base.
Changes:
- Added a Traefik rootfs build (
Dockerfile) plus Traefik runtime configuration (config.yml). - Added QEMU/Firecracker run scripts, Firecracker VM config (
fc.x86_64.json), and defconfigs. - Added setup/test automation and documentation for building/running the example.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| bincompat-traefik3.0/setup.sh | Creates workdir/ layout and symlink(s) to required repos. |
| bincompat-traefik3.0/README.md | End-to-end usage instructions for build/run/test and customization. |
| bincompat-traefik3.0/fc.x86_64.json | Firecracker configuration for running the elfloader kernel + Traefik initrd. |
| bincompat-traefik3.0/Dockerfile | Builds Traefik v3.0.0 and assembles a scratch rootfs. |
| bincompat-traefik3.0/config.yml | Traefik file-provider config routing whoami.localhost to a whoami container. |
| bincompat-traefik3.0/.scripts/test/wrapper.sh | Smoke-test wrapper intended to validate a successful boot/run. |
| bincompat-traefik3.0/.scripts/test/README.md | Instructions for running scripted tests. |
| bincompat-traefik3.0/.scripts/test/common.sh | Shared helpers for test setup/teardown and connectivity checks. |
| bincompat-traefik3.0/.scripts/test/all.sh | Runs build+run test sequences for QEMU and Firecracker. |
| bincompat-traefik3.0/.scripts/test/.gitignore | Ignores test logs. |
| bincompat-traefik3.0/.scripts/run/qemu.x86_64 | QEMU runner that configures networking and launches elfloader kernel + initrd. |
| bincompat-traefik3.0/.scripts/run/fc.x86_64 | Firecracker runner that configures TAP networking and launches firecracker with config JSON. |
| bincompat-traefik3.0/.scripts/README.md | Usage docs for the helper scripts. |
| bincompat-traefik3.0/.scripts/defconfig/qemu.x86_64 | Unikraft defconfig for QEMU x86_64 elfloader base. |
| bincompat-traefik3.0/.scripts/defconfig/fc.x86_64 | Unikraft defconfig for Firecracker x86_64 elfloader base. |
| bincompat-traefik3.0/.scripts/common.sh | Common build helper that builds the elfloader-net base kernel. |
| bincompat-traefik3.0/.scripts/build/rootfs.x86_64 | Builds the rootfs and packs it into initrd.cpio. |
| bincompat-traefik3.0/.scripts/build/qemu.x86_64 | Convenience build script (rootfs + QEMU kernel). |
| bincompat-traefik3.0/.scripts/build/kernel.qemu.x86_64 | Builds the elfloader-net QEMU kernel with the example defconfig. |
| bincompat-traefik3.0/.scripts/build/kernel.fc.x86_64 | Builds the elfloader-net Firecracker kernel with the example defconfig. |
| bincompat-traefik3.0/.scripts/build/fc.x86_64 | Convenience build script (rootfs + Firecracker kernel). |
| bincompat-traefik3.0/.gitignore | Ignores generated workdir/ and rootfs/. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| CONFIG_LIBUKCPIO=y | ||
| CONFIG_LIBDEVFS=y | ||
| CONFIG_LIBDEVFS_AUTOMOUNT=y | ||
| CONFIG_LIBUKBOOT_MAINTHREAD=y=y |
| CONFIG_LIBUKCPIO=y | ||
| CONFIG_LIBDEVFS=y | ||
| CONFIG_LIBDEVFS_AUTOMOUNT=y | ||
| CONFIG_LIBUKBOOT_MAINTHREAD=y=y |
Comment on lines
+14
to
+21
| # Start instance. | ||
| start_instance 2>&1 | grep "Hello from Unikraft!" 1>&2 | ||
| if test $? -ne 0; then | ||
| echo "Wrong message printed." 1>&2 | ||
| echo "FAILED" | ||
| clean_up | ||
| exit 1 | ||
| fi |
Comment on lines
+29
to
+31
| # Pack filesystem as an initial ramdisk CPIO file. | ||
| rm -f initrd.cpio | ||
| ../repos/unikraft/support/scripts/mkcpio initrd.cpio ./rootfs/ |
| @@ -0,0 +1,48 @@ | |||
| # Scripts for Bincompat Traefik on Unikraft | |||
|
|
|||
| These are companions instruction to the main instructions in the [`README`](README.md). | |||
Comment on lines
+15
to
+19
| COPY --from=builder /traefik-binary /usr/local/bin/traefik | ||
|
|
||
| COPY --from=builder /lib /lib | ||
|
|
||
| COPY config.yml /etc/traefik/config.yml |
Comment on lines
+10
to
+16
| # Clean up any previous instances. | ||
| sudo pkill -9 qemu-system | ||
| sudo pkill -9 firecracker | ||
| kraft stop --all | ||
| kraft rm --all | ||
| sudo kraft stop --all | ||
| sudo kraft rm --all |
Comment on lines
+24
to
+27
| # Create bridge interface for QEMU networking. | ||
| sudo ip link add dev virbr0 type bridge | ||
| sudo ip address add 172.44.0.1/24 dev virbr0 | ||
| sudo ip link set dev virbr0 up |
Comment on lines
+58
to
+62
| This will run Traefik using the Unikraft ELF Loader. | ||
|
|
||
| If you are experimenting with your own code or you encounter a bug which prevents the virtual machine from stopping, see the instructions in the ["Forcefully Terminating a Machine" section](#forcefully-terminating-a-machine). | ||
|
|
||
| Information about every step and about other types of builds is detailed below. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
bincompat-traefik3.0/directory:Dockerfile: Used to build rootfsfc.x86_64.json: Firecracker configconfig.yml: Traefik configREADME.md: usage instructions