-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
Proposal: Volume refactor and external volume plugins #13161
Conversation
ec01577
to
bb3a596
Compare
ecda39d
to
12941e1
Compare
feb89cf
to
ba707d2
Compare
fc77555
to
fd0966a
Compare
Path(name string) (mountpoint string, err error) | ||
Mount(name string) (mountpoint string, err error) | ||
Unmount(name string) (err error) | ||
} |
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.
considering storage drivers may do more then just provide a device, share or mount point, what about optional attributes that the driver may want like, performance requirements, failure domains, protection requirements like snapshots etc.?
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.
But you talking about driver options itself, which should be handled on driver run, which isn't docker task.
06d621a
to
d0494ef
Compare
Would it make sense to extend the Create function to take in a set of opaque labels to be interpreted by the VolumeDriver. This would allow storage attributes (such as those mentioned by @wallnerryan) to be associated with the volume. Create(name string, labels map[string]string) (err error) |
logDriver logger.Logger | ||
logCopier *logger.Copier | ||
|
||
MountPoints map[string]*MountPoint |
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.
Why is this public?
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.
Oh, I see, this for restoring, right?
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 think it doesn't need to be exported, I'll double check.
b6c31d0
to
ec6019e
Compare
@calavera e.g. requesting a volume of a specific size, minimum IOPS, etc. |
@calavera the volume driver needs some context to configure perf and data mgmt (ex: snapshots) of the volumes. Having this information will help the driver make appropriate volume placements decisions to meet the SLOs. ex: choosing between ssd/sas/sata tiers for volume placement. |
Brace yourself: rebase is coming. |
@calavera +1 to @cpuguy83 & @nagendersoma. drivers may themselves understand these options differently, thus being able to pass this context allows the driver to make the decision during provision/request time for a volume. |
9794e17
to
8079948
Compare
@icecrime Add a section in |
LGTM |
As seen with @moxiegirl: docs content is there but needs to be properly "linked" from some experimental land page: we'll deal with this in a followup PR. |
#BOOM |
Proposal: Volume refactor and external volume plugins
I am looking for documentation as it may be addressed somewhere. The issue of garbage collection i.e. as how storage is cleaned up in situations of errors and if such thing is required? |
@vaibhavkhanduja If yours is a general question, you should ask it in the Google Group or on IRC. You'll find information on how to get help with questions here: https://docs.docker.com/project/get-help/ This page in the documentation mentions garbage collection as it applies to volumes: https://docs.docker.com/userguide/dockervolumes/#data-volumes |
@moxiegirl .. my question is not a general ... in situations of failure or crashes are their any constructs to reclaim allocated storage? or it is responsibility of the volume driver to take care of gc? |
@vaibhavkhanduja, yes, for now, it's responsibility of the volume driver, but we're open to suggestions. |
Volume driver seems to be the best place to implement this but I am wondering as how would it come to know state of the container? The volume api create seems to be passing just a name
this is suppose is not the docker container name considering there could be multiple volumes hooked into a container. Please correct me if I am wrong here? Traditionally each mount point or file-system is associated with a unique number/entity name etc. The driver map of container run id and volume names could help in identifying which ones to be removed. Or a callback from docker to initiate GC or reclaim space when the container is removed (not stopped). |
@vaibhavkhanduja volume drivers get events for Create, Mount, Unmount, and Remove for each container that is using a given volume. |
@cpuguy83 not clear, can you elaborate more on the name? If I have a docker container with uuid how would know volumes associated with it? Does create volume api is called in context of a container passing id of the container? BTW I am talking about a GC, failure scenario .. |
@vaibhavkhanduja Please ask questions in docker-dev ML or #docker-dev on IRC, will be happy to address there. |
Extend the volume backend to accept configurations from an external process, aka plugin. It uses a pseudo rpc to get information from the plugin. Plugin discovery is performed by scanning the
/usr/share/docker/plugins
directory, looking for either a socket named like the volume driver specified or a file that contains the uri to the connection point.This PR also includes a slim version of #13025 and crosbymichael#36.
TODO: