-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
WIP Support nfs local volume mounts #2415
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 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 |
docs/podman-volume-create.1.md
Outdated
@@ -39,6 +45,8 @@ $ podman volume create myvol | |||
$ podman volume create | |||
|
|||
$ podman volume create --label foo=bar myvol | |||
|
|||
# podman volume create --opt type=nfs --opt o=addr=192.168.0.2,rw --opt device=:/nfsshare mynfsvol |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be device=:/nfsshare
or device=/nfsshare
(no colon)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both are supported.
@@ -28,7 +28,8 @@ be created at.` | |||
}, | |||
Example: `podman volume create myvol | |||
podman volume create | |||
podman volume create --label foo=bar myvol`, | |||
podman volume create --label foo=bar myvol | |||
podman volume create --opt type=nfs --opt o=addr=192.168.0.2,rw --opt device=:/nfsshare mynfsvol`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been trying to keep these to three examples. Could we kill line 31 and add '--label foo=bar' to line 29?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
libpod/volume.go
Outdated
@@ -15,7 +23,7 @@ type VolumeConfig struct { | |||
// Name of the volume | |||
Name string `json:"name"` | |||
|
|||
Labels map[string]string `json:"labels"` | |||
Labels map[string]string `jsno:"labels"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/jsno/json/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
} | ||
} | ||
return "" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this function live in common instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is only used in volume now.
Couple of nits, otherwise LGTM. |
Oh dear. We're going to need to add a state to volumes to store whether the volume is mounted (and potentially the mountpoint, for volume types without a consistent one?). That means we need to add locks back in, plus some work in the DB to add update/save functions. Also, I really hate just storing all of this in Options... there should be an easy way of saying that a volume is sourced from NFS. |
Why do we need to record this? The system nows. I don't think this should be recorded, if a container starts on a volume that is not mounted it will mount it. |
Post-system restart? After every container using a volume has been removed? I think we need to be able to tell if a volume is mounted. For now, I'm OK with leaving this as a |
Then you are likely to be wrong. Since a user could go in an umount the volume. I am actually thinking about adding a podman volume mount and umount command. |
@mheon @giuseppe @baude @vrothberg PTAL |
LGTM |
Hold this until after we cut 1.1, I don't want to land more volume work in
stable before we rework more of the internals.
…On Sun, Feb 24, 2019, 03:51 Giuseppe Scrivano ***@***.***> wrote:
LGTM
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2415 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHYHCNfAet6-ic6lOOdSTphgHaVbfaAmks5vQlKggaJpZM4bKkXn>
.
|
I disagee on this. This is an open bug and don't believe this needs to affect the libpod database. |
At the very least I want to see a type field in the volume so we can easily determine whether this is a directory-backed volume or NFS-backed - just stuffing this in opts is not a proper solution |
This behaviour matches Docker. These are considered local volumes. And I agree this is not the best solution, but I don't know how we are supposed to fix this unless, we have something hacking in the volumes code that looks for this type of signature and then refers to it as an local-nfs mount or something. If we want to keep the documented behavior of Docker, then we don't want to force the users to execute different CLI. |
We can retain the user interface for volume create, but parse the options before we store them and set a field in the DB telling us what the storage backend is |
☔ The latest upstream changes (presumably #2446) made this pull request unmergeable. Please resolve the merge conflicts. |
@mheon I would like to get this moving again. Any idea what you would like to see changed? |
@mheon Continuing to rebase this one, waiting on you. |
Most of what we need will land today or tomorrow. |
} | ||
mountOpts := options["o"] | ||
device := options["device"] | ||
if options["type"] == "nfs" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be an option. Volume has a "type" field, and that is what we should be using.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correction, I meant Driver
- I think I'd count NFS mounts as a type of volume driver...
Or we should add a type field. Let's not stuff critical information into maps. Make this top-level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add this under the covers, but if we want to follow the Docker CLI, we have to allow users to specify nfs in the manner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, matching their CLI is fine, but let's not let the CLI determine how we set up internal data structures
I am pretty convinced that volume locks need to come back for this. I don't want to have to deal with concurrent mount/unmount operations happening. |
@mheon What do I need to do with this PR Now? |
Largely waiting on the cleanups/reworks in #2774 to land. Unfortunately that one keeps finding other bugs. |
☔ The latest upstream changes (presumably #2774) made this pull request unmergeable. Please resolve the merge conflicts. |
@rhatdan this needs to be rebased but it looks like the PR that you were waiting on is the cause of the rebase. Perhaps we can merge this today? |
@mheon Could you take this one over and now do it the way you envision. |
Sure, I'll take it.
…On Fri, Apr 12, 2019, 08:47 Daniel J Walsh ***@***.***> wrote:
@mheon <https://github.com/mheon> Could you take this one over and now do
it the way you envision.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2415 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHYHCAzprnMwhKjpJd7hQYrRsBz6VezWks5vgIBmgaJpZM4bKkXn>
.
|
Allow users to create volumes with nfs shares. These volumes will get mounted when the first container gets started and then will remain mounted until the system reboots or the volume is removed. Signed-off-by: Daniel J Walsh <[email protected]>
@mheon Any update on this? |
1 similar comment
@mheon Any update on this? |
@mheon ping? |
#3709 is the first step. Once that lands, I can get this in. And then probably volume drivers. And then IPv6. |
☔ The latest upstream changes (presumably #3709) made this pull request unmergeable. Please resolve the merge conflicts. |
Superceded by #3931 |
Allow users to create volumes with nfs shares.
These volumes will get mounted when the first container gets started
and then will remain mounted until the system reboots or the volume is
removed.
Signed-off-by: Daniel J Walsh [email protected]