summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuo Ruijing <ruijing.guo@intel.com>2016-04-21 07:45:22 +0000
committerGuo Ruijing <ruijing.guo@intel.com>2016-04-21 07:46:33 +0000
commit5e73fe1c1187bbd9c152221bb0febd20e915b185 (patch)
tree632d71e7b0568b3a5675ae5e49325b8a9d322b68
parent27eaf16ac1ca2849f85e85e969c6e322c8cb42ae (diff)
Refactor fuel ovs plugin
Change-Id: I078a1c7472d76041371075c41a1069a3ba248503 Signed-off-by: Guo Ruijing <ruijing.guo@intel.com>
Notes
Notes (review): Code-Review+2: Ruijing <ruijing.guo@intel.com> Workflow+1: Ruijing <ruijing.guo@intel.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Thu, 21 Apr 2016 07:47:43 +0000 Reviewed-on: https://review.openstack.org/308817 Project: openstack/fuel-plugin-ovs Branch: refs/heads/master
-rw-r--r--README.md5
-rw-r--r--deployment_scripts/puppet/manifests/ovs-install-compute.pp30
-rw-r--r--deployment_scripts/puppet/manifests/ovs-install-controller.pp22
-rw-r--r--deployment_scripts/puppet/manifests/ovs-install-primary-controller.pp22
-rw-r--r--environment_config.yaml18
-rw-r--r--metadata.yaml4
-rw-r--r--ovs-nsh/Dockerfile27
-rwxr-xr-xovs-nsh/build-ovs-nsh-dpdk.sh50
-rw-r--r--ovs_build/Dockerfile14
-rwxr-xr-xovs_build/build-ovs-dpdk.sh37
-rwxr-xr-xovs_build/build-ovs-nsh-dpdk.sh41
-rwxr-xr-xovs_build/build-ovs-nsh.sh (renamed from ovs-nsh/build-ovs-nsh.sh)10
-rw-r--r--ovs_build/patches/060679.patch (renamed from ovs-nsh/patches/060679.patch)0
-rw-r--r--ovs_build/patches/060680.patch (renamed from ovs-nsh/patches/060680.patch)0
-rw-r--r--ovs_build/patches/060681.patch (renamed from ovs-nsh/patches/060681.patch)0
-rw-r--r--ovs_build/patches/060682.patch (renamed from ovs-nsh/patches/060682.patch)0
-rw-r--r--ovs_build/patches/060683.patch (renamed from ovs-nsh/patches/060683.patch)0
-rw-r--r--ovs_build/patches/060684.patch (renamed from ovs-nsh/patches/060684.patch)0
-rw-r--r--ovs_build/patches/060685.patch (renamed from ovs-nsh/patches/060685.patch)0
-rwxr-xr-xpre_build_hook17
-rwxr-xr-xrepositories/ubuntu/dpdk/dpdk-install.sh24
-rw-r--r--repositories/ubuntu/dpdk/dpdk.conf6
-rw-r--r--repositories/ubuntu/dpdk/dpdk.init147
-rwxr-xr-xrepositories/ubuntu/dppd/dppd-install.sh9
-rwxr-xr-xrepositories/ubuntu/ovs/ovs-install.sh12
-rw-r--r--tasks.yaml16
26 files changed, 129 insertions, 382 deletions
diff --git a/README.md b/README.md
index ca871bb..c5e36db 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@ Openvswitch plugin
7Overview 7Overview
8-------- 8--------
9 9
10New fuel plugin fuel-plugin-ovs is developed to deploy OVS with NSH + DPDK in Fuel@OPNFV, which is requested by ODL project 10Fuel plugin fuel-plugin-ovs is developed to deploy OVS with NSH + DPDK
11 11
12Requirements 12Requirements
13------------ 13------------
@@ -60,7 +60,7 @@ Openvswitch plugin installation
60 60
61 id | name | version | package_version 61 id | name | version | package_version
62 ---|-----------------|---------|---------------- 62 ---|-----------------|---------|----------------
63 1 | fuel-plugin-ovs | 0.5.2 | 3.0.0 63 1 | fuel-plugin-ovs | 0.8.0 | 3.0.0
64 64
658. Plugin is ready to use and can be enabled on the Settings tab of the Fuel web UI. 658. Plugin is ready to use and can be enabled on the Settings tab of the Fuel web UI.
66 66
@@ -132,4 +132,3 @@ Contributors
132------------ 132------------
133 133
134* ling.y.yu@intel.com,ruijing.guo@intel.com 134* ling.y.yu@intel.com,ruijing.guo@intel.com
135
diff --git a/deployment_scripts/puppet/manifests/ovs-install-compute.pp b/deployment_scripts/puppet/manifests/ovs-install-compute.pp
index 0206a84..b29deee 100644
--- a/deployment_scripts/puppet/manifests/ovs-install-compute.pp
+++ b/deployment_scripts/puppet/manifests/ovs-install-compute.pp
@@ -1,22 +1,16 @@
1$fuel_settings = parseyaml(file('/etc/compute.yaml')) 1$fuel_settings = parseyaml(file('/etc/compute.yaml'))
2if $operatingsystem == 'Ubuntu' { 2if $operatingsystem == 'Ubuntu' {
3 if $fuel_settings['fuel-plugin-ovs']['use_dpdk'] { 3 if $fuel_settings['fuel-plugin-ovs']['support_dpdk'] {
4 $NICS = $fuel_settings['fuel-plugin-ovs']['dpdk-bind-nic'] 4 $packages='openvswitch-datapath-dkms_2.4.90.dpdk-1 openvswitch-common_2.4.90.dpdk-1 openvswitch-switch_2.4.90.dpdk-1'
5 exec { "install dpdk": 5 }
6 command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk/dpdk-install.sh; bash ./dpdk-install.sh $NICS", 6 if $fuel_settings['fuel-plugin-ovs']['support_nsh'] {
7 path => "/usr/bin:/usr/sbin:/bin:/sbin", 7 $packages='openvswitch-datapath-dkms_2.4.90.nsh-1 openvswitch-common_2.4.90.nsh-1 openvswitch-switch_2.4.90.nsh-1'
8 } 8 }
9 } else { 9 if $fuel_settings['fuel-plugin-ovs']['support_nsh_dpdk'] {
10 exec { "install ovs": 10 $packages='openvswitch-datapath-dkms_2.4.90.nshdpdk-1 openvswitch-common_2.4.90.nshdpdk-1 openvswitch-switch_2.4.90.nshdpdk-1'
11 command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/ovs/ovs-install.sh; bash ./ovs-install.sh", 11 }
12 path => "/usr/bin:/usr/sbin:/bin:/sbin", 12 exec { 'ovs install':
13 } 13 command => '/usr/bin/apt-get -y --force-yes install $packages'
14 } 14 }
15 if $fuel_settings['fuel-plugin-ovs']['use_dppd'] {
16 exec { "install dppd":
17 command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dppd/dppd-install.sh; bash ./dppd-install.sh",
18 path => "/usr/bin:/usr/sbin:/bin:/sbin",
19 }
20 }
21} elsif $operatingsystem == 'CentOS' { 15} elsif $operatingsystem == 'CentOS' {
22} 16}
diff --git a/deployment_scripts/puppet/manifests/ovs-install-controller.pp b/deployment_scripts/puppet/manifests/ovs-install-controller.pp
deleted file mode 100644
index befee13..0000000
--- a/deployment_scripts/puppet/manifests/ovs-install-controller.pp
+++ /dev/null
@@ -1,22 +0,0 @@
1$fuel_settings = parseyaml(file('/etc/controller.yaml'))
2if $operatingsystem == 'Ubuntu' {
3 if $fuel_settings['fuel-plugin-ovs']['use_dpdk'] {
4 $NICS = $fuel_settings['fuel-plugin-ovs']['dpdk-bind-nic']
5 exec { "install dpdk":
6 command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk/dpdk-install.sh; bash ./dpdk-install.sh $NICS",
7 path => "/usr/bin:/usr/sbin:/bin:/sbin",
8 }
9 } else {
10 exec { "install ovs":
11 command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/ovs/ovs-install.sh; bash ./ovs-install.sh",
12 path => "/usr/bin:/usr/sbin:/bin:/sbin",
13 }
14 }
15 if $fuel_settings['fuel-plugin-ovs']['use_dppd'] {
16 exec { "install dppd":
17 command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dppd/dppd-install.sh; bash ./dppd-install.sh",
18 path => "/usr/bin:/usr/sbin:/bin:/sbin",
19 }
20 }
21} elsif $operatingsystem == 'CentOS' {
22}
diff --git a/deployment_scripts/puppet/manifests/ovs-install-primary-controller.pp b/deployment_scripts/puppet/manifests/ovs-install-primary-controller.pp
deleted file mode 100644
index e939679..0000000
--- a/deployment_scripts/puppet/manifests/ovs-install-primary-controller.pp
+++ /dev/null
@@ -1,22 +0,0 @@
1$fuel_settings = parseyaml(file('/etc/primary-controller.yaml'))
2if $operatingsystem == 'Ubuntu' {
3 if $fuel_settings['fuel-plugin-ovs']['use_dpdk'] {
4 $NICS = $fuel_settings['fuel-plugin-ovs']['dpdk-bind-nic']
5 exec { "install dpdk":
6 command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk/dpdk-install.sh; bash ./dpdk-install.sh $NICS",
7 path => "/usr/bin:/usr/sbin:/bin:/sbin",
8 }
9 } else {
10 exec { "install ovs":
11 command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/ovs/ovs-install.sh; bash ./ovs-install.sh",
12 path => "/usr/bin:/usr/sbin:/bin:/sbin",
13 }
14 }
15 if $fuel_settings['fuel-plugin-ovs']['use_dppd'] {
16 exec { "install dppd":
17 command => "wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dppd/dppd-install.sh; bash ./dppd-install.sh",
18 path => "/usr/bin:/usr/sbin:/bin:/sbin",
19 }
20 }
21} elsif $operatingsystem == 'CentOS' {
22}
diff --git a/environment_config.yaml b/environment_config.yaml
index 1d28f37..ac4b617 100644
--- a/environment_config.yaml
+++ b/environment_config.yaml
@@ -1,16 +1,16 @@
1attributes: 1attributes:
2 use_dpdk: 2 support_dpdk:
3 type: "checkbox" 3 type: "checkbox"
4 weight: 20 4 weight: 20
5 value: false 5 value: false
6 label: "Use dpdk" 6 label: "support DPDK"
7 dpdk-bind-nic: 7 support_nsh:
8 value: 'eth2'
9 label: 'Network device'
10 weight: 40
11 type: "text"
12 use_dppd:
13 type: "checkbox" 8 type: "checkbox"
14 weight: 20 9 weight: 20
15 value: false 10 value: false
16 label: "Use dppd" 11 label: "support NSH"
12 support_nsh_dpdk:
13 type: "checkbox"
14 weight: 20
15 value: false
16 label: "support NSH & DPDK"
diff --git a/metadata.yaml b/metadata.yaml
index 333c46c..bec0dcb 100644
--- a/metadata.yaml
+++ b/metadata.yaml
@@ -1,9 +1,9 @@
1# Plugin name 1# Plugin name
2name: fuel-plugin-ovs 2name: fuel-plugin-ovs
3# Human-readable name for your plugin 3# Human-readable name for your plugin
4title: Openvswitch with NSH support 4title: Openvswitch with NSH/DPDK support
5# Plugin version 5# Plugin version
6version: '0.5.2' 6version: '0.8.0'
7# Description 7# Description
8description: 'This plugin provides to deploy openvswitch with nsh' 8description: 'This plugin provides to deploy openvswitch with nsh'
9# Required fuel version 9# Required fuel version
diff --git a/ovs-nsh/Dockerfile b/ovs-nsh/Dockerfile
deleted file mode 100644
index 9d23652..0000000
--- a/ovs-nsh/Dockerfile
+++ /dev/null
@@ -1,27 +0,0 @@
1#!/bin/bash
2
3FROM ubuntu:14.04.3
4
5RUN rm -rf /lib/modules
6RUN apt-get update
7RUN apt-get install -y software-properties-common python-software-properties \
8 make python-setuptools python-all dpkg-dev debhelper \
9 fuseiso git genisoimage bind9-host wget curl lintian tmux lxc iptables \
10 ca-certificates sudo apt-utils lsb-release libtool autoconf automake build-essential fakeroot libssl-dev graphviz dh-autoreconf python-qt4 python-twisted-conch python-zopeinterface linux-headers-3.13.0-76-generic
11
12RUN ln -s /lib/modules/3.13.0-76-generic /lib/modules/`uname -r`
13
14RUN apt-get install -y pkg-config unzip liblua5.2-dev libpcap-dev libedit-dev libncurses5-dev libncursesw5-dev
15
16RUN echo "ALL ALL=NOPASSWD: ALL" > /etc/sudoers.d/open-sudo
17RUN chmod 0440 /etc/sudoers.d/open-sudo
18
19ADD ./patches /patches
20
21ADD ./build-ovs-nsh.sh /build-ovs-nsh.sh
22RUN chmod +x /build-ovs-nsh.sh
23RUN /build-ovs-nsh.sh
24
25ADD ./build-ovs-nsh-dpdk.sh /build-ovs-nsh-dpdk.sh
26RUN chmod +x /build-ovs-nsh-dpdk.sh
27RUN /build-ovs-nsh-dpdk.sh
diff --git a/ovs-nsh/build-ovs-nsh-dpdk.sh b/ovs-nsh/build-ovs-nsh-dpdk.sh
deleted file mode 100755
index 1f9e7cc..0000000
--- a/ovs-nsh/build-ovs-nsh-dpdk.sh
+++ /dev/null
@@ -1,50 +0,0 @@
1#!/bin/bash
2
3DPDK_VER=2.1.0
4
5OVS_COMMIT=121daded51b9798fe3722824b27a05c16806cbd1
6RTE_TARGET=x86_64-native-linuxapp-gcc
7PATCHES="060679 060680 060681 060682 060683 060684 060685"
8URL_OVS=https://github.com/openvswitch/ovs.git
9URL_DPDK=http://dpdk.org/browse/dpdk/snapshot/dpdk-${DPDK_VER}.tar.gz
10
11wget ${URL_DPDK}
12tar -xzvf dpdk-${DPDK_VER}.tar.gz
13cd dpdk-${DPDK_VER}
14sed -i -e 's/CONFIG_RTE_LIBRTE_VHOST=n/CONFIG_RTE_LIBRTE_VHOST=y/' \
15 -e 's/CONFIG_RTE_BUILD_COMBINE_LIBS=n/CONFIG_RTE_BUILD_COMBINE_LIBS=y/' \
16 -e 's/CONFIG_RTE_PKTMBUF_HEADROOM=128/CONFIG_RTE_PKTMBUF_HEADROOM=256/' \
17 config/common_linuxapp
18cd /
19tar -czvf dpdk-${DPDK_VER}.tar.gz dpdk-${DPDK_VER}
20cd dpdk-${DPDK_VER}
21make install T=${RTE_TARGET}
22find . | grep "\.o$" | xargs rm -rf
23cd /
24tar czvf dpdk-${DPDK_VER}.bin.tar.gz dpdk-${DPDK_VER}
25
26git clone ${URL_OVS} openvswitch-dpdk
27cd openvswitch-dpdk
28git checkout ${OVS_COMMIT} -b development
29for patch in ${PATCHES}
30do
31 patch -p1 < /patches/${patch}.patch
32done
33export RTE_SDK=/dpdk-${DPDK_VER}
34export DPDK_BUILD=${RTE_SDK}/${RTE_TARGET}
35./boot.sh
36./configure --with-dpdk=$DPDK_BUILD
37sed -i "s?set ovs-vswitchd unix?set ovs-vswitchd --dpdk -c 0x1 -n 4 -- unix?" utilities/ovs-ctl.in;sed -i "s?configure --with-linux?configure --with-dpdk=/dpdk-2.1.0/x86_64-native-linuxapp-gcc --with-linux?" debian/dkms.conf.in;sed -i "s?configure --with-linux?configure --with-dpdk=/dpdk-2.1.0/x86_64-native-linuxapp-gcc --with-linux?" debian/rules.modules;sed -i "s?configure --?configure -- --with-dpdk=/dpdk-2.1.0/x86_64-native-linuxapp-gcc?" debian/rules;make dist;tar -xzf openvswitch-2.4.90.tar.gz;
38cd openvswitch-2.4.90;DEB_BUILD_OPTIONS='parallel=8 nocheck' fakeroot debian/rules binary
39
40
41cd /
42wget https://01.org/sites/default/files/downloads/intel-data-plane-performance-demonstrators/dppd-prox-v021.zip
43unzip dppd-prox-v021.zip
44export RTE_SDK=/dpdk-${DPDK_VER}
45export RTE_TARGET=x86_64-native-linuxapp-gcc
46cd /dppd-PROX-v021
47export DPPD_DIR=`pwd`; make
48find . | grep "\.o$" | xargs rm -rf
49cd /
50tar czvf dppd-prox-v021.bin.tar.gz dppd-PROX-v021
diff --git a/ovs_build/Dockerfile b/ovs_build/Dockerfile
new file mode 100644
index 0000000..f92df82
--- /dev/null
+++ b/ovs_build/Dockerfile
@@ -0,0 +1,14 @@
1#!/bin/bash
2
3FROM ubuntu:14.04.3
4
5RUN apt-get update -y
6
7RUN rm -rf /lib/modules
8RUN apt-get install -y linux-headers-3.13.0-76-generic
9RUN ln -s /lib/modules/3.13.0-76-generic /lib/modules/`uname -r`
10
11RUN apt-get build-dep openvswitch -y
12RUN apt-get -y install devscripts dpkg-dev git wget
13
14ADD ./ /ovs_build
diff --git a/ovs_build/build-ovs-dpdk.sh b/ovs_build/build-ovs-dpdk.sh
new file mode 100755
index 0000000..53313a5
--- /dev/null
+++ b/ovs_build/build-ovs-dpdk.sh
@@ -0,0 +1,37 @@
1#!/bin/bash
2
3DPDK_VER=2.1.0
4
5export RTE_TARGET=x86_64-native-linuxapp-gcc
6export RTE_SDK=/dpdk-${DPDK_VER}
7export DPDK_BUILD=${RTE_SDK}/${RTE_TARGET}
8
9OVS_COMMIT=121daded51b9798fe3722824b27a05c16806cbd1
10URL_OVS=https://github.com/openvswitch/ovs.git
11URL_DPDK=http://dpdk.org/browse/dpdk/snapshot/dpdk-${DPDK_VER}.tar.gz
12
13cd /
14wget ${URL_DPDK}
15tar -xzvf dpdk-${DPDK_VER}.tar.gz
16cd dpdk-${DPDK_VER}
17sed -i -e 's/CONFIG_RTE_LIBRTE_VHOST=n/CONFIG_RTE_LIBRTE_VHOST=y/' \
18 -e 's/CONFIG_RTE_BUILD_COMBINE_LIBS=n/CONFIG_RTE_BUILD_COMBINE_LIBS=y/' \
19 -e 's/CONFIG_RTE_PKTMBUF_HEADROOM=128/CONFIG_RTE_PKTMBUF_HEADROOM=256/' \
20 config/common_linuxapp
21make install T=${RTE_TARGET}
22
23cd /
24git clone ${URL_OVS} openvswitch
25cd openvswitch
26git checkout ${OVS_COMMIT} -b development
27
28export DEB_BUILD_OPTIONS='parallel=8 nocheck'
29sed -i "s/2.4.90/2.4.90.dpdk/g" debian/changelog
30sed -i "s/DATAPATH_CONFIGURE_OPTS.*=.*//" debian/rules
31sed -i "2iDATAPATH_CONFIGURE_OPTS='--with-dpdk=$DPDK_BUILD'" debian/rules
32sed -i "s/DATAPATH_CONFIGURE_OPTS.*=.*//" debian/rules.modules
33sed -i "2iDATAPATH_CONFIGURE_OPTS='--with-dpdk=$DPDK_BUILD'" debian/rules.modules
34debian/rules build
35fakeroot debian/rules binary
36
37cp /*.deb /build
diff --git a/ovs_build/build-ovs-nsh-dpdk.sh b/ovs_build/build-ovs-nsh-dpdk.sh
new file mode 100755
index 0000000..11ef6b8
--- /dev/null
+++ b/ovs_build/build-ovs-nsh-dpdk.sh
@@ -0,0 +1,41 @@
1#!/bin/bash
2
3DPDK_VER=2.1.0
4
5export RTE_TARGET=x86_64-native-linuxapp-gcc
6export RTE_SDK=/dpdk-${DPDK_VER}
7export DPDK_BUILD=${RTE_SDK}/${RTE_TARGET}
8
9OVS_COMMIT=121daded51b9798fe3722824b27a05c16806cbd1
10PATCHES="060679 060680 060681 060682 060683 060684 060685"
11URL_OVS=https://github.com/openvswitch/ovs.git
12URL_DPDK=http://dpdk.org/browse/dpdk/snapshot/dpdk-${DPDK_VER}.tar.gz
13
14cd /
15wget ${URL_DPDK}
16tar -xzvf dpdk-${DPDK_VER}.tar.gz
17cd dpdk-${DPDK_VER}
18sed -i -e 's/CONFIG_RTE_LIBRTE_VHOST=n/CONFIG_RTE_LIBRTE_VHOST=y/' \
19 -e 's/CONFIG_RTE_BUILD_COMBINE_LIBS=n/CONFIG_RTE_BUILD_COMBINE_LIBS=y/' \
20 -e 's/CONFIG_RTE_PKTMBUF_HEADROOM=128/CONFIG_RTE_PKTMBUF_HEADROOM=256/' \
21 config/common_linuxapp
22make install T=${RTE_TARGET}
23
24cd /
25git clone ${URL_OVS} openvswitch
26cd openvswitch
27git checkout ${OVS_COMMIT} -b development
28for patch in ${PATCHES}
29do
30 patch -p1 < /ovs_build/patches/${patch}.patch
31done
32export DEB_BUILD_OPTIONS='parallel=8 nocheck'
33sed -i "s/2.4.90/2.4.90.nshdpdk/g" debian/changelog
34sed -i "s/DATAPATH_CONFIGURE_OPTS.*=.*//" debian/rules
35sed -i "2iDATAPATH_CONFIGURE_OPTS='--with-dpdk=$DPDK_BUILD'" debian/rules
36sed -i "s/DATAPATH_CONFIGURE_OPTS.*=.*//" debian/rules.modules
37sed -i "2iDATAPATH_CONFIGURE_OPTS='--with-dpdk=$DPDK_BUILD'" debian/rules.modules
38debian/rules build
39fakeroot debian/rules binary
40
41cp /*.deb /build
diff --git a/ovs-nsh/build-ovs-nsh.sh b/ovs_build/build-ovs-nsh.sh
index 9a5fc9c..34c661d 100755
--- a/ovs-nsh/build-ovs-nsh.sh
+++ b/ovs_build/build-ovs-nsh.sh
@@ -4,13 +4,17 @@ OVS_COMMIT=121daded51b9798fe3722824b27a05c16806cbd1
4PATCHES="060679 060680 060681 060682 060683 060684 060685" 4PATCHES="060679 060680 060681 060682 060683 060684 060685"
5URL_OVS=https://github.com/openvswitch/ovs.git 5URL_OVS=https://github.com/openvswitch/ovs.git
6 6
7cd /
7git clone ${URL_OVS} openvswitch 8git clone ${URL_OVS} openvswitch
8cd openvswitch 9cd openvswitch
9git checkout ${OVS_COMMIT} -b development 10git checkout ${OVS_COMMIT} -b development
10for patch in ${PATCHES} 11for patch in ${PATCHES}
11do 12do
12 patch -p1 < /patches/${patch}.patch 13 patch -p1 < /ovs_build/patches/${patch}.patch
13done 14done
14 15
15./boot.sh;./configure;make dist;tar -xzf openvswitch-2.4.90.tar.gz 16export DEB_BUILD_OPTIONS='parallel=8 nocheck'
16cd openvswitch-2.4.90;dpkg-checkbuilddeps;DEB_BUILD_OPTIONS='parallel=8 nocheck' fakeroot debian/rules binary 17sed -i "s/2.4.90/2.4.90.nsh/g" debian/changelog
18debian/rules build
19fakeroot debian/rules binary
20cp /*.deb /build
diff --git a/ovs-nsh/patches/060679.patch b/ovs_build/patches/060679.patch
index 635cf1d..635cf1d 100644
--- a/ovs-nsh/patches/060679.patch
+++ b/ovs_build/patches/060679.patch
diff --git a/ovs-nsh/patches/060680.patch b/ovs_build/patches/060680.patch
index 538d2df..538d2df 100644
--- a/ovs-nsh/patches/060680.patch
+++ b/ovs_build/patches/060680.patch
diff --git a/ovs-nsh/patches/060681.patch b/ovs_build/patches/060681.patch
index f5afed1..f5afed1 100644
--- a/ovs-nsh/patches/060681.patch
+++ b/ovs_build/patches/060681.patch
diff --git a/ovs-nsh/patches/060682.patch b/ovs_build/patches/060682.patch
index c6ccd25..c6ccd25 100644
--- a/ovs-nsh/patches/060682.patch
+++ b/ovs_build/patches/060682.patch
diff --git a/ovs-nsh/patches/060683.patch b/ovs_build/patches/060683.patch
index 008f430..008f430 100644
--- a/ovs-nsh/patches/060683.patch
+++ b/ovs_build/patches/060683.patch
diff --git a/ovs-nsh/patches/060684.patch b/ovs_build/patches/060684.patch
index 329ac5c..329ac5c 100644
--- a/ovs-nsh/patches/060684.patch
+++ b/ovs_build/patches/060684.patch
diff --git a/ovs-nsh/patches/060685.patch b/ovs_build/patches/060685.patch
index a9da911..a9da911 100644
--- a/ovs-nsh/patches/060685.patch
+++ b/ovs_build/patches/060685.patch
diff --git a/pre_build_hook b/pre_build_hook
index 5804d83..cdfc09c 100755
--- a/pre_build_hook
+++ b/pre_build_hook
@@ -20,18 +20,11 @@ function build_pkg {
20 pushd "${DIR}/repositories/${1}/" 20 pushd "${DIR}/repositories/${1}/"
21 download_dependencies ${1} 21 download_dependencies ${1}
22 popd 22 popd
23 cd ${DIR}/ovs-nsh 23 cd ${DIR}/ovs_build
24 sudo docker build -t ovs-nsh . 24 sudo docker build -t ovs_build .
25 container_id=`sudo docker run -d ovs-nsh` 25 sudo docker run -v ${DIR}/repositories/ubuntu/ovs-nsh:/build -ti ovs_build /ovs_build/build-ovs-nsh.sh
26 sudo docker cp $container_id:/openvswitch/openvswitch-common_2.4.90-1_amd64.deb ${DIR}/repositories/ubuntu/ovs/ 26 sudo docker run -v ${DIR}/repositories/ubuntu/ovs-dpdk:/build -ti ovs_build /ovs_build/build-ovs-dpdk.sh
27 sudo docker cp $container_id:/openvswitch/openvswitch-datapath-dkms_2.4.90-1_all.deb ${DIR}/repositories/ubuntu/ovs/ 27 sudo docker run -v ${DIR}/repositories/ubuntu/ovs-nsh-dpdk:/build -ti ovs_build /ovs_build/build-ovs-nsh-dpdk.sh
28 sudo docker cp $container_id:/openvswitch/openvswitch-switch_2.4.90-1_amd64.deb ${DIR}/repositories/ubuntu/ovs/
29
30 sudo docker cp $container_id:/openvswitch-dpdk/openvswitch-common_2.4.90-1_amd64.deb ${DIR}/repositories/ubuntu/dpdk
31 sudo docker cp $container_id:/openvswitch-dpdk/openvswitch-datapath-dkms_2.4.90-1_all.deb ${DIR}/repositories/ubuntu/dpdk
32 sudo docker cp $container_id:/openvswitch-dpdk/openvswitch-switch_2.4.90-1_amd64.deb ${DIR}/repositories/ubuntu/dpdk
33 sudo docker cp $container_id:/dpdk-2.1.0.bin.tar.gz ${DIR}/repositories/ubuntu/dpdk/
34 sudo docker cp $container_id:/dppd-prox-v021.bin.tar.gz ${DIR}/repositories/ubuntu/dppd/
35 ;; 28 ;;
36 *) echo "Not supported system"; exit 1;; 29 *) echo "Not supported system"; exit 1;;
37 esac 30 esac
diff --git a/repositories/ubuntu/dpdk/dpdk-install.sh b/repositories/ubuntu/dpdk/dpdk-install.sh
deleted file mode 100755
index 99b406c..0000000
--- a/repositories/ubuntu/dpdk/dpdk-install.sh
+++ /dev/null
@@ -1,24 +0,0 @@
1#!/bin/bash
2
3NICS=$1
4INSTALL_HOME=/usr/share/dpdk/
5rm -rf $INSTALL_HOME ; mkdir -p $INSTALL_HOME
6cd $INSTALL_HOME
7wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk/dpdk-2.1.0.bin.tar.gz
8tar xzvf dpdk-2.1.0.bin.tar.gz
9rm -rf dpdk-2.1.0.bin.tar.gz
10wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk/dpdk.init -O /etc/init.d/dpdk
11chmod +x /etc/init.d/dpdk
12wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk/dpdk.conf -O /etc/default/dpdk.conf
13sed "s/DPDK_NIC_MAPPINGS=.*/DPDK_NIC_MAPPINGS=${NICS}/" -i /etc/default/dpdk.conf
14service dpdk start
15
16INSTALL_HOME=/usr/share/ovs-dpdk/
17rm -rf $INSTALL_HOME ; mkdir -p $INSTALL_HOME
18cd $INSTALL_HOME
19wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk/openvswitch-datapath-dkms_2.4.90-1_all.deb
20dpkg -i openvswitch-datapath-dkms_2.4.90-1_all.deb
21wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk/openvswitch-common_2.4.90-1_amd64.deb
22dpkg -i openvswitch-common_2.4.90-1_amd64.deb
23wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk/openvswitch-switch_2.4.90-1_amd64.deb
24dpkg -i openvswitch-switch_2.4.90-1_amd64.deb
diff --git a/repositories/ubuntu/dpdk/dpdk.conf b/repositories/ubuntu/dpdk/dpdk.conf
deleted file mode 100644
index 6264bf5..0000000
--- a/repositories/ubuntu/dpdk/dpdk.conf
+++ /dev/null
@@ -1,6 +0,0 @@
1DPDK_NUM_HUGEPAGES=${DPDK_NUM_HUGEPAGES:-2048}
2DPDK_HUGEPAGE_MOUNT=${DPDK_HUGEPAGE_MOUNT:-/dev/hugepages}
3DPDK_NIC_MAPPINGS=eth1
4DPDK_ALLOCATE_HUGEPAGES=True
5DPDK_INTERFACE_DRIVER='igb_uio'
6DPDK_HUGEPAGE_MOUNT_PAGESIZE=''
diff --git a/repositories/ubuntu/dpdk/dpdk.init b/repositories/ubuntu/dpdk/dpdk.init
deleted file mode 100644
index 3a1ee5d..0000000
--- a/repositories/ubuntu/dpdk/dpdk.init
+++ /dev/null
@@ -1,147 +0,0 @@
1#! /bin/bash
2#
3# Copyright (C) 2015 Intel, Inc.
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at:
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
17echo "sourcing config"
18source /etc/default/dpdk.conf
19
20RTE_SDK=${RTE_SDK:-/usr/share/dpdk/dpdk-2.1.0}
21RTE_TARGET=${RTE_TARGET:-x86_64-native-linuxapp-gcc}
22DPDK_DIR=$RTE_SDK
23
24
25remove_igb_uio_module(){
26 sudo rmmod igb_uio
27}
28
29unbind_nics(){
30 NICS=`RTE_SDK=${DPDK_DIR} RTE_TARGET=build ${DPDK_DIR}/tools/dpdk_nic_bind.py --status | grep drv=igb_uio | head -1`
31 while [ "${NICS}" != "" ]
32 do
33 BUSID=`echo "${NICS}" | awk '{ print $1 }'`
34 NANTIC=`echo "${NICS}" | grep "82574L"`
35 FVL=`echo "${NICS}" | grep "X710"`
36 RRC=`echo "${NICS}" | grep "82576"`
37 EM=`echo "${NICS}" | grep "82540EM"`
38 if [ "${NANTIC}" != "" ] ;then
39 DRIVER=e1000e
40 elif [ "${FVL}" != "" ] ;then
41 DRIVER=i40e
42 elif [ "${RRC}" != "" ] ;then
43 DRIVER=igb
44 elif [ "${EM}" != "" ] ;then
45 DRIVER=e1000
46 else
47 DRIVER=ixgbe
48 fi
49 sudo RTE_SDK=${DPDK_DIR} RTE_TARGET=build ${DPDK_DIR}/tools/dpdk_nic_bind.py -b ${DRIVER} ${BUSID}
50 NICS=`RTE_SDK=${DPDK_DIR} RTE_TARGET=build ${DPDK_DIR}/tools/dpdk_nic_bind.py --status | grep drv=igb_uio | head -1`
51 done
52}
53
54free_hugepages() {
55 HUGEPAGE_SIZE=$(grep Hugepagesize /proc/meminfo | awk '{ print $2 }')
56
57 if [ -d $DPDK_HUGEPAGE_MOUNT ]; then
58 sudo rm -rf ${DPDK_HUGEPAGE_MOUNT}/rtemap*
59 fi
60
61 sudo umount ${DPDK_HUGEPAGE_MOUNT}
62
63 # de-allocate hugepages
64 if [ $DPDK_ALLOCATE_HUGEPAGES == 'True' ]; then
65 for d in /sys/devices/system/node/node? ; do
66 echo 0 | sudo tee $d/hugepages/hugepages-${HUGEPAGE_SIZE}kB/nr_hugepages
67 done
68 fi
69}
70
71load_igb_uio_module(){
72 if [ ! -f $RTE_SDK/$RTE_TARGET/kmod/igb_uio.ko ];then
73 echo "## ERROR: Target does not have the DPDK UIO Kernel Module."
74 echo " To fix, please try to rebuild target."
75 return
76 fi
77 sudo modprobe uio
78 echo "Loading DPDK UIO module"
79 sudo insmod $RTE_SDK/$RTE_TARGET/kmod/igb_uio.ko
80}
81
82bind_nic_2_driver() {
83 list=("$@")
84 # Bind nics to DPDK_INTERFACE_DRIVER.
85 for pair in "${list[@]}"; do
86 addr=`echo $pair | cut -f 1 -d "#"`
87 nic=`echo $pair | cut -f 2 -d "#"`
88 echo sudo RTE_SDK=${DPDK_DIR} RTE_TARGET=build ${DPDK_DIR}/tools/dpdk_nic_bind.py -b $DPDK_INTERFACE_DRIVER $addr
89 sudo RTE_SDK=${DPDK_DIR} RTE_TARGET=build ${DPDK_DIR}/tools/dpdk_nic_bind.py -b $DPDK_INTERFACE_DRIVER $addr
90 done
91}
92
93bind_nics(){
94 # Extract nic name, bind it with DPDK_INTERFACE_DRIVER driver
95 PCI_MAPPINGS=${DPDK_NIC_MAPPINGS//,/ }
96 PCI_ARRAY=( $PCI_MAPPINGS )
97 bind_nic_2_driver "${PCI_ARRAY[@]}"
98}
99
100alloc_hugepages() {
101 HUGEPAGE_SIZE=$(grep Hugepagesize /proc/meminfo | awk '{ print $2 }')
102 sudo mkdir -p $DPDK_HUGEPAGE_MOUNT
103
104
105 #allocate hugepages
106 if [ $DPDK_ALLOCATE_HUGEPAGES == 'True' ]; then
107 for d in /sys/devices/system/node/node? ; do
108 echo $DPDK_NUM_HUGEPAGES | sudo tee $d/hugepages/hugepages-${HUGEPAGE_SIZE}kB/nr_hugepages
109 done
110 fi
111
112 if [ -n "$DPDK_HUGEPAGE_MOUNT_PAGESIZE" ]; then
113 sudo mount -t hugetlbfs pagesize=$DPDK_HUGEPAGE_MOUNT_PAGESIZE nodev $DPDK_HUGEPAGE_MOUNT
114 else
115 sudo mount -t hugetlbfs nodev $DPDK_HUGEPAGE_MOUNT
116 fi
117}
118
119cmd_start(){
120 echo "mounting hugepages"
121 alloc_hugepages
122 echo "loading DPDK_INTERFACE_DRIVER diver"
123 load_igb_uio_module
124 bind_nics
125}
126cmd_stop(){
127 #if physical nics bindings are defined, bind nics with linux driver
128 echo "rebinding nics to linux_driver"
129 unbind_nics
130 remove_igb_uio_module
131 echo "unmounting hugepages"
132 free_hugepages
133}
134case "$1" in
135 start)
136 cmd_start
137 ;;
138 stop)
139 cmd_stop
140 ;;
141 *)
142 echo "Usage: $0 {start|stop}" >&2
143 exit 1
144 ;;
145esac
146
147exit 0
diff --git a/repositories/ubuntu/dppd/dppd-install.sh b/repositories/ubuntu/dppd/dppd-install.sh
deleted file mode 100755
index 93b918e..0000000
--- a/repositories/ubuntu/dppd/dppd-install.sh
+++ /dev/null
@@ -1,9 +0,0 @@
1#!/bin/bash
2set -eux
3INSTALL_HOME=/usr/share/dppd/
4rm -rf $INSTALL_HOME ; mkdir -p $INSTALL_HOME
5cd $INSTALL_HOME
6apt-get install -y pkg-config liblua5.2-dev libpcap-dev libedit-dev libncurses5-dev libncursesw5-dev
7wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dppd/dppd-prox-v021.bin.tar.gz
8tar xzvf dppd-prox-v021.bin.tar.gz
9rm -rf dppd-prox-v021.bin.tar.gz
diff --git a/repositories/ubuntu/ovs/ovs-install.sh b/repositories/ubuntu/ovs/ovs-install.sh
deleted file mode 100755
index a323817..0000000
--- a/repositories/ubuntu/ovs/ovs-install.sh
+++ /dev/null
@@ -1,12 +0,0 @@
1#!/bin/bash
2set -eux
3
4INSTALL_HOME=/usr/share/ovs/
5rm -rf $INSTALL_HOME ; mkdir -p $INSTALL_HOME
6cd $INSTALL_HOME
7wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/ovs/openvswitch-datapath-dkms_2.4.90-1_all.deb
8dpkg -i openvswitch-datapath-dkms_2.4.90-1_all.deb
9wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/ovs/openvswitch-common_2.4.90-1_amd64.deb
10dpkg -i openvswitch-common_2.4.90-1_amd64.deb
11wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/ovs/openvswitch-switch_2.4.90-1_amd64.deb
12dpkg -i openvswitch-switch_2.4.90-1_amd64.deb
diff --git a/tasks.yaml b/tasks.yaml
index 4cfdcc7..0df40be 100644
--- a/tasks.yaml
+++ b/tasks.yaml
@@ -1,19 +1,3 @@
1- id: ovs_install_primary_controller
2 role: ['primary-controller']
3 stage: pre_deployment
4 type: puppet
5 parameters:
6 puppet_manifest: puppet/manifests/ovs-install-primary-controller.pp
7 puppet_modules: puppet/modules:/etc/puppet/modules
8 timeout: 720
9- id: ovs_install_controller
10 role: ['controller']
11 stage: pre_deployment
12 type: puppet
13 parameters:
14 puppet_manifest: puppet/manifests/ovs-install-controller.pp
15 puppet_modules: puppet/modules:/etc/puppet/modules
16 timeout: 720
17- id: ovs_install_compute 1- id: ovs_install_compute
18 role: ['compute'] 2 role: ['compute']
19 stage: pre_deployment 3 stage: pre_deployment