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

Improve cache usage in CI #7678

Merged
merged 2 commits into from
Sep 29, 2023
Merged

Improve cache usage in CI #7678

merged 2 commits into from
Sep 29, 2023

Conversation

sarutak
Copy link
Member

@sarutak sarutak commented Sep 27, 2023

Which issue does this PR close?

Closes #7677

Rationale for this change

Making the CI faster accelerate development.

What changes are included in this PR?

This PR includes improvement of cache usage in CI.
In the current workflow, the critical path seems cargo check to verify benchmark results (amd64). So actions/cache is used only for the jobs.
Cached contents are also revised.

Are these changes tested?

Done by CI.
With my experiment, the total duration of workflow defined by rust.yml was about 30 mins.
https://github.com/sarutak/arrow-datafusion/actions/runs/6329626199

Are there any user-facing changes?

No.

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Nice work @sarutak -- thank you very much

I will say I don't really understand how the cache action works / doesn't work for Rust projects. However, I did an unscientific spot check on PR CI timings for this change, and my conclusion is that these data show a significant CI timing improvement and thus we can / should merge this PR.

This PR:
Screenshot 2023-09-28 at 2 09 09 PM

#7671
Screenshot 2023-09-28 at 2 09 38 PM

#7669

Screenshot 2023-09-28 at 2 10 46 PM

#7663

Screenshot 2023-09-28 at 2 11 41 PM

./target/
./datafusion-cli/target/
# this key equals the ones on `linux-build-lib` for re-use
key: cargo-cache-benchmark-${{ hashFiles('datafusion/**/Cargo.toml', 'benchmarks/Cargo.toml', 'datafusion-cli/Cargo.toml') }}
Copy link
Contributor

Choose a reason for hiding this comment

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

This cache key doesn't change unless we update the dependencies, right? What about the local code changes?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry for the late reply.

This cache key doesn't change unless we update the dependencies, right?

Yes.

What about the local code changes?

Local code change (except for Cargo.toml specified in hashFiles) doesn't affect the cache.

# this key equals the ones on `linux-build-lib` for re-use
key: cargo-cache-
key: cargo-cache-benchmark-${{ hashFiles('datafusion/**/Cargo.toml', 'benchmarks/Cargo.toml') }}
Copy link
Contributor

Choose a reason for hiding this comment

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

The key above also includes 'datafusion-cli/Cargo.toml' -- is in intentional that these keys do not match?

          key: cargo-cache-benchmark-${{ hashFiles('datafusion/**/Cargo.toml', 'benchmarks/Cargo.toml', 'datafusion-cli/Cargo.toml') }}

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it's intended.
This job (verify benchmark results) seems not to touch datafusion-cli, so this cache should not be stale on changing datafusion-cli/Cargo.toml.

@alamb alamb merged commit de15917 into apache:main Sep 29, 2023
22 of 23 checks passed
Ted-Jiang pushed a commit to Ted-Jiang/arrow-datafusion that referenced this pull request Oct 7, 2023
* Improve cache usage in CI

* Trigger GA to check the effect of improvement
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.

Improve cache usage in CI
2 participants