[openstack-dev] [Heat] Plugin to use Docker containers a resources in a template

Sam Alba sam.alba at gmail.com
Fri Oct 18 03:48:59 UTC 2013


On Thu, Oct 17, 2013 at 6:33 PM, Russell Bryant <rbryant at redhat.com> wrote:
> On 10/17/2013 09:06 PM, Sam Alba wrote:
>> Hi all,
>>
>> I've been recently working on a Docker plugin for Heat that makes it
>> possible to use Docker containers as resources.
>>
>> I've just opened the repository:
>> https://github.com/dotcloud/openstack-heat-docker
>>
>> It's now possible to do that via Nova (since there is now a Docker
>> driver for it). But the idea here is not to replace the Nova driver
>> with this Heat plugin, the idea is just to propose a different path.
>>
>> Basically, Docker itself has a Rest API[1] with all features needed to
>> deploy and manage containers, the Nova driver uses this API. However
>> having the Nova API in front of it makes it hard to bring all Docker
>> features to the user, basically everything has to fit into the Nova
>> API. For instance, docker commit/push are mapped to nova snapshots,
>> etc... And a lot of Docker features are not available yet; I admit
>> that some of them will be hard to support (docker Env variables,
>> Volumes, etc... how should they fit in Nova?).
>
> But we haven't talked about any of this yet, have we?  :-)

Hehe :-)

No I hope we will. I'll be in Honk-Kong in November. I don't know if
it's worth submitting a new topic for the design session? If you want
to tackle the subject before the summit, let me know, I'd be glad to
contribute on that.

>> The idea of this Docker plugin for Heat is to use the whole Docker API
>> directly from a template. All possible parameters for creating a
>> container from the Docker API[2] can be defined from the template.
>> This allows more flexibility.
>>
>> Since this approach is a bit different from the normal OpenStack
>> workflow (for instance, Nova's role is to abstract all computing units
>> right now), I am interested to get feedback on this.
>>
>> Obviously, I'll keep maintaining the Docker driver for Nova and I'm
>> also working on putting together some new features I'll propose for
>> the next release.
>>
>>
>> [1] http://docs.docker.io/en/latest/api/docker_remote_api_v1.5/
>> [2] http://docs.docker.io/en/latest/api/docker_remote_api_v1.5/#create-a-container
>>
>
> The way Nova uses the docker API is that each nova-compute service is
> managing docker locally.  So, Nova allows you to utilize docker through
> a single API across many nodes, right?  How does this work with this plugin?

You're right. With the plugin, you can map each resource on different
"DockerEndpoint" (which is an attribute), then have a multi-host
orchestration.

> I think my biggest piece of feedback is that I would like to talk about
> how we can evolve Nova to better support containers instead of just
> assuming it's hard and that another direction has to be taken.  It could
> be that the combination of some Nova enhancements and some
> docker-specific Heat features makes sense.  I don't know yet.  Can we
> get into some more details about what drove you to think you needed to
> bypass Nova?

The initial goal was to orchestrate containers with Heat. Since
passing information between containers rely on environment variables
generated during the deploy process, and since the driver does not
support yet, I wanted to take a shortcut. Let's call this an
experiment.

Again the goal is not to make this the official way of using Docker in
OpenStack. Docker does not (and will not) implement features that Nova
brings for free like quota, and especially a deep integration with all
other OpenStack services.


-- 
@sam_alba



More information about the OpenStack-dev mailing list