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

feat(up parachain): faster binary sourcing #199

Merged
merged 20 commits into from
Jun 21, 2024
Merged

Conversation

evilrobot-01
Copy link
Contributor

@evilrobot-01 evilrobot-01 commented Jun 5, 2024

Introduces the sourcing of prebuilt binaries for supported platforms (aarch64, x64, linux, macos) to avoid the need to compile locally, effectively improving the UX of pop up for launching a local network. Also makes use of downloading GitHub source code archives for building rather than cloning as we do not need commit history.

Polkadot binaries are provided at https://github.com/r0gue-io/polkadot/releases and are built via a workflow using the release tag used at https://github.com/paritytech/polkadot-sdk/releases.

Also adds Pop Network as a known chain, so users no longer need to specify the -p flag but just use pop-node within network config files, as with system parachains. This can be improved in the future to support other chains directly via the same approach as the Templates enum for pop new parachain, but retaining the -p option ensures flexibility.

Testing

Can be tested on a Apple silicon as follows:

  • native:
    • clear cache
    • cargo run -- up parachain -f ./tests/networks/pop.toml
  • x64:
    • rustup target add x86_64-apple-darwin
    • clear cache
    • cargo run --target x86_64-apple-darwin -- up parachain -f ./tests/networks/pop.toml
    • check processes show as Kind: Intel in Activity Monitor
  • linux aarch64
    • docker build -t pop .
    • docker run -it -v ./tests/networks:/tests/networks --rm --entrypoint bash pop
    • pop up parachain -f ./tests/networks/pop.toml
  • linux x64
    • docker build --platform linux/amd64 -t pop .
    • docker run --platform linux/amd64 -it -v ./tests/networks:/tests/networks --rm --entrypoint bash pop
    • pop up parachain -f ./tests/networks/pop.toml

All the above should also be tested with --verbose as well.

Remaining tasks:

README.md Show resolved Hide resolved
Copy link

codecov bot commented Jun 7, 2024

Codecov Report

Attention: Patch coverage is 81.05304% with 493 lines in your changes missing coverage. Please review.

Project coverage is 65.20%. Comparing base (130e1b2) to head (3fda663).

@@            Coverage Diff             @@
##             main     #199      +/-   ##
==========================================
+ Coverage   57.25%   65.20%   +7.94%     
==========================================
  Files          34       37       +3     
  Lines        3701     5069    +1368     
  Branches     3701     5069    +1368     
==========================================
+ Hits         2119     3305    +1186     
- Misses       1243     1248       +5     
- Partials      339      516     +177     
Files Coverage Δ
crates/pop-parachains/src/errors.rs 0.00% <ø> (-100.00%) ⬇️
crates/pop-parachains/src/templates.rs 91.11% <ø> (ø)
crates/pop-cli/src/commands/install/mod.rs 0.00% <0.00%> (ø)
crates/pop-cli/src/commands/new/parachain.rs 46.10% <0.00%> (+0.70%) ⬆️
crates/pop-parachains/src/up/relay.rs 85.86% <85.86%> (ø)
crates/pop-parachains/src/utils/git.rs 67.70% <50.00%> (+5.51%) ⬆️
crates/pop-parachains/src/up/parachains.rs 85.49% <85.49%> (ø)
crates/pop-parachains/src/up/sourcing.rs 86.51% <86.51%> (ø)
crates/pop-cli/src/commands/up/parachain.rs 8.85% <0.00%> (-3.21%) ⬇️
crates/pop-parachains/src/up/mod.rs 87.19% <87.19%> (ø)

@evilrobot-01 evilrobot-01 marked this pull request as ready for review June 20, 2024 06:41
Copy link
Collaborator

@AlexD10S AlexD10S left a comment

Choose a reason for hiding this comment

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

Great job! pop now spins up a network quickly and the pop_parachains crate has excellent test coverage now.

It also closes the issue #176

Only a comment why are we keeping all the .toml files?

crates/pop-parachains/src/utils/git.rs Show resolved Hide resolved
@evilrobot-01
Copy link
Contributor Author

Only a comment why are we keeping all the .toml files?

No real reason apart from manual testing and examples. I can remove if you want?

@AlexD10S
Copy link
Collaborator

Only a comment why are we keeping all the .toml files?

No real reason apart from manual testing and examples. I can remove if you want?

I like to have examples if can help users. My suggestion then will be to add a line in the README or in the docs explaining how to use the examples. Additionally, I recommend renaming all.toml to something more descriptive.

@evilrobot-01
Copy link
Contributor Author

I like to have examples if can help users. My suggestion then will be to add a line in the README or in the docs explaining how to use the examples. Additionally, I recommend renaming all.toml to something more descriptive.

Done in latest commit

@AlexD10S AlexD10S merged commit baacdd3 into main Jun 21, 2024
15 checks passed
@AlexD10S AlexD10S deleted the frank/seems-faster branch June 21, 2024 06:59
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