images: support checking status of image content#1567
images: support checking status of image content#1567crosbymichael merged 1 commit intocontainerd:masterfrom
Conversation
|
Closes #1514 |
d060cbc to
484b735
Compare
Codecov Report
@@ Coverage Diff @@
## master #1567 +/- ##
=======================================
Coverage 42.44% 42.44%
=======================================
Files 24 24
Lines 3362 3362
=======================================
Hits 1427 1427
Misses 1608 1608
Partials 327 327Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Microsoft? 😅
You may want to use a different variable name ;-)
There was a problem hiding this comment.
Na, this is the standard abbreviation for manifest. I don't think microsoft is a part of this context, so its not confusing.
@jhowardmsft "John Howard Manifest" Any objections to abbreviating Manifest to msft? ![]()
There was a problem hiding this comment.
how is msft an abbreviation for manifest? The order of the letters do not match at all. wouldn't it be mfst ?
484b735 to
16a1c10
Compare
|
@stevvooe So for us, during the start, we need to recover all ready images, to check whether a image is ready or not we need to:
Then we could be sure that the image is ready for use? |
|
@Random-Liu Yes, this provides the check for the metadata content. I think we should move the snapshotter preparation to the container rootfs creation stage, rather than using it to decide if an image is "Ready". If you move snapshot preparation to the image readiness size, it requires that the "image" is parameterized on which snapshot is use, which should really be a property of a given container. Basically, |
Hm. Maybe I misunderstood something. Now when create container rootfs, we usually just use If we don't check top snapshot for image readiness, does it mean that whenever we create container rootfs we should try to unpack the image? |
|
@Random-Liu Well, that is the current behavior, but I am wondering if we should have |
16a1c10 to
c7062ef
Compare
We could always add options to tell
Anyway, containerd provided the API to check existence of top snapshot, so it's enough for us. :) |
|
@Random-Liu I agree that those are good approaches where unpack is amortized into pull. However, in cases where the snapshotter isn't known until container start time, we move the unpack to container preparation/creation. For CRI-containerd, this is easy to just model as it is done in docker today, with unpack amortized into pull. Does this concern stop this PR or would you like me to add a version of this that handles the snapshotter situation, as well? |
c7062ef to
b7e91c4
Compare
As long as it's still possible to unpack during
If it's simply check top snapshot existence by chain ID, I think it's fine to do it ourselves in cri-containerd. |
|
@Random-Liu The problem is that the snapshot may not exist. What does |
|
@stevvooe If cri-containerd always does unpack during image pulling, non-exist snapshot should be rare case. I think when we find it during list/inspect/restart, we may just remove the reference and let next garbage collection handle it. |
The `Check` function returns information about an image's content components over a content provider. From this information, one can tell which content is required, present or missing to run an image. The utility can be demonstrated with the `check` command: ```console $ ctr images check REF TYPE DIGEST STATUS SIZE docker.io/library/alpine:latest application/vnd.docker.distribution.manifest.list.v2+json sha256:f006ecbb824d87947d0b51ab8488634bf69fe4094959d935c0c103f4820a417d incomplete (1/2) 1.5 KiB/1.9 MiB docker.io/library/postgres:latest application/vnd.docker.distribution.manifest.v2+json sha256:2f8080b9910a8b4f38ff5a55a82e77cb43d88bdbb16d723c71d18493590832e9 complete (13/13) 99.3 MiB/99.3 MiB docker.io/library/redis:alpine application/vnd.docker.distribution.manifest.v2+json sha256:e633cded055a94202e4ccccb8125b7f383cd6ee56527ab890db643383a2647dd incomplete (6/7) 8.1 MiB/10.0 MiB docker.io/library/ubuntu:latest application/vnd.docker.distribution.manifest.list.v2+json sha256:60f835698ea19e8d9d3a59e68fb96fb35bc43e745941cb2ea9eaf4ba3029ed8a unavailable (0/?) 0.0 B/? docker.io/trollin/busybox:latest application/vnd.docker.distribution.manifest.list.v2+json sha256:54a6424f7a2d5f4f27b3d69e5f9f2bc25fe9087f0449d3cb4215db349f77feae complete (2/2) 699.9 KiB/699.9 KiB ``` The above shows us that we have two incomplete images and one that is unavailable. The incomplete images are those that we know the complete size of all content but some are missing. "Unavailable" means that the check could not get enough information about the image to get its full size. Signed-off-by: Stephen J Day <[email protected]>
b7e91c4 to
c555df5
Compare
|
LGTM |
1 similar comment
|
LGTM |
The
Checkfunction returns information about an image's content componentsover a content provider. From this information, one can tell which content is
required, present or missing to run an image.
The utility can be demonstrated with the
checkcommand:The above shows us that we have two incomplete images and one that is
unavailable. The incomplete images are those that we know the complete
size of all content but some are missing. "Unavailable" means that the
check could not get enough information about the image to get its full
size.
Signed-off-by: Stephen J Day [email protected]