1. Prerequisites

Building Hc2vpp project requires:

  • Java 8

  • Maven (version 3.2.5 and above should be fine)

  • Properly set maven settings(displayed below) to access nexus.fd.io

2. Obtain the hc2vpp source code

git clone ssh://[username]@gerrit.fd.io:29418/hc2vpp
cd hc2vpp
git checkout stable/1810

3. Building the code

Make sure all the prerequisites are installed.

To make sure fresh hc2vpp build is compatible with VPP, it is required to make sure the same JVpp version is used preventing out-of-sync exceptions. Compatible JVPP artifacts can be obtained by installing vpp-api-java package or building VPP. In case only hc2vpp needs to be built, skip Building VPP section.

3.1. Building VPP

Clone VPP according to: https://gerrit.fd.io/r/#/admin/projects/vpp and checkout stable/1810 branch

Dive into VPP’s build-root folder:

cd vpp/build-root/

Build VPP:

make distclean && ./bootstrap.sh && make V=0 PLATFORM=vpp TAG=vpp install-deb

Install VPP:

sudo dpkg -i *.deb

Start VPP:

sudo start vpp

Now current Vpp is up and running and prepared for integration with HC.

3.2. Building hc2vpp

3.2.1. Setup settings.xml

Put the following in your ~/.m2/settings.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!-- vi: set et smarttab sw=2 tabstop=2: -->
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

  <profiles>
    <profile>
      <id>fd.io-release</id>
      <repositories>
        <repository>
          <id>fd.io-mirror</id>
          <name>fd.io-mirror</name>
          <url>https://nexus.fd.io/content/groups/public/</url>
          <releases>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
          </releases>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>fd.io-mirror</id>
          <name>fd.io-mirror</name>
          <url>https://nexus.fd.io/content/repositories/public/</url>
          <releases>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
          </releases>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>

    <profile>
      <id>fd.io-snapshots</id>
      <repositories>
        <repository>
          <id>fd.io-snapshot</id>
          <name>fd.io-snapshot</name>
          <url>https://nexus.fd.io/content/repositories/fd.io.snapshot/</url>
          <releases>
            <enabled>false</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>fd.io-snapshot</id>
          <name>fd.io-snapshot</name>
          <url>https://nexus.fd.io/content/repositories/fd.io.snapshot/</url>
          <releases>
            <enabled>false</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
    <profile>
      <id>opendaylight-snapshots</id>
      <repositories>
        <repository>
          <id>opendaylight-snapshot</id>
          <name>opendaylight-snapshot</name>
          <url>https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/</url>
          <releases>
            <enabled>false</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>opendaylight-shapshot</id>
          <name>opendaylight-snapshot</name>
          <url>https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/</url>
          <releases>
            <enabled>false</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>

  <activeProfiles>
    <activeProfile>fd.io-release</activeProfile>
    <activeProfile>fd.io-snapshots</activeProfile>
    <activeProfile>opendaylight-snapshots</activeProfile>
  </activeProfiles>
</settings>

3.2.2. Installing JVpp jars

By default hc2vpp build downloads latest JVpp jars from nexus.fd.io. They might not be compatible with installed VPP (e.g. in case of non-backward compatible VPP API changes).

In order to prevent API mismatch it is required to use JVpp version corresponding to the VPP installed.

Use

./hc2vpp/jvpp/install_from_vpp_build_dir.sh

to install JVpp jars produced during VPP build.

If vpp-api-java package is installed, use:

./hc2vpp/jvpp/install_from_package.sh

Now hc2vpp can be built and it will use compatible JVpp artifacts.

3.2.3. Building hc2vpp

cd hc2vpp/

mvn clean install

To perform quick build(no tests, no checks, no docs) run:

mvn clean install -DskipTests -Dcheckstyle.skip -Dmaven.javadoc.skip=true -Djacoco.skip

Now hc2vpp can be run with:

sudo sh vpp-integration/minimal-distribution/target/vpp-integration-distribution-1.18.10-hc/vpp-integration-distribution-1.18.10/honeycomb

3.3. Building packages

After the code has been built, you can build an RPM or DEB package for hc2vpp.

3.3.1. RPM

Export build number variable, e.g.:

export BUILD_NUMBER=33

Run package building script from:

packaging/rpm/rpmbuild.sh

3.3.2. DEB

Export build number variable, e.g.:

export BUILD_NUMBER=33

Run package building script from:

packaging/deb/xenial/debuild.sh

or

packaging/deb/trusty/debuild.sh