-
Notifications
You must be signed in to change notification settings - Fork 84
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
GHA pipeline rewrite for ease and speed #1551
Conversation
dc4ecc0
to
54bc71f
Compare
54bc71f
to
98ca8f3
Compare
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.
AFAICT, there are some removable artifacts left.
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.
Thanks so much for taking the time to pimp up our CI. Looking awesome and blazingly fast 🚀
strategy: | ||
matrix: | ||
runtime: [development, altair, centrifuge] | ||
runtime: [altair, centrifuge] |
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.
Why not development?
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 thought we didnt need to check dev benchmarks to save time. I know this kind of contradicts my argument of keeping benchmarks in Dev. However, in the past releases I merged Centrifuge benchmarks to Dev because there was no runtime benchmark pipeline. I think thats feasible because this way we mimic mainnet.
How about we iterate over that when we build the next feature, which will probably first only exist in Dev runtime?
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.
Since this are PR checks, let's keep it minimal, this won't actually publish or set benchmarks anywhere, it's just to check that the benchmarks run
Do we really need all 3 to run?
.github/CODEOWNERS
Outdated
.github/workflows @gpmayorga | ||
.github/actions @gpmayorga |
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.
👌🏻
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.
we could add @wischli too, for the bus factor
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4 |
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.
Out of curious: Why pointing to a hash directly?
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.
In the unlikely case that the actions/checkout repository introduces a bad update or let's say someone hacks it and introduces malicious code, our pipeline will run the update without questions if we do v1
vs the code commit. It's a way of freezing the code we run from others.
Keep in mind some of the CI pipelines have access to our Google Cloud credentials so a malicious change can potentially obtain access too.
More info: https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-third-party-actions
.github/workflows/run-benchmarks.yml
Outdated
runs-on: ubuntu-latest-8-cores | ||
strategy: | ||
matrix: | ||
runtimes: [centrifuge, altair] |
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 now Demo uses development we should add also here the weights. See this slack thread
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 would also add development
here. But lets have this in a second PR where we should also add the possibility to build development wasm for upgrades in dev and demo.
strategy: | ||
matrix: | ||
target: [test-general, test-integration, | ||
lint-fmt, lint-clippy, cargo-build] # ,lint-taplo] |
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.
Should be list-taple
reenable?
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.
Our intention was to re-enable it in a follow up PR in case it doesnt work out of the box. WDYT?
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.
Every time I enabled it it failed consistently, I think it requires a bit of work, I agree on dealing with it in separate PRs
echo "---- GENERATE CODE COVERAGE ----" | ||
echo "# Install Tarpaulin" | ||
cargo install --locked cargo-tarpaulin | ||
# make 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.
Can be this line removed?
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 file is not used right now but kept as a wip state to introduce code cov.
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.
Yes, this will be a separate PR
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.
Re-approving. Unfortunately, my approval is not sufficient.
All tasks for the future: |
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 will approve based on the knoweledge I have but more on the fact that @wischli and @gpmayorga spent so much time on this. Thanks a lot for the improvements!!!
.github/workflows/run-benchmarks.yml
Outdated
runs-on: ubuntu-latest-8-cores | ||
strategy: | ||
matrix: | ||
runtimes: [centrifuge, altair] |
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 would also add development
here. But lets have this in a second PR where we should also add the possibility to build development wasm for upgrades in dev and demo.
Description
Main goal was to activate an efficient cache system to improve build time of the chain nodes and wasm builds. But since every single workflow file needed touching I started consolidating code and adding other improvements resulting in an almost full re-write of our pipelines.
Ref (internal) document: https://centrifuge.hackmd.io/Ftgot4ilSxK5ERyrEujnBg?view
Changes and Descriptions
Cache features
This PR introduces 3 types of cache systems:
Used by: sanity checks, benchmarks, linters
Using the same cache system as our current pipelines with some enhancements (Swatinem/rust-cache). Getsmounted on the srtool container.
Used by: wasm runtime builds
Using buildx cache system, setup to use the registry as a cache but can be setup with GHA native cache system
Used by: docker build
To review:
Benhcmarks
Now benchmarks will run on the
main
branch for every push andcreate a PR with the new weights(creating a PR from a bot has been disabled org-wide by an admin after this, woops!).The benchmark job will upload the benchmark results to the job's page.
To review:
Docker builds
To review:
New features/enhancements
Code coverage: https://doc.rust-lang.org/rustc/instrument-coverage.htmlBuild time graphs: https://doc.rust-lang.org/nightly/cargo/reference/timings.html(Optional) To be super rust-native, can we use https://github.com/matklad/cargo-xtask to define what needs "to be done" instead of using a bash script?Checklist to set this PR as "ready"
- [ ] Makefile to consolidate CI operations into a single sourceFigure out something clever to upload benchmarks regularly and ping devs(upload to the benchmark job)Try-runtime for runtime upgrades