Skip to content

Conversation

@smklein
Copy link
Collaborator

@smklein smklein commented Dec 9, 2021

This PR integrates the Rust Cache Action to cache third party dependencies. It exclusively applies them to Github workflows, and does not yet optimize Buildomat. The cache step is skipped on main so it will always build from scratch there.

Before Cache:
image

After Cache:
image

@smklein smklein marked this pull request as ready for review December 9, 2021 23:21
@smklein smklein changed the title Try to add cache to Rust workflow Add Rust Cache Action to Github Actions Dec 9, 2021
@smklein
Copy link
Collaborator Author

smklein commented Dec 9, 2021

Note: this does not yet add a cache for the buildomat action, but it at least makes the Github actions much faster when third-party dependencies are unchanged.

@david-crespo
Copy link
Contributor

This means it worked, right? Holy crap.

image

Copy link
Contributor

@david-crespo david-crespo left a comment

Choose a reason for hiding this comment

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

incredible!

@smklein
Copy link
Collaborator Author

smklein commented Dec 9, 2021

This means it worked, right? Holy crap.

image

I believe this particular image is referencing the cache for Clickhouse/Cockroach being downloaded:

- name: Configure GitHub cache for CockroachDB binaries
id: cache-cockroachdb
# actions/cache@v2.1.4
uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6
with:
key: ${{ runner.os }}-cockroach-binary-${{ hashFiles('tools/cockroachdb_checksums') }}
path: "cockroachdb"
- name: Configure GitHub cache for ClickHouse binaries
id: cache-clickhouse
# actions/cache@v2.1.4
uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6
with:
key: ${{ runner.os }}-clickhouse-binary-${{ hashFiles('tools/clickhouse_checksums') }}
path: "clickhouse"
- name: Download ClickHouse
if: steps.cache-clickhouse.outputs.cache-hit != 'true'
run: ./tools/ci_download_clickhouse
- name: Download CockroachDB binary
if: steps.cache-cockroachdb.outputs.cache-hit != 'true'
run: bash ./tools/ci_download_cockroachdb

This is the part of the action where we check for a cache:

image

@david-crespo
Copy link
Contributor

I meant the build taking 5 minutes!

@smklein
Copy link
Collaborator Author

smklein commented Dec 9, 2021

I meant the build taking 5 minutes!

oh yeah I hope so lol

@david-crespo
Copy link
Contributor

david-crespo commented Dec 10, 2021

As discussed in chat, is there a way to make the use of the cache conditional so we can skip it on main? We want to be running clean builds at least some of the time, and main is a good spot for that because we're never waiting for CI to pass there. We would also have to turn off whatever it is that skips builds on main when it thinks the PR already handled it.

@david-crespo
Copy link
Contributor

Branch skipping works. Tested by telling it to skip this branch instead of main:

image

@smklein smklein merged commit 6d02abd into main Jan 14, 2022
@smklein smklein deleted the rust-cache branch January 14, 2022 22:18
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.

3 participants