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

[Proposal] Add image-service to dragonfly project #9

Closed
bergwolf opened this issue May 28, 2020 · 13 comments
Closed

[Proposal] Add image-service to dragonfly project #9

bergwolf opened this issue May 28, 2020 · 13 comments

Comments

@bergwolf
Copy link
Member

Introduction

Dragonfly has been very good at distributing container images, and is an excellent candidate for container distribution standard in the cloud native world. In the recent months, the OCI (Open Container Initiate) community has been actively discussing the emerging of OCI image spec v2. Here we propose an image-service to be included in the dragonfly project as a subsidiary project.

The image-service project is designed and implemented by developers at Ant Financial and Alibaba Cloud. It has been put in production usage and shown vast improvements over the old OCI image format in terms of container launching speed, image space and network bandwidth efficiency, as well as data integrity. The image-service project can also serve as an example and reference implementation for the on-going OCI image spec v2 discussion. It is a good addition to the dragonfly landscape to better support container image distribution and help users to launch containers in a faster, more efficient, and more secure way.

Problems with the current OCI Image Spec

  • Before starting a container, images must be pulled and decompressed to the local filesystem. While only a small fraction of an image is used by applications, runtime has to wait for an entire container image to be pulled before creating new containers.
  • Deduplication at image layer level is less efficient
  • Metadata only modification would cause the file data to be saved again in the new layer
  • Files modified in multiple layers are downloaded multiple times while only the last modified file data is actually useable for containers
  • Deleted files/directories are still downloaded when pulling an image
  • Image data are not verifiable after being decompressed
  • While distribution spec is general available, it is less efficient and enterprise users want to pursuit better storage backends
  • The tgz format has its own drawbacks
    • There is no universal standard for tar: mainstream tar tools try to be compatible with each other at best effort
    • Tar files are not seek-able
    • No parallel untar/decompression

Image-service architecture

image

Image-service features

It designs and implements a user space filesystem on top of a special designed container image format that improves at all the above mentioned OCI image spec defects. Key features include:

  • Container images are downloaded on demand
  • Chunk level data duplication with configurable chunk size
  • Flatten image metadata and data to remove all intermediate layers
  • Only usable image data is saved when building a container image
  • Only usable image data is downloaded when running a container
  • End-to-end image data integrity
  • Compatible with the OCI artifacts spec and distribution spec
  • Integrated with existing CNCF project dragonfly to support image distribution in large clusters
  • Except for the OCI distribution spec, other image storage backends can be supported as well

Image format

image

Plans after being accepted

The image-service project will continue evolving along with the discussion of OCI image spec v2. Its architecture and image format may change, but the plan as a reference implementation for the emerging OCI image spec v2 will be the same. Also the goal of helping dragonfly project to support container image distribution in a fast, efficient and secure way, will be the same.

@lowzj
Copy link
Member

lowzj commented May 28, 2020

@lowzj
Copy link
Member

lowzj commented May 28, 2020

@SataQiu @yeya24 @wangforthinker PTAL

@inoc603
Copy link
Member

inoc603 commented May 29, 2020

Looks cool.

Does the new OCI v2 image format require changes to the registry API?

@lowzj
Copy link
Member

lowzj commented May 29, 2020

Looks cool.

Does the new OCI v2 image format require changes to the registry API?

Here is an extension proposal of distribution spec to expose extended API.

@zhouhaibing089
Copy link

Nice! Do you have the link where the new spec is being discussed?

@bergwolf
Copy link
Member Author

bergwolf commented Jun 2, 2020

The oci-dev mailing list has several related threads. And there is a shared document to discuss OCIv2 requirements https://hackmd.io/@cyphar/ociv2-brainstorm

@lowzj lowzj pinned this issue Jun 4, 2020
@allencloud
Copy link
Contributor

LGTM

@starnop
Copy link
Contributor

starnop commented Jul 30, 2020

LGTM.

@SataQiu
Copy link
Member

SataQiu commented Aug 3, 2020

LGTM

2 similar comments
@chenchaobing
Copy link

LGTM

@inoc603
Copy link
Member

inoc603 commented Aug 4, 2020

LGTM

@zhouhaibing089
Copy link

Though I didn't attend the meeting, I do think this is pretty promising!

LGTM

@bergwolf
Copy link
Member Author

Thank you all dragonfly community members! We have just pushed the new image service source code to https://github.com/dragonflyoss/image-service. Look forward to helping more Dragonfly users to access container images fast, securely and easily!

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

No branches or pull requests

8 participants