-
Notifications
You must be signed in to change notification settings - Fork 663
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
image-layout: describe an OPTIONAL index #438
Conversation
@@ -115,4 +116,42 @@ $ cat ./blobs/sha256/e692418e4cbaf90ca69d05a66403747baa33ee08806650b51fab815ad7f | |||
[tar stream] | |||
``` | |||
|
|||
## Index |
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 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.
k
Each object has the following properties: | ||
|
||
- **ref** *string*, REQUIRED | ||
|
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.
@@ -115,4 +116,42 @@ $ cat ./blobs/sha256/e692418e4cbaf90ca69d05a66403747baa33ee08806650b51fab815ad7f | |||
[tar stream] | |||
``` | |||
|
|||
## Index | |||
|
|||
Index is intended to be generated from the content in an image-layout after any updates have been made. |
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.
“any updates” → “any ref additions or removals”. You shouldn't need to update it after other changes (e.g. blob addition or removal, or changing a ref's descriptor payload).
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.
Those are both are updates of one kind or another.
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.
But there are updates that are not included in “ref additions or removals” (e.g. blob addition, or changing a ref's descriptor payload) which would not require index regeneration. I'm suggesting we make our regeneration suggestions as narrowly-scoped as possible, because conflicts around regenerating this index are one of the major pain-points with this approach.
## Index | ||
|
||
Index is intended to be generated from the content in an image-layout after any updates have been made. | ||
Allows for mapping random access to the references in the image-layout, and needing only to read from the `oci-layout` once to build this map of references. |
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.
I'd rather replace this line with your HTTP use-case. Maybe just:
For example, HTTP servers often disable directory listing.
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.
why?
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.
As it stands, the line is not a sentence (that would be “The index allows…” or some such). And you already have random access with refs/
. The think the index adds is single-file list support when you can't walk refs/
with readdir(3)
or similar. And the HTTP sentence makes that clear with a concrete example.
|
||
**index** *array of objects*, OPTIONAL | ||
|
||
Provides a single access to top-level information about the layout. |
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.
Four-space indents nside list entries where we'll be using sub-lists (opencontainers/runtime-spec#495)?
And for the wording, maybe just “Provides a list of available refs.”
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.
This is the same indentation used in the config.md and manifest.md for its field descriptions.
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.
If you want to punt for now, that's fine with me (I'm not a consumer of the compiled HTML or PDF output). But runtime-spec has had both opencontainers/runtime-spec#495 and opencontainers/runtime-spec#608 to avoid issues with two-space indents for sub-lists. It seems like we should be sticking to that pattern here for new additions, and eventually someone will be bothered enough by:
<ul>
<li><strong><code>mediaType</code></strong> <em>string</em></li>
</ul>
<p>This REQUIRED property contains the MIME type of the referenced content.</p>
<p>The OCI image specification defines <a href="media-types.md">several of its \
own MIME types</a> for resources defined in the specification.</p>
That they'll go through and fix the existing Markdown ;).
Index is intended to be generated from the content in an image-layout after any updates have been made. | ||
Allows for mapping random access to the references in the image-layout, and needing only to read from the `oci-layout` once to build this map of references. | ||
|
||
**index** *array of objects*, OPTIONAL |
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.
The ref list could get large, and I'd rather not overload the “do I understand how to parse this?“ oci-layout
. Can we put this index in refs.json
instead? You could just dive in with the array:
$ cat refs.json
["latest", "v1"]
Since the filename + the version from oci-layout
sufficiently namespace it.
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.
it has the potential for being long, no matter where it lives. And as the oci-layout is required file, it will already be stat'ed or fetched. Deferring to another file means another read, that could be a ENOENT or a 404. Plus this truncated list you mention does not allow for having tagged metadata.
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.
With a separate file, a long index only impacts ref-listing. By putting it in oci-layout
, a long index impacts any image-layout activity (because everyone should be checking to see “is this an image-layout version I understand” before trying to use the bits they need).
Plus this truncated list you mention does not allow for having tagged metadata.
If annotating refs is important, I'd rather have annotations
added to the descriptor model. Do you have an example use case that shows that annotations
are useful for refs but not for descriptors in general?
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.
That still means that a read per ref.
The whole notion of an index will be for those sharing it in their own use-case being able to bubble up the important pieces of metadata per ref. Adding it to the descriptor might be fine as well, but as RPM, debian, and other repos have shown, there is a vast amount of metadata provided as early as possible. It is not my job to limit to these unknown users what information they're allowed to bubble up. Again, I am not just thinking through my own personal use-case of what is needed in my home directory of my personal machine.
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.
Adding annotations
to descriptors is not directly coupled to removing it from an index. It just means that folks who find the ref payload via refs/
will still have access to it (and can skip loading the potentially large index JSON). Once you have descriptor annotations, you can certainly cache them in the index as a separate performance optimization. But only supporting ref annotations via the index (and not via refs/
) seems like a strange position.
|
||
- **annotations** *string-string map*, OPTIONAL | ||
|
||
This field is under the same constaints as [manifest `annotations`](manifest.md#image-manifest-property-descriptions) |
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.
I'd rather not add this field to the ref index, since it wouldn't be supported by ref/
-walking listers. Can you motivate a use-case for it? Folks who wanted to annotate a ref can already do so by adding a new ref (e.g. v1.0.0.annotations
) pointing at a CAS blob with their desired payload.
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.
Because there is tooling that may publish or fetch from an OCI image-layout, that needs top-level views. This is arbitrary metadata.
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.
I've spun this off into #440. Can we drop it from this PR and focus on the ref-listing use case? We can come back and add it to the index if the consensus after #440 is “yes we need these, and no we can't add annotations
to the descriptor model” (that's not the consensus I expect, but I'm not a maintainer ;).
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.
really spreading out the topics. there is hardly a consensus reachable when the topic is so diluted.
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 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.
oh, it's just here, there and everywhere. The further dilution of topics never seems to have the intention to arrive at a conclusion, only to further add items to come to agreement on.
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.
I expect we will more quickly arrive at a consensus for a ref index to support our existing ref listing over HTTP (when the HTTP server disables directory listing), since we both agree that's important. I'm suggesting we decouple the orthogonal ref-annotation issue so that it doesn't bog down the ref-indexing discussion, which should help us reach a consensus on ref-indexing more quickly.
On Thu, Nov 03, 2016 at 07:41:35AM -0700, Vincent Batts wrote:
Ref payloads are just descriptors, so they usually won't be very big. $ cat refs.json Once you have that, maybe you no longer need /refs? There are pros
My feeling is that in situations where you're using a ref-listing JSON
So I'd argue for refs.json as a complete replacement for refs/ which $ cat oci-layout for refs/ and: $ cat oci-layout for refs.json. |
3c8b9ef
to
7cffab1
Compare
On Thu, Nov 03, 2016 at 09:41:26AM -0700, W. Trevor King wrote:
Spun off into #441 to avoid distracting here. |
|
||
- **annotations** *string-string map*, OPTIONAL | ||
|
||
This field is under the same constaints as [manifest `annotations`](manifest.md#image-manifest-property-descriptions) |
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.
constaints
a typo here :)
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.
fixed
88eca7e
to
eb8a764
Compare
updated. PTAL |
@@ -118,4 +119,40 @@ $ cat ./blobs/sha256/e692418e4cbaf90ca69d05a66403747baa33ee08806650b51fab815ad7f | |||
[tar stream] | |||
``` | |||
|
|||
## Index | |||
|
|||
Index is intended to be generated from the content in an image-layout after any udates have been made. |
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.
nit: udates
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.
fxied
This is a great change, but the structure is nearly identical to manifest-list. Let's do the following:
In general, this addresses concerns I've had with |
eb8a764
to
9b6dd3d
Compare
@stevvooe I think I largely agree but what replaces the concept of a "ref name" in the manifest list? Any arbitrary annotation? |
Perhaps a specific annotation. "org.opencontainer.ref.name" or similar?
…On Wed, Nov 30, 2016, 18:59 Brandon Philips ***@***.***> wrote:
@stevvooe <https://github.com/stevvooe> I think I largely agree but what
replaces the concept of a "ref name" in the manifest list
<https://github.com/opencontainers/image-spec/blob/master/manifest-list.md>?
Any arbitrary annotation?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#438 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEF6S19anozd4BT6gyWmjT7Ni54-xgyks5rDg3LgaJpZM4KocFV>
.
|
@philips @vbatts I was leaving that as arbitrary for now. We could have tools on import pick up various fields then work on conventions from there. Perhaps we work through this change and address this in a follow up. I can already imagine a tool that dumps the index and annotations:
Maybe integrate such that the consumer doesn't need to have a convention:
|
@vbatts Any movement on updating this approach to use the manifest list type? |
i'm still mulling on this @stevvooe . I realize this is very overlapped with the manifest-list, though the manifest list is meant for pointing to only manifests with an election based on platform, though the act of indexing could allow for pointing to any mediatypes (even arbitrary types). I feel like this is different enough. It would take some restructuring of the manifest-list that would make it generic. |
On Tue, Dec 13, 2016 at 08:45:39AM -0800, Vincent Batts wrote:
It would take some restructuring of the manifest-list that would
make it generic.
With a new Descriptor.annotations, I think manifest-list is *already*
generic enough (although it would be good to provide more context
around these dual use-cases, e.g. near [1]). What else are you
missing?
[1]: https://github.com/opencontainers/image-spec/blame/v1.0.0-rc3/manifest-list.md#L35
|
@wking besides the |
On Tue, Dec 13, 2016 at 09:07:32AM -0800, Vincent Batts wrote:
@wking besides the `manifests` field name with the sentence `This
REQUIRED property contains a list of manifests for specific
platforms.`
The ‘manifests’ name could be made more generic. Are you suggesting
lifting the requirement to allow for indexes that contain no entries?
I'm ok with that. The “list of manifests” context could be made more
generic too, but it's currently not blocking you putting non-manifests
in because the descriptor types are flexible [1].
We'd probably also want to move the currently-REQUIRED platform stuff
[2] into Descriptor.annotations.
[1]: https://github.com/opencontainers/image-spec/blame/v1.0.0-rc3/manifest-list.md#L35
[2]: https://github.com/opencontainers/image-spec/blame/v1.0.0-rc3/manifest-list.md#L39
|
i do agree all the platform values would be better as annotations. Especially given their inconsistent naming convention (to speak of, we use |
@vbatts The manifest-list is already generic enough. I'd prefer not to see a secondary data type that is the same but not.
The manifest-list was never meant to be limited to this particular use case. It got de-featured during the design process, since no one could understand its usefulness in other cases (like this one), as I had argued back at that time. Subsequently, this was the use case that got it in, but the limitation is arbitrary. Adding annotations is all it would take. No other movements are necessary. |
Dropping For the manifest list digest it would be quite nice if you could extend it with other types. For instance, when using OCI registries for flatpak I would like to put in an index in the registry that points to an appstream[1] xml file which could be used by a graphical app-store frontent. I.e. it would get me metadata like title, description, icons, screenshots, etc for all the apps in the registry. But I agree with @wking in that it seems the spec already allows this. [1] https://www.freedesktop.org/wiki/Distributions/AppStream/ |
Depending on where and how an OCI image-layout is provided (tar, zip, HTTP, etc) the mechanism to "walk" the refs can vary in complexity and expense. For HTTP in example, getting a directory listing is often disabled, but even would require multiple fetches to build the map of refs. Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
9b6dd3d
to
04404f0
Compare
i've just rebased this, but haven't had a chance to merge it with @stevvooe thoughts on an |
@vbatts @RobDolinMS I thought we had agreed that these were structurally identical to manifest lists. That would entail closing this PR and fixing it to take that into account. |
@vbatts And if we should NOTE the different of Index and manifest-list in this section? Currently manifest-list is mainly for pointing to one manifest under specific platform. While |
Next steps here to move forward and satisfy the requirements would be:
Last thing for me to do is clarify the scope/context of annotations and expectations around conveying them. |
From the 2017-01-25 call we agreed to keep the manifest list as the entry point for accessing objects. The index concept is only a more generic use of the manifest-list. opencontainers#438 (comment) This change uses the manifest-list as an index that allows implementations to work around needing to walk/traverse the `./refs/` or `./blobs/` directories. Obsoletes opencontainers#438 Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
From the 2017-01-25 call we agreed to keep the manifest list as the entry point for accessing objects. The index concept is only a more generic use of the manifest-list. opencontainers#438 (comment) This change uses the manifest-list as an index that allows implementations to work around needing to walk/traverse the `./refs/` or `./blobs/` directories. Obsoletes opencontainers#438 Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
From the 2017-01-25 call we agreed to keep the manifest list as the entry point for accessing objects. The index concept is only a more generic use of the manifest-list. opencontainers#438 (comment) This change uses the manifest-list as an index that allows implementations to work around needing to walk/traverse the `./refs/` or `./blobs/` directories. This includes validating the image-layout example. This also makes `validate-examples` automatically update `schema-fs` if there have been changes to the JSON schema. Obsoletes opencontainers#438 Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
From the 2017-01-25 call we agreed to keep the manifest list as the entry point for accessing objects. The index concept is only a more generic use of the manifest-list. opencontainers#438 (comment) This change uses the manifest-list as an index that allows implementations to work around needing to walk/traverse the `./refs/` or `./blobs/` directories. This includes validating the image-layout example. This also makes `validate-examples` automatically update `schema-fs` if there have been changes to the JSON schema. Obsoletes opencontainers#438 Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
From the 2017-01-25 call we agreed to keep the manifest list as the entry point for accessing objects. The index concept is only a more generic use of the manifest-list. opencontainers#438 (comment) This change uses the manifest-list as an index that allows implementations to work around needing to walk/traverse the `./refs/` or `./blobs/` directories. This includes validating the image-layout example. This also makes `validate-examples` automatically update `schema-fs` if there have been changes to the JSON schema. Obsoletes opencontainers#438 Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
From the 2017-01-25 call we agreed to keep the manifest list as the entry point for accessing objects. The index concept is only a more generic use of the manifest-list. opencontainers#438 (comment) This change uses the manifest-list as an index that allows implementations to work around needing to walk/traverse the `./refs/` or `./blobs/` directories. This includes validating the image-layout example. This also makes `validate-examples` automatically update `schema-fs` if there have been changes to the JSON schema. Obsoletes opencontainers#438 Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
From the 2017-01-25 call we agreed to keep the manifest list as the entry point for accessing objects. The index concept is only a more generic use of the manifest-list. opencontainers#438 (comment) This change uses the manifest-list as an index that allows implementations to work around needing to walk/traverse the `./refs/` or `./blobs/` directories. This includes validating the image-layout example. This also makes `validate-examples` automatically update `schema-fs` if there have been changes to the JSON schema. Obsoletes opencontainers#438 Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
From the 2017-01-25 call we agreed to keep the manifest list as the entry point for accessing objects. The index concept is only a more generic use of the manifest-list. opencontainers#438 (comment) This change uses the manifest-list as an index that allows implementations to work around needing to walk/traverse the `./refs/` directory. As the `./refs/` directory was REQUIRED to exist, with its removal this `index.json` is REQUIRED to be present. This includes validating the image-layout example. This also makes `validate-examples` automatically update `schema-fs` if there have been changes to the JSON schema. Obsoletes opencontainers#438 Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
From the 2017-01-25 call we agreed to keep the manifest list as the entry point for accessing objects. The index concept is only a more generic use of the manifest-list. opencontainers#438 (comment) This change uses the manifest-list as an index that allows implementations to work around needing to walk/traverse the `./refs/` directory. As the `./refs/` directory was REQUIRED to exist, with its removal this `index.json` is REQUIRED to be present. This includes validating the image-layout example. This also makes `validate-examples` automatically update `schema-fs` if there have been changes to the JSON schema. Obsoletes opencontainers#438 Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
#533 merged |
From the 2017-01-25 call we agreed to keep the manifest list as the entry point for accessing objects. The index concept is only a more generic use of the manifest-list. opencontainers/image-spec#438 (comment) This change uses the manifest-list as an index that allows implementations to work around needing to walk/traverse the `./refs/` directory. As the `./refs/` directory was REQUIRED to exist, with its removal this `index.json` is REQUIRED to be present. This includes validating the image-layout example. This also makes `validate-examples` automatically update `schema-fs` if there have been changes to the JSON schema. Obsoletes #438 Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
From the 2017-01-25 call we agreed to keep the manifest list as the entry point for accessing objects. The index concept is only a more generic use of the manifest-list. opencontainers/image-spec#438 (comment) This change uses the manifest-list as an index that allows implementations to work around needing to walk/traverse the `./refs/` directory. As the `./refs/` directory was REQUIRED to exist, with its removal this `index.json` is REQUIRED to be present. This includes validating the image-layout example. This also makes `validate-examples` automatically update `schema-fs` if there have been changes to the JSON schema. Obsoletes #438 Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
From the 2017-01-25 call we agreed to keep the manifest list as the entry point for accessing objects. The index concept is only a more generic use of the manifest-list. opencontainers/image-spec#438 (comment) This change uses the manifest-list as an index that allows implementations to work around needing to walk/traverse the `./refs/` directory. As the `./refs/` directory was REQUIRED to exist, with its removal this `index.json` is REQUIRED to be present. This includes validating the image-layout example. This also makes `validate-examples` automatically update `schema-fs` if there have been changes to the JSON schema. Obsoletes #438 Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
From the 2017-01-25 call we agreed to keep the manifest list as the entry point for accessing objects. The index concept is only a more generic use of the manifest-list. opencontainers/image-spec#438 (comment) This change uses the manifest-list as an index that allows implementations to work around needing to walk/traverse the `./refs/` directory. As the `./refs/` directory was REQUIRED to exist, with its removal this `index.json` is REQUIRED to be present. This includes validating the image-layout example. This also makes `validate-examples` automatically update `schema-fs` if there have been changes to the JSON schema. Obsoletes #438 Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
From the 2017-01-25 call we agreed to keep the manifest list as the entry point for accessing objects. The index concept is only a more generic use of the manifest-list. opencontainers/image-spec#438 (comment) This change uses the manifest-list as an index that allows implementations to work around needing to walk/traverse the `./refs/` directory. As the `./refs/` directory was REQUIRED to exist, with its removal this `index.json` is REQUIRED to be present. This includes validating the image-layout example. This also makes `validate-examples` automatically update `schema-fs` if there have been changes to the JSON schema. Obsoletes #438 Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
Depending on where and how an OCI image-layout is provided (tar, zip,
HTTP, etc) the mechanism to "walk" the refs can vary in complexity and
expense. For HTTP in example, getting a directory listing is often
disabled, but even would require multiple fetches to build the map of refs.
Signed-off-by: Vincent Batts vbatts@hashbangbash.com
Closes #374