-
Notifications
You must be signed in to change notification settings - Fork 759
config: reformat and add optional/required #333
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: reformat and add optional/required #333
Conversation
c1b986d
to
d47024d
Compare
Reformat this file to look more like manifest.md and add OPTIONAL/REQUIRED tags on all fields. Fixes opencontainers#251 Signed-off-by: Brandon Philips <[email protected]>
d47024d
to
f3d0f78
Compare
Caught by @coolljt072 and rebased here in markdown format. Signed-off-by: Brandon Philips <[email protected]>
config.md
Outdated
A set of directories which should be created as data volumes in a container running this image. This field MAY be "null". | ||
If a file or folder exists within the image with the same path as a data volume, that file or folder is replaced with the data volume and is never merged. **NOTE:** This JSON structure value is unusual because it is a direct JSON serialization of the Go type <code>map[string]struct{}</code> and is represented in JSON as an object mapping its keys to an empty object. | ||
|
||
- **WorkingDir** *string*, REQUIRED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the config
is OPTIONAL, but WorkingDir
is REQUIRED? I think all the filed in config
is OPTIONAL :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean if config
is not null, then the WorkingDir
is REQUIRED
?
config.md
Outdated
|
||
A custom message set when creating the layer. | ||
|
||
- **empty_layer** *string* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a Boolean
, not a string
On Tue, Sep 20, 2016 at 08:36:59PM -0700, Lei Jitang wrote:
This means that if you set ‘config’ you MUST set ‘config.WorkingDir’. |
config.md
Outdated
</dl> | ||
- **created** *string*, OPTIONAL | ||
|
||
A ISO-8601 formatted combined date and time at which the image was created. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“A ISO” → “An ISO”.
config.md
Outdated
- **config** *object*, OPTIONAL | ||
|
||
The execution parameters which should be used as a base when running a container using the image. | ||
This field can be <code>null</code>, in which case any execution parameters should be specified at creation of the container. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<code>
→ backticks.
config.md
Outdated
The execution parameters which should be used as a base when running a container using the image. | ||
This field can be <code>null</code>, in which case any execution parameters should be specified at creation of the container. | ||
|
||
- **user** *string*, OPTIONAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was previously title-case, and as of 403a1af specs-go/v1/config.go
still has:
User string `json:"User"`
config.md
Outdated
|
||
The username or UID which the process in the container should run as. | ||
This acts as a default value to use when the value is not specified when creating a container. | ||
All of the following are valid: `user`, `uid`, `user:group`, `uid:gid`, `uid:group`, `uiser:gid` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uiser:gid
→ user:gid
.
config.md
Outdated
A layer DiffID is a SHA256 digest over the layer's uncompressed tar archive and serialized in the descriptor digest format, e.g., `sha256:a9561eb1b190625c9adb5a9513e72c4dedafc1cb2d4c5236c9a6957ec7dfd5a9`. | ||
Layers must be packed and unpacked reproducibly to avoid changing the layer DiffID, for example by using tar-split to save the tar headers. | ||
|
||
NOTE: the DiffID is different than the digest in the manifest list because the manifest digest is taken over the gzipped layer for <code>application/vnd.oci.image.layer.tar+gzip</code> types. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<code>
→ backticks.
config.md
Outdated
|
||
- **MemorySwap** *integer*, OPTIONAL | ||
|
||
Total memory usage (memory + swap); set to <code>-1</code> to disable swap. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<code>
→ backticks.
config.md
Outdated
Its keys can be in the format of: | ||
`port/tcp`, `port/udp`, `port` with the default protocol being `tcp` if not specified. | ||
These values act as defaults and are merged with any specified when creating a container. | ||
**NOTE:** This JSON structure value is unusual because it is a direct JSON serialization of the Go type <code>map[string]struct{}</code> and is represented in JSON as an object mapping its keys to an empty object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<code>
→ backticks.
config.md
Outdated
|
||
- **Env** *array of strings*, OPTIONAL | ||
|
||
Entries are in the format of <code>VARNAME="var value"</code>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<code>
→ backticks.
config.md
Outdated
- **Entrypoint** *array of strings* | ||
|
||
A list of arguments to use as the command to execute when the container starts. | ||
This value acts as a default and is replaced by an entrypoint specified when creating a container. This field MAY be "null". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"null"
→ null
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also remove the doubled space: “as a default“ → “as a default”. And move “This field MAY be null
” to its own line.
config.md
Outdated
|
||
- **Volumes** *object*, OPTIONAL | ||
A set of directories which should be created as data volumes in a container running this image. This field MAY be "null". | ||
If a file or folder exists within the image with the same path as a data volume, that file or folder is replaced with the data volume and is never merged. **NOTE:** This JSON structure value is unusual because it is a direct JSON serialization of the Go type <code>map[string]struct{}</code> and is represented in JSON as an object mapping its keys to an empty object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<code>
→ backticks.
config.md
Outdated
|
||
Describes the history of each layer. | ||
The array is ordered from bottom-most layer to top-most layer. | ||
The object has the following fields: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing indents?
config.md
Outdated
The array is ordered from bottom-most layer to top-most layer. | ||
The object has the following fields: | ||
|
||
- **created** *string*, OPTIONAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Four-space indents for sub-lists (opencontainers/runtime-spec#495).
config.md
Outdated
|
||
- **empty_layer** *string* | ||
|
||
This field is used to mark if the history item created a filesystem diff, OPTIONAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“OPTIONAL“ should go on the line with empty_layer, like you do with all the other properties.
config.md
Outdated
Sets the current working directory of the entrypoint process in the container. | ||
This value acts as a default and is replaced by a working directory specified when creating a container. | ||
|
||
- **rootfs** *object, REQUIRED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*object
-> *object*
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still lack of a *
at the end of object
. It looks like
rootfs *object, REQUIRED
config.md
Outdated
If an `Entrypoint` value is not specified, then the first entry of the `Cmd` array should be interpreted as the executable to run. | ||
|
||
- **Volumes** *object*, OPTIONAL | ||
A set of directories which should be created as data volumes in a container running this image. This field MAY be "null". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should have a blang line after **Volumes** *object*, OPTIONAL
|
||
Each image has an associated JSON structure which describes some basic information about the image such as date created, author, and the ID of its parent image as well as execution/runtime configuration like its entrypoint, default arguments, CPU/memory shares, networking, and volumes. | ||
The JSON structure also references a cryptographic hash of each layer used by the image, and provides history information for those layers. | ||
This JSON is considered to be immutable, because changing it would change the computed ImageID. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a new commit carrying #301, which changes ImageID
→ [ImageID](#imageid)
?
|
||
Each image's ID is given by the SHA256 hash of its configuration JSON. | ||
It is represented as a hexadecimal encoding of 256 bits, e.g., <code>sha256:a9561eb1b190625c9adb5a9513e72c4dedafc1cb2d4c5236c9a6957ec7dfd5a9</code>. | ||
Since the configuration JSON that gets hashed references hashes of each layer in the image, this formulation of the ImageID makes images content-addresable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a new commit carrying #301, which changes configuration JSON
→ configuration JSON, both on this line and the “Each image's ID…” line two above it?
- use correct indentation for sub lists - address some missing OPTIONAL tags - random formatting issues. Thanks @coolljt0725 and @wking for the review. Signed-off-by: Brandon Philips <[email protected]>
629abd5
to
5d8014e
Compare
Addressed @coolljt0725 and @wking |
config.md
Outdated
|
||
An array of layer content hashes (`DiffIDs`), in order from bottom-most to top-most. | ||
|
||
- **history** *array of object*, REQUIRED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“array of object” → “array of objects”
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is history
OPTIONAL
? since all the filed in history is optional
- **Volumes** *object*, OPTIONAL | ||
|
||
A set of directories which should be created as data volumes in a container running this image. This field MAY be null. | ||
If a file or folder exists within the image with the same path as a data volume, that file or folder is replaced with the data volume and is never merged. **NOTE:** This JSON structure value is unusual because it is a direct JSON serialization of the Go type `map[string]struct{}` and is represented in JSON as an object mapping its keys to an empty object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Split this into separate lines for each sentence.
|
||
Each image's ID is given by the SHA256 hash of its configuration JSON. | ||
It is represented as a hexadecimal encoding of 256 bits, e.g., `sha256:a9561eb1b190625c9adb5a9513e72c4dedafc1cb2d4c5236c9a6957ec7dfd5a9`. | ||
Since the configuration JSON that gets hashed references hashes of each layer in the image, this formulation of the ImageID makes images content-addresable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
config.md
Outdated
|
||
- **empty_layer** *boolean*, OPTIONAL | ||
|
||
This field is used to mark if the history item created a filesystem diff, OPTIONAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“, OPTIONAL” → “.” (you say empty_layer
is optional two lines above)
config.md
Outdated
|
||
- **created** *string*, OPTIONAL | ||
|
||
Creation time, expressed as a ISO-8601 formatted combined date and time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“a ISO” → “an ISO”.
config.md
Outdated
- **Entrypoint** *array of strings*, OPTIONAL | ||
|
||
A list of arguments to use as the command to execute when the container starts. | ||
This value acts as a default and is replaced by an entrypoint specified when creating a container. This field MAY be null. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still has a doubled space in “as a default”.
Some duplicate spaces and duplicate words. Signed-off-by: Brandon Philips <[email protected]>
I think this is g2g @opencontainers/image-spec-maintainers |
Pretty huge overhaul. |
On Thu, Sep 22, 2016 at 12:01:30PM -0700, Brandon Philips wrote:
As of 85138c9 there are still a number of unaddressed comments on the |
There are a couple of questions on the choices made for OPTIONAL/REQUIRED |
@vbatts what are the questions? |
|
||
Here is an example rootfs section: | ||
|
||
<pre>"rootfs": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we dropping the examples?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a big example at the end which gets verified vs. the JSON Schema. I think that's sufficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stevvooe Right, I came to the same conclusion as @wking. The examples in the middle of the spec weren't being verified and the sub-objects aren't really stand alone anyways.
The other downside of adding them back in is it makes formatting into markdown impossible and I need to go back to HTML (or find some hack with a mix).
Various markdown, and grammar issues summarized here: opencontainers#333 (comment) Thank you to wking and coolljt0725 for the detailed review.
Various markdown, and grammar issues summarized here: opencontainers#333 (comment) Thank you to wking and coolljt0725 for the detailed review. Signed-off-by: Brandon Philips <[email protected]>
8d58c72
to
974ac79
Compare
As suggested [1,2] for opencontainers#333. [1]: https://github.com/opencontainers/image-spec/pull/333/files#r79975924 [2]: opencontainers#333 (comment) Signed-off-by: W. Trevor King <[email protected]>
Originally proposed by Lei Jitang in 28743f6 (Add some links in config.md, 2016-09-18, opencontainers#301) and not carried by opencontainers#333 [1]. [1]: opencontainers#333 (comment) Signed-off-by: W. Trevor King <[email protected]>
Covering all cases turned up by: $ git grep '\*array' runtime-spec does this pretty consistently, and the first such usage appeared in image-spec with f3d0f78 (config: reformat and add optional/required, 2016-09-20, opencontainers#333). Signed-off-by: W. Trevor King <[email protected]>
Covering all cases turned up by: $ git grep '\*array' runtime-spec does this pretty consistently, and the first such usage appeared in image-spec with f3d0f78 (config: reformat and add optional/required, 2016-09-20, opencontainers#333). And before that, c22ca79 (serialization: docker v1 image format media type, 2016-04-04, opencontainers#6) had landed some: <code>array of strings</code> Signed-off-by: W. Trevor King <[email protected]>
Various markdown, and grammar issues summarized here: opencontainers/image-spec#333 (comment) Thank you to wking and coolljt0725 for the detailed review. Signed-off-by: Brandon Philips <[email protected]>
Originally proposed by Lei Jitang in 28743f6c (Add some links in config.md, 2016-09-18, #301) and not carried by #333 [1]. [1]: opencontainers/image-spec#333 (comment) Signed-off-by: W. Trevor King <[email protected]>
As suggested [1,2] for #333. [1]: https://github.com/opencontainers/image-spec/pull/333/files#r79975924 [2]: opencontainers/image-spec#333 (comment) Signed-off-by: W. Trevor King <[email protected]>
Various markdown, and grammar issues summarized here: opencontainers/image-spec#333 (comment) Thank you to wking and coolljt0725 for the detailed review. Signed-off-by: Brandon Philips <[email protected]>
Originally proposed by Lei Jitang in 28743f6c (Add some links in config.md, 2016-09-18, #301) and not carried by #333 [1]. [1]: opencontainers/image-spec#333 (comment) Signed-off-by: W. Trevor King <[email protected]>
As suggested [1,2] for #333. [1]: https://github.com/opencontainers/image-spec/pull/333/files#r79975924 [2]: opencontainers/image-spec#333 (comment) Signed-off-by: W. Trevor King <[email protected]>
Various markdown, and grammar issues summarized here: opencontainers/image-spec#333 (comment) Thank you to wking and coolljt0725 for the detailed review. Signed-off-by: Brandon Philips <[email protected]>
Originally proposed by Lei Jitang in 28743f6c (Add some links in config.md, 2016-09-18, #301) and not carried by #333 [1]. [1]: opencontainers/image-spec#333 (comment) Signed-off-by: W. Trevor King <[email protected]>
As suggested [1,2] for #333. [1]: https://github.com/opencontainers/image-spec/pull/333/files#r79975924 [2]: opencontainers/image-spec#333 (comment) Signed-off-by: W. Trevor King <[email protected]>
Various markdown, and grammar issues summarized here: opencontainers/image-spec#333 (comment) Thank you to wking and coolljt0725 for the detailed review. Signed-off-by: Brandon Philips <[email protected]>
Originally proposed by Lei Jitang in 28743f6c (Add some links in config.md, 2016-09-18, #301) and not carried by #333 [1]. [1]: opencontainers/image-spec#333 (comment) Signed-off-by: W. Trevor King <[email protected]>
As suggested [1,2] for #333. [1]: https://github.com/opencontainers/image-spec/pull/333/files#r79975924 [2]: opencontainers/image-spec#333 (comment) Signed-off-by: W. Trevor King <[email protected]>
Various markdown, and grammar issues summarized here: opencontainers/image-spec#333 (comment) Thank you to wking and coolljt0725 for the detailed review. Signed-off-by: Brandon Philips <[email protected]>
Originally proposed by Lei Jitang in 28743f6c (Add some links in config.md, 2016-09-18, #301) and not carried by #333 [1]. [1]: opencontainers/image-spec#333 (comment) Signed-off-by: W. Trevor King <[email protected]>
As suggested [1,2] for #333. [1]: https://github.com/opencontainers/image-spec/pull/333/files#r79975924 [2]: opencontainers/image-spec#333 (comment) Signed-off-by: W. Trevor King <[email protected]>
Reformat this file to look more like manifest.md and add
OPTIONAL/REQUIRED tags on all fields.
Fixes #251