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

Descriptor annotations #501

Merged
merged 4 commits into from
Jan 24, 2017
Merged

Conversation

vbatts
Copy link
Member

@vbatts vbatts commented Dec 15, 2016

this has come up in discussion and is needed for adding discoverable arbitrary data to the descriptor references. Especially in making an index for image layout.

In DRY'ing up the references to annotations. This makes the defined keys in a very logical place rather than the bottom of one of the other docs.

Copy link
Contributor

@wking wking left a comment

Choose a reason for hiding this comment

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

Hooray DRY :).


## Pre-Defined Annotation Keys

This specification defines the following annotation keys, which MAY be used by manifest list and image manifest authors:
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason to restrict the scope of the pre-defined keys to manifests and manifest lists? For example, org.opencontainers.source seems like it would be a good match for a descriptor referencing layer tar archive. If that's too big a shift for this PR, I'm fine spinning it off into a follow-up issue/PR.

@wking
Copy link
Contributor

wking commented Dec 15, 2016

Oh, you'll also want Makefile and spec.md-ToC updates to pull in the new file. See here for a pre-spec.md example.

@@ -0,0 +1,25 @@
# Annotations
This OPTIONAL property MUST use the [annotation rules](annotations.md#rules).
Copy link
Contributor

Choose a reason for hiding this comment

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

imho something like "Several components of the specification, like Image Manifests and Descriptors, feature an optional annotations property, whose format is common and defined in this section"

@jonboulle
Copy link
Contributor

one suggestion, looks good overall!

@wking wking mentioned this pull request Jan 6, 2017
@vbatts vbatts force-pushed the descriptor_annotations branch 2 times, most recently from d1196fd to 4d581b7 Compare January 11, 2017 14:54
@vbatts
Copy link
Member Author

vbatts commented Jan 11, 2017

updated. PTAL

If there are no annotations then this property MUST either be absent or be an empty map.
Implementations that are reading/processing manifest lists MUST NOT generate an error if they encounter an unknown annotation key.

See [Pre-Defined Annotation Keys](manifest.md#pre-defined-annotation-keys).
Copy link
Contributor

Choose a reason for hiding this comment

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

You removed this manifest.md section, and the annotations.md section if right after this line. So I think we should drop this line.

This specification defines the following annotation keys, intended for but not limited to manifest list and image manifest authors:
* **org.opencontainers.created** date on which the image was built (string, date-time as defined by [RFC 3339](https://tools.ietf.org/html/rfc3339#section-5.6)).
* **org.opencontainers.authors** contact details of the people or organization responsible for the image (freeform string)
* **org.opencontainers.homepage** URL to find more information on the image (string, must be a URL with scheme HTTP or HTTPS)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should either drop "must be a" here or add it to org.opencontainers.created. I'm in favor of dropping it.

@philips
Copy link
Contributor

philips commented Jan 18, 2017

@vbatts please fix the one nit and then we can LGTM this.


This specification defines the following annotation keys, intended for but not limited to manifest list and image manifest authors:
* **org.opencontainers.created** date on which the image was built (string, date-time as defined by [RFC 3339](https://tools.ietf.org/html/rfc3339#section-5.6)).
* **org.opencontainers.authors** contact details of the people or organization responsible for the image (freeform string)
Copy link
Contributor

Choose a reason for hiding this comment

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

How would multiple authors be specified?

* **org.opencontainers.authors** contact details of the people or organization responsible for the image (freeform string)
* **org.opencontainers.homepage** URL to find more information on the image (string, must be a URL with scheme HTTP or HTTPS)
* **org.opencontainers.documentation** URL to get documentation on the image (string, must be a URL with scheme HTTP or HTTPS)
* **org.opencontainers.source** URL to get source code for the binary files in the image (string, must be a URL with scheme HTTP or HTTPS)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we require a licenses field?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, as per the discussion in #506, we should add an org.opencontainers.licenses field. Because licensing is complicated, we could allow a free-form string but the string SHOULD be made up of SPDX identifiers like GPL-2.0 or MIT.

Copy link
Member

Choose a reason for hiding this comment

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

No, that's not going to work at all, you can't properly describe the license for a whole layer in any form of a string that could be standardized or parsed. SPDX is great for describing the individual licenses of things, but not for a collection of things, which almost always has an arbitrary license (example, what's the license, in a simple string, for a Ubuntu base layer?)

Copy link
Contributor

Choose a reason for hiding this comment

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

what's the license, in a simple string, for a Ubuntu base layer?

This is still a pain, but it's becoming almost bearable as Debian's copyright-file spec gains ground. Walking the package list (e.g. yakkety-20170104), looking up the associated copyright file (e.g. util-linux_2.28.2-1ubuntu1) and collecting the license information will result in something like this quasi-SPDX license expression:

Artistic AND BSD-2-Clause AND BSD-3-Clause AND BSD-3-Clause-with-weird-numbering AND BSD-4-Clause AND BSD-4-Clause-POWERDOG AND BZIP AND CC0 AND CC0-1.0 AND DONT-CHANGE-THE-GPL AND Expat AND ( Expat OR GPL-1+ OR Artistic ) AND GAP AND GAP~FSF AND GFDL-1.3+ AND GPL AND ( GPL-1+ OR Artistic ) AND GPL-2 AND GPL-2+ AND ( GPL-2+ OR Artistic ) AND ( GPL-2+ OR LGPL-3+ ) AND ( GPL-2+ WITH libtool exception ) AND GPL-2.0+ AND GPL-2.1+ AND GPL-3 AND GPL-3+ AND ( GPL-3+ OR BSD-3-Clause ) AND ( GPL-3+ WITH the GCC Runtime Library Exception 3.1 ) AND ( GPL-3+-WITH-BISON-EXCEPTION ) AND HPND AND ( HSIEH-DERIVATIVE OR HSIEH-BSD OR LGPL-2.1 ) AND INNER-NETv2.0 AND ISC AND ISOC-rfc WITH disclaimer AND LGPL AND LGPL-2 AND LGPL-2+ AND ( LGPL-2+ OR BSD-2-Clause OR MIT ) AND LGPL-2.0+ AND LGPL-2.1 AND LGPL-2.1+ AND LGPL-3+ AND ( LGPL-3+ OR GPL-2+ ) AND LGPL-3.1 AND MACHv3.0-modified AND MIT AND PCRE AND PD AND REGCOMP AND RFC-Reference AND S2P AND SDBM-PUBLIC-DOMAIN AND SMAIL AND Spencer-94 AND TEXT-TABS AND TinySCHEME AND Unicode AND X11 AND ZLIB AND attribution AND bzip2-1.0.6 AND permissive AND public-domain AND public-domain-md5 AND public-domain-s-s-d AND verbatim AND ( verbatim OR GFDL-1.3+ ) AND ( verbatim WITH some-TeX-stuff ) AND more because many packages don't use the copyright-file spec yet…

Besides being incomplete, the license tagging isn't particularly consistent (and SPDX 2.6 doesn't name everthing we need). But that can get fixed on a per-project basis for parse-ability and a per-license basis for registration (and/or we could follow Debian and give a standard way to inline any unregistered licenses).

You can't properly describe the license for a whole layer…

It would be a lot easier to handle this if we had per-file granularity for the license metadata. But with the current OCI image spec, layers are the closest we get to per-file. I don't think bumping the licensing information up into higher levels is going to make it any easier to set the appropriate data when you publish an image (although it may make it slightly easier to discover the data when you read the image, since you'd only have to look in one place).

Copy link
Contributor

Choose a reason for hiding this comment

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

It would be a lot easier to handle this if we had per-file granularity for the license metadata.

This is wildly outside of scope for the OCI image format.

What is wrong with having something where you take a layer digest and get back the licensing information about that digest? Data normalization is a good thing and applying it here is a no brainer.

Trying to make the format do everything is just going to make it bad at everything.

Copy link
Contributor

@wking wking Jan 20, 2017

Choose a reason for hiding this comment

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

What is wrong with having something where you take a layer digest and get back the licensing information about that digest?

Per-descriptor metadata for licensing seems like the best way to handle licensing with the current OCI image modeling. I don't see a need to push this metadata out of band, and I don't see a benefit to documenting licensing in the config instead of in the digest linking to the licensed content.

A per-layer out of band licensing registry might be a useful way to share data among image producers (as a build-time optimization), but I think having licensing metadata in the Merkle DAG is a better experience for image consumers.

Copy link
Contributor

Choose a reason for hiding this comment

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

@wking

I think having licensing metadata in the Merkle DAG is a better experience for image consumers.

I don't see how this can possibly work without making a format that has an entry for every file.

Either way, let's not let this point block the PR. We can get annotations in, then have another PR to discuss standard annotation license key.

@gregkh
Copy link
Member

gregkh commented Jan 20, 2017

As much as I feel "this way lies madness", I understand the need/wish to have arbitrary annotations to help describe things, so it is good to describe a way to have this.

LGTM.

@caniszczyk
Copy link
Contributor

Can we also target this towards RC4?

@stevvooe stevvooe added this to the v1.0.0-rc4 milestone Jan 20, 2017
@jonboulle
Copy link
Contributor

jonboulle commented Jan 23, 2017

lgtm

Approved with PullApprove

@jonboulle
Copy link
Contributor

@gregkh bot didn't pick up your approval properly

@gregkh
Copy link
Member

gregkh commented Jan 23, 2017

lgtm

There, that better?

@gregkh
Copy link
Member

gregkh commented Jan 23, 2017

lgtm

@jonboulle
Copy link
Contributor

Oh, oops. I forgot you aren't actually a maintainer of the spec...

@gregkh
Copy link
Member

gregkh commented Jan 23, 2017

ah, that makes sense why it wasn't working for me :)

@vbatts
Copy link
Member Author

vbatts commented Jan 23, 2017

nits fixed and rebased. PTAL

@stevvooe
Copy link
Contributor

stevvooe commented Jan 23, 2017

LGTM

Approved with PullApprove

Keys SHOULD be named using a reverse domain notation - e.g. `com.example.myKey`.
Keys using the `org.opencontainers` namespace are reserved and MUST NOT be used by other specifications and extensions.
If there are no annotations then this property MUST either be absent or be an empty map.
Implementations that are reading/processing manifest lists MUST NOT generate an error if they encounter an unknown annotation key.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this restriction specific to manifest lists? Maybe it should read:

Consumers MUST NOT generate an error if they encounter an unknown annotation key.

or something similarly generic.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

Copy link
Member Author

Choose a reason for hiding this comment

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

done

In DRY'ing up the references to annotations. This makes the defined keys
in a very logical place rather than the bottom of one of the other docs.

Signed-off-by: Vincent Batts <[email protected]>
this has come up in discussion and is needed for adding discoverable
arbitrary data to the descriptor references. Especially in making an
index for image layout.

Signed-off-by: Vincent Batts <[email protected]>
@jonboulle
Copy link
Contributor

jonboulle commented Jan 24, 2017

lgtm

Approved with PullApprove

@stevvooe
Copy link
Contributor

stevvooe commented Jan 24, 2017

LGTM

Approved with PullApprove

@stevvooe stevvooe merged commit 84a74b0 into opencontainers:master Jan 24, 2017
wking added a commit to wking/image-spec that referenced this pull request Jan 24, 2017
As I suggested in the PR landing these blocks [1,2,3].  I've shifted
the extensibility section to a separate considerations.md, since it's
a generic policy that applies to both our manifest and manifest-list.

The extensibility requirements might arguably apply to our other JSON
types as well (like annotations, which were recently DRYed up in
f15a268, annotations: make a designated doc and DRY a bit, 2016-12-15,
opencontainers#501).  The new extensibility section sets the stage for that, but
I've left the other types off this commit to focus on making the
current requirements more DRY without changing the specified behavior.

My personal preference would be to have separate canonicalization.md
and extensibility.md files, but Jonathan wanted the single file:

On Mon, Oct 10, 2016 at 09:22:46AM -0700, Jonathan Boulle wrote [4]:
> Ehh, I preferred it where it was - now worried about death by a
> thousand files (extensibility, canonicalization, etc etc). Can we
> combine them (into a generic "considerations" document or similar),
> or just put this back?

[1]: opencontainers#164 (comment)
[2]: opencontainers#164 (comment)
[3]: opencontainers#164 (comment)
[4]: opencontainers#340 (comment)

Signed-off-by: W. Trevor King <[email protected]>
wking added a commit to wking/image-spec that referenced this pull request Jan 24, 2017
As I suggested in the PR landing these blocks [1,2,3].  I've shifted
the extensibility section to a separate considerations.md, since it's
a generic policy that applies to both our manifest and manifest-list.

The extensibility requirements might arguably apply to our other JSON
types as well (like annotations, which were recently DRYed up in
f15a268, annotations: make a designated doc and DRY a bit, 2016-12-15,
opencontainers#501).  The new extensibility section sets the stage for that, but
I've left the other types off this commit to focus on making the
current requirements more DRY without changing the specified behavior.

My personal preference would be to have separate canonicalization.md
and extensibility.md files, but Jonathan wanted the single file:

On Mon, Oct 10, 2016 at 09:22:46AM -0700, Jonathan Boulle wrote [4]:
> Ehh, I preferred it where it was - now worried about death by a
> thousand files (extensibility, canonicalization, etc etc). Can we
> combine them (into a generic "considerations" document or similar),
> or just put this back?

[1]: opencontainers#164 (comment)
[2]: opencontainers#164 (comment)
[3]: opencontainers#164 (comment)
[4]: opencontainers#340 (comment)

Signed-off-by: W. Trevor King <[email protected]>
@vbatts vbatts deleted the descriptor_annotations branch February 8, 2017 14:59
@caniszczyk caniszczyk mentioned this pull request May 18, 2017
3 tasks
wking added a commit to wking/image-spec that referenced this pull request May 18, 2017
Instead of comma-separated short identifiers, which have unclear
semantics (are the delimiters AND or OR?).  I don't see any discussion
of the syntax for this field in [1] (which landed it), but I'd floaded
license expressions before in the sub-thread starting at [2].  Greg
had pushed back against my earlier proposal (licensing information on
descriptors) with [3]:

> No, that's not going to work at all, you can't properly describe the
> license for a whole layer in any form of a string that could be
> standardized or parsed. SPDX is great for describing the individual
> licenses of things, but not for a collection of things, which almost
> always has an arbitrary license (example, what's the license, in a
> simple string, for a Ubuntu base layer?)

But SPDX License Expression are both more expressive and better
defined than the current comma delimiters.  Everything you could have
said with the comma-delimited string you can say more clearly with a
SPDX License Expression.  And because the syntax is not OCI-specific,
you're more likely to be able to find tooling that handles these
values out of the box.

[1]: opencontainers#636
[2]: opencontainers#501 (comment)
[3]: opencontainers#501 (comment)

Signed-off-by: W. Trevor King <[email protected]>
wking added a commit to wking/image-spec that referenced this pull request May 18, 2017
Instead of comma-separated short identifiers, which have unclear
semantics (are the delimiters AND or OR?).  I don't see any discussion
of the syntax for this field in [1] (which landed it), but I'd floaded
license expressions before in the sub-thread starting at [2].  Greg
had pushed back against my earlier proposal (licensing information on
descriptors) with [3]:

> No, that's not going to work at all, you can't properly describe the
> license for a whole layer in any form of a string that could be
> standardized or parsed. SPDX is great for describing the individual
> licenses of things, but not for a collection of things, which almost
> always has an arbitrary license (example, what's the license, in a
> simple string, for a Ubuntu base layer?)

But SPDX License Expression are both more expressive and better
defined than the current comma delimiters.  Everything you could have
said with the comma-delimited string you can say more clearly with a
SPDX License Expression.  And because the syntax is not OCI-specific,
you're more likely to be able to find tooling that handles these
values out of the box.

[1]: opencontainers#636
[2]: opencontainers#501 (comment)
[3]: opencontainers#501 (comment)

Signed-off-by: W. Trevor King <[email protected]>
jonboulle pushed a commit to jonboulle/image-spec that referenced this pull request May 22, 2017
Instead of comma-separated short identifiers, which have unclear
semantics (are the delimiters AND or OR?).  I don't see any discussion
of the syntax for this field in [1] (which landed it), but I'd floaded
license expressions before in the sub-thread starting at [2].  Greg
had pushed back against my earlier proposal (licensing information on
descriptors) with [3]:

> No, that's not going to work at all, you can't properly describe the
> license for a whole layer in any form of a string that could be
> standardized or parsed. SPDX is great for describing the individual
> licenses of things, but not for a collection of things, which almost
> always has an arbitrary license (example, what's the license, in a
> simple string, for a Ubuntu base layer?)

But SPDX License Expression are both more expressive and better
defined than the current comma delimiters.  Everything you could have
said with the comma-delimited string you can say more clearly with a
SPDX License Expression.  And because the syntax is not OCI-specific,
you're more likely to be able to find tooling that handles these
values out of the box.

[1]: opencontainers#636
[2]: opencontainers#501 (comment)
[3]: opencontainers#501 (comment)

Signed-off-by: W. Trevor King <[email protected]>
dattgoswami9lk5g added a commit to dattgoswami9lk5g/bremlinr that referenced this pull request Jun 6, 2022
Instead of comma-separated short identifiers, which have unclear
semantics (are the delimiters AND or OR?).  I don't see any discussion
of the syntax for this field in [1] (which landed it), but I'd floaded
license expressions before in the sub-thread starting at [2].  Greg
had pushed back against my earlier proposal (licensing information on
descriptors) with [3]:

> No, that's not going to work at all, you can't properly describe the
> license for a whole layer in any form of a string that could be
> standardized or parsed. SPDX is great for describing the individual
> licenses of things, but not for a collection of things, which almost
> always has an arbitrary license (example, what's the license, in a
> simple string, for a Ubuntu base layer?)

But SPDX License Expression are both more expressive and better
defined than the current comma delimiters.  Everything you could have
said with the comma-delimited string you can say more clearly with a
SPDX License Expression.  And because the syntax is not OCI-specific,
you're more likely to be able to find tooling that handles these
values out of the box.

[1]: opencontainers/image-spec#636
[2]: opencontainers/image-spec#501 (comment)
[3]: opencontainers/image-spec#501 (comment)

Signed-off-by: W. Trevor King <[email protected]>
7c00d pushed a commit to 7c00d/J1nHyeockKim that referenced this pull request Jun 6, 2022
Instead of comma-separated short identifiers, which have unclear
semantics (are the delimiters AND or OR?).  I don't see any discussion
of the syntax for this field in [1] (which landed it), but I'd floaded
license expressions before in the sub-thread starting at [2].  Greg
had pushed back against my earlier proposal (licensing information on
descriptors) with [3]:

> No, that's not going to work at all, you can't properly describe the
> license for a whole layer in any form of a string that could be
> standardized or parsed. SPDX is great for describing the individual
> licenses of things, but not for a collection of things, which almost
> always has an arbitrary license (example, what's the license, in a
> simple string, for a Ubuntu base layer?)

But SPDX License Expression are both more expressive and better
defined than the current comma delimiters.  Everything you could have
said with the comma-delimited string you can say more clearly with a
SPDX License Expression.  And because the syntax is not OCI-specific,
you're more likely to be able to find tooling that handles these
values out of the box.

[1]: opencontainers/image-spec#636
[2]: opencontainers/image-spec#501 (comment)
[3]: opencontainers/image-spec#501 (comment)

Signed-off-by: W. Trevor King <[email protected]>
7c00d added a commit to 7c00d/J1nHyeockKim that referenced this pull request Jun 6, 2022
Instead of comma-separated short identifiers, which have unclear
semantics (are the delimiters AND or OR?).  I don't see any discussion
of the syntax for this field in [1] (which landed it), but I'd floaded
license expressions before in the sub-thread starting at [2].  Greg
had pushed back against my earlier proposal (licensing information on
descriptors) with [3]:

> No, that's not going to work at all, you can't properly describe the
> license for a whole layer in any form of a string that could be
> standardized or parsed. SPDX is great for describing the individual
> licenses of things, but not for a collection of things, which almost
> always has an arbitrary license (example, what's the license, in a
> simple string, for a Ubuntu base layer?)

But SPDX License Expression are both more expressive and better
defined than the current comma delimiters.  Everything you could have
said with the comma-delimited string you can say more clearly with a
SPDX License Expression.  And because the syntax is not OCI-specific,
you're more likely to be able to find tooling that handles these
values out of the box.

[1]: opencontainers/image-spec#636
[2]: opencontainers/image-spec#501 (comment)
[3]: opencontainers/image-spec#501 (comment)

Signed-off-by: W. Trevor King <[email protected]>
laventuraw added a commit to laventuraw/Kihara-tony0 that referenced this pull request Jun 6, 2022
Instead of comma-separated short identifiers, which have unclear
semantics (are the delimiters AND or OR?).  I don't see any discussion
of the syntax for this field in [1] (which landed it), but I'd floaded
license expressions before in the sub-thread starting at [2].  Greg
had pushed back against my earlier proposal (licensing information on
descriptors) with [3]:

> No, that's not going to work at all, you can't properly describe the
> license for a whole layer in any form of a string that could be
> standardized or parsed. SPDX is great for describing the individual
> licenses of things, but not for a collection of things, which almost
> always has an arbitrary license (example, what's the license, in a
> simple string, for a Ubuntu base layer?)

But SPDX License Expression are both more expressive and better
defined than the current comma delimiters.  Everything you could have
said with the comma-delimited string you can say more clearly with a
SPDX License Expression.  And because the syntax is not OCI-specific,
you're more likely to be able to find tooling that handles these
values out of the box.

[1]: opencontainers/image-spec#636
[2]: opencontainers/image-spec#501 (comment)
[3]: opencontainers/image-spec#501 (comment)

Signed-off-by: W. Trevor King <[email protected]>
tomalopbsr0tt added a commit to tomalopbsr0tt/fabiojosej that referenced this pull request Oct 6, 2022
Instead of comma-separated short identifiers, which have unclear
semantics (are the delimiters AND or OR?).  I don't see any discussion
of the syntax for this field in [1] (which landed it), but I'd floaded
license expressions before in the sub-thread starting at [2].  Greg
had pushed back against my earlier proposal (licensing information on
descriptors) with [3]:

> No, that's not going to work at all, you can't properly describe the
> license for a whole layer in any form of a string that could be
> standardized or parsed. SPDX is great for describing the individual
> licenses of things, but not for a collection of things, which almost
> always has an arbitrary license (example, what's the license, in a
> simple string, for a Ubuntu base layer?)

But SPDX License Expression are both more expressive and better
defined than the current comma delimiters.  Everything you could have
said with the comma-delimited string you can say more clearly with a
SPDX License Expression.  And because the syntax is not OCI-specific,
you're more likely to be able to find tooling that handles these
values out of the box.

[1]: opencontainers/image-spec#636
[2]: opencontainers/image-spec#501 (comment)
[3]: opencontainers/image-spec#501 (comment)

Signed-off-by: W. Trevor King <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants