Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Additional Layer Store #301

Merged
merged 1 commit into from
May 11, 2021
Merged

Conversation

ktock
Copy link
Member

@ktock ktock commented Apr 12, 2021

This is the subset of #281.

This commit adds "additional layer store" that enables lazy pulling on Podman/CRI-O. Instead of the snapshotter API, this directly exposes layers on the filesystem, following the required directory structure.

The command which provides such directory structure is stargz-store (cmd/stargz-store). This is implemented using fs/layer pkg of this project. This commit comes with scripts to test (script/cri-o) and benchmark (script/benchmark-podman) with Podman and CRI-O.

The following command mounts the store at <mountpoint>:

# stargz-store <mountpoint>

This store exposes the following structure required as an additional layer store:

<mountpoint>/base64(imageref)/<layerdigest>/
- diff  : exposes the extracted layer
- info  : contains JSON-formatted "Layer" structure of containers/storage
- use  : files to notify the use of this layer (used for management of reference count)

There are also other APIs for debugging:

<mountpoint>/base64(imageref)/
- manifest       : contains manifest of this image
- config         : contains config blob of this image

The following configuration is required on /etc/containers/storage.conf.
Here, /var/lib/stargz-store/store is an example of <mountpoint>.

[storage]
driver = "overlay"
graphroot = "/var/lib/containers/storage"
runroot = "/run/containers/storage"

[storage.options]
additionallayerstores = ["/var/lib/stargz-store/store:ref"]
  • TODOs
    • add demo environment: we should have script/demo for additional layer store as well.
    • dedupe scripts: script/benchmark-containerd and script/benchmark-podman are very similar. will address in Switch from shellscripts-based CI to Go-based CI #310
    • add docs: will address in following up PRs

@ktock ktock force-pushed the stargz-store branch 7 times, most recently from 03e1d0e to 32196a7 Compare April 15, 2021 06:12
@ktock ktock force-pushed the stargz-store branch 2 times, most recently from 8c9a189 to 9e93c21 Compare April 21, 2021 04:38
@ktock ktock force-pushed the stargz-store branch 2 times, most recently from a836557 to 7de0770 Compare April 28, 2021 08:30
@ktock ktock force-pushed the stargz-store branch 5 times, most recently from b8d05b5 to e647e84 Compare May 8, 2021 03:04
@ktock ktock marked this pull request as ready for review May 8, 2021 03:42
@ktock ktock requested a review from AkihiroSuda May 8, 2021 03:42
@ktock
Copy link
Member Author

ktock commented May 8, 2021

containers/storage#795 and containers/image#1109 are merged to Podman/CRI-O so eStargz-based lazy pulling is now available on them without patches.

Please note that stargz-store needs to run as a separete process and there are some limitations as of now (lazily pulled images can't be save/push-ed, runtime cannot verify chunks).

@ktock ktock force-pushed the stargz-store branch 3 times, most recently from 6e04f70 to 1adaf97 Compare May 10, 2021 07:39
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
@AkihiroSuda AkihiroSuda merged commit 02bf457 into containerd:master May 11, 2021
@ktock ktock mentioned this pull request May 12, 2021
@ktock ktock deleted the stargz-store branch September 3, 2021 09:55
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.

None yet

2 participants