From 17fdb321f3e87bc18a6004d871a5b2b3778821b3 Mon Sep 17 00:00:00 2001 From: Ray Kinsella Date: Tue, 4 Apr 2017 17:38:05 +0100 Subject: vpp-bootstrap: VPP 17.04 Support * Adding support for VPP17.04 * Disabling DPDK to reduce mem footprint to 1G * Fixing AWS for Xenial Change-Id: I70f4ac0e70b80fd9b50d08f88a0987c089503ff2 Signed-off-by: Ray Kinsella --- vpp-bootstrap/Vagrantfile | 8 ++++---- vpp-bootstrap/containers/ctwo.provision.sh | 10 +++------- vpp-bootstrap/provision.sh | 23 +++++++++++------------ 3 files changed, 18 insertions(+), 23 deletions(-) diff --git a/vpp-bootstrap/Vagrantfile b/vpp-bootstrap/Vagrantfile index fc93751..e607c44 100644 --- a/vpp-bootstrap/Vagrantfile +++ b/vpp-bootstrap/Vagrantfile @@ -8,10 +8,10 @@ end Vagrant.configure(2) do |config| - # Pick the right distro and bootstrap, default is ubuntu1404 + # Pick the right distro and bootstrap, default is ubuntu1604 config.vm.box = "puppetlabs/ubuntu-16.04-64-nocm" vmcpu=(ENV['VPP_VAGRANT_VMCPU'] || 2) - vmram=(ENV['VPP_VAGRANT_VMRAM'] || 2048) + vmram=(ENV['VPP_VAGRANT_VMRAM'] || 1024) # Define some physical ports for your VMs to be used by DPDK config.vm.network "private_network", type: "dhcp" @@ -67,8 +67,8 @@ Vagrant.configure(2) do |config| #to enable `vagrant ssh` to work. aws.security_groups = [ "permit-ssh", "default" ] - #Amazon Machine Instance (AMI) to use, default is Ubuntu Trusty (HVM). - aws.ami = "ami-0c59f37f" + #Amazon Machine Instance (AMI) to use, default is Ubuntu Xenial (HVM). + aws.ami = "ami-405f7226" #EC2 instance type (how much cpu/mem resources to give the instance). aws.instance_type = "t2.micro" diff --git a/vpp-bootstrap/containers/ctwo.provision.sh b/vpp-bootstrap/containers/ctwo.provision.sh index d8e5796..f914f2d 100755 --- a/vpp-bootstrap/containers/ctwo.provision.sh +++ b/vpp-bootstrap/containers/ctwo.provision.sh @@ -12,10 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -VPP_VERSION=v17.01 +VPP_VERSION=v17.04 VPP_DIR=~/vpp VPP_GIT="https://git.fd.io/vpp" -PLATFORM=vpp_lite echo Cloning $VPP_GIT git clone $VPP_GIT $VPP_DIR @@ -31,8 +30,5 @@ make wipe rm -f build-root/.bootstrap.ok # Build and install packaging -make PLATFORM=$PLATFORM bootstrap -make PLATFORM=$PLATFORM build -#not sure why this is needed to called explicitly -make PLATFORM=$PLATFORM build-vpp-api -make PLATFORM=$PLATFORM plugins +make bootstrap +make build diff --git a/vpp-bootstrap/provision.sh b/vpp-bootstrap/provision.sh index d913489..5c01939 100755 --- a/vpp-bootstrap/provision.sh +++ b/vpp-bootstrap/provision.sh @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -PACKAGE_REPO="https://nexus.fd.io/content/repositories/fd.io.stable.1701.ubuntu.trusty.main/" +PACKAGE_REPO="https://nexus.fd.io/content/repositories/fd.io.stable.1704.ubuntu.xenial.main/" HOME_DIR="/home/$USER" RC_LOCAL="/etc/rc.local" SSH_OPTIONS="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" @@ -84,20 +84,19 @@ function get_field() { echo $value } -sudo sysctl -w vm.nr_hugepages=128 -HUGEPAGES=`sudo sysctl -n vm.nr_hugepages` -if [ $HUGEPAGES != 128 ]; then - echo "ERROR: Unable to get 128 hugepages, only got $HUGEPAGES. Cannot finish." - exit -fi - echo "deb $PACKAGE_REPO ./" | sudo tee -a /etc/apt/sources.list.d/99fd.io.list sudo apt-get -qq update -sudo apt-get -qq install -y --force-yes lxc bridge-utils tmux vpp vpp vpp-dpdk-dkms +sudo apt-get -qq install -y --force-yes linux-image-extra-$(uname -r) lxc bridge-utils tmux +sudo apt-get -qq install -y --force-yes vpp vpp vpp-dpdk-dkms vpp-plugins + +#Disable DPDK to make memory requirements more modest +sudo sed -i_dpdk '47,52d' /etc/vpp/startup.conf +echo -e "plugins {\n\tplugin dpdk_plugin.so { disable }\n}" | sudo tee -a /etc/vpp/startup.conf -#Fix VPP on the host to use 128 hugepages -sudo sed -i 's/vm.nr_hugepages=1024/vm.nr_hugepages=128/' /etc/sysctl.d/80-vpp.conf -sudo sed -i 's/kernel.shmmax=2147483648/kernel.shmmax=268435456/' /etc/sysctl.d/80-vpp.conf +#Fix VPP on the host to use 32 hugepages +echo -e "heapsize 64M" | sudo tee -a /etc/vpp/startup.conf +sudo sed -i 's/vm.nr_hugepages=1024/vm.nr_hugepages=32/' /etc/sysctl.d/80-vpp.conf +sudo sed -i 's/kernel.shmmax=2147483648/kernel.shmmax=67018864/' /etc/sysctl.d/80-vpp.conf #Provision containers with two network connections, second connection is unconnected echo -e "lxc.network.name=veth0" | sudo tee -a /etc/lxc/default.conf -- cgit 1.2.3-korg