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

config: Link platform:"…" JSON tags with ~~protocol~~ platform slugs #570

Merged
merged 2 commits into from
Feb 9, 2017

Conversation

wking
Copy link
Contributor

@wking wking commented Sep 15, 2016

Spun off from here.

More details on the individual pivots in the commit messages. The
meat is the one-liner in the last commit, and the bit I'm not sure
about (also discussed in the commit message ;) is whether we want to
rename the JSON tag from platform:"…" to protocol:"…" to
consolidate around the “protocol” term used in #527 to decouple
compliance from platforms
. For example, if we want to add
optional extensions (e.g. allowing Linux containers that use
namespacing but not cgroups), we could have a ‘linux’ protocol (with
the base stuff) and a ‘linux-cgroups’ protocol (with the cgroups stuff
and the base stuff). Runtimes that implemented both would be
compliant with both ‘linux’ and ‘linux-cgroups’.

@wking wking mentioned this pull request Oct 25, 2016
@RobDolinMS RobDolinMS added this to the 1.0.0 milestone Jan 11, 2017
@RobDolinMS
Copy link
Collaborator

@wking Please break-out into separate PRs

@wking
Copy link
Contributor Author

wking commented Jan 11, 2017

I pushed the header normalization out into #650 and rebased the remaining two commits onto master with eb82badc987b8f, so this is now focused exclusively on slugging protocols and defining the Go binding's platform tag.

Copy link
Member

@crosbymichael crosbymichael left a comment

Choose a reason for hiding this comment

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

change from protocol to platform

config.md Outdated
@@ -2,6 +2,7 @@

The container's top-level directory MUST contain a configuration file called `config.json`.
The canonical schema is defined in this document, but there is a JSON Schema in [`schema/config-schema.json`](schema/config-schema.json) and Go bindings in [`specs-go/config.go`](specs-go/config.go).
For properties that are only defined for some [protocols](spec.md#protocols), the Go property has a `platform` tag listing those protocols (e.g. `platform:"linux,solaris"`).
Copy link
Member

Choose a reason for hiding this comment

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

I'd call them platforms not protocols, because that is what they actually are and why the tag is named that way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd call them platforms not protocols, because that is what they actually are and why the tag is named that way.

That's what they are now, but protocols leaves the door open for future entries that are not platforms. Are we comfortable closing that door (I'd rather leave it open, but I'm not a maintainer)?

If maintainers are comfortable closing the door, how thoroughly should I replace ‘protocol’ with ‘platform’? Do you want me to change these too:

$ git grep -i protocol origin/master
origin/master:spec.md:Protocols defined by this specification are:
origin/master:spec.md:An implementation is not compliant for a given CPU architecture if it fails to satisfy one or more of the MUST, REQUIRED, or SHALL requirements for the protocols it implements.
origin/master:spec.md:An implementation is compliant for a given CPU architecture if it satisfies all the MUST, REQUIRED, and SHALL requirements for the protocols it implements.

For example,

An implementation is compliant for a given CPU architecture if it satisfies all the MUST, REQUIRED, and SHALL requirements for the platforms it implements.

reads a bit strangely to me, because we are currently including the CPU architecture in platform. Maybe the protocol-less version of that line would be:

An implementation is compliant for a given CPU architecture if it satisfies all the MUST, REQUIRED, and SHALL requirements for the operating systems it implements.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd vote for platform as well, and I don't see why our spec would define such non-platform protocol such as linux-cgroup protocol.

Copy link
Contributor

@hqhq hqhq Feb 8, 2017

Choose a reason for hiding this comment

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

If we use platform, it should be consistent through all spec, I think your first replacement is fine, an implementation for a specific platform sound reasonable to me .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't see why our spec would define such non-platform protocol such as linux-cgroup protocol.

I'd floated making hooks a protocol to accommodate a Windows runtime that chose not to support then despite their being possible on Windows (although I'm not sure if hooks are possible or not on Windows). And I think we want a base protocol to cover stuff that all compliant runtimes will need (e.g. ociVersion). But having a maintainer reply to my counter-argument with a clear rejection of "protocol" is enough for a rebase here. I'll get it pushed sometime today, and then file a follow-up PR adding base, which you can pick up if it looks useful.

@hqhq
Copy link
Contributor

hqhq commented Feb 8, 2017

@wking Could your update and rebase since this PR has a v1.0.0 milestone, thanks.

We'll be referring to these in code, and using a slug everywhere
avoids having to define both a slug form (linux) and an English form
(Linux containers).

Signed-off-by: W. Trevor King <wking@tremily.us>
So that the semantics of the tags are clear.

The platform/protocol disconnect is unfortunate.  "Protocol" was
chosen in de3f1af (Remove language around Solaris being optional as
it is covered in compliance language, 2016-08-17, opencontainers#527) because we may
have compliance subsets that aren't linked to platforms [1].  I'd be
open to renaming the JSON tag from platform:"..." -> protocol:"...",
but that's probably more change than it's worth.  The approach taken
in this commit, on the other hand, renames "protocol" to "platform".
I think that unnecessarily limits (or sets up confusing semantics for)
the platform/protocol values you can use, but two maintainers both
prefer "platform" [2,3].

[1]: opencontainers#527 (comment)
[2]: opencontainers#570 (comment)
[3]: opencontainers#570 (comment)

Signed-off-by: W. Trevor King <wking@tremily.us>
@wking wking changed the title config: Link platform:"…" JSON tags with protocol slugs config: Link platform:"…" JSON tags with ~~protocol~~ platform slugs Feb 8, 2017
@wking
Copy link
Contributor Author

wking commented Feb 8, 2017 via email

@hqhq
Copy link
Contributor

hqhq commented Feb 9, 2017

LGTM

Approved with PullApprove

@vbatts
Copy link
Member

vbatts commented Feb 9, 2017

LGTM

Approved with PullApprove

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.

5 participants