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

Support a caching mode where we always append to the existing caches #1749

Closed
mcassaniti opened this issue Aug 7, 2023 · 6 comments
Closed
Labels

Comments

@mcassaniti
Copy link
Contributor

I'd like to see yet another way to cache builds using mkosi. Let's assume we're building weekly using the same configuration so package updates can be included in the final image. Most of the work the package manager will do for fetching files or performing package installation will be redone over and over without any difference between runs. Any skeleton or extra directories will remain unchanged too.

I'm proposing that a new caching mechanism be available that caches the working directory. This does come with the caveat that the user is responsible for dealing with any non-idempotent actions. For example, if a package is no longer specified for install they will need to either destroy the cache or add a post-install script to check for and remove the package. The same goes for mkosi.extra and mkosi.skeleton directories.

The benefit is a significant speed-up in image rebuild times, despite a user needing to make sure they manage non-idempotent actions.

As an aside, should discussions be enabled for this repository?

@DaanDeMeyer
Copy link
Contributor

Issues are fine for the scale we're at.

I have had the same idea and I agree, we should have an incremental mode that behaves like you describe.

@DaanDeMeyer DaanDeMeyer added the RFE label Aug 7, 2023
@DaanDeMeyer DaanDeMeyer changed the title Discussion: More caching Support a caching mode where we always append to the existing caches Aug 8, 2023
@mcassaniti
Copy link
Contributor Author

If I take a look at the code now it will cache until about where the postinst script runs in the pipeline for the final image. Maybe this is enough?

@DaanDeMeyer
Copy link
Contributor

What's missing is that when we invalidate the cache because we add a package or such, we throw away the entire cache and rebuild it from scratch. I figured this was about not throwing away the cache in that case and just installing the extra packages on top of the existing cache.

@mcassaniti
Copy link
Contributor Author

That would be good, along with some other pieces I'll write up later.

@mcassaniti
Copy link
Contributor Author

I've raised #1808 to get this started. Once that is merged in whatever form it takes I'll add another caching option.

@DaanDeMeyer
Copy link
Contributor

Let's merge this into #1756

@DaanDeMeyer DaanDeMeyer closed this as not planned Won't fix, can't repro, duplicate, stale Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants