Skip to content

Add documentation for bind mount consistency flags (#31047).#31749

Merged
vdemeester merged 1 commit intomoby:masterfrom
yallop:docs-31047
Mar 22, 2017
Merged

Add documentation for bind mount consistency flags (#31047).#31749
vdemeester merged 1 commit intomoby:masterfrom
yallop:docs-31047

Conversation

@yallop
Copy link
Copy Markdown
Contributor

@yallop yallop commented Mar 10, 2017

Documentation for #31047, following @thaJeztah's recommendations, copied here for convenience:

@yallop yallop changed the title Update the docs for run Add documentation for bind mount consistency flags (#31047). Mar 10, 2017
@cpuguy83
Copy link
Copy Markdown
Member

@yallop I think the service create doc should go in the table just beneath ro/rw options.

@justincormack
Copy link
Copy Markdown
Contributor

cc @thaJeztah

@yallop
Copy link
Copy Markdown
Contributor Author

yallop commented Mar 13, 2017

Thanks, @cpuguy83. I've added an entry to the table.

api/swagger.yaml Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you list valid options here as well?

@thaJeztah
Copy link
Copy Markdown
Member

Left one suggestion. Also, we probably need to add a note that this is (currently) only used on Docker for Mac?

I think it's ok to squash commits here before merging 😸

@yallop yallop force-pushed the docs-31047 branch 4 times, most recently from 6176c6c to 7ebacf7 Compare March 14, 2017 09:38
@andrerom
Copy link
Copy Markdown

andrerom commented Mar 14, 2017

Seems conceptual difference between consistent, delegate and cached is missing here.

Can maybe reuse text from the original gist, slightly adapted here to signal which one is default:

  • consistent: perfect consistency (default, host and container have an identical view of the mount at all times)
  • cached: the host's view is authoritative (permit delays before updates on the host appear in the container)
  • delegated: the container's view is authoritative (permit delays before updates on the container appear in the host)

api/swagger.yaml Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It seems weird to have default. Isn't that just an alias for consistent?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

default is consistent except with the lowest (instead of highest) priority in cases where multiple consistency requirements overlap. In the future, default may be changed to be cached except with the lowest (instead of the second highest) priority in cases where multiple consistency requirements overlap.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Question; if this field is left empty, is that equal to "default"? Wondering if we actually need the literal "default" value

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure what the API semantics are regarding omitted fields but the default mode is present in the --mount long-form CLI so that every mode is representable as an explicit value. At least in that context, having default allows things like scripting consistency=$MODE where the MODE variable can then be set to any of default, delegated, cached, or consistent. Without a representation for every mode, there is not a nice way to set the consistency to default without additional complexity of omitting consistency= sometimes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think overall the API allows omitting values to use the default, which also is "strictly" what default is 😇;

In computer technology, a default (noun, pronounced dee-FAWLT ) is a predesigned value or setting that is used by a computer program when a value or setting is not specified by the program user.

What will the result be if an older client creates a mount? (older clients won't know about this option, so use the old API version, and don't specify this property)

@cpuguy83 wdyt?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It probably doesn't need to be documented other than what the default actually is vs a value of "default".

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What's the deal with the order here? Can it be either alphabetical or default-first? Also this doesn't have default as above.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

default is not in this list because in the short -v form, :default is not very explanatory and simply omitting it is the same. default is in the long --mount form as it is an actual consistency mode that can be selected and may be indicated for maximum explanatory effect.

delegated is the most relaxed and lowest priority (except for default, not present in this form). cached is the next most relaxed and higher priority. consistent is not relaxed and highest priority.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same comments as above

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ordering again, and questions about default. Also, this is a great time to explain what each of them means. I'd put them into a <ul>.

Copy link
Copy Markdown
Contributor Author

@yallop yallop Mar 20, 2017

Choose a reason for hiding this comment

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

Thanks for the review, @mstanleyjones. I've added a <ul> explaining the modes, based on @andrerom's suggestion (c06c6bc).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You can remove this line now.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As above.

Signed-off-by: Jeremy Yallop <yallop@docker.com>
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah
Copy link
Copy Markdown
Member

Seen this fail a couple of times, possibly flaky test

12:55:59 ----------------------------------------------------------------------
12:55:59 FAIL: docker_cli_push_test.go:607: DockerRegistryAuthTokenSuite.TestPushMisconfiguredTokenServiceResponseError
12:55:59 
12:55:59 docker_cli_push_test.go:615:
12:55:59     c.Assert(out, checker.Contains, "Retrying")
12:55:59 ... obtained string = "" +
12:55:59 ...     "The push refers to a repository [127.0.0.1:5000/busybox]\n" +
12:55:59 ...     "5f70bf18a086: Preparing\n" +
12:55:59 ...     "9508eff2c687: Preparing\n" +
12:55:59 ...     "toomanyrequests: out of tokens\n"
12:55:59 ... substring string = "Retrying"
12:55:59 
12:55:59 
12:55:59 ----------------------------------------------------------------------

@vdemeester vdemeester merged commit 9439402 into moby:master Mar 22, 2017
@yallop yallop deleted the docs-31047 branch March 22, 2017 09:52
thaJeztah pushed a commit to thaJeztah/docker that referenced this pull request Apr 3, 2017
Add documentation for bind mount consistency flags (moby#31047).
(cherry picked from commit 9439402)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants