Update MRI upstreams
[ovsdb.git] / README
1 DIRECTORY ORGANIZATION
2 ======================
3
4 - commons
5   +-- parent : Contains Parent pom.xml for all the ovsdb modules.
6
7 - hwvtepsouthbound : Contains the hw_vtep southbound plugin.
8
9 - library : Contains Schema-independent library that is a reference implementation for RFC 7047.
10             This module doesn't depend on any of the Opendaylight components.
11             This library module can also be used independently in a non-OSGi environment.
12
13 - resources : Contains some useful resources such as scripts, testing utilities and tools used for deployment
14               or testing the binaries generated from the OVSDB project.
15
16 - schemas :
17   +-- openvswitch : Schema wrapper that represents http://openvswitch.org/ovs-vswitchd.conf.db.5.pdf
18   +-- hardwarevtep: Schema wrapper that represents http://openvswitch.org/docs/vtep.5.pdf
19
20 - southbound : contains the plugin for converting from the OVSDB protocol to mdsal and vice-versa.
21
22 - utils : OVSDB common utilities.
23
24 HOW TO BUILD & RUN
25 ==================
26
27 Pre-requisites : JDK 1.7+, Maven 3+
28
29 1. Building a Karaf Feature and deploying it in an Opendaylight Karaf distribution :
30    1. From the root ovsdb/ directory, execute "mvn clean install"
31
32    2. Unzip the karaf-<VERSION_NUMBER>-SNAPSHOT.zip file created from step 1 in the directory ovsdb/karaf/target/:
33       "unzip karaf-<VERSION_NUMBER>-SNAPSHOT.zip"
34
35    3. Once karaf has started and you see the Opendaylight ascii art in the console, the last step
36       is to start the OVSDB plugin framework with the following command in the karaf console:
37       "feature:install odl-ovsdb-southbound-impl odl-ovsdb-hwvtepsouthbound" (without quotation marks).
38
39    Sample output from Karaf console :
40
41   opendaylight-user@root>feature:list -i | grep ovsdb
42    odl-ovsdb-southbound-impl                                       x 1.9.0.SNAPSHOT   x x        x Started x odl-ovsdb-southbound-impl-1.9.0-SNAPSHOT                        x ODL :: ovsdb :: odl-ovsdb-southbound-impl
43    odl-ovsdb-hwvtepsouthbound-api                                  x 1.9.0.SNAPSHOT   x          x Started x odl-ovsdb-hwvtepsouthbound-api                                  x ODL :: ovsdb :: odl-ovsdb-hwvtepsouthbound-api
44    odl-ovsdb-utils                                                 x 1.9.0.SNAPSHOT   x          x Started x odl-ovsdb-utils                                                 x ODL :: ovsdb :: odl-ovsdb-utils
45    odl-ovsdb-hwvtepsouthbound                                      x 1.9.0.SNAPSHOT   x x        x Started x odl-ovsdb-hwvtepsouthbound                                      x ODL :: ovsdb :: odl-ovsdb-hwvtepsouthbound
46    odl-ovsdb-library                                               x 1.9.0.SNAPSHOT   x          x Started x odl-ovsdb-library-1.9.0-SNAPSHOT                                x ODL :: ovsdb :: odl-ovsdb-library
47    odl-ovsdb-southbound-api                                        x 1.9.0.SNAPSHOT   x          x Started x odl-ovsdb-southbound-api                                        x ODL :: ovsdb :: odl-ovsdb-southbound-api
48   opendaylight-user@root>
49
50 2. Building a bundle and deploying it in an Opendaylight Karaf distribution :
51    This method can be used to update and test new code in a bundle. If the bundle of interest is rebuilt as a
52    snapshot with the same version as what it already defined in a feature repo then that new bundle will be used
53    when the feature is loaded in karaf. If karaf is already running with the feature loaded then follow the steps
54    below to load the new bundle:
55
56    1. Find the bundle id of the bundle you are going to rebuild:
57       - bundle:list -s | grep <bundlename>, i.e. bundle:list -s | grep odl-ovsdb-plugin
58
59    2. Instruct karaf to watch the new bundle and reload it if it changes:
60       - bundle:watch <id>
61       - The id is the value returned in 1 above.
62       - You can also watch the bundle URL itself:
63         - bundle:watch mvn:org.opendaylight.ovsdb/plugin/1.0.2-SNAPSHOT
64
65    3. Rebuild bundle.
66       - cd bundle dir, i.e. cd ovsdb/plugin
67       - mvn clean install. This will install the new bundle into the local mvn repo.
68
69    4. karaf will see the changed bundle and reload it.
70
71 Running The Integration Tests
72 =============================
73
74 To run the integration tests locally the following components are required:
75
76  - Docker
77  - Docker Compose
78
79 To install docker, follow the installation guide for your platform:
80    http://docs.docker.com/installation/
81
82 To install Docker Compose:
83    http://docs.docker.com/compose/install/
84
85 To run the integration tests:
86
87     mvn clean install
88     # The first time you need to set everything up
89     docker-compose up -d
90     # Later runs only need the containers to be started
91     docker-compose start
92     # OSX
93     mvn verify -Pintegrationtest -Dovsdbserver.ipaddress=$(boot2docker ip 2>/dev/null) -Dovsdbserver.port=6640
94     # Linux
95     mvn verify -Pintegrationtest -Dovsdbserver.ipaddress=127.0.0.1 -Dovsdbserver.port=6640 -Dovsdb.controller.address=<addr of docker interface> -Dovsdb.userspace.enabled=yes
96     docker-compose stop
97
98 On Linux you'll generally need to run fig as root (sudo fig ...).
99
100 Running the docker image manually:
101     sudo docker run -itd --cap-add NET_ADMIN -p 6640:6640 jhershbe/centos7-ovs:latest
102
103 Skipping unit tests and karaf tests
104 ====================
105
106 mvn clean install -Dmaven.test.skip=true -Dskip.karaf=true