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

Optimize Bazel CI performance #312

Merged
merged 5 commits into from
Feb 14, 2025
Merged

Conversation

jchadwick-buf
Copy link
Member

@jchadwick-buf jchadwick-buf commented Feb 14, 2025

This should improve performance for the Bazel CI workflow, and ensure that it is cached more often. We will need to manually clear caches periodically though, since the approach used to save/restore the bazel cache is naive. (This is also true for the main CI rule, unfortunately. Maybe there is a more advanced Bazel cache integration for GitHub Actions.)

Copy link

github-actions bot commented Feb 14, 2025

The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedFeb 14, 2025, 4:42 PM

@jchadwick-buf jchadwick-buf changed the title Split Bazel testing across two jobs to reduce CI time. Split Bazel testing across two jobs to reduce CI time Feb 14, 2025
@jchadwick-buf jchadwick-buf changed the title Split Bazel testing across two jobs to reduce CI time Optimize Bazel CI performance Feb 14, 2025
@jchadwick-buf
Copy link
Member Author

When cached, this should bring the Bazel CI runtime down to around a minute-thirty. Latest run in this PR: https://github.com/bufbuild/protovalidate/actions/runs/13320833173

Copy link
Member

@nicksnyder nicksnyder left a comment

Choose a reason for hiding this comment

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

We will need to manually clear caches periodically though, since the approach used to save/restore the bazel cache is naive.

What is the negative consequence of not clearing the cache periodically? Slower cache sync because size keeps increasing? Failed builds due to disk filling up? Can we document how to do this somewhere?

@jchadwick-buf
Copy link
Member Author

The consequence is that the cache gets increasingly stale. It'd be ideal if it wrote back in a concurrency-safe way, but there are downsides to just telling GHA to always write back. Probably just need to look into if there's a better cache integration for Bazel specifically.

@jchadwick-buf jchadwick-buf merged commit 6d0ebb6 into main Feb 14, 2025
7 checks passed
@jchadwick-buf jchadwick-buf deleted the jchadwick/parallel-bazel-ci branch February 14, 2025 16:56
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