-
Notifications
You must be signed in to change notification settings - Fork 30
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
The CI uses up a lot of resources #212
Comments
We intentionally made it do as much stuff as possible, assuming that most users would open source their code by default (which means infinite GitHub actions) or be ready to deal either the consequences of having a private repository, i.e. fiddling with the workflow. That said, it would be fairly easy to enable or disable the builds based on a The CI builds should take like a minute at most when cached, and an uncached release takes about 10 minutes for me. Did something go wrong there? Do private repos get less powerful CI agents? @TimJentzsch |
Under the hood it uses the GitHub Actions cache, I'm not aware of any restrictions for private repositories. |
Yeah I'm curious if caching wasn't working, or otherwise why it was taking so long. Looking at my own game's CI, I see this error when trying to save the cache (https://github.com/benfrankel/blobo_party/actions/runs/10139032444):
This started happening on the same CI run that spontaneously started recompiling from This is with 5 saved caches at 3 GB each. On the other hand, my releases were all under 10 minutes because I reused the same tag every time and hit the cache. |
GitHub runners for private repos are smaller than for public repos, except macOS hosts |
@mockersf thanks! That explains the performance issues then. Nothing we can fix, but it might be good to point it out in the docs. Edit: oh, looking at the logs, the machine simply ran out of space! Yeah, I've had that happen to me as well a couple of times. Don't think there's much we can do there other than restarting a build. Although you're right, this shouldn't invalidate the cache. Hmm. |
Hmm thats interesting. Maybe we can start optimizing the size of the cache though. |
So I noticed that in the CI run I linked, the |
Ah shoot. We should probably remove the last cache key fallback. It doesnt make sense for Check to fallback to a cache from Test for example, because they need different builds anyway, it just increases the cache size for nothing. |
Well I think the fallback itself is okay and shouldn't increase cache size, the problem is that Unless using a fallback means that when the cache is saved at the end of the job, it will also include any irrelevant stuff it downloaded from the fallback, thus increasing cache sizes every time a fallback occurs? If that's the case... maybe it would be better to have no fallback at all. |
Yes, the stuff from the fallbacks will also be saved again because its in the same folder. |
Could there be a situation where cache Z is a fallback from cache Y, which is a fallback from cache X, ... causing an ever-ballooning cache size over time? I wonder if there's a way to prune unused stuff from |
Yes, I think in theory that's possible. Otherwise I guess it's a good idea to clear your caches in CI occasionally. |
Is it alright if I move this issue to |
IMO that makes sense for cache size specifically, but this issue should remain here as well since we ought to consider the fact that private runners have worse performance + are not free. |
Would a solution be to ask you in |
Yes, and a note in the workflows doc that mentions the issue with private runners, so users hopefully see that when they're setting up CI. |
I created an issue for this on the |
Here's another issue on the |
Addresses part of #212. I recently merged a feature into [Leafwing-Studios/cargo-cache](https://github.com/Leafwing-Studios/cargo-cache) v2.3.0 that automatically deletes unused build artifacts before creating a new cache, to prevent cache sizes from snowballing. It's disabled by default due to backward compatibility reasons, so this PR enables it. Cache sweeping should keep cache sizes small and workflow runs fast. (As an side, should a cache be used at all in the release build? Caching prevents builds from being reproducible, and can introduce the occasional issue when building.)
Remaining tasks:
|
A single game jam was all it took.
Too late I realized that I should disable the windows/linux/mac build since I only really needed the web build for the game jam. I think the template probably should disable those by default and require people to enable them if they need them.
Maybe there are other things one could do to reduce the amount of minutes it takes up? Maybe running
cargo fmt
andcargo test
isn't necessary by default on main. Maybe one could runcargo test
without triggering it parsing the docs folder? Are there other improvements one could make?The text was updated successfully, but these errors were encountered: