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

[Tracker] Platform/Compiler agnostic schema #166

Closed
vbatts opened this issue Sep 9, 2015 · 14 comments
Closed

[Tracker] Platform/Compiler agnostic schema #166

vbatts opened this issue Sep 9, 2015 · 14 comments
Milestone

Comments

@vbatts
Copy link
Member

vbatts commented Sep 9, 2015

like #135 began to fix, this needs to track our movement from golang compiler constrained schema, to something like json-schema.
At that point, we can have the provided *.go (if at all) as a reference for valid structs for the schema.

@wking
Copy link
Contributor

wking commented Sep 9, 2015

On Wed, Sep 09, 2015 at 10:30:24AM -0700, Vincent Batts wrote:

like #135 began to fix…

How is this related to #135?

… this needs to track our movement from golang compiler constrained
schema, to something like json-schema.

JSON Schema is fine with me (although their docs can be hard to browse
;). Are any other schema languages under consideration? If we're all
on-board with JSON Schema, I'd just start working on it :p. If we
don't think everybody's on board, I'd suggest floating alternatives on
the mailing list, and linking to the list thread from this issue.

@dqminh
Copy link
Contributor

dqminh commented Sep 9, 2015

I think a richer schema is definitely beneficial.

Does json schema support things like one field can have different types (like uid/gid can be string on windows iirc ), and oneOf/anyOf relationship for things like Resources/CgroupPaths etc. ?

@wking
Copy link
Contributor

wking commented Sep 9, 2015

On Wed, Sep 09, 2015 at 11:25:47AM -0700, Daniel, Dao Quang Minh wrote:

Does json schema support things like one field can have different
types (like uid/gid can be string on windows iirc ),

That sounds like oneOf.

… and oneOf/anyOf relationship for things like
Resources/CgroupPaths etc. ?

Yes, see 1.

Maybe the approach should be “start translating the spec to JSON
Schema (or any other proposed schema language), and then compare the
partial translations to see which feels most expressive”?

@vbatts
Copy link
Member Author

vbatts commented Sep 10, 2015

@wking it's related to #135 because the schema is presently tied up in source that will compile differently on various platforms. So to have a way, for instance, to validate a linux config, from an OSX host, is not straight forward. This is what we were talking about on the call today.

@wking
Copy link
Contributor

wking commented Sep 10, 2015

On Wed, Sep 09, 2015 at 07:53:07PM -0700, Vincent Batts wrote:

@wking it's related to #135 because the schema is presently tied up
in source that will compile differently on various platforms…

#135 is a step towards a platform-agnostic Go spec. Is that a valid
end-goal? It may be better than a platform-specific Go spec, but it
seems like dead-end work if this issue gets traction for a non-Go spec
language. On the other hand, if we expect a non-Go spec to take a
while, it may still be useful dead-end work ;).

@vbatts
Copy link
Member Author

vbatts commented Sep 10, 2015

This is about not yak shaving, and actually trying to solve the problem
#135 was pursuing.

On Wed, Sep 9, 2015 at 11:21 PM, W. Trevor King notifications@github.com
wrote:

On Wed, Sep 09, 2015 at 07:53:07PM -0700, Vincent Batts wrote:

@wking it's related to #135 because the schema is presently tied up
in source that will compile differently on various platforms…

#135 is a step towards a platform-agnostic Go spec. Is that a valid
end-goal? It may be better than a platform-specific Go spec, but it
seems like dead-end work if this issue gets traction for a non-Go spec
language. On the other hand, if we expect a non-Go spec to take a
while, it may still be useful dead-end work ;).


Reply to this email directly or view it on GitHub
#166 (comment)
.

@vbatts
Copy link
Member Author

vbatts commented Sep 11, 2015

#179 is an approach to this.

@laijs
Copy link
Contributor

laijs commented Sep 16, 2015

Any approach that changes json to other protocol would be an endless progress.
It is not a good idea to shift it from json. It is to be hoped that the user-platform-agnostic problem is fixed before 0.2.0

@vbatts
Copy link
Member Author

vbatts commented Jan 13, 2016

another part of this is code generation. As mentioned in #185 (comment), it is a goal of having a schema that is language agnostic. /cc @LK4D4

@kofalt
Copy link

kofalt commented Jan 13, 2016

FWIW, we've been using JSON schemas to great effect (example here). I'd agree their docs are a little wonky beyond a few demos, but there are a lot of options for validation and it seems a well-tread path. It's also convenient that a schema is itself JSON, so you're not mucking about with various formats & protocols.

I don't want to claim that it's the best option for this use case, in fact I'd be interested if there are alternative proposals, but it has yet to bite us in our applications. YMMV.

vbatts added a commit to vbatts/oci-runtime-spec that referenced this issue Jan 13, 2016
This introduces verbiage of fields that may occur in json (technically
optional), but is required on certain platforms (e.g. Linux).

Not adding a "name" string, as that is not a requirement yet.

In the event a windows runtime shows up, I could imagine an `sid`, but
we'll get to that when it happens.

Closes opencontainers#135
Related to opencontainers#166

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
vbatts added a commit to vbatts/oci-runtime-spec that referenced this issue Jan 14, 2016
This introduces verbiage of fields that may occur in json (technically
optional), but is required on certain platforms (e.g. Linux).

The JSON document will look the same as it presently does, but now the
reference source compiles regardless of platform.

Not adding a "name" string to the user sturct, as that is not a
requirement yet.

In the event a windows runtime shows up, I could imagine an `sid` on the
user struct, but we'll get to that when it happens.

Closes opencontainers#135
Related to opencontainers#166

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
vbatts added a commit to vbatts/oci-runtime-spec that referenced this issue Jan 14, 2016
This introduces verbiage of fields that may occur in json (technically
optional), but is required on certain platforms (e.g. Linux).

The JSON document will look the same as it presently does, but now the
reference source compiles regardless of platform.

Not adding a "name" string to the user sturct, as that is not a
requirement yet.

In the event a windows runtime shows up, I could imagine an `sid` on the
user struct, but we'll get to that when it happens.

Closes opencontainers#135
Related to opencontainers#166

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
vbatts added a commit to vbatts/oci-runtime-spec that referenced this issue Jan 15, 2016
This introduces verbiage of fields that may occur in json (technically
optional), but is required on certain platforms (e.g. Linux).

The JSON document will look the same as it presently does, but now the
reference source compiles regardless of platform.

Not adding a "name" string to the user sturct, as that is not a
requirement yet.

In the event a windows runtime shows up, I could imagine an `sid` on the
user struct, but we'll get to that when it happens.

Closes opencontainers#135
Related to opencontainers#166

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
vbatts added a commit to vbatts/oci-runtime-spec that referenced this issue Jan 15, 2016
This introduces verbiage of fields that may occur in json (technically
optional), but is required on certain platforms (e.g. Linux).

The JSON document will look the same as it presently does, but now the
reference source compiles regardless of platform.

Not adding a "name" string to the user sturct, as that is not a
requirement yet.

In the event a windows runtime shows up, I could imagine an `sid` on the
user struct, but we'll get to that when it happens.

Closes opencontainers#135
Related to opencontainers#166

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
vbatts added a commit to vbatts/oci-runtime-spec that referenced this issue Jan 15, 2016
This introduces verbiage of fields that may occur in json (technically
optional), but is required on certain platforms (e.g. Linux).

The JSON document will look the same as it presently does, but now the
reference source compiles regardless of platform.

Not adding a "name" string to the user sturct, as that is not a
requirement yet.

In the event a windows runtime shows up, I could imagine an `sid` on the
user struct, but we'll get to that when it happens.

Closes opencontainers#135
Related to opencontainers#166

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
@vbatts
Copy link
Member Author

vbatts commented Jan 19, 2016

see #313

@vbatts
Copy link
Member Author

vbatts commented Jan 19, 2016

Thanks for the pointer @kofalt

@vbatts vbatts added this to the v0.4.0 milestone Feb 29, 2016
@vbatts vbatts changed the title [Tracker] Compiler agnostic schema [Tracker] Platform/Compiler agnostic schema Feb 29, 2016
@vbatts
Copy link
Member Author

vbatts commented Feb 29, 2016

@crosbymichael I've added this to the v0.4.0 milestone, as you had added it to #324

vbatts added a commit to vbatts/oci-runtime-spec that referenced this issue Mar 9, 2016
This introduces verbiage of fields that may occur in json (technically
optional), but is required on certain platforms (e.g. Linux).

The JSON document will look the same as it presently does, but now the
reference source compiles regardless of platform.

Not adding a "name" string to the user sturct, as that is not a
requirement yet.

In the event a windows runtime shows up, I could imagine an `sid` on the
user struct, but we'll get to that when it happens.

Closes opencontainers#135
Related to opencontainers#166

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
@crosbymichael crosbymichael added this to the v0.5.0 milestone Mar 9, 2016
@crosbymichael crosbymichael removed this from the v0.4.0 milestone Mar 9, 2016
vbatts added a commit to vbatts/oci-runtime-spec that referenced this issue Mar 9, 2016
This introduces verbiage of fields that may occur in json (technically
optional), but is required on certain platforms (e.g. Linux).

The JSON document will look the same as it presently does, but now the
reference source compiles regardless of platform.

Not adding a "name" string to the user sturct, as that is not a
requirement yet.

In the event a windows runtime shows up, I could imagine an `sid` on the
user struct, but we'll get to that when it happens.

Closes opencontainers#135
Related to opencontainers#166

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
@vbatts
Copy link
Member Author

vbatts commented Mar 9, 2016

This should be resolved, as #310 is merged. Let me know if this needs further iteration.

@vbatts vbatts closed this as completed Mar 9, 2016
Mashimiao pushed a commit to Mashimiao/specs that referenced this issue Aug 19, 2016
This introduces verbiage of fields that may occur in json (technically
optional), but is required on certain platforms (e.g. Linux).

The JSON document will look the same as it presently does, but now the
reference source compiles regardless of platform.

Not adding a "name" string to the user sturct, as that is not a
requirement yet.

In the event a windows runtime shows up, I could imagine an `sid` on the
user struct, but we'll get to that when it happens.

Closes opencontainers#135
Related to opencontainers#166

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants