Remove error return on !exists in validateMountConfigReg#35159
Remove error return on !exists in validateMountConfigReg#35159cdhunt wants to merge 1 commit intomoby:masterfrom
Conversation
|
I seem to recall auto-creation was only kept around on Linux for backward compatibility (it was deprecated for a long time, but was too much of a breaking change to remove), however, on Windows it never worked, and because of that (at least at the time) it was decided to not enable it. Some background in #19953, #21666, #16349 /cc @cpuguy83 |
|
Thanks, @thaJeztah. I think I concur with a lot of the sentiment in #21666 (for both sides). Specifically, we're trying to avoid interacting with the host directly and only use the Docker API. I'm pretty sure the GitLab CI Runner is already largely dependent on this feature for Linux hosts. I have validated the create logic does work on Server 2016 build |
|
It seems like this behavior is here to stay on the Linux side (for good/for bad/for otherwise) for me parity across platforms is a really valuable principal especially as we roll out LCOW. The original PR (Moby: 19953) on listed the motivation for the change as "it is not reasonable.in fact,we can skip non-existant volume host path and remove "MkdirAll" from Setup.". Which doesn't give me much to go on as to why auto-creation is the wrong policy. It seems this also tied into a change was made in runC (runc: 493). I can see a very reasonable position that runC fail in this case vs auto creation but that Docker or even ContainerD could support the auto creation of the directory as a management policy in effect. All that to say without an good reason to depart from parity with Linux I would be in favor of accepting this (or a similar) change. cc: @jhowardmsft @darrenstahlmsft |
|
I agree parity would be good here so long as it works. |
|
pinging myself |
|
We discussed this in the maintainers meeting, and we're okay with lifting this restriction for Windows ping @cdhunt can you update the PR (remove the commented-out code), so that we can move this forward? |
|
Please sign your commits following these rules: $ git clone -b "master" [email protected]:cdhunt/moby.git somewhere
$ cd somewhere
$ git rebase -i HEAD~842353698296
editor opens
change each 'pick' to 'edit'
save the file and quit
$ git commit --amend -s --no-edit
$ git rebase --continue # and repeat the amend for each commit
$ git push -fAmending updates the existing PR. You DO NOT need to open a new one. |
volume/volume_test.go
Outdated
There was a problem hiding this comment.
Do we have a "positive" test for this? (i.e. this test-case should now pass, correct?)
There was a problem hiding this comment.
Code wise, there's nothing new to test. The coverage is the same either way. I did change the functional test to validate no error is thrown. Do you still think we should include the positive tests?
There was a problem hiding this comment.
Well, we previously tested that this should fail, but I couldn't find a test in the Windows valid list that now verifies that the test passes with a non-existing path (but I may have overlooked)
There was a problem hiding this comment.
I've added valid tests for Windows and LCOW.
|
Sorry, trying to catch up with my backlog. I guess my only concern with this is that docker users can now arbitrarily create folders on the host through the docker API which they can't necessarily clean up. Is that not a concern? |
|
This is pretty consistent with linux. |
Correct; it's not ideal, but it's what a lot of people use. We are recommending the
Can they be removed from a privileged/elevated session? @cdhunt looks like this needs a rebase; also looks like there's a commit that isn't signed off |
|
@thaJeztah I've rebased and it looks like all commits are signed. |
@cpuguy83 Right, but that wasn't what I was asking. I was asking if it's the right thing to be doing. |
|
@cdhunt Can you squash your commits? |
|
@cpuguy83 Could you provide some guidance for that? When I try to squash 2 commits I end up with thousands of changes. I'm struggling to tame my messy branch history. |
|
|
|
There's some information about squashing here as well; https://docs.docker.com/v17.06/opensource/workflow/work-issue/#pull-and-rebase-frequently |
Codecov Report
@@ Coverage Diff @@
## master #35159 +/- ##
==========================================
- Coverage 35.85% 35.61% -0.24%
==========================================
Files 606 611 +5
Lines 44704 44960 +256
==========================================
- Hits 16027 16014 -13
- Misses 26469 26733 +264
- Partials 2208 2213 +5 |
|
@cdhunt thanks for squashing! Looks like there's two failures; looks related to this change; |
On Linux, volume binding creates the directory on the host. This conditional check on Windows was preventing Windows Containers from creating the directory producing inconsistent behavior between platforms. Signed-off-by: Chris Hunt <[email protected]>
|
@thaJeztah Sorry about that. |
|
no worries! Just noted that it was failing (github likely won't send a notification if that's happening). Looks like one was fixed, but one is still failing; one down; one to go! 🎉 |
|
@thaJeztah Can you point me to that result? Or maybe more specifically the test automation. I'm pretty sure this is coming from the LCOW side and I'm not sure exactly how to run those tests. |
CI in this repository currently doesn't run on Windows RS3 and up (so doesn't run LCOW), so likely not related to LCOW (perhaps there's a test-case that shouldn't be run on Linux though) You can click the links next to the failing CI runs;
Windows RS1 actually showed a panic in |
|
Any news regarding this topic? |
|
@cdhunt were you still working on the test failures? |
|
@thaJeztah No, I'm not set up to develop and test the affected variations. Thank you for your help over the last 13 months. |
|
No worries, thanks @cdhunt ! I'll have a look around as well if there's possibly someone that has time to carry this PR |
|
@simonferquel @silvin-lubecki - perhaps of interest to you? |
|
This is interesting to me. If I was to get the PR in a mergeable state would it be accepted? |
|
@fastloris yes, definitely. I think the PR was almost done, but there were some complications to get the tests working correctly; if you're interested in carrying this, that would be appreciated 👍 |
|
Feel free to "ping" me if you need help (e.g. to restore/copy the branch in this PR; you can download the patch if needed using this URL; https://patch-diff.githubusercontent.com/raw/moby/moby/pull/35159.patch |
|
I've picked this up and opened a new PR #38465 I have questions about that original fix though to help me fix that failing tests! |
We found while developing Docker Executor for Windows support for GitLab CI that the CI Runner code takes advantage of the docker daemon behavior to create directories on the host when mounting volumes. With Windows Containers, this throws an error, however, the logic to create the missing directory is platform agnostic.
- What I did
Removed the hard check if the directory exists on the host in mount config validation.
- How I did it
Changed the condition logic.
- How to verify it
Mount a volume to a directory that does not exist on the host. It should be created and not throw an error.
- Description for the changelog
Fix the inconsistent behavior between Linux and Windows containers when mounting to a directory that does not already exist.