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
linuxkit/build: implement --modified-only option #4038
Conversation
This implements --modified-only option, which should complement recent --input-tar feature by generating resulting tarball with modified only files. Signed-off-by: Roman Penyaev <r.peniaev@gmail.com>
I don't understand what this does. What does this option do? |
Does not copy files to the resulting tarball if they are not modified. The resulting tarball will be populated only with files, which we get through the regular OCI procedure. For example here the eve/kdump was modified:
So only kdump will be included. The rest is skipped. |
Let's run through a simple use case:
You want to create an option so that I have a tar file that contains only |
That's correct. Motivation is the same: creation of full copy ~900Mb tar and then copy it to the rootfs can take a while. Changed files are usually not greater than ~150Mb, which saves ~10-15 seconds from overall image build time. But! The issue is (about which I completely forgot) that eventually we need to merge both tars, but that can be done later, let's say if sizes of a tar with modified files grows to the half of the original (--input-tar foo.tar) tar size. Need to do some experiments. Don't you mind if we keep this PR hanging here for a while? |
Sure, we can keep it open. I need time to think this one through. |
It took me some time to figure out what was bothering me about this. When you run This change makes it so that it is not exactly that, the output no longer is fully usable, but rather a diff. That sort of breaks the philosophy of I understand why you might want this. linuxkit itself has such intimate knowledge of how things are built, if you want a diff, it is the convenient place to get it. It sounds like you aren't clear if this is useful to you in the first place. Let's resolve that. If it still is, then let's find a way to make it happen. I am not sure it breaks it enough to reject doing it; you are adding an explicit flag that says "only give me the modified info". I wouldn't make it work only if |
Will close this for now. |
This implements
--modified-only
option, which should complement recent--input-tar
feature by generating resulting tarball with modified only files.- A picture of a cute animal (not mandatory but encouraged)
Sure thing. Sad Hamster himself: