Proposal: Abstract Volume Driver Proxy to allow for multiple drivers and native external storage management#13924
Proposal: Abstract Volume Driver Proxy to allow for multiple drivers and native external storage management#13924clintkitson wants to merge 1 commit intomoby:masterfrom clintkitson:update_volume_driver
Conversation
|
Thanks for opening this PR @clintonskitson. I agree that those improvements should make the volume extensions much more useful. I don't think we should try to put everything into a single pull request, it will be much harder to review and merge. I think you should check these three PRs out too: |
|
Also I've got a working implementation of a top level volumes API (just the API atm, not CLI). |
|
@cpuguy83 the commit clintkitson@26539cf may be interesting to review as it includes some semantics around extra settings and snapshot management building from your 1.4.1 work. It includes shoehorning in a Go volume manager at the time to get EC2 and other storage platform integration but represents some aspects that may be interesting to include in the API design. But yes, definitely a good conversation can be had around how someone would interact with the additional semantics available. |
|
@calavera and @cpuguy83, would you support the idea that the three items left could represent a PR? I believe the three are inter-related to include the ability for a remote driver to function. Although the abstraction in the first item is critical to allow complete packages to be embedded similar to the graph driver implementations. Any guidance on how you would want to see the three related items submitted would be appreciated. |
|
Changed the scope of the PR to focus only on abstracting volume driver proxy. |
|
I keep going back and forth with this PR and I have a couple concerns/unknowns:
|
|
volume/drivers/drivers.go
Outdated
There was a problem hiding this comment.
this can be initialized when the variable is created in line 43.
|
I just left a couple of minor comments, but it's looking great so far. |
|
I made those small tweaks. |
|
LGTM |
|
Rebased for new merges. |
|
Is there further work that needs to take place on this one? @calavera |
|
As far as I know it only needs a review by another maintainer. /cc @cpuguy83, @tiborvass |
|
@calavera Rebased. |
Signed-off-by: Clinton Kitson <[email protected]> Conflicts: volume/drivers/extpoint.go
|
@cpuguy83 following up on a conversation we had around using the code generator a couple of plugin files.
The abstraction of the drivers, or further implementation towards a driver pattern in certain ways that may overlap with the code generation tool. If leveraging the defined Docker Volume API then this it can be a valid generation tool. But the new driver abstraction can open the door for alternative APIs or vendoring to achieve the same functionality which wouldn't necessarily be code gen'd. |
|
@clintonskitson the purpose of the code generator is to read a defined interface and generate the relevant proxy code that can call out over the plugin API. There should only ever be 1 interface for dealing with drivers as far as the daemon can see. |
There was a problem hiding this comment.
How come we've added this?
Create should serve this purpose.
There was a problem hiding this comment.
Yeah I think you're right here. I believe the only change here would be to update to use the volumedriver versus volume.
There was a problem hiding this comment.
I just noticed that the naming of the test file was outdated as well. Can you elaborate on the initial comment though?
|
@cpuguy83 Re the previous comment around It seems like the |
|
Collective review @cpuguy83 @vbatts @duglin @tonistiigi @abronan @clintonskitson If we're taking a step back, what's the purpose of this refactoring? If it is to allow multiple builtin volume drivers, then it's not clear that is desired at this time, because we already have volume drivers as plugins (although, out-of-process) and you can already have multiple of those for the same container. What's wrong with |
|
Throwing back to design review since it seems like there's some discussion on if we want to make this change. |
|
Yes very valid today as is. The opportunity however is that is the volume driver, if properly abstracted would allow for volume drivers that operate in slightly different ways. For example, today the volume driver represents local capabilities where the volume drivers always need to reside with the Docker engine. For example, a The trajectory of this functionality goes towards allowing this and a vendor'd approach for managing volumes and something that gets closer to something like |
|
@clintonskitson then what you're asking for is for a volume driver to determine whether it is running on the same host as the engine that's making requests. That seems fair to me. /cc @cpuguy83 |
|
Thanks for the response @tiborvass. @cpuguy83, let me know what I can do to assist. |
|
@clintonskitson I haven't been ignoring. I think it makes sense.. however before making changes I'd personally like to see how things with libnetwork/network-overlay shake out in the engine so that we can follow the same kind of model (and discovery mechanisms) for remote drivers (and potentially extract remote/local/other into a single interface). |
|
@clintonskitson, @cpuguy83 I'm going to close this PR. I like how this was looking but I feel like we're not arriving to a good compromise that we all agree on. We're still changing the internals of the volume plugins too much and I don't think it's reasonable to have this PR waiting around until things settle down. Please, feel free to reopen if you think we must move this forward, we could reconsider it. But, I think we should wait to land this change in at least until #16534 is merged. |
The purpose of this PR is to enhance and abstract the Volume Driver Proxy (#13161) implementation to allow for multiple drivers with additional functionality. Thanks @calavera and team. The abstraction will allow further contribution and support the many different types of storage and semantics of how these platforms function with operating systems.
In 1.7, the volume driver proxy provides Docker with methods that allow for local management of storage with a dependency on a Proxy Endpoint localized to the Docker service.
As an example, currently the Mount method would call the Proxy Endpoint to ask for a volume to be mounted to the OS. This operation is, done by the local Proxy Endpoint is, 1) asking a storage platform to attach a volume to the underlying Docker OS 2) asking the underlying Docker OS to mount the new device as a consumable mount point. The second in most cases requires the local OS to facilitate which drives the requirement for the Proxy Endpoint to live localized to Docker. This can depend on the type of storage (Kernel driver based, iSCSI, dm, hypervisor provided (SCSI), NFS, etc).
The initialization process of Graph drivers has been modeled for the volume proxy endpoint abstraction.
This is work in progress, and looking for opinions and discussion.
Updated PluginSpec to as JSON to include multiple fieldsAbstract Volume Driver ProxyTesting