Skip to content

bincompat-django-python - #111

Open
alxcris wants to merge 4 commits into
unikraft:mainfrom
alxcris:django-port-final
Open

bincompat-django-python#111
alxcris wants to merge 4 commits into
unikraft:mainfrom
alxcris:django-port-final

Conversation

@alxcris

@alxcris alxcris commented Jul 5, 2026

Copy link
Copy Markdown

Draft PR django6.0-python3.12

I've chosen to base the structure on the bincompat-c-hello directory and adapted the Makefile and configuration scripts to ensure compatibility with the Django 6.0 and Python 3.12 environment.
The application has been successfully tested and runs correctly with Unikraft locally.

@alxcris
alxcris force-pushed the django-port-final branch 2 times, most recently from 82fd7c3 to 07db624 Compare July 11, 2026 10:43
@alxcris alxcris changed the title bincompat Django6.0-python3.12 port to catalog-core bincompat-django-python Jul 11, 2026
@razvand
razvand requested a review from Copilot July 11, 2026 11:29
@razvand razvand self-assigned this Jul 11, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a new bincompat-django6.0-python3.12 catalog entry intended to run a minimal Django 6.0 app on Unikraft via the ELF Loader (QEMU + Firecracker), including a Docker-built root filesystem and helper scripts.

Changes:

  • Introduces a minimal Django app (server.py) plus a scratch-based Docker rootfs build.
  • Adds build/run/test automation scripts and a Firecracker config for x86_64.
  • Adds setup helpers and documentation for manual execution.

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-django6.0-python3.12/setup.sh Creates workdir/ and symlinks required repos into it.
bincompat-django6.0-python3.12/rootfs/server.py Minimal Django app configured to run runserver on 0.0.0.0:8080.
bincompat-django6.0-python3.12/rootfs/requirements.txt Python deps for the rootfs (Django).
bincompat-django6.0-python3.12/rootfs/Makefile Make wrapper intended to build via Unikraft workdir/ paths.
bincompat-django6.0-python3.12/rootfs/Dockerfile Builds a scratch rootfs containing Python 3.12 + installed Django.
bincompat-django6.0-python3.12/README.md Manual setup/build/run instructions for QEMU.
bincompat-django6.0-python3.12/fc.x86_64.json Firecracker boot config (kernel path, boot args, initrd).
bincompat-django6.0-python3.12/.scripts/README.md Helper-script documentation for build/run workflows.
bincompat-django6.0-python3.12/.scripts/common.sh Shared build helper to reuse elfloader-net base kernel artifacts.
bincompat-django6.0-python3.12/.scripts/build/rootfs.x86_64 Rootfs/initrd build script (currently Makefile-based).
bincompat-django6.0-python3.12/.scripts/build/kernel.qemu.x86_64 Builds the base ELF loader kernel for QEMU via elfloader-net.
bincompat-django6.0-python3.12/.scripts/build/kernel.fc.x86_64 Builds the base ELF loader kernel for Firecracker via elfloader-net.
bincompat-django6.0-python3.12/.scripts/build/qemu.x86_64 Convenience script to build rootfs + kernel for QEMU.
bincompat-django6.0-python3.12/.scripts/build/fc.x86_64 Convenience script to build rootfs + kernel for Firecracker.
bincompat-django6.0-python3.12/.scripts/run/qemu.x86_64 Runs the base kernel under QEMU with initrd + Django command line.
bincompat-django6.0-python3.12/.scripts/run/fc.x86_64 Runs the base kernel under Firecracker with initrd + Django command line.
bincompat-django6.0-python3.12/.scripts/test/common.sh Test helpers (cleanup, start instance, ping/curl checks).
bincompat-django6.0-python3.12/.scripts/test/wrapper.sh Test wrapper that starts the instance and asserts expected behavior.
bincompat-django6.0-python3.12/.scripts/test/all.sh Runs build+run test flows for QEMU and Firecracker.
bincompat-django6.0-python3.12/.scripts/test/README.md Test instructions for the new example.
bincompat-django6.0-python3.12/.scripts/test/.gitignore Ignores test logs.
bincompat-django6.0-python3.12/.gitignore Ignores build artifacts and Python cache.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1 to +6
#!/bin/sh

rm -f initrd.cpio
make -C rootfs/ clean
make -C rootfs/
./workdir/unikraft/support/scripts/mkcpio initrd.cpio ./rootfs/
Comment on lines +1 to +5
UK_ROOT ?= $(PWD)/workdir/unikraft
UK_BUILD ?= $(PWD)/workdir/build
UK_APP ?= $(PWD)/workdir/apps/elfloader
LIBS_BASE = $(PWD)/workdir/libs
UK_LIBS ?= $(LIBS_BASE)/libelf
Comment on lines +15 to +21
./setup.sh
mkdir rootfs
docker build -t unikraft-django-fs .
docker container create --name unikraft-django-container unikraft-django-fs sh
docker export unikraft-django-container -o rootfs.tar
tar xvf rootfs.tar -C rootfs/
test -f initrd.cpio || ./workdir/unikraft/support/scripts/mkcpio initrd.cpio ./rootfs/
Comment on lines +42 to +47
mkdir rootfs
docker build -t unikraft-django-fs .
docker container create --name unikraft-django-container unikraft-django-fs sh
docker export unikraft-django-container -o rootfs.tar
tar xvf rootfs.tar -C rootfs/
test -f initrd.cpio || ./workdir/unikraft/support/scripts/mkcpio initrd.cpio ./rootfs/
Comment on lines +3 to +5
These are companions instruction to the main instructions in the [`README`](README.md).

Use scripts as quick actions for building and running the bincompat C HTTP server on Unikraft:
Comment thread bincompat-django6.0-python3.12/.scripts/test/README.md Outdated
Comment on lines +14 to +18
# 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"
@@ -0,0 +1 @@
django==6.0
Comment thread bincompat-django6.0-python3.12/rootfs/server.py
@alxcris
alxcris force-pushed the django-port-final branch 3 times, most recently from c4b617c to 2c83557 Compare July 11, 2026 12:17
Signed-off-by: alxcris <ilie_alexandru26@yahoo.com>
@alxcris
alxcris force-pushed the django-port-final branch from 2c83557 to bab21a3 Compare July 11, 2026 12:19

@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.

The .scripts/test/README.md and README.md and rootfs/server.py file use Windows endings (CRLF).

Be sure all files have ending newlines.

Remove trailing whitespaces.

Remove the file rootfs/Makefile if it's not used.

Comment thread bincompat-django6.0-python3.12/.scripts/build/fc.x86_64

firecracker-x86_64 \
--api-sock firecracker.socket \
--config-file fc.x86_64.json 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.

./setup.sh
test -d ./.scripts/test/log || mkdir ./.scripts/test/log
test_build_run qemu.x86_64
test_build_run fc.x86_64 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.

exit 0
}

start_command="$1" 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.


if __name__ == "__main__":
from django.core.management import execute_from_command_line
execute_from_command_line(["", "runserver", "0.0.0.0:8080", "--noreload"]) 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.

Ending newline.

Comment thread bincompat-django6.0-python3.12/README.md Outdated
Comment thread bincompat-django6.0-python3.12/README.md Outdated
Comment thread bincompat-django6.0-python3.12/README.md
alxcris and others added 3 commits July 29, 2026 11:06
Co-authored-by: Razvan Deaconescu <razvan@rosedu.org>
Signed-off-by: aLeX <ilie_alexandru26@yahoo.com>
Co-authored-by: Razvan Deaconescu <razvan@rosedu.org>
Signed-off-by: aLeX <ilie_alexandru26@yahoo.com>
Co-authored-by: Razvan Deaconescu <razvan@rosedu.org>
Signed-off-by: aLeX <ilie_alexandru26@yahoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants