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 HTTP Python3 server as example #18

Closed

Conversation

razvand
Copy link

@razvand razvand commented Nov 30, 2023

Introduce an HTTP Python3 server as binary compatibility run. Extract Python3 binary and required file 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
  • server.py: the Python3 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.

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]>
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]>
Introduce an HTTP Python3 server as binary compatibility run. Extract
Python3 binary and required file 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
* `server.py`: the Python3 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]>
@razvand razvand added the enhancement New feature or request label Nov 30, 2023
@razvand
Copy link
Author

razvand commented Dec 1, 2023

Closing this, it's already handled by #11

@razvand razvand closed this Dec 1, 2023
@razvand razvand deleted the razvand/examples/http-python3-bin branch December 1, 2023 08:25
razvand added a commit that referenced this pull request Mar 18, 2024
Reviewd-by: Razvan Deaconescu [email protected]
Approved-by: Razvan Deaconescu [email protected]
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
Development

Successfully merging this pull request may close these issues.

2 participants