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

Utilize content addressed binaries and reduce src dl #8

Merged
merged 5 commits into from
Sep 7, 2023
Merged

Conversation

johnalotoski
Copy link
Collaborator

@johnalotoski johnalotoski commented Sep 1, 2023

Overview:

  • Decreases initial eval and shell entrance time and download size significantly (see benchmark section)
  • Utilizes content addressed pure fetchClosure packages where possible
  • Eliminates flake inputs where possible to reduce initial recursive source pulls
  • NixOS service only flake references are set to flake = false which is adequate for nixOS module import

Benchmark:

  • Quick benchmark test taken before and after this PR for entering an ops shell from a clean cardano-parts nix-garbage-collected system.
  • Total file count and download size are determined after having entered the new shell, then exiting and removing the GC roots for the shell and re-running a nix-collect-garbage.
  • In the "After PR" part of the comparison, the offchain-metadata-registry-tools binaries and cardano-faucet binary are not included as they are not available in capkgs yet. However, this won't affect the overall comparison significantly as the binaries from capkgs are much smaller/quicker than the alternative use of the upstream flake input due to the flakes recursive input source download, IFD and eval time to arrive at the binary artifact(s).
  • Speed test shows ~150 Mbps download bandwidth at the time of testing
Ops shell:
                  Before PR       After PR
DL size (MiB)     8733            644
File count        7894            854
Time              12m:30s         1m:5s

Migration notes:

  • Update your .envrc file with this PRs template version, link
  • Add a new flake/lib.nix file to your consuming repo, using the contents here, link
  • Requires nix 2.17.0 or later (a direnv check with the new .envrc will warn and exit if you don't meet this requirement)
  • Requires nix experimental-feature fetch-closure (a direnv check with the new .envrc will warn and exit if you don't meet this requirement)
  • Consuming repos needing to override default packages for packages, jobs or entrypoints use should use the flakeModule pkgs config option (perSystem context: config.cardano-parts.pkgs.<...> = ...;) rather than apply flake input overrides since most default package definitions now come from capkgs.

.envrc Show resolved Hide resolved
.envrc Show resolved Hide resolved
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.

3 participants