-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Installation part of the workflow is slow (by 2 orders of magnitude) #145
Comments
Hi Josh! 👋
I don't know. Maybe I'm fine using cargo-binstall, since Release-plz already has cargo-binstall instructions, and running cargo-binstall is reproducible locally. Install-action vs cargo-binstallWhat's the advantage of using
What do you mean? I don't understand what is saved and in which git repo 🤔 Using cargo-binstallIf we use cargo-binstall, for caching we can rely on release-plz/release-plz#1442 as it should cache release-plz and cargo-semver-checks. However, this has the disadvantage of removing the files from the cache when Cargo.lock changes. So maybe it's more efficient to cache the binaries ourselves, maybe with https://github.com/actions/cache We could run cargo-binstall to install release-plz in the following way: cargo binstall release-plz \
--version ${{ inputs.version }}
--strategies crate-meta-data In the same way, we could install cargo-semver-checks like this: cargo binstall cargo-semver-checks \
--version 0.31.0
--strategies crate-meta-data We should also pass the GITHUB_TOKEN environment variable to avoid rate limiting. Question: is cargo-binstall faster if we pass the Very curious to hear your thoughts on this! 🤗 |
1.6K (binstall) vs 6.9K (install-action) installs in repos. install-action uses binstall, but has a path that allows caching that github metadata once in the install-action repo rather than hitting the api for every run.
The manifests are updated every three hours. https://github.com/taiki-e/install-action/blob/main/.github/workflows/ci.yml
The metadata that I was referring to that is cached by install-action is the github api calls mentioned above (the version info and download links). Instead of every action run querying the release status API for every installation, it runs with the values that are cached from the install-action repo (example: https://github.com/taiki-e/install-action/blob/main/manifests/cargo-audit.json)
I wouldn't worry about caching any of this and investing the effort to duplicate the work of install-action, which falls back on using cargo-binstall anyway. Often this action takes literally no time at all: Example - this is from tui-scrollview: installing cargo-llvm-cov (https://github.com/joshka/tui-scrollview/actions/runs/9169759107/job/25210765142) Pulling the cargo deps for this repo takes about 2 secs and updating takes 7 secs. install-action takes 0 secs and 0 effort. |
Testing this out in #146, the install time goes down to 2s without any specific changes to the install-action repo. |
Ok, I think I understand how the If we add support for release-plz and cargo-semver-checks, Probably we need to add support for release-plz and cargo-semver-checks in Anyway, I merged the PR since it brings significant improvements, thanks 🙌 I just want to make sure I understand everything happening under the hood. Would you like to add support for release-plz and cargo-semver-checks in |
Released this. Thanks for addressing this issue ❤️ |
Yep - your summary is correct.
Sure thing :) |
TL;DR:
Expected <30s for release process
Actual 5min
Consider taiki-e/install-action instead of action-install-gh-release.
In many of my crate repos I have CI that install various cargo tools using https://github.com/taiki-e/install-action. This is fast (usually single digit seconds for multiple tools).
The install process in release-plz-action is 2 orders of magnitude slower (~4-5 minutes). I suspect perhaps the difference is down to whatever is happening with the caching? If my crate isn't getting updated as often as release-plz / cargo-semver, then I never benefit from the cache and always feel the downside of how long it takes to upload the cache.
taiki-e install-action has a list of supported tools (cargo-semver isn't there yet, and neither is release-plz), but it also falls back to using cargo binstall if the tools aren't available, which is also fairly fast. It doesn't need to cache the install as the metadata about release versions is written to the git repo and doesn't have to be parsed for each install.
Example logs (turn on timestamps):
release-plz using action-install-gh-release: https://github.com/joshka/tui-big-text/actions/runs/9265763819/job/25488487114
ci process using taiki install-action: https://github.com/joshka/tui-big-text/actions/runs/9265763820/job/25488487509
Proposed fix:
(The process for adding a tool is to write a small amount of metadata, run a tool that checks the available versions once and then let the build system handle updates automatically from then on)
The text was updated successfully, but these errors were encountered: