The source code for the contrail network virtualization system uses several code repositories, currently hosted in GitHub. The source code for the configuration server, control-plane, analytics and compute-node agent is located in github.com/Juniper/contrail-controller. The source code for the dataplane component is located in github.com/Juniper/contrail-vrouter. Several other repositories that contain build tools and code generators are also used.
In order to create a sandbox that can be used to build the complete system there are several steps. Overview:
Several distributions are supported:
The tools repo
and git
should be installed to pull a development sandbox.
We use the google multiple repository tool, the andoid repo. Here's the download/install link.
apt-get install git
should install git.
Before you can create a sandbox you will need a github account, and you will need to set up ssh access to github.
To create a development sandbox you can use the following steps:
The build depends on several tools which are listed in the following distribution specific sections.
On RHEL/CentOS/Scientific 6.4 the basic build dependencies can be installed by the following command:
In addition to the above, contrail build requires the following:
libipfix:
this needs to be installed manually by downloading from
http://sourceforge.net/projects/libipfix/files/libipfix/libipfix_110209.tgz
librdkafka:
this needs to be installed manually by downloading from
https://github.com/edenhill/librdkafka/librdkafka-0.8.5.tar.gz
The following sections provide additional info for specific CentOS releases
On CentOS 6.6, there are a few additional build dependencies:
The first two are handled by the following command:
The newer automake requires more fiddling, as most yum repositories for Centos 6.x will have v2.63 automake. Here is a link to automake-2.69 for CentOS 6.x.
The up-to-date build dependency list can be found in your sandbox.
See the sandbox file tools/packages/rpm/contrail/contrail.spec
for BuildRequires
entries.
The ability to build on CentOS 7 is a work in progress, so all caveats apply.
Like CentOS 6.6, these packages are also required by
CentOS 7, and can be installed using the
same yum
command as for CentOS 6.6 (see above).
Centos 7 has some additional complexity due to build dependencies on the following:
Packages (1) through (6) can be installed with
this yum
command:
The packages (7) through (10) are not in the default CentOS 7 repository, but they can be installed from the epel repository. To install access to the epel repository, run these two commands:
After installing and enabling epel access, packages (6) through (9) can be installed:
As stated, configuring CentOS 7 to build Contrail is currently a work in progress. To make it a bit less tedious, Flavio Fernandes has provided a provisioning script that adds epel repository access and also installs all needed packages (i.e., a one-step configure script). Here is a link to the github-hosted provisioning script.
On Ubuntu both 12.04 and 14.04 the basic build
dependencies are specified in the sandbox file tools/packages/debian/contrail/debian/control
,
look for the Build-Depends:
list.
There are some packages in the Build-Depends list that come from opencontrail PPA. Hence the following need to be
done.
tools/packages/debian/contrail/debian/control
.
On Ubuntu 14.04 these additional build dependencies are required:
See the sandbox
file tools/packages/debian/contrail/debian/builddep.trusty
for up-to-date list.
The current list is as below, but it's recommended to pick the latest from the builddep.trusty file.
Before building the software you will need to download other
open source software libraries used by the controller
repository. The python
script third_party/fetch_packages.py
automates
this process and automatically applies patches to some of
these libraries.
Contrail uses SCons as
its build tool. You should have installed it on your
system in step (4). To build, execute the
command scons
at the top-level sandbox
directory.
A few more packages are required to run unit tests and they need to be installed as below.
Additionally make sure ping `hostname`
works.
To run unit tests, execute the
command scons test
at the top-level sandbox
directory.
Please report build issues in the developers mailing list.