Merge lp:~kim0/pyjuju/adding-hook-traces-to-readme-for-bashified-example into lp:pyjuju

Proposed by Ahmed Kamal
Status: Work in progress
Proposed branch: lp:~kim0/pyjuju/adding-hook-traces-to-readme-for-bashified-example
Merge into: lp:pyjuju
Diff against target: 55 lines (+32/-2)
1 file modified
examples/readme.txt (+32/-2)
To merge this branch: bzr merge lp:~kim0/pyjuju/adding-hook-traces-to-readme-for-bashified-example
Reviewer Review Type Date Requested Status
Clint Byrum (community) Needs Fixing
William Reade (community) Approve
Review via email: mp+62537@code.launchpad.net

Description of the change

Fixed docs to match hook changes (joined instead of changed) and new execution order

To post a comment you must log in.
Revision history for this message
Kapil Thangavelu (hazmat) wrote :

Excerpts from Ahmed Kamal's message of Thu May 26 18:51:41 UTC 2011:
> Ahmed Kamal has proposed merging lp:~kim0/ensemble/adding-hook-traces-to-readme-for-bashified-example into lp:ensemble.
>
> Requested reviews:
> Ensemble Team (ensemble)
>
> For more details, see:
> https://code.launchpad.net/~kim0/ensemble/adding-hook-traces-to-readme-for-bashified-example/+merge/62537
>
> Fixed docs to match hook changes (joined instead of changed) and new execution order

Thanks again, for working on the documentation. Looks good but there are some errors in the traces.

There is no ensemble 'established' hook for relations. Instead we have joined called, all joines
are followed by a changed invocation (independent of if there is an actual change subsequent to
the join). All subsequent change invocations are due to changes in the related units.

188. By Ahmed Kamal

Updating hook trace, changed always gets fired after joined

Revision history for this message
Ahmed Kamal (kim0) wrote :

Just pushed fixed docs, let me know if that looks good

Revision history for this message
William Reade (fwereade) wrote :

I'd prefer it if there were a little more distinction between the explanatory comments and the actual hooks which are firing, but this is still useful information and I can't see any drawback to adding it.

review: Approve
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

lgtm as well

review: Approve
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

This was created before config-changed, I just realized. So it needs to be updated before merging to reflect when config-changed is run as well.

review: Needs Fixing

Unmerged revisions

188. By Ahmed Kamal

Updating hook trace, changed always gets fired after joined

187. By Ahmed Kamal

Fixing docs to match hook changes (joined)

186. By Ahmed Kamal

Adding a sample hook execution trace to readme to better understand execution dynamics

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'examples/readme.txt'
--- examples/readme.txt 2011-02-23 19:08:28 +0000
+++ examples/readme.txt 2011-05-27 15:29:31 +0000
@@ -1,7 +1,6 @@
1Examples1Examples
2========2========
33
4
5These are some example formulas that can be deployed together to create some connected services.4These are some example formulas that can be deployed together to create some connected services.
65
7Many more formulas of greater functionality and utility exist in the Principia project, which6Many more formulas of greater functionality and utility exist in the Principia project, which
@@ -9,7 +8,6 @@
98
10http://launchpad.net/principia9http://launchpad.net/principia
1110
12
13Deploying11Deploying
14=========12=========
1513
@@ -22,3 +20,35 @@
22 $ ensemble status20 $ ensemble status
2321
24The status command will show the address of the newly deployed wordpress service.22The status command will show the address of the newly deployed wordpress service.
23
24Hooks Triggering Sequence
25=========================
26
27To better understand the above deployment dynamics, let's trace through hook execution
28
29 $ ensemble deploy --repository=examples mysql
30 mysql/0(install)
31 mysql/0(start)
32 $ ensemble deploy --repository=examples wordpress
33 wordpress/0(install)
34 wordpress/0(start)
35 $ ensemble add-relation wordpress mysql
36 Two joined hooks are fired in parallel
37 wordpress/0(db-relation-joined): Hook doesn't exist, skipped
38 mysql/0(db-relation-joined): Does DB setup, might consume some time
39 After joined hooks, changed hooks always get fired regardless
40 wordpress/0(db-relation-changed): Hook finds out database is still being created, early exits
41 mysql/0(db-relation-changed): Hook doesn't exist, skipped
42 At end of mysql/0(db-relation-joined) relation-set is called, triggering a run of
43 wordpress/0(db-relation-changed): Read DB settings from relation, applies config
44
45Assuming another wordpress service unit is to be added
46 $ ensemble add-unit wordpress
47 wordpress/1(install)
48 wordpress/1(start)
49 Two joins in no particular order
50 wordpress/1(db-relation-joined): Hook doesn't exist, skipped
51 mysql/0(db-relation-joined): Hook detects DB already exists, does early exit
52 Two db-relation-changed in no particular order
53 mysql/0(db-relation-changed): Hook doesn't exist, skipped
54 wordpress/1(db-relation-changed): Read DB settings from relation, applies config

Subscribers

People subscribed via source and target branches

to status/vote changes: