You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stratos.apache.org by Imesh Gunaratne <im...@apache.org> on 2015/01/27 20:09:32 UTC

[Discuss] Building Puppet-Based Applications Inside Docker

Hi Devs,

This is cool, now we can use Puppet with Docker:
http://puppetlabs.com/blog/building-puppet-based-applications-inside-docker

Currently we package Cartridge Agent package with base docker image. This
is an overhead. Each time we update the Cartridge Agent package we need to
re-create the base docker image and service docker images.

Now with this approach we can host puppet modules in a git repo and create
a base docker image without bundling any software. Then we can create
service docker images by bundling Puppetfiles which can install puppet
modules on runtime. This is great!

Thanks


-- 
Imesh Gunaratne

Technical Lead, WSO2
Committer & PMC Member, Apache Stratos

Re: [Discuss] Building Puppet-Based Applications Inside Docker

Posted by Chamila De Alwis <ch...@wso2.com>.
Hi Imesh, Lakmal,

On Wed, Jan 28, 2015 at 10:59 AM, Imesh Gunaratne <im...@apache.org> wrote:

> - However at the moment Puppet can be used for creating Docker images with
> existing puppet modules. Puppet modules will run at the Docker image build
> time.
>

This will help us in maintaining a uniform recipe for both containers and
VMs. Currently, whenever a change is done in a Puppet module, however less
frequent that is, it has to be reflected on the Dockerfile too.

Since more modular approach for Dockerfiles doesn't seem to be in the
spotlight [1], using Puppet, 1) which is already an established
configuration tool, 2) for which we already have tested manifests, to
create Docker images would be great.

[1] - https://github.com/docker/docker/issues/735#issuecomment-37273719


Regards,
Chamila de Alwis
Software Engineer | WSO2 | +94772207163
Blog: code.chamiladealwis.com

Re: [Discuss] Building Puppet-Based Applications Inside Docker

Posted by Imesh Gunaratne <im...@apache.org>.
Hi Lakmal,

Thank you very much for the clarification, I agree with your concerns. Let
me summarize what we discussed offline:

- Docker is designed to run one process in a container by adhering to
Single Responsibility Principle [1]
- Therefore ideally Puppet should run in a different container, similar to
networking process in Kubernetes. Puppet says that they are working on
this, need to check the latest status.
- However at the moment Puppet can be used for creating Docker images with
existing puppet modules. Puppet modules will run at the Docker image build
time.
- To preserve the advantage of using Docker (startup speed) the idea is to
pre-install all required software and create Docker images before hand,
unlike VMs.
- Software update process can be handled with Docker by creating new Docker
images for updates and roll-out the changes by stopping the existing
containers and starting new ones. This is currently supported by Kubernetes.
- When using Puppet with VMs we could notify the instances and execute
puppet agent to propagate updates.

[1] http://paynedigital.com/articles/2013/11/introduction-to-docker

Thanks

On Wed, Jan 28, 2015 at 10:18 AM, Lakmal Warusawithana <la...@wso2.com>
wrote:

> I think you have misunderstood what they are doing. Dockerfile RUN command
> execute at the docker built time. Puppet is involved with RUN command. Only
> CMD command will execute at the docker container startup time. I think this
> will help to understand what they are doing.
>
> On Wed, Jan 28, 2015 at 9:37 AM, Imesh Gunaratne <im...@apache.org> wrote:
>
>> Hi Lakmal,
>>
>> I agree with the point on the concept of running a single process,
>> according to [1] Puppet team is currently working on running puppet in a
>> different container.
>>
>> Regarding the puppet usage, IMO we do not necessarily need to run puppet
>> and install software at docker image build time. We could execute that
>> logic on container startup.
>>
>> [1]
>> http://puppetlabs.com/presentations/using-docker-puppet-james-turnbull-kickstarter
>>
>> On Wed, Jan 28, 2015 at 8:10 AM, Lakmal Warusawithana <la...@wso2.com>
>> wrote:
>>
>>> Hi Imesh,
>>>
>>> This was there form the beginning. This is for create docker image using
>>> puppet, not running puppet inside a container and install application at
>>> run time. By design docker not mean to support this, because it have not a
>>> init system inside the container. By design it recommend to run single
>>> processor inside a container.
>>>
>>> On Wed, Jan 28, 2015 at 12:39 AM, Imesh Gunaratne <im...@apache.org>
>>> wrote:
>>>
>>>> Hi Devs,
>>>>
>>>> This is cool, now we can use Puppet with Docker:
>>>>
>>>> http://puppetlabs.com/blog/building-puppet-based-applications-inside-docker
>>>>
>>>> Currently we package Cartridge Agent package with base docker image.
>>>> This is an overhead. Each time we update the Cartridge Agent package we
>>>> need to re-create the base docker image and service docker images.
>>>>
>>>> Now with this approach we can host puppet modules in a git repo and
>>>> create a base docker image without bundling any software. Then we can
>>>> create service docker images by bundling Puppetfiles which can install
>>>> puppet modules on runtime.
>>>>
>>>
>>> This is wrong. it not install modules run time, rather it re-create
>>> docker image with help from puppet.
>>>
>>>
>>>
>>>> This is great!
>>>>
>>>> Thanks
>>>>
>>>>
>>>> --
>>>> Imesh Gunaratne
>>>>
>>>> Technical Lead, WSO2
>>>> Committer & PMC Member, Apache Stratos
>>>>
>>>
>>>
>>>
>>> --
>>> Lakmal Warusawithana
>>> Vice President, Apache Stratos
>>> Director - Cloud Architecture; WSO2 Inc.
>>> Mobile : +94714289692
>>> Blog : http://lakmalsview.blogspot.com/
>>>
>>>
>>
>>
>> --
>> Imesh Gunaratne
>>
>> Technical Lead, WSO2
>> Committer & PMC Member, Apache Stratos
>>
>
>
>
> --
> Lakmal Warusawithana
> Vice President, Apache Stratos
> Director - Cloud Architecture; WSO2 Inc.
> Mobile : +94714289692
> Blog : http://lakmalsview.blogspot.com/
>
>


-- 
Imesh Gunaratne

Technical Lead, WSO2
Committer & PMC Member, Apache Stratos

Re: [Discuss] Building Puppet-Based Applications Inside Docker

Posted by Lakmal Warusawithana <la...@wso2.com>.
I think you have misunderstood what they are doing. Dockerfile RUN command
execute at the docker built time. Puppet is involved with RUN command. Only
CMD command will execute at the docker container startup time. I think this
will help to understand what they are doing.

On Wed, Jan 28, 2015 at 9:37 AM, Imesh Gunaratne <im...@apache.org> wrote:

> Hi Lakmal,
>
> I agree with the point on the concept of running a single process,
> according to [1] Puppet team is currently working on running puppet in a
> different container.
>
> Regarding the puppet usage, IMO we do not necessarily need to run puppet
> and install software at docker image build time. We could execute that
> logic on container startup.
>
> [1]
> http://puppetlabs.com/presentations/using-docker-puppet-james-turnbull-kickstarter
>
> On Wed, Jan 28, 2015 at 8:10 AM, Lakmal Warusawithana <la...@wso2.com>
> wrote:
>
>> Hi Imesh,
>>
>> This was there form the beginning. This is for create docker image using
>> puppet, not running puppet inside a container and install application at
>> run time. By design docker not mean to support this, because it have not a
>> init system inside the container. By design it recommend to run single
>> processor inside a container.
>>
>> On Wed, Jan 28, 2015 at 12:39 AM, Imesh Gunaratne <im...@apache.org>
>> wrote:
>>
>>> Hi Devs,
>>>
>>> This is cool, now we can use Puppet with Docker:
>>>
>>> http://puppetlabs.com/blog/building-puppet-based-applications-inside-docker
>>>
>>> Currently we package Cartridge Agent package with base docker image.
>>> This is an overhead. Each time we update the Cartridge Agent package we
>>> need to re-create the base docker image and service docker images.
>>>
>>> Now with this approach we can host puppet modules in a git repo and
>>> create a base docker image without bundling any software. Then we can
>>> create service docker images by bundling Puppetfiles which can install
>>> puppet modules on runtime.
>>>
>>
>> This is wrong. it not install modules run time, rather it re-create
>> docker image with help from puppet.
>>
>>
>>
>>> This is great!
>>>
>>> Thanks
>>>
>>>
>>> --
>>> Imesh Gunaratne
>>>
>>> Technical Lead, WSO2
>>> Committer & PMC Member, Apache Stratos
>>>
>>
>>
>>
>> --
>> Lakmal Warusawithana
>> Vice President, Apache Stratos
>> Director - Cloud Architecture; WSO2 Inc.
>> Mobile : +94714289692
>> Blog : http://lakmalsview.blogspot.com/
>>
>>
>
>
> --
> Imesh Gunaratne
>
> Technical Lead, WSO2
> Committer & PMC Member, Apache Stratos
>



-- 
Lakmal Warusawithana
Vice President, Apache Stratos
Director - Cloud Architecture; WSO2 Inc.
Mobile : +94714289692
Blog : http://lakmalsview.blogspot.com/

Re: [Discuss] Building Puppet-Based Applications Inside Docker

Posted by Imesh Gunaratne <im...@apache.org>.
Hi Lakmal,

I agree with the point on the concept of running a single process,
according to [1] Puppet team is currently working on running puppet in a
different container.

Regarding the puppet usage, IMO we do not necessarily need to run puppet
and install software at docker image build time. We could execute that
logic on container startup.

[1]
http://puppetlabs.com/presentations/using-docker-puppet-james-turnbull-kickstarter

On Wed, Jan 28, 2015 at 8:10 AM, Lakmal Warusawithana <la...@wso2.com>
wrote:

> Hi Imesh,
>
> This was there form the beginning. This is for create docker image using
> puppet, not running puppet inside a container and install application at
> run time. By design docker not mean to support this, because it have not a
> init system inside the container. By design it recommend to run single
> processor inside a container.
>
> On Wed, Jan 28, 2015 at 12:39 AM, Imesh Gunaratne <im...@apache.org>
> wrote:
>
>> Hi Devs,
>>
>> This is cool, now we can use Puppet with Docker:
>>
>> http://puppetlabs.com/blog/building-puppet-based-applications-inside-docker
>>
>> Currently we package Cartridge Agent package with base docker image. This
>> is an overhead. Each time we update the Cartridge Agent package we need to
>> re-create the base docker image and service docker images.
>>
>> Now with this approach we can host puppet modules in a git repo and
>> create a base docker image without bundling any software. Then we can
>> create service docker images by bundling Puppetfiles which can install
>> puppet modules on runtime.
>>
>
> This is wrong. it not install modules run time, rather it re-create docker
> image with help from puppet.
>
>
>
>> This is great!
>>
>> Thanks
>>
>>
>> --
>> Imesh Gunaratne
>>
>> Technical Lead, WSO2
>> Committer & PMC Member, Apache Stratos
>>
>
>
>
> --
> Lakmal Warusawithana
> Vice President, Apache Stratos
> Director - Cloud Architecture; WSO2 Inc.
> Mobile : +94714289692
> Blog : http://lakmalsview.blogspot.com/
>
>


-- 
Imesh Gunaratne

Technical Lead, WSO2
Committer & PMC Member, Apache Stratos

Re: [Discuss] Building Puppet-Based Applications Inside Docker

Posted by Lakmal Warusawithana <la...@wso2.com>.
Hi Imesh,

This was there form the beginning. This is for create docker image using
puppet, not running puppet inside a container and install application at
run time. By design docker not mean to support this, because it have not a
init system inside the container. By design it recommend to run single
processor inside a container.

On Wed, Jan 28, 2015 at 12:39 AM, Imesh Gunaratne <im...@apache.org> wrote:

> Hi Devs,
>
> This is cool, now we can use Puppet with Docker:
> http://puppetlabs.com/blog/building-puppet-based-applications-inside-docker
>
> Currently we package Cartridge Agent package with base docker image. This
> is an overhead. Each time we update the Cartridge Agent package we need to
> re-create the base docker image and service docker images.
>
> Now with this approach we can host puppet modules in a git repo and create
> a base docker image without bundling any software. Then we can create
> service docker images by bundling Puppetfiles which can install puppet
> modules on runtime.
>

This is wrong. it not install modules run time, rather it re-create docker
image with help from puppet.



> This is great!
>
> Thanks
>
>
> --
> Imesh Gunaratne
>
> Technical Lead, WSO2
> Committer & PMC Member, Apache Stratos
>



-- 
Lakmal Warusawithana
Vice President, Apache Stratos
Director - Cloud Architecture; WSO2 Inc.
Mobile : +94714289692
Blog : http://lakmalsview.blogspot.com/