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

Update generator to work on bincompat apps. #42

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

Conversation

razvand
Copy link

@razvand razvand commented May 7, 2024

This translates to adding support for Dockerfile-based root filesystem and for templated applications (i.e. the base library entry).

This pull request is based on PR #40

The script generates other scripts that setup, configure, build and run
native applications.

The input of the script is the `Kraftfile` of the application and the
`config.yaml` file that specifies configuration such as memory, path to
filesystem (if any), requirements for networking.

Also add the test support files (`test/common.sh` and `test/test.sh`) used
for testing. The application will define a `single_test.sh` script.

Signed-off-by: Razvan Deaconescu <[email protected]>
Add specific files to scripted actions. Add `config.yaml` and
`single_test.sh`.

The `config.yaml` file is used doring the setup, build and run phases to
generate the directory structure and scripts.

The `single_test.sh` script is used as the basic script. It is called
for each build and run phase by the generated `script/test/test.sh`
script.

Signed-off-by: Razvan Deaconescu <[email protected]>
Add instructions in README for testing applications using generated
scripts.

Signed-off-by: Razvan Deaconescu <[email protected]>
Build root filesystem from Dockerfile, if specified in the Kraftfile.

Signed-off-by: Razvan Deaconescu <[email protected]>
Templated apps make use of a separate application repository. The only
current example is `app-elfloader`.

Signed-off-by: Razvan Deaconescu <[email protected]>
Force the use of the BuildKit container when using `kraft build` by
prefixing the build commands with
`KRAFTKIT_BUILDKIT_HOST=docker-container://buildkitd`.

Signed-off-by: Razvan Deaconescu <[email protected]>
Add specific files to scripted actions. Add `config.yaml` and
`single_test.sh`.

The `config.yaml` file is used doring the setup, build and run phases to
generate the directory structure and scripts.

The `single_test.sh` script is used as the basic script. It is called
for each build and run phase by the generated `script/test/test.sh`
script.

Signed-off-by: Razvan Deaconescu <[email protected]>
Add 9pfs configuration settings.

Signed-off-by: Razvan Deaconescu <[email protected]>
@razvand razvand added the enhancement New feature or request label May 7, 2024
@razvand razvand requested a review from Mihnea0Firoiu May 7, 2024 15:14
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.

See the comments

"""Generate shell script to set up repositories."""

if config["libs"]:
if config["template"]:
Copy link
Member

Choose a reason for hiding this comment

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

This will thow KeyError: 'template' if no template is used. I think the check should be something like if "template" in config

Copy link
Author

Choose a reason for hiding this comment

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

Yes, you're right. I will fix.

@@ -0,0 +1,2 @@
networking: True
memory: 8
Copy link
Member

Choose a reason for hiding this comment

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

Isn't 8mb of memory way too less?

Copy link
Author

Choose a reason for hiding this comment

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

No. Test it and you'll see. The beauty of native apps.

return "$found"
}

out_dir="scripts/test/$(date +"%Y-%m-%d-%H:%M:%S")"
Copy link
Member

Choose a reason for hiding this comment

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

This looks to granular, you will very likely have a different directory for every test that is done during the testing phase (e.g. one directory for qemu-x86_64-einitrd, one for fc-x86_64-einitrd, etc.
I would stop at the hour mark.

Copy link
Author

Choose a reason for hiding this comment

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

Won't work. You actually make multiple runs during an hour, while testing. And yes, the goal is for every test to have its own directory, you want to capture them all, right?

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: In Progress
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants