5af3cda09bc1b353b4ae40946f48a1c3641c318b
[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     kill $(pgrep -f "DominoServer.py")
28     kill $(pgrep -f "DominoClient.py") 
29
30 ###Start Domino Server:
31     ./DominoServer.py --log=DEBUG
32
33 ###Start the first Domino Client:
34     ./DominoClient.py -p 9091 --cliport 9100 --log=DEBUG
35
36 Note: if --log option is ommitted, the default logging level is Warning messages
37
38 ###Start the second Domino Client:
39     ./DominoClient.py -p 9092 --cliport 9200 --log=DEBUG
40
41 ##CLI at the Domino Client:
42
43 ###Send heartbeat
44     python domino-cli.py <cliport> heartbeat
45
46 ###Subscribe for policy labels
47     python domino-cli.py <cliport> subscribe -l/--label <policytype>:properties:key:value
48     
49 Example:
50 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:
51
52     python domino-cli.py 9100 subscribe --label tosca.policies.Placement.Geolocation:properties:region:us-west-1
53  
54 ###Publish default template file under tosca-templates
55     python domino-cli.py <cliport> publish --tosca-file <path_to_toscafile>
56
57 Example:
58 Run the following command for the second Domino Client:
59
60     python domino-cli.py 9200 publish --tosca-file ./tosca-templates/tosca_helloworld_nfv.yaml
61
62 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)
63
64 ###Query published tosca-templates for each client
65     python domino-cli.py <cliport> list-tuids
66
67 Example:
68 Run the following command for the second Domino Client:
69     python domino-cli.py 9200 list-tuids
70
71 ###Change the published template for a specific Template Unique ID (TUID)
72     python domino-cli.py <cliport> publish -t ./tosca-templates/tosca_helloworld_nfv.yaml -k <TUID>
73
74 Example:
75 Run the following command for the second Domino Client:
76     TUID=$(python domino-cli.py 9200 list-tuids | cut -c3-34)
77     python domino-cli.py 9200 publish -t ./tosca-templates/tosca_helloworld_nfv.yaml -k "$TUID"
78
79 ##NOTES
80   If accidentally you start DominoClient before DominoServer, don't panic. First start the DominoServer and then input the command on the DominoClient side:
81
82     register