VPP/Setting Up Your Dev Environment

From fd.io
< VPP
Revision as of 20:43, 24 February 2016 by GiorgiGuliashvili (Talk | contribs)

Jump to: navigation, search

Install The Enviroment

You will need a virtual machine and Vagrant software to host and launch the build environment.

Install Virtualbox or VMWare

The default configuration supports VMWare and VirtualBox. You will need to install *one* of them.

VirtualBox is free. You can download and install VirtualBox from here.

VMWare runs faster than VirtualBox, but requires purchase. You can acquire VMWare Fusion (Mac) or VMWare Workstation (Windows)

VMware runs faster than VirtualBox. To use VMware you will need to obtain a VMware plugin for Vagrant. You can learn more about support for VMware from the Vagrant documentation: https://docs.vagrantup.com/v2/vmware/.

Install Vagrant software.

Install the Vagrant software: https://docs.vagrantup.com/v2/installation/index.html

Install vagrant-cachier

Optional: To cache apt/yum (for faster Vagrant VM rebuild), install vagrant-cachier.

At the unix command line run:

$ vagrant plugin install vagrant-cachier

Obtain The VPP Source Code

Using ssh

Make sure you have registered your ssh key with gerrit.

Get the VPP source code.

a. Open a command-line interface (terminal window).

b. Change to the directory where you want to install VPP

$ cd $HOME/source/vpp

c. Type the following git command (replacing USERNAME with your Linux Foundation username):

$ git clone ssh://USERNAME@gerrit.fd.io:29418/vpp.git

Using https

Get the VPP source code.

a. Open a command-line interface (terminal window).

b. Change to the directory where you want to install VPP

$ cd $HOME/source/vpp

c. Type the following git command (replacing USERNAME with your Linux Foundation username):

$ git clone https://gerrit.fd.io/r/vpp

Install cscope

cscope is a tool that can make browsing the code base much easier.

Installing on a Mac:

a. Install cscope on your mac following the instructions at: [http://macappstore.org/cscope/]

b. Go to the directory where you have installed VPP

$ cd $HOME/source/vpp

c. Run the following commands to create a cscope database file

$ find . -path .git -prune -o -name "*.[ch]" -print > cscope.files
$ cscope -b -q -k

d. Now you can explore the code base using cscope (-d command tells it not to regenerate the database)

$ cscope -d

e. For more information on how to use csocpe, check out http://cscope.sourceforge.net/

Installing on Windows:

Check out http://cscope.sourceforge.net/ for instructions on how to download and install on Windows

Customize Vagrant

The vagrant file included needs to be updated as follows. The file can be found at build-root/vagrant/Vagrantfile

$ vi ./build-root/vagrant/Vagrantfile


Change the CPU/Memory config of the VM (Optional)

You may wish to increase the number of CPU, amount of memory, or otherwise configure the Vagrant VM you're about to create. You can do so after creating the VM, as well.

Depending on which provider you are using, you can edit the appropriate section and set the memory or num of cpus

 
  config.vm.provider "virtualbox" do |vb|
    vb.memory = "4096"
  end
  config.vm.provider "vmware_fusion" do |fusion,override|
    fusion.vmx["memsize"] = "4096"
  end
  config.vm.provider "vmware_workstation" do |vws,override|
    vws.vmx["memsize"] = "8192"
    vws.vmx["numvcpus"] = "4"
  end

Configure http proxy (optional)

When running behind a proxy/firewall, you may need to set http_proxy and https_proxy in the environment. You can use the export command to make the following environmental variables available to child processes:

$ export http_proxy=http://<proxy-server>:<port>
$ export https_proxy=https://<proxy-server>:<port>

Vagrant can do this for you by installing proxyconf:

$ vagrant plugin install vagrant-proxyconf

Next Steps

Try some of the following tutorials:

Build, install, and test images

Accessing gerrit repo from within DMZ machine

How To Connect A PCI Interface To VPP