Build patched containers - netronome-support/Agilio-vRouter5 GitHub Wiki

The goal of this step is to build a set of containers on the R5.0 branch of Tungsten Fabric, with offloading patches applied.

Create a ~/patches directory and copy the fix-container-build.patch file from the build/patches/ path of the extracted package into it::

mkdir -p ~/patches
cp ~/netronome-agilio-vrouter-5.0-tp1/build/patches/* ~/patches

1. Install docker

For CentOS/RHEL/Fedora linux host:

yum install docker

For Ubuntu linux host:

apt install docker.io

NOTE (only if you hit any issues): Make sure that your docker engine supports images bigger than 10GB. For instructions, see here: https://stackoverflow.com/questions/37100065/resize-disk-usage-of-a-docker-container Make sure that there is TCP connectivity allowed between the containers in the default docker bridge network, (for example disable firewall).

2. Clone dev setup repo

git clone https://github.com/Juniper/contrail-dev-env
cd contrail-dev-env

3. Execute script to start 3 containers

After changing to the ~/contrail-dev-env/ directory, execute the following commands::

git checkout origin/R5.0 -b R5.0
patch -p1 < ~/patches/fix-container-build.patch
sudo ./startup.sh -t R5.0
docker ps -a should show these 3 containers
contrail-developer-sandbox [For running scons, unit-tests etc]
contrail-dev-env-rpm-repo  [Repo server for contrail RPMs after they are build]
contrail-dev-env-registry  [Registry for contrail containers after they are built]

4. Attach to developer-sandbox container and patch sources

docker attach contrail-developer-sandbox
mkdir -p ~/patches
curl 'https://review.opencontrail.org/changes/47586/revisions/69b7cfe2721ea6093d9c354094c1dcff7cd9c3bf/patch?download' | base64 -d > ~/patches/controller-fix_vnic_semantics.patch
cd /root/contrail
repo sync -j $(nproc) # to get the latest code checked out
cd /root/contrail/controller
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
git am ~/patches/controller-fix_vnic_semantics.patch
cd ../vrouter
git am ~/patches/0001-Include-hardware-offload-hooks.patch

5. Run scons, UT, make RPMS or make containers

Required first steps in the container:

cd /root/contrail-dev-env
make setup
make dep
make rpm
make containers

Now you can run any commands using the source code sandbox, e.g.

cd /root/contrail
scons  # ( or "scons test" etc)

Additional make targets provided by contrail-dev-env/Makefile:

  • make setup - initial configuration of image (required to run once)
  • make dep - installs all build dependencies
  • make dep-<pkg_name> - installs build dependencies for <pkg_name>
  • make list - lists all available rpm targets
  • make rpm - builds all RPMs
  • make rpm-<pkg_name> - builds single RPM for <pkg_name>
  • make list-containers - lists all container targets
  • make containers - builds all containers, requires RPM packages in /root/contrail/RPMS
  • make container-<container_name> - builds single container as a taret, with all docker dependencies
  • make clean{-containers,-repo,-rpm} - artifacts cleanup

6. Testing the deployment

See https://github.com/Juniper/contrail-ansible-deployer/wiki/Contrail-with-Kolla-Ocata . Set CONTAINER_REGISTRY to registry:5000 to use containers built in step 5.

⚠️ **GitHub.com Fallback** ⚠️