Skip to content

Add bincompat-go-http#101

Draft
Criss-Ivana wants to merge 1 commit into
unikraft:mainfrom
Criss-Ivana:feat/bincompat-go-http
Draft

Add bincompat-go-http#101
Criss-Ivana wants to merge 1 commit into
unikraft:mainfrom
Criss-Ivana:feat/bincompat-go-http

Conversation

@Criss-Ivana

Copy link
Copy Markdown

This PR ports the go-httpbin 2.13.4 from catalog into catalog-core.

@Criss-Ivana Criss-Ivana marked this pull request as ready for review May 9, 2026 14:07
@Criss-Ivana Criss-Ivana force-pushed the feat/bincompat-go-http branch 2 times, most recently from 5d62eab to d6f3654 Compare May 16, 2026 07:02
Add catalog-core application to run mccutchen/go-httpbin as a Linux ELF via app-elfloader with lwIP networking. It includes rootfs Docker build, initrd packaging and detailed instructions in README.md for building and running the application on QEMU and Firecracker.

Signed-off-by: Criss-Ivana <criss.ivana@gmail.com>
@Criss-Ivana Criss-Ivana force-pushed the feat/bincompat-go-http branch from d6f3654 to dc1355a Compare May 16, 2026 07:16
@Criss-Ivana

Copy link
Copy Markdown
Author

Commit history was squashed to a single commit. Earlier force-pushes were from amending locally and me constantly changing my mind on what the best commit message is. :)

@razvand razvand self-requested a review May 16, 2026 14:21
@razvand razvand self-assigned this May 16, 2026
@razvand razvand added the enhancement New feature or request label May 16, 2026

@razvand razvand left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Make the commit message wrap to 72 lines. Use "instructions" instead of "instructis" in the commit message.

If the application is httpbingo, name the directory accordingly: bincompat-go-httpbingo.

Use a proper name for authorship and for signed-off-by. Use Firstname Lastname <email>. Do not use Criss-Ivana.

Copy-pasting the commands doesn't work:

./setup.sh
make -C rootfs clean
make -C rootfs
./workdir/unikraft/support/scripts/mkcpio initrd.cpio ./rootfs/
make

sudo ip link set dev virbr0 down || true
sudo ip link del dev virbr0 || true
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

sudo qemu-system-x86_64 \
    -nographic \
    -enable-kvm \
    -m 256 \
    -cpu host \
    -netdev bridge,id=en0,br=virbr0 -device virtio-net-pci,netdev=en0 \
    -append "elfloader_qemu-x86_64 netdev.ip=172.44.0.2/24:172.44.0.1::: vfs.fstab=[ \"initrd0:/:extract::ramfs=1:\" ] -- /go-httpbin" \
    -kernel workdir/build/elfloader_qemu-x86_64 \
    -initrd ./initrd.cpio

Follow the instructions and example from the bincompat-c-hello/ directory. See the README, scripts and other files.

CGO_ENABLED=1 CC=musl-gcc go build \
-buildmode=pie \
-ldflags='-linkmode external -extldflags "-static-pie"' \
-o /src/dist/go-httpbin ./cmd/go-httpbin No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add ending newline.

@@ -0,0 +1,2 @@
/workdir
/rootfs/go-httpbin No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add ending newline.

rm -f firecracker.socket
firecracker-x86_64 --config-file fc.x86_64.json --api-sock firecracker.socket
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove extra white line.

check_exists_and_create_symlink "unikraft"
check_exists_and_create_symlink "libs/libelf"
check_exists_and_create_symlink "libs/lwip"
check_exists_and_create_symlink "apps/elfloader" No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add ending newline.

@Criss-Ivana Criss-Ivana marked this pull request as draft May 16, 2026 22:23
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.

2 participants