-
Notifications
You must be signed in to change notification settings - Fork 664
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
media-types.md: add foreign layer media type #216
Conversation
@@ -3,6 +3,7 @@ | |||
The following `mediaType` MIME types are used by the formats described here, and the resources they reference: | |||
|
|||
- `application/vnd.oci.descriptor.v1+json`: [Content Descriptor](descriptor.md) | |||
- `application/vnd.oci.descriptor.foreign.v1+json`: [Content Descriptor](descriptor.md) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you figure out what the real type is? Docker uses application/vnd.docker.image.rootfs.foreign.diff.tar.gzip
, which is clearly a foreign version of their application/vnd.docker.image.rootfs.diff.tar.gzip
.
Stepping back, I don't think we need this information for pulling. However, “this content is not licensed for sharing” is a clear property that doesn't rely on vague ideas like “the usual channel”. Maybe we can add a new descriptor.license field (an array of SPDX identifiers?), and refuse to push blobs which don't have such an array (and are therefore not shareable).
Blob license information would be nice (more in #71), but if we want to scope this more narrowly we could add a boolean descriptor.shareable to make life easier for publishers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wking Types of objects are not detected. The type of an object comes from trusted descriptors or a metadata storage system.
We are not adding licensing information in the course of this PR.
Please keep the conversation focused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Tue, Aug 30, 2016 at 01:48:59PM -0700, Stephen Day wrote:
@@ -3,6 +3,7 @@
The followingmediaType
MIME types are used by the formats described here, and the resources they reference:
application/vnd.oci.descriptor.v1+json
: Content Descriptor
+-application/vnd.oci.descriptor.foreign.v1+json
: Content Descriptor@wking Types of objects are not detected. The type of an object
comes from trusted descriptors or a metadata storage system.
If you have a descriptor holding type
application/vnd.oci.descriptor.foreign.v1+json, what does it point to?
Does it point to another descriptor, and that descriptor has a type
like application/vnd.oci.image.serialization.rootfs.tar.gzip? That
would be the first case I describe in 1. The current Docker
approach, as I understand it, is the third case I describe in 1. Or
are you intending this type be used in a way that I don't describe in
1 at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no application/vnd.oci.descriptor.foreign.v1+json
. That doesn't exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Tue, Aug 30, 2016 at 02:39:23PM -0700, Stephen Day wrote:
@@ -3,6 +3,7 @@
The followingmediaType
MIME types are used by the formats described here, and the resources they reference:
application/vnd.oci.descriptor.v1+json
: Content Descriptor
+-application/vnd.oci.descriptor.foreign.v1+json
: Content DescriptorThere is no
application/vnd.oci.descriptor.foreign.v1+json
. That doesn't exist.
It's in this PR, in the lines we're discussing now ;). Maybe we
should table this sub-thread until @runcom rerolls the PR?
I still don't understand why this is a new mime-type instead of a field on the manifest. cc @stevvooe |
@stevvooe right, but would I use this media-type in an |
@philips One may store the layer without the data structure. The media type is for the layer itself, not the descriptor pointing to it. |
On Mon, Aug 29, 2016 at 01:46:08PM -0700, Stephen Day wrote:
What is “for the layer itself”? Blobs are opaque, so the first |
@stevvooe Right, but the layer won't embed that it is 'foreign' either, right? I just don't understand why it is a media-type when really it is advising people about what they can/cannot do with the contents, not what the content format is. |
@philips It is a legal distinction, rather than a technical one. It has nothing to do with being "foreign". It is embedded as media type so that information isn't lost for storage targets that may drop other descriptor fields but not media type. |
@stevvooe Why can't a storage target be taught to hold on to metadata besides the media-type? |
@philips It can, but embedding in the media type removes the requirement. Such images may also have slightly different properties for the platform and will be interpreted differently. It's the difference between using a flag and a type to decide behavior. In this case, we said these layers are a different type. |
On Mon, Aug 29, 2016 at 03:59:58PM -0700, Stephen Day wrote:
Can this PR grow some docs about those differences? I'm still missing how you figure out what the actual type of the
I'd rather have:
But if you can't bring yourself to add a descriptor field to cover
which is closer to Docker's current implementation 2. |
@wking I agree. We need the "foreign" types added to the compatibility matrix and an explanation of how these types should be handled differently. I am still skeptical about encoding policy into a mime-type. Particularly policy that might change between platforms. |
@philips I agree that this isn't ideal, but I am not sure if this is the right venue for design review. @wking That documentation of docker's current implementation is wrong. The relationship between the mediatype and URLs is incidental but |
PR that fixes the upstream docker specification: distribution/distribution#1932 |
On Mon, Aug 29, 2016 at 05:04:10PM -0700, Stephen Day wrote:
The distinction you're making there and in distribution/distribution#1932 I still don't see a need to push this information into the media type |
The more I read, even after seeing the Docker notes, the more I think it is clear there should be a "pushable" field that is false to enforce this policy. |
I see the issue: from an engineering perspective, these aren't different things. From a legal standpoint, they are different types, and the handling of each type is different. Pulling this property up to the descriptor level obscures that. Fundamentally, treating these as different types is correct. Each type has a handler for how it is pulled, pushed and managed. The descriptor only tells the type of a thing, where to get it and how big it is. There is no policy or processing that is specific to a given type within the descriptor itself. All of that is encoded in the type itself. Having this as a type is just an extension of that methodology: for this type, the ability to push it is not defined. |
On Tue, Aug 30, 2016 at 04:05:12PM -0700, Stephen Day wrote:
Engineering issues with the three choices from 1, in the same order a. Adding a generic application/vnd.oci.descriptor.foreign.v1+json b. Adding a Descriptor field. No need for an additional Descriptor or c. Adding foreign versions of existing media types. Folks can use So I like (b). If we know (somehow) that the unpushable tag will only |
Option (a) is out, since I think that was a misunderstanding. |
On Tue, Aug 30, 2016 at 04:45:06PM -0700, Stephen Day wrote:
I think one benefit of (b) (no need to land foreign versions of media But either way, I think the main issue is that a boolean (wherever we
I'm guessing that Descriptor.annotations in the spec and “can push?” |
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
i'm game for not having a new mimetype for same content. Just because it is not resolved in the present blobs directory and may need to be fetched does not make it new content. |
@runcom can you add more information on "pushed"? We need to be crisp on this and I don't feel anyone has really defined the semantics of "pushing". Can I not mirror it internally? Can it not be pushed into a local cache? |
@runcom right, but uploaded where and why? "Uploaded outside of administrative control?". I understand this is about handling of copyrighted material but I don't know how to phrase this. |
On Wed, Aug 31, 2016 at 11:47:23AM -0700, Brandon Philips wrote:
I'd guess “pushed to a location from which users other than the
|
Closing this as per #233 |
Relates to #169
This patch adds a new media type to indicate to implementation that the descriptor which it refers isn't supposed to be pushed or carried in an image layout.
Not sure everyone likes foreign - I don't have a strong opinion either so suggestions are welcome.
/cc @stevvooe @vbatts @philips
Are there other places I should update for this? Is there a place where we have a description of each media type?
Signed-off-by: Antonio Murdaca runcom@redhat.com