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: Docker Storage API #11090
Comments
I like this proposal, +1 |
For reference; another proposal was also created recently; Proposal: Storage Interfaces for Docker #11020 |
Also, @hoskeri could you change the title and have it start with "Proposal: "? |
I feel like this is covering a couple of things, 1) volume management, 2) enhanced volume functionality. Please see #8363 and the subsequent #8484 implementing volume management. On the enhanced volume functionality, I feel like adding complexity to Docker and making it a data management platform is not the right way to go... what we can do is provide a standard API that calls out to other tools when a volume is requested. |
@thaJeztah Done! |
@cpuguy83 - The CLI in proposal #8363 looks reasonable and we can have the API mirror those.
With the above two, the modified volume create CLI could look like this: The API proposed addresses these additional areas as well.
Without a way for docker to manage relationship between volumes and providers, docker will not be able to use multiple storage providers and allow the volumes to be shared between docker hosts. |
From a UX perspective, here are some proposals for being able to specify a driver/options when creating volumes; #9803, #9250 (and others #7249 (comment)). (IMO, it's time to collect all those proposals and have a design, both from a UX and technical perspective) |
@thaJeztah - Thanks for the references. So, essentially with the remote volumes, docker will be mainly connecting to existing volumes (so 'docker volume create' is more like attach or mount).
|
It's not clear to me how these are really to work in an orchestrated system. Suppose, as per your example, I get DataVolume for my database-master. Then that node dies - how do I get my data back? |
@thockin - The way this would work is docker (or any other orchestration layer) will store the reference to the volume (volumeID) and provider details in its configuration. If the volume was attached to any container(s), volumeID will also be referenced (along with details such as mount point or dev path) by the container's configuration. All of this can be achieved if we use the same common interface to manage shared volumes:
So if a host crashes, the container can be restarted on another host if that host has access to the docker configuration (# 3 above). It can then look up the container configuration (# 2 above) using container ID, lookup, attach all its volume and then restart/resume the container. |
Hi, @hoskeri I am very interested in your proposal, is there any work have started, or perhaps we can discuss, even work together. |
@ahanwadi I'm a concrete sort of guy - can we bring this down to examples of possible implementation strategies? Where does a user who is running a container ask for "I want 10 GB of HA read-write block storage with at least 500 IOPs"? Now, once that container is running imagine the machine hosting it dies. How does a user ask for "I want THE SAME storage I was using before" ? |
@ahanwadi So my thoughts here are this: A volume is necessarily a filesystem that is either actually part of the host's fs, or has been mounted as an fs to the host. So, using the host path of the volume as the API, we can create an extension system that is simple to implement but powerful to use. docker run -v /foo busybox
docker run -v /foo:/bar busybox In the first command, we are requesting a volume for the container with no specific host path, which would be (and is indeed today presented to the volume subsystem) as an empty string. In the 2nd command we explicitly requested In both cases this would be sent to an extension, along with the container ID, to deal with (or ignore). The extension would return either return exactly what it got or even a modified path. If ignored Docker would handle it as it does today. This, by the way, is already a working POC. While data must be addressable beyond the life of any single container, data is for and created by a container. |
@LaynePeng We are playing with some code to get an implementation going. One of the other goals of this issue is document the requirements a storage system has from a container orchestrator/implementor, and also to get some feedback on what the docker folks feel the interaction should look like. |
@hoskeri thanks for your quickly reply. Is there any codes we can acces currently? You know, I like this proposal, but just one suggestion: Docker core is tend to become focus and lean, is it more reasonable to consider this as "add addition facility to a container", then put this enhancement to the docker/compose project? Then in docker core project, we can remain use "-v" to mount the fs or block device to a container. |
Hi @hoskeri I also liked the proposal. +1 @cpuguy83 since you already had a working on POC https://github.com/cpuguy83/docker/blob/volume_drivers/volumes/volumedriver/host/driver.go Do you plan to bring a some consolidated proposal from #11090, #11020 and UX proposals ? |
@cpuguy83 I understand your concern about docker having to provision block storage. |
@cpuguy83 Maybe, I am trying to understand your suggestion about using container ID in the extension to lookup container specific configuration. The container ID won't be known to the extension(s) in advance; so how can they lookup container specific volume(s)? This is similar to the issue that we are having for networking. The netns is based on container ID and hence there is no way to configure netns before hand for a container. Many (including us) ended up having to use pipework to get around that.
|
We already have a storage API with a plugin system. Closing this as fixed. |
Docker Storage API - Proposal
Motivation
storage volumes from within docker.
Volumes as a first class object in Docker.
We achieve these goals by promoting Volumes and Storage as
first class entities in docker on the same level as containers.
This would also allow containers to describe the volumes they must be
attached and store the container configuration in a way that permits the
creation of Highly available containers.
Another feature would be the ability to discover capabilities of various
storage backends and automatically provision and configure storage volume
based on QoS specs for containers.
Use Case Example.
Lets take the example of a common pattern for multi-tiered database application.
Such an application may consist of one or more database servers, a number of
application processes, HTTP servers, caching servers, load balancers, management, etc.
The deployment of such an application imposes different levels of performance,
availability and reliability requirements. It is useful to be able to specify
what each volume and each container type needs, and for the available storage
to be matched and provisioned automatically.
Thus user facing terms like 'high', 'low' can be translated by docker and/or volume
drivers to concrete metrics such as IOPS, etc.
Examples of such containers and their storage needs:
Design Overview.
We create a new type of driver interface called the 'storagedriver'.
Just like the existing 'graphdriver' and 'execdriver' interfaces,
this will allow the existence of multiple implementations of
the interface - referred to below as 'drivers'.
The central new entity introduced by this interface is called the
'Volume'. Each driver allows the creation, manipulation and destruction
of these volumes.
'Volumes' are meant to supersede and formalize the existing concept of
data volumes. They can also be used to represent individual layers in a
container. Thus any snapshot capability offered by the storage can be used
to implement the layering of filesystems needs for docker to work.
We also create definitions of service levels and performance criteria
that can serve as input to the storage drivers to manage their resources.
Interface/API definitions.
Future work.
The text was updated successfully, but these errors were encountered: