Skip to content

Add volume drivers#12862

Closed
cpuguy83 wants to merge 1 commit intomoby:masterfrom
cpuguy83:volume_drivers
Closed

Add volume drivers#12862
cpuguy83 wants to merge 1 commit intomoby:masterfrom
cpuguy83:volume_drivers

Conversation

@cpuguy83
Copy link
Member

Stop using vfs graphrdriver for volumes.
Create new driver interface for volumes which implements what we need for vfs and binds ("vfs" and "host" drivers).

This implements just the things we need in the drivers to get current functionality with volume drivers.
Future improvements would include:

  • passing options to driver init
  • passing options to volume init (e.g. docker run -v /foo:rw,opt1=bar,opt2)
  • new driver to be used for communicating with (future) plugin system

Also potential new drivers that could be built in:

  • fuse driver for remote volumes
  • fuse driver for better handling of bind-mount uid/gids
  • ???

Some implementation details

Volume drivers are pretty dumb in general and really enforces the concept of the system (or use in the case of the host driver) requesting a volume some place to store data to be placed at some host path which later gets bind-mounted into the container.

The volume repo object manages (as it already does today) ref counting and generating paths to be used for volumes, then just passes the generated path to the volume driver with the expectation that the volume driver just creates the volume at the given path.
Partly this is to keep the implementation of new volume drivers pretty small, but also to help ensure that the "host" driver (aka bind mounts) can itself be implemented as a volume driver.

Signed-off-by: Brian Goff <[email protected]>
@calavera
Copy link
Contributor

/cc @crosbymichael that's doing some volumes stuff these days

@thaJeztah
Copy link
Member

There have been various proposals for changes in volumes (will take some time to find them all), I suggest collecting those issues / proposals to see if the discussions on them contain additional requirements / ideas that need to be considered.

I don't think all features have to be implemented, just looking at them to see if the general design needs fine-tuning to allow future expansion.

@cpuguy83
Copy link
Member Author

@thaJeztah like #6496 ?

@thaJeztah
Copy link
Member

@cpuguy83 I think there are some others that are not on that list, e.g. #9250, #7249

On summarised some of them in this comment; #7249 (comment)

I'm not sure how relevant those are at this point, just that it would be good to delve through them :)

edit:
Might be some others, but haven't looked closely; https://github.com/docker/docker/issues?page=1&q=volumes+in%3Atitle+is%3Aissue+is%3Aopen

@cpuguy83
Copy link
Member Author

@thaJeztah Thanks. All these are handled by adding a volume driver, and also included in potential enhancements in the PR comment.

Copy link
Member

Choose a reason for hiding this comment

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

Was browsing through the code; does getDriverNameFromPath() actually return an empty string? Perhaps the logic to use "vfs" should be moved to that function, i.e., make passing an empty string to getDriverNameFromPath() to return "vfs"

Copy link
Member Author

Choose a reason for hiding this comment

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

Even if it doesn't return an empty string, I still prefer to check because it is technically possible as the only contract is that the function returns a string and a string can be empty.

@SvenDowideit
Copy link
Contributor

yup, my quick reading of the code makes me think #9250 can be implemented with this +1

@LK4D4
Copy link
Contributor

LK4D4 commented May 12, 2015

ping @cpuguy83 @calavera
What we decided here?

@cpuguy83
Copy link
Member Author

Closing this sense the #13161 was merged.

@cpuguy83 cpuguy83 closed this May 24, 2015
@cpuguy83 cpuguy83 deleted the volume_drivers branch September 20, 2017 16:56
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.

6 participants