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