Skip to content

Fully populate layer records for mapped image top layers#1197

Merged
rhatdan merged 1 commit intocontainers:mainfrom
nalind:mapped-layer-sizes
Apr 13, 2022
Merged

Fully populate layer records for mapped image top layers#1197
rhatdan merged 1 commit intocontainers:mainfrom
nalind:mapped-layer-sizes

Conversation

@nalind
Copy link
Copy Markdown
Member

@nalind nalind commented Apr 12, 2022

When we create a copy of an image's top layer that's intended to be identical to the top layer, except for having some set of ID mappings already applied to it, copy over the template layer's compressed and uncompressed digest and size information, compression information, tar-split data, and lists of used UIDs and GIDs, if we have them.

The lack of sizing information was forcing ImageSize() to regenerate the diffs to determine the size of the mapped layers, which shouldn't have been necessary.

Teach the overlay DiffGetter to look for files in the diff directories of lower layers if we can't find them in the current layer, so that tar-split can retrieve content that we didn't have to pull up.

Fixes containers/podman#13755.

@nalind nalind force-pushed the mapped-layer-sizes branch from 2d4babc to cf8644e Compare April 12, 2022 15:45
When we create a copy of an image's top layer that's intended to be
identical to the top layer, except for having some set of ID mappings
already applied to it, copy over the template layer's compressed and
uncompressed digest and size information, compression information,
tar-split data, and lists of used UIDs and GIDs, if we have them.

The lack of sizing information was forcing ImageSize() to regenerate the
diffs to determine the size of the mapped layers, which shouldn't have
been necessary.

Teach the overlay DiffGetter to look for files in the diff directories
of lower layers if we can't find them in the current layer, so that
tar-split can retrieve content that we didn't have to pull up.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
@nalind nalind force-pushed the mapped-layer-sizes branch from cf8644e to d76b360 Compare April 12, 2022 19:40
Copy link
Copy Markdown
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
@giuseppe PTAL

@rhatdan
Copy link
Copy Markdown
Member

rhatdan commented Apr 13, 2022

LGTM

@rhatdan rhatdan merged commit b3a57ab into containers:main Apr 13, 2022
@nalind nalind deleted the mapped-layer-sizes branch April 13, 2022 12:43
@debarshiray
Copy link
Copy Markdown
Member

Thanks, @nalind (because of containers/toolbox#1027) !

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.

Running "podman images -a" is very slow

4 participants