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 setup for developer-centric scripts #7

Merged
merged 8 commits into from
Oct 20, 2023

Conversation

razvand
Copy link
Contributor

@razvand razvand commented Oct 14, 2023

Update setup to include scripts for building and running. Restructure contents to use the workdir/ directory as the directory to store repository clones and build output; use defconfigs/ to store default configuration files.

This relies on lib-wamr #9 PR.

Add a slash (`/`) at the beginning of ignore entries in `.gitignore` to
ignore entries in the curent (root) directory.

Signed-off-by: Razvan Deaconescu <razvand@unikraft.io>
`.unikraft/` was previously used as the directory to clone library
 repositories (including the `unikraft` core repository). Being a
hidden directory, it is not immediately available to the developer.

Use `workdir/` instead.
Also use `workdir/build/` as output directory and ignore the
`workdir/` directory.

Signed-off-by: Razvan Deaconescu <razvand@unikraft.io>
Add all the defconfig files into the `defconfigs/` directory.

Signed-off-by: Razvan Deaconescu <razvand@unikraft.io>
Use a filesystem to store wasm file, so place the `main.wasm` file in
the `rootfs/` directory.

Signed-off-by: Razvan Deaconescu <razvand@unikraft.io>
The `generate.py` script will be downloaded from
https://raw.githubusercontent.com/unikraft/app-testing/staging/scripts/generate.py
and used to generate the scripts in the `scripts/build/` and
`scripts/run/` directories. This will improve maintenance (only required
to happen for the `generate.py` script), while still keeping things
usable by providing the basic build and run scripts.

Signed-off-by: Razvan Deaconescu <razvand@unikraft.io>
 Update `.gitignore` to ignore generated `rootfs.cpio` file.

Signed-off-by: Razvan Deaconescu <razvand@unikraft.io>
@razvand razvand added documentation Improvements or additions to documentation enhancement New feature or request labels Oct 14, 2023
@razvand razvand changed the base branch from stable to staging October 14, 2023 10:22
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.
Besides those, the main file does not load properly.
It gives a magic header not detected error on initrd and a did not select --repl nor -initrd mode! warning on 9pfs.

The way lib-wamr works now, it expects the actual main file (not a cpio archive) to be passed as an initrd, without mounting it as a filesystem. So it would be CONFIG_LIBVFSCORE_AUTOMOUNT_ROOTFS=n in the config files, and the run command should be qemu-system-x86_64 -kernel build/wamr_qemu-x86_64 -initrd main.wasm -nographic.

This means the 9pfs-initrd separation is no longer relevant. Also this might not work with the generate.py script, we might want to add some way of configuring extra arguments to be passed to the qemu run command.

README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@razvand
Copy link
Contributor Author

razvand commented Oct 20, 2023

@StefanJum , this relies on lib-wamr PR #9.

Add instructions on how to use the generator script and the output
scripts to build and run the application.

Signed-off-by: Razvan Deaconescu <razvand@unikraft.io>
Update all configurations in `kraft.yaml` to feature proper
configuration options.

Signed-off-by: Razvan Deaconescu <razvand@unikraft.io>
@StefanJum
Copy link
Member

@razvand does lib-wamr#9 works for you? I don't get the errors anymore but the file is not executed. The application just closes after printing the Unikraft banner.
I can look into it, just want to make sure if it's something wrong on my config.

@razvand
Copy link
Contributor Author

razvand commented Oct 20, 2023

@razvand does lib-wamr#9 works for you? I don't get the errors anymore but the file is not executed. The application just closes after printing the Unikraft banner. I can look into it, just want to make sure if it's something wrong on my config.

lemme retry

@razvand
Copy link
Contributor Author

razvand commented Oct 20, 2023

@razvand does lib-wamr#9 works for you? I don't get the errors anymore but the file is not executed. The application just closes after printing the Unikraft banner. I can look into it, just want to make sure if it's something wrong on my config.

lemme retry

@StefanJum , I've retried. I used lib-wamr in workdir/libs/ checked out at PR #9. And I tested both with initrd and 9pfs. It all works:

./scripts/generate.py
./scripts/build/make-qemu-x86_64-9pfs.sh
./scripts/run/qemu-x86_64-9pfs.sh
./scripts/build/make-qemu-x86_64-initrd.sh
./scripts/run/qemu-x86_64-initrd.sh

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.

Reviewed-by: Stefan Jumarea stefanjumarea02@gmail.com
Approved-by: Stefan Jumarea stefanjumarea02@gmail.com

@razvand razvand merged commit 792f91b into unikraft:staging Oct 20, 2023
@razvand razvand deleted the razvand/add-dev-content branch October 20, 2023 15:54
razvand added a commit that referenced this pull request Oct 20, 2023
Add a slash (`/`) at the beginning of ignore entries in `.gitignore` to
ignore entries in the curent (root) directory.

Signed-off-by: Razvan Deaconescu <razvand@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Approved-by: Stefan Jumarea <stefanjumarea02@gmail.com>
GitHub-Closes: #7
razvand added a commit that referenced this pull request Oct 20, 2023
`.unikraft/` was previously used as the directory to clone library
 repositories (including the `unikraft` core repository). Being a
hidden directory, it is not immediately available to the developer.

Use `workdir/` instead.
Also use `workdir/build/` as output directory and ignore the
`workdir/` directory.

Signed-off-by: Razvan Deaconescu <razvand@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Approved-by: Stefan Jumarea <stefanjumarea02@gmail.com>
GitHub-Closes: #7
razvand added a commit that referenced this pull request Oct 20, 2023
Add all the defconfig files into the `defconfigs/` directory.

Signed-off-by: Razvan Deaconescu <razvand@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Approved-by: Stefan Jumarea <stefanjumarea02@gmail.com>
GitHub-Closes: #7
razvand added a commit that referenced this pull request Oct 20, 2023
Use a filesystem to store wasm file, so place the `main.wasm` file in
the `rootfs/` directory.

Signed-off-by: Razvan Deaconescu <razvand@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Approved-by: Stefan Jumarea <stefanjumarea02@gmail.com>
GitHub-Closes: #7
razvand added a commit that referenced this pull request Oct 20, 2023
The `generate.py` script will be downloaded from
https://raw.githubusercontent.com/unikraft/app-testing/staging/scripts/generate.py
and used to generate the scripts in the `scripts/build/` and
`scripts/run/` directories. This will improve maintenance (only required
to happen for the `generate.py` script), while still keeping things
usable by providing the basic build and run scripts.

Signed-off-by: Razvan Deaconescu <razvand@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Approved-by: Stefan Jumarea <stefanjumarea02@gmail.com>
GitHub-Closes: #7
razvand added a commit that referenced this pull request Oct 20, 2023
Update `.gitignore` to ignore generated `rootfs.cpio` file.

Signed-off-by: Razvan Deaconescu <razvand@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Approved-by: Stefan Jumarea <stefanjumarea02@gmail.com>
GitHub-Closes: #7
razvand added a commit that referenced this pull request Oct 20, 2023
Add instructions on how to use the generator script and the output
scripts to build and run the application.

Signed-off-by: Razvan Deaconescu <razvand@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Approved-by: Stefan Jumarea <stefanjumarea02@gmail.com>
GitHub-Closes: #7
razvand added a commit that referenced this pull request Oct 20, 2023
Update all configurations in `kraft.yaml` to feature proper
configuration options.

Signed-off-by: Razvan Deaconescu <razvand@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Approved-by: Stefan Jumarea <stefanjumarea02@gmail.com>
GitHub-Closes: #7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants