Commit Graph

15 Commits

Author SHA1 Message Date
weixian.cxy
535191abf3 fix #6054 MaxConcurrentDownloads is not effect when Unpack is true
Signed-off-by: weixian.cxy <weixian.cxy@alibaba-inc.com>
2021-10-19 10:56:01 +08:00
Kathryn Baldauf
f8992f451c add optional check that snapshotter supports the image platform when unpacking
Signed-off-by: Kathryn Baldauf <kabaldau@microsoft.com>
2020-12-10 10:54:22 -08:00
Daniel Canter
a91c298d1d Optimize Windows and LCOW snapshotters to only create scratch layer on the final snapshot
For LCOW currently we copy (or create) the scratch.vhdx for every single snapshot
so there ends up being a sandbox.vhdx in every directory seemingly unnecessarily. With the default scratch
size of 20GB the size on disk is about 17MB so there's a 17MB overhead per layer plus the time to copy the
file with every snapshot. Only the final sandbox.vhdx is actually used so this would be a nice little
optimization.

For WCOW we essentially do the exact same except copy the blank vhdx from the base layer.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2020-11-30 16:25:38 -08:00
Gaurav Singh
db74d3115e unpacker: Fix data race and possible data corruption
Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>
2020-05-17 10:55:52 -04:00
Sebastiaan van Stijn
dc92ad6520
Replace errors.Cause() with errors.Is()
Dependencies may be switching to use the new `%w` formatting
option to wrap errors; switching to use `errors.Is()` makes
sure that we are still able to unwrap the error and detect the
underlying cause.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-05-08 14:36:45 +02:00
Maksym Pavlenko
8cddb5f91d Pass snapshotter opts during Pull
For remote snapshotter cases it's quite often there is need to pass extra info
from client (for instance - registry URL to query remote layer from, credentials, etc).

This commit slightly extends WithPullSnapshotter to pass extra labels to a snapshotter.

Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
2020-03-02 13:45:40 -08:00
Brandon Lum
95fbf3dc28 Fix unpacker to pass use apply options
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
2020-01-09 15:10:07 +00:00
ktock
493a36de95 Move label filter to snapshots package
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2019-12-25 12:13:08 +09:00
Kohei Tokunaga
4ccb7aa221 Enable to propagate necessary information to snapshotter during unpack
Though containerd gives ChainID to backend snapshotters during unpack for
searching snapshots to be skipped downloading the contents, ChainID isn't enough
for some snapshotters which require additional information of layers.
Some examples are remote snapshotters which is based on stargz filesystem
(requires image-related information to query the contents to docker registry)
and those which is based on CernVM-FS (requires manifest digest, etc. for
providing squashed rootfs).

This commit solves this issue by enabling a handler to inject additional
information of layers to snapshotters during unpack.

Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2019-12-23 10:39:40 +09:00
Derek McGowan
30d92eff1c
Defer layer download until unpack
Moves the content fetching into the unpack process
and defers the download until the snapshot needs it
and is ready to apply. As soon as a layer is reached
which requires fetching, all remaining layers are
fetched.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2019-12-09 10:29:06 -08:00
Lantao Liu
c560591627 Avoid deadlock in unpacker.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-11-15 14:01:37 -08:00
Derek McGowan
6f31417d49
Generalize media types
Avoid directly handling media types with "+" attributes,
instead handling the base and passing through the full
media type to the appropriate stream processor or decompression.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2019-09-19 16:09:19 -07:00
Lantao Liu
d6a6e0b8bc Support foreign and encrypted layers in the unpacker.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-09-03 18:43:10 -07:00
Lantao Liu
56bcc77679 Handle layers with the same digest in unpacker.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-08-26 11:31:33 -07:00
Lantao Liu
60f73b6cf1 Support simultaneous image unpack.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-08-21 16:31:29 -07:00