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

Root layer caching #68

Open
GZGavinZhao opened this issue Jan 27, 2024 · 2 comments
Open

Root layer caching #68

GZGavinZhao opened this issue Jan 27, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@GZGavinZhao
Copy link
Member

GZGavinZhao commented Jan 27, 2024

This is the design for caching our container root between subsequent builds on the same package. The container root will be reused as long as system.base, system.devel, and the package's dependencies remain the same. This will eliminate most if not all the time needed for fetching and installing dependencies.

To do this, we will need to have three overlays that are mounted and unmounted one after another. Relative paths are relative to /var/cache/solbuild/<profile>/<package>/.

  1. Overlay 1: for ensuring system.base, system.devel, and other packages needed by solbuild to function are at their latest version.
    • lower: img
    • upper: base
    • merged: unionb
    • other mounts:
      • eopkg package cache: /var/cache/eopkg/packages
    • <hash-of-dependencies> is generated inside this overlay after everything is up-to-date.
  2. Overlay 2: for installing the dependencies of the package to build. This overlay is only mounted if the layer doesn't exist already.
    • lower: img:base
    • upper: /var/cache/solbuild/<layers>/<hash-of-dependencies>. This is the layer that will be cached and reused.
    • merged: uniond
    • other mounts:
      • eopkg package cache: /var/cache/eopkg/packages
  3. Overlay 3: for actually building the package
    • lower: img:base:/var/cache/solbuild/<layers>/<hash-of-dependencies>
    • upper: tmp
    • merged: union
    • other mounts:
      • everything that we currently mount

<hash-of-dependencies> is generated by ypkg-install-deps --dry-run --json (getsolus/ypkg#57).

@GZGavinZhao GZGavinZhao added the enhancement New feature or request label Jan 27, 2024
@GZGavinZhao GZGavinZhao self-assigned this Jan 27, 2024
@ReillyBrogan
Copy link
Contributor

What about creating different overlay layers for each individual package install? That would allow layers to be reused between builds.

@GZGavinZhao
Copy link
Member Author

I'm concerned about file conflicts between different packages. If we install packages one by one, we would need extra measure to make sure file conflicts are reported to us, while if we let eopkg install everything eopkg will handle that.

I used to mention running triggers is also an issue, but I guess we could force run triggers before running ypkg-build, so now my main concern is if packages have file conflicts.

@ermo ermo modified the milestones: 1.6.0, 1.6.x Feb 27, 2024
@silkeh silkeh modified the milestones: 1.6.x, 1.7.0 Feb 28, 2024
@silkeh silkeh modified the milestones: 1.7.0, 1.8.0 Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

4 participants