Flags for specifying bind mount consistency#31047
Conversation
|
Can we add these flags to |
|
@AkihiroSuda: a1649ef |
|
Design LGTM |
api/types/mount/mount.go
Outdated
There was a problem hiding this comment.
I wonder if State is the right term here.
Would something like Consistency work?
There was a problem hiding this comment.
Yes, State is a bit general. Consistency sounds good.
There was a problem hiding this comment.
bump, now that this PR is in code review
|
While I definitely appreciate the goal of making osxfs faster (directly affects me!) this does not seem right. Additionally it seems like we're pushing osxfs performance issues to the user to deal with. |
Improving performance on Docker for Mac is an immediate goal of this introducing this feature now, but there's nothing specific to osxfs in the design. We're allowing the user to describe the consistency requirements of the mount, because that's information that only the user has, and because Docker can make use of that information to improve performance. The interface currently has no way to enable caching because it's been designed with the Linux implementation in mind. If we want Docker to perform well on other systems then we need to adapt the interface so that it's less Linux-specific.
We can certainly hope that people start to use the feature. If we see |
|
I just retriggered the experimental rebuild, we were having some issues, I don't think it was triggered as the label was not automatically removed. |
|
There's not a lot of activity on this issue, perhaps because it's not clear to the casual reader how critical this patch is to the success of Docker on macOS. Here's an account posted on Reddit yesterday of how one company gave up on Docker:
This PR allows us to address the company's major concern. And this is far from an isolated case; it would be easy to give many more such examples. |
|
@yallop I get it, I really do... but again this is not doing anything but changing the API. Docker is not consuming it any way. Major red flag here. Why not at least provide a switch to change the default behavior in d4mac preferences? This could be done either globally or per share. |
|
I applaud the general effort to improve shared folder performance in Docker for Mac but I share @cpuguy83's concerns that this is adding something to the Docker API which does not get used by the Docker daemon at all. Why would this not be added as a configurable setting in Docker for Mac? It seems to be very Docker for Mac specific. The Docker daemon is designed to run on Linux and Windows, but this adds a parameter which will be ignored by both. |
|
@nathanleclaire while Docker for Mac is the first use case for these semantics, they are applicable to Infinit, Docker for Windows, volume plugins, and potentially Docker on Linux with a future extension point ( |
api/types/mount/mount.go
Outdated
There was a problem hiding this comment.
synchronous seem to refer more to the mechanism used to accomplish the consistency.
Where as consistent refers to the desired "state".
I prefer consistent here.
api/types/mount/mount.go
Outdated
There was a problem hiding this comment.
Change State here to Consistency
|
Just for the record, I was wooed and am ok with this change. |
|
@cpuguy83 we're open to changing the name of the field and the names of the modes. We initially selected
The cases considered look like:
I think you are proposing to change I don't think
Renaming
We also believe that the terms used should be the same between
Ultimately, this all comes down to various comprehensibility and ease-of-use trade-offs in the design space. We think that the current names are the best of those we considered during design (e.g. What issues do you foresee with the current set of names? |
|
I think |
volume/volume_unix.go
Outdated
There was a problem hiding this comment.
Can we use the API types here rather than redefining the strings?
Also needs a squash. |
|
I've opened a separate in-progress PR for documentation, following @justincormack's suggestion, so as not to delay the merge here: #31749. |
|
As the freeze for 17.04 is Monday, splitting doesn't help much, as we need
docs if we are going to ship it.
…On 10 Mar 2017 22:49, "yallop" ***@***.***> wrote:
I've opened a separate in-progress PR for documentation, following
@justincormack <https://github.com/justincormack>'s suggestion, so as not
to delay the merge here: #31749
<#31749>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#31047 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAdcPMfTP7GAYz-ixeWoyaXfcAquGKu1ks5rkdOHgaJpZM4MB5U4>
.
|
|
I've pushed docs to #31749. |
|
Thanks for doing the docs PR; let's go ahead and merge this |
|
This seems to be missing CLI docs. @thaJeztah PTAL |
|
@mstanleyjones see #31749 |
|
Wow! Thanks. |
Add documentation for bind mount consistency flags (#31047).
Add documentation for bind mount consistency flags (moby#31047). (cherry picked from commit 9439402) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
|
Just wanted to thank the Moby team for integrating those changes. 👍 |
| Source string `json:",omitempty"` | ||
| Target string `json:",omitempty"` | ||
| ReadOnly bool `json:",omitempty"` | ||
| Consistency Consistency `json:",omitempty"` |
There was a problem hiding this comment.
Any reason this didn't land on BindOptions? This seems to only apply to bind mounts.
Adds the `docker_consistency` option, which sets the Docker volume consistency level. This can be used to greatly improved synced folder performance, especially on macOS. See for details: moby/moby#31047
Adds the `docker_consistency` option, which sets the Docker volume consistency level. This can be used to greatly improved synced folder performance, especially on macOS. See for details: moby/moby#31047
This PR introduces a small change to the Docker CLI as part of a larger project to address some longstanding file sharing performance on Docker for Mac ([1], [2]).
The poor performance of bind mounts in Docker for Mac for some applications arises from osxfs ensuring perfectly consistent views of bind mounts between container and host: reads, writes and events from within a container are propagated synchronously to the host, and vice versa.
Perfect consistency is the right default, but for some workloads where it's unnecessary it puts a low ceiling on performance. To improve performance for such workloads, we plan to allow the user to relax consistency guarantees for individual bind-mounted directories.
The full details of the proposal are available here. This patch includes one small piece of the work, namely additional bind options
cached,delegated,consistent, for selecting consistency modes. Although the immediate aim is improvingosxfsperformance, these options are not macOS-specific; they give a general view of consistency that applies to many systems, both for bind mounts and volume plugins. For example,delegatedandcached.)