Json schema and examples#370
Conversation
config.md
Outdated
| { | ||
| "hostID": 1000, | ||
| "containerID": 0, | ||
| "size": 10 |
There was a problem hiding this comment.
32k will be a better example for the mappings.
fc6670d to
737f4ff
Compare
Several fields needed the correct typing, and updates for recent changes. Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
737f4ff to
1e2a72d
Compare
|
updated. PTAL. |
|
On Thu, Apr 07, 2016 at 07:14:17AM -0700, Vincent Batts wrote:
It looks like fc6670d → 1e2a72d addresses all the points raised so There are still some zero values that don't make sense (e.g. in |
1e2a72d to
e8ba1d0
Compare
|
@wking fair. Though it also says that a -1 to quotas indicates no restriction, though we have it as a uint64. That does not line up. I've updated the example. |
config.md
Outdated
| "memory": { | ||
| "limit": 536870912, | ||
| "reservation": 0, | ||
| "swap": 0, |
There was a problem hiding this comment.
Perhaps make the swap same as the limit?
There was a problem hiding this comment.
done
On Fri, Apr 8, 2016 at 1:06 PM, Mrunal Patel notifications@github.com
wrote:
In config.md
#370 (comment)
:
]},"pids": {"limit": 32771},"hugepageLimits": [{"pageSize": "2MB","limit": 9223372036854772000}],"oomScoreAdj": 100,"memory": {"limit": 536870912,"reservation": 0,"swap": 0,Perhaps make the swap same as the limit?
—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
https://github.com/opencontainers/runtime-spec/pull/370/files/e8ba1d05e1347edc6771a8133a4c729db6df3a50#r59057195
e8ba1d0 to
a341686
Compare
config.md
Outdated
| "swappiness": 0 | ||
| }, | ||
| "cpu": { | ||
| "shares": 0, |
a341686 to
c1612af
Compare
|
@mrunalp done. |
config-linux.md
Outdated
| "memory": { | ||
| "limit": 0, | ||
| "limit": 536870912, | ||
| "reservation": 0, |
There was a problem hiding this comment.
This is probably not a good example of a soft-limit ;).
There was a problem hiding this comment.
There was a problem hiding this comment.
now I have a question. @mrunalp or @crosbymichael, does this reservation correspond to memory.soft_limit_in_bytes? if so, that can take a string like 1G or 256M. So is this uint64 value just the number of bytes for a soft limit?
There was a problem hiding this comment.
AFAIK, it is supposed to be in bytes.
There was a problem hiding this comment.
If we were to be pedantic, I'd rename all the fields to include the units. For example, reservation becomes reservationBytes
There was a problem hiding this comment.
fixed. and add in bytes to the field docs
There was a problem hiding this comment.
On Mon, Apr 11, 2016 at 03:52:52PM -0700, Vish Kannan wrote:
@@ -267,9 +267,9 @@ The following parameters can be specified to setup the controller:
"memory": { - "limit": 0, + "limit": 536870912, "reservation": 0,If we were to be pedantic, I'd rename all the fields to include the
units. For example,reservationbecomesreservationBytes
Ugh :p. I think that's what docs are for ;).
There was a problem hiding this comment.
I disagree. API should be user-friendly and readable. Having to keep
referring to docs while programming against an API is not a good user
experience. Simple changes like including units in the field names will
save a lot of time in the long run.
On Mon, Apr 11, 2016 at 4:01 PM, W. Trevor King notifications@github.com
wrote:
In config-linux.md
#370 (comment)
:@@ -267,9 +267,9 @@ The following parameters can be specified to setup the controller:
"memory": { - "limit": 0, + "limit": 536870912, "reservation": 0,On Mon, Apr 11, 2016 at 03:52:52PM -0700, Vish Kannan wrote: > @@ -267,9
+267,9 @@ The following parameters can be specified to setup the
controller: > > ```json > "memory": { > - "limit": 0, > + "limit":
536870912, > "reservation": 0, If we were to be pedantic, I'd rename all
the fields to include the units. For example,reservationbecomes
`reservationBytes`
Ugh :p. I think that's what docs are for ;).—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/opencontainers/runtime-spec/pull/370/files/c1612af9b80dd828f8fccea3bfca5300281d37b9#r59296588
There was a problem hiding this comment.
On Mon, Apr 11, 2016 at 04:08:14PM -0700, Vish Kannan wrote:
@@ -267,9 +267,9 @@ The following parameters can be specified to setup the controller:
"memory": { - "limit": 0, + "limit": 536870912, "reservation": 0,I disagree. API should be user-friendly and readable. Having to keep
referring to docs while programming against an API is not a good
user experience.
Some ideas don't pack down nicely into a JSON key, so I think not
referring to docs while programming against an API is a bad idea. If
the only interesting thing to say is “this is in bytes”, then reading
the docs won't take very long ;). That said, the kernel devs are with
you on this one (since they chose limit_in_bytes),
|
a341686 → c1612af look good to me, although it's still pretty easy to |
|
I think we can do cleanups in follow on PRs. This LGTM overall. |
|
@crosbymichael @vishh PTAL |
|
LGTM |
* "complete" JSON example * fix a couple of values * fix a missing comma Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
c1612af to
d4e7326
Compare
Through 6734c7a (Merge pull request opencontainers#370 from vbatts/json_schema_and_examples, 2016-04-11). The only unlisted changes to master were a brief run with ffjson (opencontainers#343, opencontainers#351), but that was pulled out due to gccgo issues in opencontainers#363. Signed-off-by: W. Trevor King <wking@tremily.us>
Through 6734c7a (Merge pull request opencontainers#370 from vbatts/json_schema_and_examples, 2016-04-11). The only unlisted changes to master were a brief run with ffjson (opencontainers#343, opencontainers#351), but that was pulled out due to gccgo issues in opencontainers#363. Signed-off-by: W. Trevor King <wking@tremily.us>
Through 6734c7a (Merge pull request opencontainers#370 from vbatts/json_schema_and_examples, 2016-04-11). The only unlisted changes to master were a brief run with ffjson (opencontainers#343, opencontainers#351), but that was pulled out due to gccgo issues in opencontainers#363. Signed-off-by: W. Trevor King <wking@tremily.us>
To match where they're defined in the JSON Schema [1]. The old location is from d4e7326 (config: JSON examples, 2016-04-06, opencontainers#370), and seems to have been accidental. [1]: https://github.com/opencontainers/runtime-spec/blob/0982071b288ddddc1ae84d21c4bd682c96942f5c/schema/schema-linux.json#L21-L48
To match where they're defined in the JSON Schema [1]. The old location is from d4e7326 (config: JSON examples, 2016-04-06, opencontainers#370), and seems to have been accidental. [1]: https://github.com/opencontainers/runtime-spec/blob/0982071b288ddddc1ae84d21c4bd682c96942f5c/schema/schema-linux.json#L21-L48 Signed-off-by: W. Trevor King <wking@tremily.us>
Through 6734c7a (Merge pull request opencontainers#370 from vbatts/json_schema_and_examples, 2016-04-11). The only unlisted changes to master were a brief run with ffjson (opencontainers#343, opencontainers#351), but that was pulled out due to gccgo issues in opencontainers#363. Signed-off-by: W. Trevor King <wking@tremily.us>
To match where they're defined in the JSON Schema [1]. The old location is from d4e7326 (config: JSON examples, 2016-04-06, opencontainers#370), and seems to have been accidental. [1]: https://github.com/opencontainers/runtime-spec/blob/0982071b288ddddc1ae84d21c4bd682c96942f5c/schema/schema-linux.json#L21-L48 Signed-off-by: W. Trevor King <wking@tremily.us>
Fixes #344