Skip to content
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

Implement Windows volume/mount support #13908

Merged
merged 2 commits into from
Apr 26, 2022

Conversation

n1hility
Copy link
Member

@n1hility n1hility commented Apr 18, 2022

Based on WSL2 9p support: remaps windows paths to /mnt/ locations for
both podman and Docker API clients.

For example:

podman run -it -v C:\Users\Jason:/blah ubi8-micro sh

Additionally unixified paths sometimes used by Docker clients are supported

podman run -it -v /c/Users/Jason:/blah ubi8-micro sh

This also works with mount paths:

.\docker run -it --mount 'type=bind,source=C:\Users\Jason,destination=/blah' alpine sh

Finally, windows paths can be used on Linux in the WSL session to enable workflows where users are running process under the native Linux prompt yet accessing data on their Win drives.

This code is only active if either the podman-remote client is windows (in which case there is client side path remapping), or if the podman backend is configured as a WSL machine. The latter is necessary since there are parsing ambiguities (see tests) when interpreting potential win paths. While in practice they are uncommon, ideally existing behavior is preserved and the new code paths are only active where needed.

Resolves #13707

Depends on containers/common#1012

Signed-off-by: Jason T. Greene [email protected]

@n1hility n1hility force-pushed the win-mounts branch 3 times, most recently from 7f393f4 to 3b9e0d2 Compare April 18, 2022 14:18
@n1hility n1hility changed the title Implements Windows volume/mount support Implement Windows volume/mount support Apr 19, 2022
@rhatdan rhatdan changed the title Implement Windows volume/mount support [WIP] Implement Windows volume/mount support Apr 19, 2022
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 19, 2022
@rhatdan
Copy link
Member

rhatdan commented Apr 19, 2022

/approve
LGTM
Need to get changes merged into containers/common first though.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 19, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: n1hility, rhatdan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 19, 2022
@TomSweeneyRedHat
Copy link
Member

LGTM, once c/common is vendored

@n1hility n1hility changed the title [WIP] Implement Windows volume/mount support Implement Windows volume/mount support Apr 22, 2022
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 22, 2022
@n1hility
Copy link
Member Author

@rhatdan @TomSweeneyRedHat @Luap99 Here is the updated PR that drops the config updates and instead uses the marker file like discussed on containers/common#1005. However, this update does touch the libpod networking code. To make it easier to review I broke this off in another commit here: 6a44a43

I also did not update the mac code to use the new marker yet (still using the supported config value), i figured it would be better to follow-up immediately with a small update for that than to shove too much in here. Let me know if you prefer me to add it, and I can include that.

pkg/util/utils.go Outdated Show resolved Hide resolved
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 22, 2022
@Luap99
Copy link
Member

Luap99 commented Apr 22, 2022

/hold PR has merge conflict

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 22, 2022
@Luap99
Copy link
Member

Luap99 commented Apr 22, 2022

Also my other comments see above are not addressed.

pkg/specgenutil/volumes.go Outdated Show resolved Hide resolved
@n1hility
Copy link
Member Author

thanks for the great feedback I will turn this around quickly (and sorry for the missed call - great catch!)

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Apr 22, 2022
@n1hility n1hility changed the title Implement Windows volume/mount support [WIP] Implement Windows volume/mount support Apr 22, 2022
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 22, 2022
@n1hility
Copy link
Member Author

PR Updated to resolve feedback, marker code moved to common here: containers/common#1012

Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

Could you create the podman-machine file for the qemu backend as well since we consider the config file option deprecated.

libpod/networking_linux.go Outdated Show resolved Hide resolved
pkg/specgen/volumes.go Show resolved Hide resolved
@n1hility
Copy link
Member Author

Could you create the podman-machine file for the qemu backend as well since we consider the config file option deprecated.

Sure. I was originally planning to do this in a follow-up PR to keep it easier to review, but will go ahead and throw that in.

@n1hility n1hility force-pushed the win-mounts branch 2 times, most recently from ec69d4a to fcde02f Compare April 25, 2022 18:49
@n1hility n1hility changed the title [WIP] Implement Windows volume/mount support Implement Windows volume/mount support Apr 25, 2022
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 25, 2022
@n1hility
Copy link
Member Author

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 25, 2022
Based on WSL2 9p support: remaps windows paths to /mnt/<drive> locations for
both podman and Docker API clients.

Signed-off-by: Jason T. Greene <[email protected]>
@n1hility
Copy link
Member Author

PR is rebased and updated to latest main of config/common which includes the just merged containers/common#1012

"github.com/pkg/errors"
)

func isHostWinPath(path string) bool {
Copy link
Member

Choose a reason for hiding this comment

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

possible to get unittests on these functions to avoid simple regressions?

Copy link
Member Author

Choose a reason for hiding this comment

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

@baude these are tested via specgenutil_test which I originally had to do for API access reasons. Although, I think those reasons may no longer apply. I can see if I can move them to specgen

Copy link
Member Author

Choose a reason for hiding this comment

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

@baude ah yes, it creates an import cycle that was the other reason they had to be in the other package.

@rhatdan
Copy link
Member

rhatdan commented Apr 26, 2022

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 26, 2022
@openshift-merge-robot openshift-merge-robot merged commit ace6672 into containers:main Apr 26, 2022
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filepath Conversion issue when running podman machine's in WSL2 and volumes/tmpfs
6 participants