Update README.md
[domino.git] / README.md
1 # Domino
2
3 ##Quick Start on the same machine:
4
5 Tested on Ubuntu 14.04 and OS X El Capitan
6
7 ###Prerequisite:
8     git clone https://gerrit.opnfv.org/gerrit/domino
9     sudo apt-get install python-pip
10     sudo pip install tosca-parser
11     sudo pip install heat-translator
12
13 ###Testing:    
14 Proceed to the domino folder and run a smoke test that checks APIs
15  
16     cd domino    
17     ./tests/run.sh
18
19 ###Common Errors
20 If "internal error" message is received, a python library is missing
21
22 Clean the server side database:
23
24     rm -r dominoserver.db
25
26 Make sure that all the existing domino server and client processes are killed.
27
28     kill $(pgrep -f "DominoServer.py")
29     kill $(pgrep -f "DominoClient.py") 
30
31 ###Start Domino Server:
32     ./DominoServer.py --log=DEBUG
33
34 ###Start the first Domino Client:
35     ./DominoClient.py -p 9091 --cliport 9100 --log=DEBUG
36
37 Note: if --log option is ommitted, the default logging level is Warning messages
38
39 ###Start the second Domino Client:
40     ./DominoClient.py -p 9092 --cliport 9200 --log=DEBUG
41
42 ##CLI at the Domino Client:
43
44 ###Send heartbeat
45     python domino-cli.py <cliport> heartbeat
46
47 ###Subscribe for policy labels
48     python domino-cli.py <cliport> subscribe -l/--label <policytype>:properties:key:value
49     
50 Example:
51 First checkout the tosca file "./tosca-templates/tosca_helloworld_nfv.yaml" and see how policy types and rules are defined. Then, for the first Domino Client, use subscribe command as:
52
53     python domino-cli.py 9100 subscribe --label tosca.policies.Placement.Geolocation:properties:region:us-west-1
54  
55 ###Publish default template file under tosca-templates
56     python domino-cli.py <cliport> publish --tosca-file <path_to_toscafile>
57
58 Example:
59 Run the following command for the second Domino Client:
60
61     python domino-cli.py 9200 publish --tosca-file ./tosca-templates/tosca_helloworld_nfv.yaml
62
63 Now, inspect the files generated under ./toscafiles, where the original file as well as parts sent to each Domino Client are shown (each part identified by UDID assigned to that client)
64
65 ###Query published tosca-templates for each client
66     python domino-cli.py <cliport> list-tuids
67
68 Example:
69 Run the following command for the second Domino Client:
70
71     python domino-cli.py 9200 list-tuids
72
73 ###Change the published template for a specific Template Unique ID (TUID)
74     python domino-cli.py <cliport> publish -t ./tosca-templates/tosca_helloworld_nfv.yaml -k <TUID>
75
76 Example:
77 Run the following command for the second Domino Client:
78
79     TUID=$(python domino-cli.py 9200 list-tuids | cut -c3-34)
80     python domino-cli.py 9200 publish -t ./tosca-templates/tosca_helloworld_nfv.yaml -k "$TUID"
81
82 ##NOTES
83   If accidentally you start DominoClient before DominoServer, don't panic. First start the DominoServer and then input the command on the DominoClient side:
84
85     register