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

Subscribers

People subscribed via source and target branches

to status/vote changes: