-
Notifications
You must be signed in to change notification settings - Fork 91
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
fix/enable rust tests, make build faster #623
Conversation
This commit fixes rust tests and configures ci to run them on commit. It also sets up CI to run those in a timely manner by caching dependencies and splitting jobs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thanks for doing this! I left a couple of comments, but I overall I really like this and I think it's a good improvement for our CI.
.github/workflows/caching-build.yml
Outdated
prefix-key: "1" | ||
- run: cargo build --manifest-path rust/Cargo.toml | ||
- run: cargo test --manifest-path rust/Cargo.toml --no-run | ||
- run: vng -m10G --force-9p -r linux/arch/x86/boot/bzImage --net user --exec "cargo test --manifest-path rust/Cargo.toml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May I suggest to change the vng command as following:
vng -v -m10G -c8 --force-9p -r linux/arch/x86/boot/bzImage --net user -- cargo test --manifest-path rust/Cargo.toml
-v
allows to catch potential OOM conditions (even if 10G should be enough to run the tests)-c8
always using 8 CPUs allows to run tests in a consistent environment, independently on the CPUs on the host (I'm thinking at the Cpumask tests)--exec
is the old-style deprecated syntax, better to move to the new syntax
rust/scx_utils/src/cpumask.rs
Outdated
//! let from_str_mask = cpumask::from_string(str); | ||
//! use scx_utils::Cpumask; | ||
//! let all_zeroes = Cpumask::new(); | ||
//! let str = String::from("0xff00ff00"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this one is going to fail unless we have all these CPUs inside the vng instance (hence my comment about using just 8 CPUs). So, maybe change this code chunk with:
use scx_utils::Cpumask;
let all_zeroes = Cpumask::new();
let str = String::from("0xf0");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh that makes sense, thank you!
set vng cpus to 8 for rust tests (for stability in testing), update relevant doc test.
This PR fixes rust tests and configures CI to run them on commit.
It does this by configuring 3 CI jobs.
One CI job will, hourly, build and cache a new sched_ext kernel if there is a new commit on for-next. This periodic job only runs on main.
The other two CI jobs run meson tests and cargo tests. These use that cached kernel.
All branches can that cached kernel from main. not-main branches will create their own caches if one for main does not exist for for-next's current head, but these are less useful because they are not shared like main's is.
When the kernel is cached, job turnaround time (test time) looks to be ~12 minutes: https://github.com/likewhatevs/scx/actions/runs/10736459682
Not-cached job time looks like 20-25 minutes.
I'm not sure if I should replace the current configs with this config (I think it's a superset, or can be made one easily enough) or add another (as this PR does atm).
Lmk what you think, thanks!