deploy should add peer relations automatically

Bug #803855 reported by Juan L. Negron
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
pyjuju
Fix Released
High
Kapil Thangavelu

Bug Description

Ensemble is not invoking the hooks for the peer interfaces.
See lp:~negronjl/+junk/tomcat6
The hooks for the peer interfaces needed for tomcat clustering are not being invoked.

Related branches

Revision history for this message
Kapil Thangavelu (hazmat) wrote :

i already addressed this on irc and separately via email. the peer hooks are being invoked, the problem is that the hooks have errors.

  <hazmat> negronjl, so the problem with the tomcat formula is that its using relative addressing to files
  <hazmat> 2011-06-29 11:38:28,105 unit:tomcat6/1: hook.output ERROR: sed: can't read /usr/lib/ensemble/txzookeeper/../templates/tomcat-server-xml-top.tmpl: No such file or directory
  <hazmat> hth
  <hazmat> that output is from the debug-log which is very useful for debugging problems.. as is the debug-hooks cmd
  <hazmat> negronjl, there's a branch in review to ensure that formula hooks are always executed from the formula dir
  <hazmat> but it hasn't landed, atm the hook PWD isn't something that can be relied on by hooks
  <hazmat> and addressing paths from there should be absolute
  <hazmat> negronjl, i guess in this case your trying to get to some formula included config?
  <hazmat> negronjl, which will become more easier once bug 761015 is fixed

If this isn't capturing the entire issue, please add additional details.

Changed in ensemble:
status: New → Invalid
Revision history for this message
Juan L. Negron (negronjl) wrote :

hazmat: I fixed the issues with the tomcat6 formula and I still don't see the peer hooks being invoked.

Here is what I am doing:
ensemble deploy tomcat6
ensemble add-node
ensemble debug-hooks ( then, as the hooks get invoked, I manually run them ). The peer ones never get invoked.

-Juan

Revision history for this message
Kapil Thangavelu (hazmat) wrote : Re: [Bug 803855] Re: peer hooks are not invoked

Excerpts from Juan L. Negron's message of Thu Jun 30 17:13:00 UTC 2011:
> hazmat: I fixed the issues with the tomcat6 formula and I still don't
> see the peer hooks being invoked.
>
> Here is what I am doing:
> ensemble deploy tomcat6
> ensemble add-node
> ensemble debug-hooks ( then, as the hooks get invoked, I manually run them ). The peer ones never get invoked.
>
> -Juan
>

It looks like your missing the ensemble add-relation step to establish the peer relation.

Revision history for this message
Juan L. Negron (negronjl) wrote :

Kapil:

According to Gustavo, Ben and Clynt, the peer relation should not need to
establish a relation. Ensemble gives out an error when I try to
add-relation between the nodes. Here is the output of the commands:

negronjl@negronjl-laptop:~/src/ensemble/formulas$ ensemble status
2011-06-30 23:29:23,048 INFO Connecting to environment.
machines:
  0: {dns-name: ec2-184-73-90-26.compute-1.amazonaws.com, instance-id:
i-39000557}
  1: {dns-name: ec2-50-17-135-210.compute-1.amazonaws.com, instance-id:
i-872520e9}
  2: {dns-name: ec2-50-19-4-115.compute-1.amazonaws.com, instance-id:
i-a52722cb}
  3: {dns-name: ec2-50-19-46-146.compute-1.amazonaws.com, instance-id:
i-a72326c9}
services:
  tomcat6:
    formula: local:tomcat6-1
    relations: {}
    units:
      tomcat6/0:
        machine: 1
        relations: {}
        state: started
      tomcat6/1:
        machine: 2
        relations: {}
        state: started
      tomcat6/2:
        machine: 3
        relations: {}
        state: null
2011-06-30 23:29:28,933 INFO 'status' command finished successfully
negronjl@negronjl-laptop:~/src/ensemble/formulas$ ensemble add-relation
tomcat6/0 tomcat6/1
2011-06-30 23:29:49,631 INFO Connecting to environment.
Service 'tomcat6/0' was not found
2011-06-30 23:29:51,798 ERROR Service 'tomcat6/0' was not found
negronjl@negronjl-laptop:~/src/ensemble/formulas$ ensemble add-relation
tomcat6 tomcat6
2011-06-30 23:30:04,279 INFO Connecting to environment.
2011-06-30 23:30:07,816 INFO Added tomcat-cluster relation to all service
units.
2011-06-30 23:30:07,817 INFO 'add_relation' command finished successfully
negronjl@negronjl-laptop:~/src/ensemble/formulas$ ensemble status
2011-06-30 23:30:22,052 INFO Connecting to environment.
list index out of range
2011-06-30 23:30:26,005 ERROR list index out of range

On Thu, Jun 30, 2011 at 9:39 PM, Kapil Thangavelu <<email address hidden>
> wrote:

> Excerpts from Juan L. Negron's message of Thu Jun 30 17:13:00 UTC 2011:
> > hazmat: I fixed the issues with the tomcat6 formula and I still don't
> > see the peer hooks being invoked.
> >
> > Here is what I am doing:
> > ensemble deploy tomcat6
> > ensemble add-node
> > ensemble debug-hooks ( then, as the hooks get invoked, I manually run
> them ). The peer ones never get invoked.
> >
> > -Juan
> >
>
> It looks like your missing the ensemble add-relation step to establish
> the peer relation.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/803855
>
> Title:
> peer hooks are not invoked
>
> Status in Ensemble:
> Invalid
>
> Bug description:
> Ensemble is not invoking the hooks for the peer interfaces.
> See lp:~negronjl/+junk/tomcat6
> The hooks for the peer interfaces needed for tomcat clustering are not
> being invoked.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ensemble/+bug/803855/+subscriptions
>

Revision history for this message
Clint Byrum (clint-fewbar) wrote : Re: peer hooks are not invoked

I can repeat this last effect that Juan shows with Juan's formula on EC2 with current trunk.

marking Confirmed, importance High as this makes peer formulas basically unusable.

Changed in ensemble:
status: Invalid → Confirmed
importance: Undecided → Medium
Changed in ensemble:
importance: Medium → High
Revision history for this message
Kapil Thangavelu (hazmat) wrote :

relations are added between services

ensemble add-relation tomcat6 tomcat6

Revision history for this message
Kapil Thangavelu (hazmat) wrote :

at the moment all relations require being established via add-relation be they peer or client/server. we should probably automatically establish a peer relations, and there does appear to be a bug in status, but as per my original comment on this issue the peer hooks are firing.

Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

Peer relations were never intended to be added manually. Their only reason of existence is to establish communication between members of the same service, and if the peer relation is declared it's the only hint we need to know they are supposed to be established.

This behavior is actually in the specification:

"""
peers: - Relations that are established with P2P semantics instead of a provides/requires (or client/server) style. When the formula is deployed as a service unit, all the units from the given service will automatically be made part of the relation. See below for how to define a relation.
"""

Revision history for this message
Kapil Thangavelu (hazmat) wrote : Re: [Bug 803855] Re: peer hooks are not invoked

Excerpts from Gustavo Niemeyer's message of Mon Jul 04 22:00:56 UTC 2011:
> Peer relations were never intended to be added manually. Their only
> reason of existence is to establish communication between members of the
> same service, and if the peer relation is declared it's the only hint we
> need to know they are supposed to be established.
>
> This behavior is actually in the specification:
>
> """
> peers: - Relations that are established with P2P semantics instead of a provides/requires (or client/server) style. When the formula is deployed as a service unit, all the units from the given service will automatically be made part of the relation. See below for how to define a relation.
> """
>

indeed, i'm in progress on adding peer relations automatically in the auto-peer branch.

summary: - peer hooks are not invoked
+ deploy should add peer relations automatically
Changed in ensemble:
milestone: none → dublin
assignee: nobody → Kapil Thangavelu (hazmat)
Changed in ensemble:
status: Confirmed → In Progress
Changed in ensemble:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.