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

[prepare-rootfs] improve rootfs selection #84

Closed
chantra opened this issue Feb 1, 2023 · 2 comments
Closed

[prepare-rootfs] improve rootfs selection #84

chantra opened this issue Feb 1, 2023 · 2 comments

Comments

@chantra
Copy link
Collaborator

chantra commented Feb 1, 2023

Currently, we run tests in a Debian Bullseye rootfs. This works with our current CI runners (Ubuntu focal) but this is very brittle.

  1. in the past, we had some dependency issues.
  2. people may run vmtests from different hosts then Ubuntu focal.

The way we do rootfs selection at the moment is pretty simple: https://github.com/libbpf/ci/blob/1b794627fd7431428a7e5a077010285733eaedf2/prepare-rootfs/run.sh#L223C26-L231

The rootfs have the distro release in their name, so we could possibly filter on this.
The script to generate rootfs uses debootstrap and should work with pretty much any Debian derivative.

We could generate a rootfs for common rootfs we care about, put them all in INDEX and when selecting the rootfs, try to match the hosts' distro, and fallback on a default one otherwise.

This should help with #83, and avoid issues like we had in the past (see comment in that PR).

Because currently libbpf/ci and vmtest in kernel tree differ, we would also need to update
https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/tree/tools/testing/selftests/bpf/vmtest.sh?id=c1a3daf7363b48c6c4b86aee2efa2287f695f649#n106 with the change.

Given the current behaviour of that function, we may be able to get away with updating the index file and the test will just pick up whatever is latest alphabetically.

@iii-i
Copy link
Contributor

iii-i commented Feb 2, 2023

I like this proposal, thanks for looking into it.
A small suggestion: it would also be nice to provide a way to specify the distro manually when running vmtest.sh.

chantra added a commit to chantra/kernel-patches-vmtest that referenced this issue Jan 25, 2024
https://github.com/danobi/vmtest make it easy to run a VM with a given kernel
and using the host rootfs (RO) and a shared directory (RW).

This will help us with a couple of issue:
- we don't have to maintain a rootfs anymore
- when running the test, we do not need to perform a dance with libguestfs, which allows us to save time during test, and make it trivial to exchange files between the host and the guest.
- we won't have anymore discrepency between the libraries used in the host and guest (like explained in libbpf/ci#84 and also libbpf/ci#103)

This change migrates the test runs from using `prepare-rootfs` + `run-qemu` actions to using `run-vmtest` instead.
chantra added a commit to kernel-patches/vmtest that referenced this issue Jan 26, 2024
https://github.com/danobi/vmtest make it easy to run a VM with a given kernel
and using the host rootfs (RO) and a shared directory (RW).

This will help us with a couple of issue:
- we don't have to maintain a rootfs anymore
- when running the test, we do not need to perform a dance with libguestfs, which allows us to save time during test, and make it trivial to exchange files between the host and the guest.
- we won't have anymore discrepency between the libraries used in the host and guest (like explained in libbpf/ci#84 and also libbpf/ci#103)

This change migrates the test runs from using `prepare-rootfs` + `run-qemu` actions to using `run-vmtest` instead.
@chantra
Copy link
Collaborator Author

chantra commented Jan 31, 2024

Since #117 was landed and used in BPF CI, this should not be a problem anymore.

@chantra chantra closed this as completed Jan 31, 2024
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

No branches or pull requests

2 participants