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 fetching performance (mainly for CI) #10

Merged
merged 5 commits into from
May 27, 2024
Merged

Improve fetching performance (mainly for CI) #10

merged 5 commits into from
May 27, 2024

Conversation

marienz
Copy link
Owner

@marienz marienz commented May 27, 2024

This disables submodule fetches, which may have broken something.

marienz added 5 commits May 26, 2024 22:06
This may turn out to be too much (but it does at least build).

Motivation: CI's git checkouts consume an unmanageably large amount of
cache (over 3 GiB per snapshot out of 10 GiB quota), and must be cached
for acceptable build speeds. Dropping submodules should help somewhat
directly, but I want to try switching most of CI over to fetchTree's
github fetcher, which won't include submodules. This change should help
maintain parity.

I'm also seeing a submodule fetch failure in CI (for stan-mode) that I
may not need to debug if the package functions without that submodule.
This seems to be much more space-efficient: ~/.cache/nix/tarball-cache
is about 700MiB uncompressed, under 300MiB as tzst (using tar's
defaults, CI uses zstdmt but I assume will be in the same ballpark). The
gitv3 cache is multiple GiB.

CI will still build doom-example using fetchGit. I intend to shrink the
number of modules enabled in the example to keep gitv3 cache size under
control.
Using the lockfile hash as cache key did not make much sense, since
changes to Unstraightened itself change what we fetch.

And a static restore key means we never flush our cache: that might be
ok if cache size was reasonable, but it is not (over 3 GiB).

Switch to using the date as cache key, and only restore caches from the
current month.

Add tarballs as a second cache.

I considered caching all of ~/.cache/nix, but do not want to find out
the hard way any (new) caches are not portable if I add CI for other
platforms. The tarball-cache seems to be another git tree, so it should
be ok.
This now matters for CI, as the example is still built using fetchGit
instead of the github fetcher.

The example was doing double duty as an example and a stress-test,
enabling some problematic or interesting modules. That is no longer
necessary (once the branch with dynamically generated init.el with all
modules/flags enabled lands).
This should not be doing anything, and I saw it stall (to retry
requests) once or twice.
@marienz marienz merged commit 73cd965 into main May 27, 2024
3 checks passed
@marienz marienz deleted the fetchtree branch May 27, 2024 09:59
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.

1 participant