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

Add Github Action cache to improve CI time #269

Closed
wants to merge 3 commits into from
Closed

Conversation

duc-nx
Copy link
Contributor

@duc-nx duc-nx commented Aug 9, 2024

No description provided.

Copy link

vercel bot commented Aug 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nexus-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 23, 2024 7:06pm

Copy link
Contributor

@slumber slumber left a comment

Choose a reason for hiding this comment

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

Note that current CI configuration already caches compile artifacts, from main branch test workflow:

... Restoring cache ...
Received 22[229](https://github.com/nexus-xyz/nexus-zkvm/actions/runs/10273767219/job/28429080317#step:3:239)8112 of 509254757 (43.7%), 211.6 MBs/sec
Received 478150656 of 509254757 (93.9%), 227.8 MBs/sec
Cache Size: ~486 MB (509254757 B)

It does appear to not work now, might be a misconfiguration issue or something else. Quick search gives https://github.com/actions/cache/blob/main/tips-and-workarounds.md#use-cache-across-feature-branches

Tearing out the whole thing isn't proper solution, as there's no guarantee it will not happen again (especially because two workflows function the same way).

Secondly, the whole CI configuration now looks very cluttered compared to main.

@duc-nx
Copy link
Contributor Author

duc-nx commented Aug 12, 2024

Hmm, I didn't know we have build cache, perhaps because I only look at build time in CI. When I made this PR, I notice the build time improve.
For example: the test-smoke and test-sdk usually take 8 to 10 minutes, now down to 5 to 7 minutes.

I separate the clippy, because this way we have code scanning features and can be viewed overtime in Github settings.
Other than that, I group a few build and check together, so they don't have to query the cache if they run separately.
Because the CI success is determined at the longest task (which is tesk-sdk and test-smoke), so by combing them together doesn't make the CI worst, IMO.

@duc-nx
Copy link
Contributor Author

duc-nx commented Aug 21, 2024

Updated the Cache and compare the test time between main and this branch:

Build time actually improved. (except tesk_smoke and test_sdk where we do a fresh build).

.github/workflows/rust-clippy.yml Outdated Show resolved Hide resolved
.github/workflows/rust-clippy.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/rust-clippy.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
Comment on lines +1 to +4
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this sentence here? Depending on the reason, you might want the same sentence in .github/workflows/ci.yml.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not our script. We should leave it as is in so in the future we get a fresh new one instead of fixing it.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is just a caveat emptor that you're using third-party code on GH Actions and if something breaks it's not GHs fault. No harm in keeping it or removing it either way, but might make it easier to track down the provenance.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is not our script.

Let's add a link to the source. Also, what's the license of the source?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Idk, it's from the Github action item, and I just click on it and make minor modification.
I'm pretty sure it's open license, because there are plenty projects use this, although I don't have time to find the exact original license of this source.

.github/workflows/rust-clippy.yml Outdated Show resolved Hide resolved
duc-nx added 2 commits August 23, 2024 14:22
move to seperate github action

compact CI

rename file

fix name

add clippy as well

just check example

shorten the test time
Copy link
Contributor

@yoichi-nexus yoichi-nexus left a comment

Choose a reason for hiding this comment

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

EDIT: Doesn't look ready to merge.

@duc-nx
Copy link
Contributor Author

duc-nx commented Aug 27, 2024

Close this PR due to no time to work on it anymore. Although the CI build is improved and Code scanning will be helpful to the project.

@duc-nx duc-nx closed this Aug 27, 2024
@yoichi-nexus yoichi-nexus deleted the duc-nx-rust-cache branch August 27, 2024 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
benchmark Enable benchmark CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants