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

Exporter: support nydus image export #2045

Closed
wants to merge 2 commits into from
Closed

Conversation

imeoer
Copy link
Contributor

@imeoer imeoer commented Mar 29, 2021

Related issue: #2046

Nydus image is a container accelerated image format provided by the Dragonfly image-service project, which offers the ability to pull image data on demand, without waiting for the entire image pull to complete and then start the container. 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 Nydus image can also serve as an example and reference implementation for the on-going OCI image spec v2 discussion.

Nydus has provided a conversion tool Nydusify for converting OCI image to Nydus image, which assumes that the OCI image is already available in the registry, but a better way would be to build the Nydus images directly from the build system instead of using the conversion tool, which would increase the speed of the image export, so we experimentally integrated the Nydus exporter in Buildkit.

Nydusify provides a package to do the actual image conversion. We use the same package to implement the buildkit nydus exporter. The exporter mounts all layers and calls the package to build to a Nydus image and push it to the remote registry. The current implementation relies on the Nydus builder, which is used to build a layer to a RAFS layer, and in the future, we can explore simpler, less dependent integrations.

Nydus image is a container accelerated image format provided by the
Dragonfly image-service project, which offers the ability to pull image
data on demand, without waiting for the entire image pull to complete
and then start the container. 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 Nydus image can also serve as an example and
reference implementation for the on-going OCI image spec v2 discussion.

Nydus has provided a conversion tool Nydusify for converting OCI image to
Nydus image, which assumes that the OCI image is already available in the
registry, but a better way would be to build the Nydus images directly from
the build system instead of using the conversion tool, which would increase
the speed of the image export, so we experimentally integrated the Nydus
exporter in Buildkit.

Nydusify provides a package to do the actual image conversion. We use the
same package to implement the buildkit nydus exporter. The exporter mounts
all layers and calls the package to build to a Nydus image and push it to the
remote registry. The current implementation relies on the Nydus builder, which
is used to build a layer to a RAFS layer, and in the future, we can explore
simpler, less dependent integrations.

Signed-off-by: Yan Song <imeoer@linux.alibaba.com>
Pack the nydus-image binary into integration image, export Nydus
image with Nydus exporter, and simply check.

Signed-off-by: Yan Song <imeoer@linux.alibaba.com>
@tonistiigi
Copy link
Member

@ktock

ExporterTar = "tar"
ExporterOCI = "oci"
ExporterDocker = "docker"
ExporterNydusImage = "nydus"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need a new exporter for nydus? Can we add "nydus" as a "compression format" for existing exporters? Please see #2057.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, here is an example of Nydus image. Nydus image is not currently a standard OCI image format, it is composed of a bootstrap layer and some blob layers, so we can't just treat the format of these layers as another compression type.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can rename "compression type" to another word as you like, e.g., "blob type" , but having another exporter is fine to me as well

@ktock WDYT?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on #2057, the manifest index converter is configurable so nydus image should be able to generated without introducing a new exporter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that's a good point if using a configurable converter, we will take a look.

@tonistiigi
Copy link
Member

There's a concern of future maintenance cost of this code should it be merged. Would you be interested on taking a look at the problem of providing out-of-tree exporters(or blob converters per #2045 (review)) support instead that would run in containers like buildkit frontends do and what capabilities they would need.

@imeoer
Copy link
Contributor Author

imeoer commented Jun 11, 2021

There's a concern of future maintenance cost of this code should it be merged. Would you be interested on taking a look at the problem of providing out-of-tree exporters(or blob converters per #2045 (review)) support instead that would run in containers like buildkit frontends do and what capabilities they would need.

@tonistiigi Thanks, will take a look at blob converter first, this PR can be closed for now.

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.

4 participants