Uh oh!
There was an error while loading. Please reload this page.
source and schema: differentiate with examples - #276
Conversation
There was a problem hiding this comment.
nit: “exmample” → “example”, and I'd drop “contents” and “(generated with runc spec)”. The generation note may be useful for a commit message, but doesn't seem useful in the spec itself.
wking
commented
Dec 18, 2015
On Fri, Dec 18, 2015 at 01:50:31PM -0800, Vincent Batts wrote:
I'm not sure these examples have much normative weight, but they |
vishh
commented
Dec 18, 2015
+1 for the overall intent of separating schema from the golang structures. |
crosbymichael
commented
Dec 18, 2015
The only downside is that it makes the Go import path ugly. |
wking
commented
Dec 18, 2015
On Fri, Dec 18, 2015 at 02:52:59PM -0800, Michael Crosby wrote:
We expect Go import paths to get more interesting soon anyway, no? |
vishh
commented
Dec 19, 2015
@vbatts: How do we differentiate between optional and required fields? And how will this address extensible fields? |
wking
commented
Dec 19, 2015
On Fri, Dec 18, 2015 at 05:46:21PM -0800, Vish Kannan wrote:
The normative specification will still be things like 1. This is |
vbatts
commented
Dec 21, 2015
@vishh that has to be done per field and value. Like the comments that describe them. ***`path`** (string, required) ...
***`readonly`** (bool, optional) ...
It's not very parsable, but is legible. |
vbatts
commented
Dec 21, 2015
@crosbymichael you thinking those paths would be ugly was the first thing that came to mind. What do you recommend besides |
vbatts
commented
Dec 21, 2015
otherwise, I've rebased and updated the structs a little based on comments. |
wking
commented
Dec 21, 2015
On Mon, Dec 21, 2015 at 12:24:27PM -0800, Vincent Batts wrote:
All the ecccada → 99d1df7 changes look good to me, but this is still |
vbatts
commented
Jan 13, 2016
rebased. PTAL |
wking
commented
Jan 13, 2016
On Wed, Jan 13, 2016 at 01:22:20PM -0800, Vincent Batts wrote:
$ diff -u <(git show -M50 99d1df7) <(git show -M50 998344) So that is just “rebased onto the new master to pickup changes in the |
mrunalp
commented
Jan 13, 2016
We can do this using ocitools to generate and a Makefile target to update this. |
wking
commented
Jan 13, 2016
On Wed, Jan 13, 2016 at 02:43:21PM -0800, Mrunal Patel wrote:
I'm concerned that:
is too long a loop, involving a number of non-normative moving parts. But if the idea is that PR submitters will use whatever tooling they |
vbatts
commented
Jan 19, 2016
rebased |
vbatts
commented
Jan 20, 2016
brainstorming: would the sample json be better served as an |
| "CAP_NET_BIND_SERVICE" | ||
| ], | ||
| "apparmorProfile": "", | ||
| "selinuxProcessLabel": "" |
There was a problem hiding this comment.
Before these moved @mrunalp and I were suggesting we drop the empty values. Since #329they're omitempty, so I see no reason to keep them in this example.
There was a problem hiding this comment.
Its fine to have these in an example because how else would ppl know that they are there without them being in an EXAMPLE
There was a problem hiding this comment.
On Tue, Mar 08, 2016 at 10:43:21AM -0800, Michael Crosby wrote:
"apparmorProfile": "","selinuxProcessLabel": ""Its fine to have these in an example because how else would ppl know
that they are there without them being in an EXAMPLE
I'm fine listing them here with meaningful content. And regardless of
whether they're listed here, I think people should be able to discover
them via the process documentation [1](which seems to use
‘selinuxLabel’ and not ‘selinuxProcessLabel’ anyway).
vbatts
commented
Mar 9, 2016
rebased |
mrunalp
commented
Mar 9, 2016
Should we format the json using jq to get a consistent output? |
crosbymichael
commented
Mar 9, 2016
import"github.com/opencontainers/specs/spec-go" |
vbatts
commented
Mar 9, 2016
@crosbymichael done |
The standard is on the JSON schema (not yet IETF spec JSON-schema), such that it is not implemenations specific. Thus far, the reference has been in how golang source renders the JSON documents. Having the JSON source and the markdown documents in sync has been an ongoing step to keep in sync. Separating these two allows the golang source to continue being _a_ reference, but the JSON schema in the documentation to be _the_ reference. As validation tooling is refined, then it will facilitate ensuring the available golang source conforms to the reference JSON. Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
vbatts
commented
Mar 9, 2016
rebased again |
crosbymichael
commented
Mar 9, 2016
LGTM |
| "hooks": { | ||
| "prestart": [ | ||
| { | ||
| "path": "/", |
There was a problem hiding this comment.
This should be /usr/bin/uptime
args[0] could match that or be something else or just empty.
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
mrunalp
commented
Mar 9, 2016
LGTM |
source and schema: differentiate with examples
The label changed in 5a8a779 (Move process specific settings to process, 2016-03-02, opencontainers#329) and 7bf06d5 (source and schema: differentiate with examples, 2015-12-18, opencontainers#276) missed this instance when rebasing around opencontainers#329. Signed-off-by: W. Trevor King <wking@tremily.us>
Also: * Update the link to Go bindings after 7bf06d5 (source and schema: differentiate with examples, 2015-12-18, opencontainers#276). * Add a reference to the JSON Schema after cdcabde (schema: JSON Schema and validator for `config.json`, 2016-01-19, opencontainers#313). It's pretty clear that the Go bindings cannot be canonical on their own, because they do not define limits (e.g. the 0 through 512 range for FileMode). The JSON Schema is closer, but still does not cover everything (e.g. "a directory must exist at root.path"). Both the Go bindings and the JSON Schema could grow to cover the full spec by adding that sort of thing to comments and descriptions, but that's not how things seem to be working now. Signed-off-by: W. Trevor King <wking@tremily.us>
Catch up with 7bf06d5 (source and schema: differentiate with examples, 2015-12-18, opencontainers#276). Signed-off-by: W. Trevor King <wking@tremily.us>
Also: * Update the link to Go bindings after 7bf06d5 (source and schema: differentiate with examples, 2015-12-18, opencontainers#276). * Add a reference to the JSON Schema after cdcabde (schema: JSON Schema and validator for `config.json`, 2016-01-19, opencontainers#313). It's pretty clear that the Go bindings cannot be canonical on their own, because they do not define limits (e.g. the 0 through 512 range for FileMode). The JSON Schema is closer, but still does not cover everything (e.g. "a directory must exist at root.path"). Both the Go bindings and the JSON Schema could grow to cover the full spec by adding that sort of thing to comments and descriptions, but that's not how things seem to be working now. Signed-off-by: W. Trevor King <wking@tremily.us>
Catch up with 7bf06d5 (source and schema: differentiate with examples, 2015-12-18, opencontainers#276). Signed-off-by: W. Trevor King <wking@tremily.us>
The label changed in 5a8a779 (Move process specific settings to process, 2016-03-02, opencontainers#329) and 7bf06d5 (source and schema: differentiate with examples, 2015-12-18, opencontainers#276) missed this instance when rebasing around opencontainers#329. Signed-off-by: W. Trevor King <wking@tremily.us>
Also: * Update the link to Go bindings after 7bf06d5 (source and schema: differentiate with examples, 2015-12-18, opencontainers#276). * Add a reference to the JSON Schema after cdcabde (schema: JSON Schema and validator for `config.json`, 2016-01-19, opencontainers#313). It's pretty clear that the Go bindings cannot be canonical on their own, because they do not define limits (e.g. the 0 through 512 range for FileMode). The JSON Schema is closer, but still does not cover everything (e.g. "a directory must exist at root.path"). Both the Go bindings and the JSON Schema could grow to cover the full spec by adding that sort of thing to comments and descriptions, but that's not how things seem to be working now. Signed-off-by: W. Trevor King <wking@tremily.us>
Catch up with 7bf06d5 (source and schema: differentiate with examples, 2015-12-18, opencontainers#276). Signed-off-by: W. Trevor King <wking@tremily.us>
The standard is on the JSON schema (not yet IETF spec JSON-schema), such
that it is not implemenations specific. Thus far, the reference has been
in how golang source renders the JSON documents.
Having the JSON source and the markdown documents in sync has been an
ongoing step to keep in sync.
Separating these two allows the golang source to continue being a
reference, but the JSON schema in the documentation to be the
reference.
As validation tooling is refined, then it will facilitate ensuring
the available golang source conforms to the reference JSON.