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 Python 3 HTTP Server #11

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

razvand
Copy link

@razvand razvand commented Nov 28, 2023

Introduce Python3 as binary compatibility runstarting an HTTP server. Extract / Install Python 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: Python script to start an 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.

@razvand razvand added the enhancement New feature or request label Nov 28, 2023
@razvand razvand force-pushed the razvand/examples/http-python3 branch from ee8d4f4 to 2d84a72 Compare December 1, 2023 08:25
@razvand razvand force-pushed the razvand/examples/http-python3 branch 4 times, most recently from e47c163 to 8a4d5df Compare December 3, 2023 18:53
Copy link
Member

@StefanJum StefanJum left a comment

Choose a reason for hiding this comment

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

All good besides the one comment.

```

It will print "Hello, World!".

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

Remove the extra line.

Copy link
Member

@Mihnea0Firoiu Mihnea0Firoiu left a comment

Choose a reason for hiding this comment

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

All good.

razvand pushed a commit that referenced this pull request Dec 15, 2023
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]>
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]>
Introduce Python3 as binary compatibility starting an HTTP server.
Extract / Install Python 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`: Python script to start an 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 force-pushed the razvand/examples/http-python3 branch from d566fb0 to c2f1944 Compare December 19, 2023 09:44
Copy link
Member

@StefanJum StefanJum left a comment

Choose a reason for hiding this comment

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

All good, thanks.

Approved-by: Stefan Jumarea [email protected]

Copy link
Member

@Mihnea0Firoiu Mihnea0Firoiu left a comment

Choose a reason for hiding this comment

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

All good.
Reviewed-by: Mihnea Firoiu [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
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants