containerd / accelerated-container-image

A production-ready remote container image format (overlaybd) and snapshotter based on block-device.
Apache License 2.0
411 stars 76 forks source link

Question: what is the acceleration-layer? #79

Closed northtyphoon closed 3 years ago

northtyphoon commented 3 years ago

I inspected the sample image provided in https://github.com/alibaba/accelerated-container-image/blob/main/docs/EXAMPLES.md#ondemand-pulling-image and noticed one layer at the end was marked as "acceleration-layer". However, when I followed he doc and converted registry.hub.docker.com/library/redis:6.2.1, I didn't find the layer in my converted image. May I know what the layer is?

                {
                        "mediaType": "application/vnd.oci.image.layer.v1.tar",
                        "digest": "sha256:c32be80bd739307433858c79994ffc050393691d77453bd93bee1cc89c7473c1",
                        "size": 11264,
                        "annotations": {
                                "containerd.io/snapshot/overlaybd/acceleration-layer": "yes",
                                "containerd.io/snapshot/overlaybd/blob-digest": "sha256:c32be80bd739307433858c79994ffc050393691d77453bd93bee1cc89c7473c1",
                                "containerd.io/snapshot/overlaybd/blob-size": "11264"
                        }
                }

docker manifest inspect registry.hub.docker.com/overlaybd/redis:6.2.1_obd

{
        "schemaVersion": 2,
        "config": {
                "mediaType": "application/vnd.docker.container.image.v1+json",
                "digest": "sha256:8e3bd5ee258431fd6bb25652afc666f7582777229c5147e096ccf9b20c06ac1c",
                "size": 3688
        },
        "layers": [
                {
                        "mediaType": "application/vnd.oci.image.layer.v1.tar",
                        "digest": "sha256:a8b5fca80efae55088290f3da8110d7742de55c2a378d5ab53226a483f390e21",
                        "size": 4739584,
                        "annotations": {
                                "containerd.io/snapshot/overlaybd/blob-digest": "sha256:a8b5fca80efae55088290f3da8110d7742de55c2a378d5ab53226a483f390e21",
                                "containerd.io/snapshot/overlaybd/blob-size": "4739584"
                        }
                },
                {
                        "mediaType": "application/vnd.oci.image.layer.v1.tar",
                        "digest": "sha256:87763befd4f3289905d709bd03c969db43e512502be7e1132b625bdef487d01f",
                        "size": 43458048,
                        "annotations": {
                                "containerd.io/snapshot/overlaybd/blob-digest": "sha256:87763befd4f3289905d709bd03c969db43e512502be7e1132b625bdef487d01f",
                                "containerd.io/snapshot/overlaybd/blob-size": "43458048"
                        }
                },
                {
                        "mediaType": "application/vnd.oci.image.layer.v1.tar",
                        "digest": "sha256:5bf55fa8550c47a1054c7a02138b9f79b5f574f040b1e444ad717d320d3afc67",
                        "size": 25600,
                        "annotations": {
                                "containerd.io/snapshot/overlaybd/blob-digest": "sha256:5bf55fa8550c47a1054c7a02138b9f79b5f574f040b1e444ad717d320d3afc67",
                                "containerd.io/snapshot/overlaybd/blob-size": "25600"
                        }
                },
                {
                        "mediaType": "application/vnd.oci.image.layer.v1.tar",
                        "digest": "sha256:62a999219eb529a2403f2b5849869d3253bf1014721293333f7f66be54308b94",
                        "size": 2610688,
                        "annotations": {
                                "containerd.io/snapshot/overlaybd/blob-digest": "sha256:62a999219eb529a2403f2b5849869d3253bf1014721293333f7f66be54308b94",
                                "containerd.io/snapshot/overlaybd/blob-size": "2610688"
                        }
                },
                {
                        "mediaType": "application/vnd.oci.image.layer.v1.tar",
                        "digest": "sha256:f2d33f598db59a8a4fcb490764cdfca3157ec6a742870378154cbef93acefce9",
                        "size": 17303040,
                        "annotations": {
                                "containerd.io/snapshot/overlaybd/blob-digest": "sha256:f2d33f598db59a8a4fcb490764cdfca3157ec6a742870378154cbef93acefce9",
                                "containerd.io/snapshot/overlaybd/blob-size": "17303040"
                        }
                },
                {
                        "mediaType": "application/vnd.oci.image.layer.v1.tar",
                        "digest": "sha256:8d77203e222f30ab4b8ba2e232fd9d71880dd80f6f24fa18e45d1d578e40eb57",
                        "size": 8192,
                        "annotations": {
                                "containerd.io/snapshot/overlaybd/blob-digest": "sha256:8d77203e222f30ab4b8ba2e232fd9d71880dd80f6f24fa18e45d1d578e40eb57",
                                "containerd.io/snapshot/overlaybd/blob-size": "8192"
                        }
                },
                {
                        "mediaType": "application/vnd.oci.image.layer.v1.tar",
                        "digest": "sha256:8bdb50d0eb5ec766ba235c06ac8c8a6f44ab1beeed756efa532e73b79786e36a",
                        "size": 11776,
                        "annotations": {
                                "containerd.io/snapshot/overlaybd/blob-digest": "sha256:8bdb50d0eb5ec766ba235c06ac8c8a6f44ab1beeed756efa532e73b79786e36a",
                                "containerd.io/snapshot/overlaybd/blob-size": "11776"
                        }
                },
                {
                        "mediaType": "application/vnd.oci.image.layer.v1.tar",
                        "digest": "sha256:c32be80bd739307433858c79994ffc050393691d77453bd93bee1cc89c7473c1",
                        "size": 11264,
                        "annotations": {
                                "containerd.io/snapshot/overlaybd/acceleration-layer": "yes",
                                "containerd.io/snapshot/overlaybd/blob-digest": "sha256:c32be80bd739307433858c79994ffc050393691d77453bd93bee1cc89c7473c1",
                                "containerd.io/snapshot/overlaybd/blob-size": "11264"
                        }
                }
        ],
        "mediaType": "application/vnd.docker.distribution.manifest.v2+json"
}
alpczerg commented 3 years ago

By now, the acceleration layer may contains the I/O trace file which is used for prefetching. We consider to put the merged index or the zfile indexes in acceleration layer in the future. To produce the acceleration layer and trace file, please refer to https://github.com/alibaba/accelerated-container-image/blob/main/docs/trace-prefetch.md

northtyphoon commented 3 years ago

@alpczerg thank you very much for the explanation. It's very helpful.