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

Proposed by Ahmed Kamal
Status: Needs review
Proposed branch: lp:~kim0/pyjuju/adding-hook-traces-to-readme-for-bashified-example
Merge into: lp:~jimbaker/pyjuju/bashified-wordpress-mysql-examples
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
Gustavo Niemeyer (community) Disapprove
Jim Baker Pending
Review via email: mp+57716@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

That's a nice way to visualize the communication, but there's a small issue
related to one of the hooks:

[1]

+ mysql/0(db-relation-chaned): Does DB setup, calls relation-set setting variables, which triggers another run of

The mysql formula doesn't have the db-relation-changed hook, and has the db-relation-joined one.

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

Also note that this is targeting the "bashified" branch, while it should be targeting trunk by now.

187. By Ahmed Kamal

Fixing docs to match hook changes (joined)

188. By Ahmed Kamal

Updating hook trace, changed always gets fired after joined

Revision history for this message
Gustavo Niemeyer (niemeyer) :
review: Disapprove

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:32 +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 all changes: