storage
storage copied to clipboard
Potential improvement over Naive Diff, from Email conversation.
Hi Miklos,
Can you elaborate a bit more on what docker/container-storage and do here to expedite image generation with redirect_dir/metacopy enabled.
They can't pack these xattrs in image because image will not be portable. It will be overlayfs specific and can't be made to work on target without overlayfs.
Are you referring to apps being able to traverse lower layers and do the redirect_dir and metacopy resoltion as kernel does. To me that process is not trivial. Having a library might help with adoption though.
AFAICS what happens when generating a layer is to start with a clean upper layer, do some operations, then save the contents of the upper layer. If redirect or metacopy is enabled, then the contents of the upper layer won't be portable. So need to do something like this:
traverse(overlay_dir, upper_dir, target_dir) { iterate name for entries in $upper_dir { if ($name is non-directory) { copy($overlay_dir/$name, $target_dir/$name) } else if ($name is redirect) { copy-recursive($overlay_dir/$name, $target_dir/$name) } else { copy($overlay_dir/$name, $target_dir/$name) traverse($overlay_dir/$name, $upper_dir/$name, $target_dir/$name) } } }
Basically: traverse the upper layer but copy files and directories from the overlay. Does that make sense?
Thanks, Miklos
@rhvgoyal FYI
@nalind @rhvgoyal @giuseppe @vrothberg Is this something we now have time to pursue? Would potentially help speed up the building of container images.
My November schedule tells me that I don't have time but it would be great to follow the idea and look into it :+1:
We have an issue on naivediff and metacopy=up, that might be related. We probably need to revisit this issue.
@kolyshkin or @giuseppe This might be something that interests you ?