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

fix/enable rust tests, make build faster #623

Merged
merged 2 commits into from
Sep 6, 2024
Merged

Conversation

likewhatevs
Copy link
Contributor

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!

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.
Copy link
Contributor

@arighi arighi left a 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.

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"
Copy link
Contributor

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

//! let from_str_mask = cpumask::from_string(str);
//! use scx_utils::Cpumask;
//! let all_zeroes = Cpumask::new();
//! let str = String::from("0xff00ff00");
Copy link
Contributor

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");

Copy link
Contributor Author

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.
@arighi arighi merged commit 0a8dc01 into sched-ext:main Sep 6, 2024
1 check failed
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

Successfully merging this pull request may close these issues.

3 participants