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

combinational image #508

Closed
xiekeyang opened this issue Dec 22, 2016 · 7 comments
Closed

combinational image #508

xiekeyang opened this issue Dec 22, 2016 · 7 comments

Comments

@xiekeyang
Copy link
Contributor

xiekeyang commented Dec 22, 2016

Hi all,

The purpose is to talk about improving the agile way of publishing image with cooperation between different departments.

For example, when some image, with many layer parts like applications, jvm, os, want to be published. Following current rules, it needs to generate and publish series of image, as:

  • OS (base image)

  • JVM (from OS)

  • APP (from JVM, from OS)

This is from some consumer requirement. I think image-spec might add some new definition to support this kind of requirement, and bring about some benefits (as described below).
Publishing image might be separated by 2 steps:

  1. Upload only JVM and APP as layered-image (means can’t generate rootfs). They need be combined with OS, to generate rootfs and run successfully. The images, in repository, looks like normal image, have also name and reference.

  2. Upload combinational image manifest, in which involving above manifest list and their dependency, like below:

{
  "schemaVersion": 2,
  "mediaType": "application/vnd.oci.image.manifest.list.v1+json",
  "config": {
    "mediaType": "application/vnd.oci.combinational.image.config.v1+json",
    "size": 7023,
    "digest": "alg:hash"
  },  
  "manifests": [
    {
      "mediaType": "application/vnd.oci.image.manifest.v1+json",
      "size": 7143,
      "digest": "alg:hash"
    },
    {
      "mediaType": "application/vnd.oci.image.manifest.v1+json",
      "size": 7682,
      "digest": "alg:hash"
    }
  ],
}

This is a metadata of whole image. We define a name and reference for it, and publish it on repository. Then consumer can pull it with all layered-image.

I think this way has some benefit:

  • Make different branch focus on, and publish only their partly development, needn’t frequently care other branch change (to a certain extent).

  • Makes publish and distribution more freely. The final publish job may be taken by application department, or specific department.

  • Sometimes departments want to publish their partly image on different Hubs. If we defined the layered-images URL (hashed) in combinational manifest, we will be able to get the whole image from different hubs.

  • For image manifest is hashed in combinational manifest, it will not be changed with any layered-image, unless it is re-published.

Here I’d like to discuss with folks about if it make sense.

@wking
Copy link
Contributor

wking commented Dec 22, 2016 via email

@xiekeyang
Copy link
Contributor Author

@wking

I might mostly understand after reading your comment. Maybe we should talk the detailed design principle later. Also I'd like to re-emphasize that:

Purpose of this issue might be some different to #102 and #109. This want to let teams publish their effort as image. Some effort might be just layer (as image patch), but it should (to be discussed) be published as image (with layer, manifest and config).

This is because we can sign the image just on manifest, and consumer can fetch it as normal image fetching way. This kind of patched-image can't be run as oci container individually. But I think it doesn't matter.

The combinational image, which need patch and base image, just set up a manifest list, to combine the manifests and a config in which show how to organize them to run a container (shown the example above).

The combinational image will be publish just after uploading its manifest list, which can be signed.

I prefer this way rather than below:

"layers": [
    {
        "digest": "sha256:abc…"
        "mediaType": "application/vnd.oci.image.manifest.v1+json"
        
    },
    {
        "digest": "sha256:def…"
        "mediaType": "application/vnd.oci.image.layer.tar+gzip",
        
    }
]

Please take a comprehensive consideration on my suggestion, thanks a lot!

cc @vbatts @philips @stevvooe

@stevvooe
Copy link
Contributor

stevvooe commented Jan 6, 2017

This has been suggested several times before and I'm getting a little exhausted explaining why this is a bad idea to do at the image layer but basically, this is the summary:

Composition should be a runtime concern. PODs are one example of this style of composition but there are others. This composition can even be shipped as a separate unit, but that might not necessarily be an OCI image.

@xiekeyang
Copy link
Contributor Author

@stevvooe thanks for your explain. I read the previous issues #102, #190, involving your comments inside.

Here I won't say my idea (composition image) is prefect, because it is against to immutable building. But we had better to consider the customers requirement. From previous issues, I think @vbatts and @philips might receive similar requirement.

Sometime developers just want to publish their own partly application as (widely using) image, not to care the base image.

And customers want OCI hub to support deployable image directly, as a total solution, during building and publishing stage. They don't want to fix it during deploying and running stage. They think this way is more agile and easy using.

Even we ignore combinational image, how do we look this kind of requirement? Or if this is really bad to OCI ecosystem? Actually I hope we can present a good solution to customers.

Thanks a lot!

@stevvooe
Copy link
Contributor

stevvooe commented Jan 6, 2017

@xiekeyang This is a great example of the unending scope creep that happens with software engineering. The format already supports the model for which you are asking. There is no need to add more half-baked bells and whistles to meet this use case.

@wking
Copy link
Contributor

wking commented Jan 6, 2017 via email

@xiekeyang
Copy link
Contributor Author

I think #438 is including this requirement. Closed.

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

3 participants