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

initial attempt at per package layering #158

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

initial attempt at per package layering #158

wants to merge 2 commits into from

Conversation

tofay
Copy link
Contributor

@tofay tofay commented Sep 17, 2024

As discussed in #153

implement per-package layering a la https://grahamc.com/blog/nix-and-layered-docker-images/, using nix's existing popularity algorithm.

The package graph is determine heuristically, by looking for the first installed package that satisfies each of a packages requires.
Cycles are then removed arbitrarily using Python's TopologicalSorter before the graph is passed to the nix popularity function.
This is likely to affect determinism of the image manifest:

  • the graph we build is dependent on the results of dnf queries
  • the cycle removal isn't guaranteed to be deterministic
  • the nix popularity function results need sorting by package name

A layer is created for each of the most popular packages. Each layer has it's own "clamp_mtime", which is taken from the package build date, so package layer digests are consistent across builds.

TODO

  • determine how configurable this should be (on/off, number of layers, batched layering??)
  • investigate impact on per image reproducibility. It seems unlikely that
  • sort the results from nix's popularity algorithm by popularity and name
  • testing

@tofay tofay changed the title initial attempt per package layering as discussed in initial attempt at per package layering Sep 17, 2024
implement per-package layering a la
https://grahamc.com/blog/nix-and-layered-docker-images/,
using nix's existing popularity algorithm
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