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