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

Short benchmarking in CI with frame-omni-bencher + extract chain-spec-builder stuff to get_preset #379

Conversation

bkontur
Copy link
Contributor

@bkontur bkontur commented Jul 11, 2024

This PR introduces a new CI pipeline for checking and running runtime benchmarks as part of the test pipelines. This means we will now know if any changes break the benchmarks.

The pipeline is based on downloading frame-omni-bencher (building it in-place is too expensive for every matrix run) and running it with a minimal setup: --steps 2 --repeat 1.

Another part of this PR splits the default genesis setups from chain-spec-generator and moves them to the sp_genesis_builder::GenesisBuilder::get_preset runtime API implementation for every runtime, which is required by frame-omni-bencher.

Closes: #197
Relates to: #298
Relates to: #324

  • Does not require a CHANGELOG entry

Future works

When this issue is fixed, I will rewrite weight-generation.md. The new version will be significantly simplified, with instructions to simply download frame-omni-bencher, build the runtime WASM, and run it—no other steps will be necessary.

2024-07-18 14:45:51 Using the chain spec instead of the runtime to generate the genesis state is deprecated. Please remove the `--chain`/`--dev`/`--local` argument, point `--runtime` to your runtime blob and set `--genesis-builder=runtime`. This warning may become a hard error any time after December 2024.    

@bkontur

This comment was marked as resolved.

@bkontur bkontur force-pushed the bko-short-benchmarks-get_preset branch from 17d3e21 to 8a531c9 Compare July 17, 2024 16:32
@bkontur bkontur marked this pull request as ready for review July 19, 2024 16:08
Copy link
Contributor

@bkchr bkchr left a comment

Choose a reason for hiding this comment

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

Nice work!

.github/workflows/test.yml Outdated Show resolved Hide resolved
chain-spec-generator/Cargo.toml Show resolved Hide resolved
bkontur and others added 2 commits July 23, 2024 09:40
Co-authored-by: Bastian Köcher <git@kchr.de>
@bkontur bkontur mentioned this pull request Jul 23, 2024
3 tasks
Copy link
Contributor

@acatangiu acatangiu left a comment

Choose a reason for hiding this comment

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

Nice! 🚀

relay/polkadot/src/genesis_config_presets.rs Outdated Show resolved Hide resolved
@bkchr
Copy link
Contributor

bkchr commented Jul 24, 2024

/merge

@fellowship-merge-bot fellowship-merge-bot bot enabled auto-merge (squash) July 24, 2024 18:44
@fellowship-merge-bot
Copy link
Contributor

Enabled auto-merge in Pull Request

Available commands
  • /merge: Enables auto-merge for Pull Request
  • /merge cancel: Cancels auto-merge for Pull Request
  • /merge help: Shows this menu

For more information see the documentation

@fellowship-merge-bot fellowship-merge-bot bot merged commit afe696b into polkadot-fellows:main Jul 24, 2024
44 checks passed
@bkontur bkontur deleted the bko-short-benchmarks-get_preset branch July 24, 2024 22:47
@@ -348,7 +43,9 @@ pub fn polkadot_development_config() -> Result<Box<dyn ChainSpec>, String> {
.with_name("Polakdot Development")
.with_id("polkadot-dev")
.with_chain_type(ChainType::Development)
.with_genesis_config_patch(polkadot_development_config_genesis())
.with_genesis_config_patch(
Copy link
Contributor

Choose a reason for hiding this comment

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

You could use: with_genesis_config_preset_name.

This would allow to fetch the preset from the wasm blob, w/o necessity to natively compile the runtime,

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.

[CI] Add pipeline for checking benchmarks
5 participants