-
Notifications
You must be signed in to change notification settings - Fork 15
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
Feature request: use a single cache entry #16
Comments
We're also struggling with rate limits. @batteries-included has a nix mono-repo with nix + rust + node + elixir. Each language has its dependencies, and as such, the number of things in the store are very high. Most of the starting deps are node packages or very small rust crates. In the end we have a large dependency tree like this: graph TD;
WebCSSBundle-->NodeBuildDerivation;
CSSSourceCode-->NodeBuildDerivation;
JSSourceCode-->NodeBuildDerivation;
NodeBuildDerivation-->NodeDep1;
NodeBuildDerivation-->NodeDep2;
NodeBuildDerivation-->NodeDep3;
NodeBuildDerivation-->NodeDepN;
RustBinary-->RustBuildDerivation;
RustSourceCode-->RustBuildDerivation;
RustBuildDerivation-->CargoDep1;
RustBuildDerivation-->CargoDep2;
RustBuildDerivation-->CargoDep3;
RustBuildDerivation-->CargoDepN;
Any change to the input source code for a build derivation results in cache misses on the build derivation, and the need for all of the inputs. We tried cachix. It's useful, but since each github worker starts with an empty store, we sometimes spend as many as 10 minutes fetching the small dependencies sequentially. Fetching from cachix or fetching from npm are around the same speed. magic-nix-cache-action is faster for us than cachix (comparing on a warm branch or on master). However it still struggles with rate limits, like before we spend a large amount to time sequentially fetching dependencies. Fetching from the github cache in a GitHub worker is faster than going to npm or cachix. So this is a win. However, we still see a lot of failures in reading from the cache because of the number of dependency cache fetches. These failures then propagate into failures to push into the cache. I would love to see:
|
These suggestions are just crutches. I hope someone makes an action after considering these ideas. Currently, I have no experience in writing GH actions and not much time. |
@elliottneilclark , I'm currently going to use the |
Hi!
I used your GH Action and got a GH API error just as you warned. Also, I saw that GH Caches had a lot of entries just like in this (
magic-nix-cache-action
) repo.There are other approaches to caching the store.
Approach 1
Use
cachix
.Advantages:
Disadvantages:
Approach 2
Host a custom binary cache like attic.
Didn't use. I suspect it has approximately the same advantages and disadvantages the
cachix
option.Approach 3
Use a chroot local store.
Advantages:
Disadvantages:
macOS
nix build
as they point to/nix/store/bar
and not to the actualprefix/nix/store/bar
.Approach 4
Use an intermediate store with
nix-store --{import,export}
ornix copy --{from,to}
(cachix/install-nix-action#56), possibly keep only a working set of paths by usingatime
.Attempts:
Advantages:
Caches
entryDisadvantages:
Approach 5
Don't use an intermediate store.
Use nix-quick-install-action to restore and save
/nix
directly (nixbuild/nix-quick-install-action#33).Advantages:
Disadvantages:
The text was updated successfully, but these errors were encountered: