Difference between revisions of "VPP/Setting Up Your Dev Environment"

From fd.io
< VPP
Jump to: navigation, search
(Install a Virtualbox or VMWare)
m (Replaced projectrotterdam.info with fd.io)
Line 32: Line 32:
 
a. Open a command-line interface (terminal window).
 
a. Open a command-line interface (terminal window).
  
b. Type the following command (replacing USERNAME with your LF username):
+
b. Type the following git command (replacing USERNAME with your Linux Foundation username):
  
<pre>git clone ssh://USERNAME@gerrit.projectrotterdam.info:29418/vpp.git</pre>
+
<pre>git clone ssh://USERNAME@gerrit.fd.io:29418/vpp.git</pre>
  
 
== Customize Vagrant (optional) ==  
 
== Customize Vagrant (optional) ==  

Revision as of 19:57, 8 January 2016

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.

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

Make sure you have registered your ssh key with gerrit.

Get the VPP source code.

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

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

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

Customize Vagrant (optional)

Customize the Vagrantfile (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.

emacs ./build-root/vagrant/Vagrantfile


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

Running Vagrant

For more information about using Vagrant on a command-line interface (CLI), see: https://docs.vagrantup.com/v2/cli/index.html

cd to the vagrant directory

In the command-line interface, navigate to the directory that has the pre-configured Vagrantfile. (In the following sample command, <install_dir> is the directory where you unzipped or cloned the VPP software.)

$ cd <install_dir>/build-root/vagrant/

NOTE: The .../build-root directory contains the files that make up most of the build system. It contains all of the generic targets, including: xxx-build, xxx-rebuild, xxx-install, xxx-clean, xxx-wipe, xxx-configure, and xxx-find-source.

Start Vagrant

Use the Vagrant up command to cause Vagrant to start. Vagrant uses the Vagrantfile in the current working directory.

$ vagrant up

By default this will build an Ubuntu 14.0.4 VM. If you wish instead to build a Centos7 VM instead:

$ (export VPP_VAGRANT_DISTRO=centos7;vagrant up)

When you first start Vagrant, it is normal for it to run for several minutes, building the VM, building VPP, and then a README will be displayed telling you how to run VPP.

Access the shell

Use the Vagrant SSH command to access the running Vagrant machine and give you access to a shell.

$ vagrant ssh

If you wish to forward X-windows server requests, use this variation:

$ vagrant ssh -- -X

Success!

You've set up the basic environment that you need in order to start building the VPP codebase.