Skip to content

Windows: [TP4] Add volume support#16433

Merged
tiborvass merged 1 commit intomoby:masterfrom
microsoft:10662-volumes5
Oct 23, 2015
Merged

Windows: [TP4] Add volume support#16433
tiborvass merged 1 commit intomoby:masterfrom
microsoft:10662-volumes5

Conversation

@lowenna
Copy link
Copy Markdown
Member

@lowenna lowenna commented Sep 20, 2015

Signed-off-by: John Howard jhoward@microsoft.com

This PR adds volume support to Windows.

There are a HUGE number of moving pieces of code in this PR which makes rebasing it a true nightmare. Hence, getting it merged soon so I can continue to do more work/finish off in this area for TP4 would be GREATLY appreciated! @cpuguy83 @cavalera @jfrazelle @icecrime

To verify for yourselves, this will need a very recent TP4 build. It will not work on TP3 as mapped directory support is not in the platform.

VOLUME in the builder works, but only if there is no content pre-existing in the directory. There is a FIXME comment for post TP4 in create_windows.go for this as it will require platform support.

@lowenna
Copy link
Copy Markdown
Member Author

lowenna commented Sep 20, 2015

volumepr1
volumepr2
volumepr3

@lowenna lowenna force-pushed the 10662-volumes5 branch 2 times, most recently from ba5267f to 48c360f Compare September 20, 2015 02:57
@lowenna
Copy link
Copy Markdown
Member Author

lowenna commented Sep 20, 2015

One more - shows docker inspect showing the mount correctly.

volumepr4

@lowenna lowenna force-pushed the 10662-volumes5 branch 24 times, most recently from 0d57736 to bccdca3 Compare September 20, 2015 05:04
@tiborvass
Copy link
Copy Markdown
Contributor

I don't have any concerns other than I want to understand what's going on.
Will finish reviewing tonight.
On Thu, Oct 15, 2015 at 4:43 PM David Calavera notifications@github.com
wrote:

Okay, I think we should move this forward, but I know @tiborvass
https://github.com/tiborvass has some concerns. I don't think we can do
much about the server side vs client side validation.

@jhowardmsft https://github.com/jhowardmsft do we need to modify any
documentation that talks about volumes to say that windows also supports
volumes now?


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

@lowenna
Copy link
Copy Markdown
Member Author

lowenna commented Oct 16, 2015

@tiborvass Anything else found?

@lowenna
Copy link
Copy Markdown
Member Author

lowenna commented Oct 19, 2015

ping @tiborvass @cpuguy83 @calavera

With one LGTM, AFAI can tell, there are two things outstanding on this. One: Tibor/Brian/David agreeing on a name should it require revising for -this- PR (it can be changed in a subsequent one as it's not going to hit 1.9 anyway). The name decision has been outstanding since Thursday and has stalled. Second, @tiborvass finishing his review.

Can I get a status update as to where we are. What else do I need to do? This is a critical TP4 PR, for all parties involved - docker inc have indicated on multiple occasions now that this is one of the most highly requested features for docker on Windows. From a Microsoft perspective, this is necessary to support multiple TP4 scenarios.

@lowenna
Copy link
Copy Markdown
Member Author

lowenna commented Oct 20, 2015

@tiborvass Updated following our IRC conversation yesterday so that a volume with a mode, eg /foo:rw (Unix) or c:\foo:rw (Windows) fails. [This was left over incorrectly from the split of the combined device and volume parsing on the client side]

@lowenna
Copy link
Copy Markdown
Member Author

lowenna commented Oct 20, 2015

Ugh, go-lint caught me out. Updated.

@lowenna
Copy link
Copy Markdown
Member Author

lowenna commented Oct 21, 2015

Phew!!!!!!! OK, so added a second commit based on Tibor's most excellent work. Still running integration cli locally to verify, but believe it should pass (it did yesterday, shouldn't have changed). What is now fixed from the commit I pointed you guys at yesterday is the rejigging of unit tests, which do pass locally on both Windows and Linux.

So, gone is the extra field in Config. Yay!

@calavera @tiborvass @cpuguy83 PTAL, and if looks good, I'll squash the commits. Keeping them as two for now to make your review easier.

@lowenna
Copy link
Copy Markdown
Member Author

lowenna commented Oct 21, 2015

Rebased, but squashed the commits. You can see the config struct parameter removal change independently at https://github.com/microsoft/docker/tree/jjh/tiborupdate

@calavera
Copy link
Copy Markdown
Contributor

LGTM

@lowenna
Copy link
Copy Markdown
Member Author

lowenna commented Oct 22, 2015

@calavera You're not supposed to say that - I had tomorrow blocked off to address comments on this. What am I going to do instead lol! ;)

@thaJeztah
Copy link
Copy Markdown
Member

LOL

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.

shouldn't these whole block go into volume/volume_test.go?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Looking. I seem to recall there was a good reason for putting it here, but will verify this morning.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

You were right. Not sure why I thought it had to go here. Moved. Will be in the next push.

@cpuguy83
Copy link
Copy Markdown
Member

An invalid -v bind is yielding an error: Invalid bind mount spec "/foo:/bar:baz": volumeinvalidmode: invalid mode for volumes-from: baz

Looks like the volumeinvalidmode bit is incorrect.

@cpuguy83
Copy link
Copy Markdown
Member

Seems there are two similar errcodes:

    // ErrorCodeVolumeInvalidMode is generated when we the mode of a volume
    // mount is invalid.
    ErrorCodeVolumeInvalidMode = errcode.Register(errGroup, errcode.ErrorDescriptor{
        Value:          "VOLUMEINVALIDMODE",
        Message:        "invalid mode for volumes-from: %s",
        Description:    "An invalid 'mode' was specified in the mount request",
        HTTPStatusCode: http.StatusInternalServerError,
    })
    // ErrorCodeVolumeMode is generated when 'mode' for a volume
    // isn't a valid.
    ErrorCodeVolumeMode = errcode.Register(errGroup, errcode.ErrorDescriptor{
        Value:          "VOLUMEMODE",
        Message:        "invalid mode for volumes-from: %s",
        Description:    "An invalid 'mode' path was specified in the mount request",
        HTTPStatusCode: http.StatusInternalServerError,
    })

Neither seem to have the correct message, one can probably be eliminated, not sure....

@lowenna
Copy link
Copy Markdown
Member Author

lowenna commented Oct 22, 2015

Interesting. I don't recall changing that, but maybe I did. Should be an easy fix.

@lowenna
Copy link
Copy Markdown
Member Author

lowenna commented Oct 22, 2015

Duplicate/Incorrect error fix will be in the next push.

@lowenna
Copy link
Copy Markdown
Member Author

lowenna commented Oct 22, 2015

@cpuguy83 Pushed updates for error codes and moving unit tests out of ext_endpoint. Looking at the name normalise. Might ping you on IRC...

Signed-off-by: John Howard <jhoward@microsoft.com>
@lowenna
Copy link
Copy Markdown
Member Author

lowenna commented Oct 23, 2015

@tiborvass - Looks like all the comments are resolved, and I don't think there's anything left outstanding now from @cpuguy83 and @calavera. Yay! 👍

Is there anything else from your perspective left to change, or are we ready (post 1.9 rc2) to move this to a merge status?

Thanks!!!

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.

@jhowardmsft we accept only American English

@tiborvass
Copy link
Copy Markdown
Contributor

LGTM, minor nit about error message on the client, but can be dealt with separately, given the time, effort and impact this PR has.

@tiborvass
Copy link
Copy Markdown
Contributor

Merging since docs will be dealt separately as tracked in #15597

@thaJeztah
Copy link
Copy Markdown
Member

\o/

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