Skip to content

feat: add pre- and post-benchmark scripts#93

Merged
not-matthias merged 3 commits intocod-1008-benchmark-run-fails-on-macro-runner-with-systemd-runfrom
cod-1010-benchmark-setup-is-slow-when-running-with-isolated-cores
Jun 30, 2025
Merged

feat: add pre- and post-benchmark scripts#93
not-matthias merged 3 commits intocod-1008-benchmark-run-fails-on-macro-runner-with-systemd-runfrom
cod-1010-benchmark-setup-is-slow-when-running-with-isolated-cores

Conversation

@not-matthias
Copy link
Member

This allows us to run custom logic on the macro runner (e.g. set core isolation) without having all of that logic inside the runner.

@not-matthias not-matthias requested a review from art049 June 24, 2025 17:23
@not-matthias not-matthias force-pushed the cod-1010-benchmark-setup-is-slow-when-running-with-isolated-cores branch from 3986f87 to cbba43e Compare June 25, 2025 14:59
Copy link
Member

@art049 art049 left a comment

Choose a reason for hiding this comment

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

Instead of relying on env variables maybe we could have a set of default path to check?
Just suggesting this because we have quite a lot of env variables already and avoiding adding new ones to think about is good at this point IMO.

Maybe we could also add a CLI lag to opt-out of those pre/post scripts as well if that's needed. WDYT?

@not-matthias not-matthias force-pushed the cod-1010-benchmark-setup-is-slow-when-running-with-isolated-cores branch from 7669674 to 194d890 Compare June 26, 2025 16:39
@not-matthias not-matthias force-pushed the cod-1008-benchmark-run-fails-on-macro-runner-with-systemd-run branch from 868f7d9 to e3afd62 Compare June 26, 2025 16:48
@not-matthias not-matthias force-pushed the cod-1010-benchmark-setup-is-slow-when-running-with-isolated-cores branch 2 times, most recently from 41784aa to ec3413f Compare June 26, 2025 16:50
@not-matthias
Copy link
Member Author

not-matthias commented Jun 27, 2025

Instead of relying on env variables maybe we could have a set of default path to check? Just suggesting this because we have quite a lot of env variables already and avoiding adding new ones to think about is good at this point IMO.

good idea!

Maybe we could also add a CLI lag to opt-out of those pre/post scripts as well if that's needed. WDYT?

I'm a bit torn whether to add this. On the one hand we also don't want to add too many CLI args and I'm not sure how useful this one would be. When running locally the scripts won't be executed if they don't exist. The only case where it would be interesting would be when there's issues with the isolation. But I would argue it's better to fix this by changing the pre/post bench scripts in the macro runner.

@not-matthias not-matthias requested a review from art049 June 30, 2025 11:45
Copy link
Member

@art049 art049 left a comment

Choose a reason for hiding this comment

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

exceppt the strange test change, lgtm

Comment on lines 54 to 60
#[test]
fn test_venv_compat_no_crash() {
assert!(symlink_libpython(None).is_ok());
let _ = symlink_libpython(None);
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Uh, did I miss something?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ahh, yeah. Probably should've created a linear issue/separate PR for this. On my system this test failed because libpython is statically linked. I've created a separate commit and wanted to include it in this PR, but I guess it's better to create a new one.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, okay, well, we still need to keep this test, though

Copy link
Member Author

@not-matthias not-matthias Jun 30, 2025

Choose a reason for hiding this comment

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

Ah, okay, well, we still need to keep this test, though

Yeah, definitely. But we can't really check if we patched it since there's no way to ensure that libpython is dynamically linked. So my intention here was to just check if it ran, and didn't crash.

Copy link
Member

Choose a reason for hiding this comment

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

maybe we can have something to skip it locally and run it still in the CI?
https://nexte.st/docs/running/

Copy link
Member

@art049 art049 Jun 30, 2025

Choose a reason for hiding this comment

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

Or https://crates.io/crates/test-with only when CI is set

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed it. We're now only running it in CI using the test-with create (nice find!). Is it fine to keep it in this PR, feels a bit overkill to create a new one/ticket for this.

Copy link
Member

Choose a reason for hiding this comment

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

yep thats fine

@not-matthias not-matthias force-pushed the cod-1010-benchmark-setup-is-slow-when-running-with-isolated-cores branch from 99edace to e73c80b Compare June 30, 2025 12:06
@not-matthias not-matthias force-pushed the cod-1008-benchmark-run-fails-on-macro-runner-with-systemd-run branch from e3afd62 to 79b3ae1 Compare June 30, 2025 12:10
@not-matthias not-matthias force-pushed the cod-1010-benchmark-setup-is-slow-when-running-with-isolated-cores branch from e73c80b to fa91580 Compare June 30, 2025 12:11
@not-matthias not-matthias requested a review from art049 June 30, 2025 12:14
Copy link
Member

@art049 art049 left a comment

Choose a reason for hiding this comment

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

lgtm!

@not-matthias not-matthias merged commit fa91580 into cod-1008-benchmark-run-fails-on-macro-runner-with-systemd-run Jun 30, 2025
9 checks passed
@not-matthias not-matthias deleted the cod-1010-benchmark-setup-is-slow-when-running-with-isolated-cores branch June 30, 2025 12:39
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.

2 participants

Comments