You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by Martin Harris <ma...@cloudsoftcorp.com> on 2015/11/13 17:28:22 UTC

Child Entities

Hi All,

I'm deploying an app where a SoftwareProcess (TomcatServer) is the child of
a VanillaSoftwareProcess, but when I deploy it, both the TomcatServer and
the VanillaSoftwareProcess are installed on the same VM. Is this new
behaviour or has it changed? I thought it provisioned a new VM for the child

One issue with this the problem that when deploying to AWS the ports
required for the child aren't opened in the AWS security group [1]


[1]:
https://github.com/apache/incubator-brooklyn/blob/master/software/base/src/main/java/org/apache/brooklyn/entity/software/base/SoftwareProcessImpl.java#L496-L521

Cheers

-- 
Martin Harris
Lead Software Engineer
Cloudsoft Corporation Ltd
www.cloudsoftcorp.com
Mobile: +44 (0)7989 047-855

Re: Child Entities

Posted by Martin Harris <ma...@cloudsoftcorp.com>.
Hi Folks,

Thanks for the info - I'd obviously got the wrong impression about how
child entities are handled. As it happens my use-case is such that I
*don't* want a machine provisioned for the parent entity (I've replaced it
with a BasicApplication), I was just surprised by the behaviour

Cheers

M

On 13 November 2015 at 21:27, Aled Sage <al...@gmail.com> wrote:

> Hi,
>
> Svet's right: it's always been that way (since January 2014 when the
> functionality was added - c8fb5aac5b0c7f60ff98d6a9530d3aafb7e68edc).
>
> See SoftwareProcessDriverLifecycleEffectorTasks.startProcessesAtMachine,
> which calls StartableMethods.startingChildren(entity(), machineS.get()) -
> i.e. with the machine-location rather than the MachineProvisioningLocation
> that it might have been passed when it was being started.
>
> The most common use-case (I believe) for having a child entity of a
> SoftwareProcess is because you want to have additional things as part of
> that software process (e.g. you could have an entity for a logstash or
> NewRelic agent as a child). Hence we pass the machine to the child.
>
> Is Svet's workaround good for you Martin? Or is your use-case different,
> meaning you really do need a different machine?
>
> Aled
>
>
>
> On 13/11/2015 16:36, Svetoslav Neykov wrote:
>
>> Hi Martin,
>> I believe this has always been the case, at least not changed recently.
>> Spinning on the same machine is more of a side effect from entities
>> inheriting their parent's locations than explicitly supporting this
>> scenario.
>> As a workaround you can configure the ports on the parent entity, it will
>> add them to the security group, while the child will inherit and use them.
>>
>> Svet.
>>
>>
>> On 13.11.2015 г., at 18:31, Martin Harris <
>>> martin.harris@cloudsoftcorp.com> wrote:
>>>
>>> P.S. for the SameServerEntity (which is used where you want multiple
>>> entities installed on the same VM), the ports of the child entities *are*
>>> added to the required ports[2]
>>>
>>> [2]:
>>>
>>> https://github.com/apache/incubator-brooklyn/blob/master/software/base/src/main/java/org/apache/brooklyn/entity/software/base/SameServerDriverLifecycleEffectorTasks.java#L97-L99
>>>
>>> On 13 November 2015 at 16:28, Martin Harris <
>>> martin.harris@cloudsoftcorp.com
>>>
>>>> wrote:
>>>> Hi All,
>>>>
>>>> I'm deploying an app where a SoftwareProcess (TomcatServer) is the child
>>>> of a VanillaSoftwareProcess, but when I deploy it, both the TomcatServer
>>>> and the VanillaSoftwareProcess are installed on the same VM. Is this new
>>>> behaviour or has it changed? I thought it provisioned a new VM for the
>>>> child
>>>>
>>>> One issue with this the problem that when deploying to AWS the ports
>>>> required for the child aren't opened in the AWS security group [1]
>>>>
>>>>
>>>> [1]:
>>>>
>>>> https://github.com/apache/incubator-brooklyn/blob/master/software/base/src/main/java/org/apache/brooklyn/entity/software/base/SoftwareProcessImpl.java#L496-L521
>>>>
>>>> Cheers
>>>>
>>>> --
>>>> Martin Harris
>>>> Lead Software Engineer
>>>> Cloudsoft Corporation Ltd
>>>> www.cloudsoftcorp.com
>>>> Mobile: +44 (0)7989 047-855
>>>>
>>>>
>>>
>>> --
>>> Martin Harris
>>> Lead Software Engineer
>>> Cloudsoft Corporation Ltd
>>> www.cloudsoftcorp.com
>>> Mobile: +44 (0)7989 047-855
>>>
>>
>


-- 
Martin Harris
Lead Software Engineer
Cloudsoft Corporation Ltd
www.cloudsoftcorp.com
Mobile: +44 (0)7989 047-855

Re: Child Entities

Posted by Aled Sage <al...@gmail.com>.
Hi,

Svet's right: it's always been that way (since January 2014 when the 
functionality was added - c8fb5aac5b0c7f60ff98d6a9530d3aafb7e68edc).

See SoftwareProcessDriverLifecycleEffectorTasks.startProcessesAtMachine, 
which calls StartableMethods.startingChildren(entity(), machineS.get()) 
- i.e. with the machine-location rather than the 
MachineProvisioningLocation that it might have been passed when it was 
being started.

The most common use-case (I believe) for having a child entity of a 
SoftwareProcess is because you want to have additional things as part of 
that software process (e.g. you could have an entity for a logstash or 
NewRelic agent as a child). Hence we pass the machine to the child.

Is Svet's workaround good for you Martin? Or is your use-case different, 
meaning you really do need a different machine?

Aled


On 13/11/2015 16:36, Svetoslav Neykov wrote:
> Hi Martin,
> I believe this has always been the case, at least not changed recently. Spinning on the same machine is more of a side effect from entities inheriting their parent's locations than explicitly supporting this scenario.
> As a workaround you can configure the ports on the parent entity, it will add them to the security group, while the child will inherit and use them.
>
> Svet.
>
>
>> On 13.11.2015 г., at 18:31, Martin Harris <ma...@cloudsoftcorp.com> wrote:
>>
>> P.S. for the SameServerEntity (which is used where you want multiple
>> entities installed on the same VM), the ports of the child entities *are*
>> added to the required ports[2]
>>
>> [2]:
>> https://github.com/apache/incubator-brooklyn/blob/master/software/base/src/main/java/org/apache/brooklyn/entity/software/base/SameServerDriverLifecycleEffectorTasks.java#L97-L99
>>
>> On 13 November 2015 at 16:28, Martin Harris <martin.harris@cloudsoftcorp.com
>>> wrote:
>>> Hi All,
>>>
>>> I'm deploying an app where a SoftwareProcess (TomcatServer) is the child
>>> of a VanillaSoftwareProcess, but when I deploy it, both the TomcatServer
>>> and the VanillaSoftwareProcess are installed on the same VM. Is this new
>>> behaviour or has it changed? I thought it provisioned a new VM for the child
>>>
>>> One issue with this the problem that when deploying to AWS the ports
>>> required for the child aren't opened in the AWS security group [1]
>>>
>>>
>>> [1]:
>>> https://github.com/apache/incubator-brooklyn/blob/master/software/base/src/main/java/org/apache/brooklyn/entity/software/base/SoftwareProcessImpl.java#L496-L521
>>>
>>> Cheers
>>>
>>> --
>>> Martin Harris
>>> Lead Software Engineer
>>> Cloudsoft Corporation Ltd
>>> www.cloudsoftcorp.com
>>> Mobile: +44 (0)7989 047-855
>>>
>>
>>
>> -- 
>> Martin Harris
>> Lead Software Engineer
>> Cloudsoft Corporation Ltd
>> www.cloudsoftcorp.com
>> Mobile: +44 (0)7989 047-855


Re: Child Entities

Posted by Svetoslav Neykov <sv...@cloudsoftcorp.com>.
Hi Martin,
I believe this has always been the case, at least not changed recently. Spinning on the same machine is more of a side effect from entities inheriting their parent's locations than explicitly supporting this scenario.
As a workaround you can configure the ports on the parent entity, it will add them to the security group, while the child will inherit and use them.

Svet.


> On 13.11.2015 г., at 18:31, Martin Harris <ma...@cloudsoftcorp.com> wrote:
> 
> P.S. for the SameServerEntity (which is used where you want multiple
> entities installed on the same VM), the ports of the child entities *are*
> added to the required ports[2]
> 
> [2]:
> https://github.com/apache/incubator-brooklyn/blob/master/software/base/src/main/java/org/apache/brooklyn/entity/software/base/SameServerDriverLifecycleEffectorTasks.java#L97-L99
> 
> On 13 November 2015 at 16:28, Martin Harris <martin.harris@cloudsoftcorp.com
>> wrote:
> 
>> Hi All,
>> 
>> I'm deploying an app where a SoftwareProcess (TomcatServer) is the child
>> of a VanillaSoftwareProcess, but when I deploy it, both the TomcatServer
>> and the VanillaSoftwareProcess are installed on the same VM. Is this new
>> behaviour or has it changed? I thought it provisioned a new VM for the child
>> 
>> One issue with this the problem that when deploying to AWS the ports
>> required for the child aren't opened in the AWS security group [1]
>> 
>> 
>> [1]:
>> https://github.com/apache/incubator-brooklyn/blob/master/software/base/src/main/java/org/apache/brooklyn/entity/software/base/SoftwareProcessImpl.java#L496-L521
>> 
>> Cheers
>> 
>> --
>> Martin Harris
>> Lead Software Engineer
>> Cloudsoft Corporation Ltd
>> www.cloudsoftcorp.com
>> Mobile: +44 (0)7989 047-855
>> 
> 
> 
> 
> -- 
> Martin Harris
> Lead Software Engineer
> Cloudsoft Corporation Ltd
> www.cloudsoftcorp.com
> Mobile: +44 (0)7989 047-855


Re: Child Entities

Posted by Martin Harris <ma...@cloudsoftcorp.com>.
P.S. for the SameServerEntity (which is used where you want multiple
entities installed on the same VM), the ports of the child entities *are*
added to the required ports[2]

[2]:
https://github.com/apache/incubator-brooklyn/blob/master/software/base/src/main/java/org/apache/brooklyn/entity/software/base/SameServerDriverLifecycleEffectorTasks.java#L97-L99

On 13 November 2015 at 16:28, Martin Harris <martin.harris@cloudsoftcorp.com
> wrote:

> Hi All,
>
> I'm deploying an app where a SoftwareProcess (TomcatServer) is the child
> of a VanillaSoftwareProcess, but when I deploy it, both the TomcatServer
> and the VanillaSoftwareProcess are installed on the same VM. Is this new
> behaviour or has it changed? I thought it provisioned a new VM for the child
>
> One issue with this the problem that when deploying to AWS the ports
> required for the child aren't opened in the AWS security group [1]
>
>
> [1]:
> https://github.com/apache/incubator-brooklyn/blob/master/software/base/src/main/java/org/apache/brooklyn/entity/software/base/SoftwareProcessImpl.java#L496-L521
>
> Cheers
>
> --
> Martin Harris
> Lead Software Engineer
> Cloudsoft Corporation Ltd
> www.cloudsoftcorp.com
> Mobile: +44 (0)7989 047-855
>



-- 
Martin Harris
Lead Software Engineer
Cloudsoft Corporation Ltd
www.cloudsoftcorp.com
Mobile: +44 (0)7989 047-855