Browse Source

Refactor fuel ovs plugin

Change-Id: I078a1c7472d76041371075c41a1069a3ba248503
Signed-off-by: Guo Ruijing <ruijing.guo@intel.com>
Guo Ruijing 3 years ago
parent
commit
5e73fe1c11

+ 2
- 3
README.md View File

@@ -7,7 +7,7 @@ Openvswitch plugin
7 7
 Overview
8 8
 --------
9 9
 
10
-New fuel plugin fuel-plugin-ovs is developed to deploy OVS with NSH + DPDK in Fuel@OPNFV, which is requested by ODL project
10
+Fuel plugin fuel-plugin-ovs is developed to deploy OVS with NSH + DPDK
11 11
 
12 12
 Requirements
13 13
 ------------
@@ -60,7 +60,7 @@ Openvswitch plugin installation
60 60
 
61 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
 
65 65
 8. 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 134
 * ling.y.yu@intel.com,ruijing.guo@intel.com
135
-

+ 12
- 18
deployment_scripts/puppet/manifests/ovs-install-compute.pp View File

@@ -1,22 +1,16 @@
1 1
 $fuel_settings = parseyaml(file('/etc/compute.yaml'))
2 2
 if $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
-        }
3
+    if $fuel_settings['fuel-plugin-ovs']['support_dpdk'] {
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
+    }
6
+    if $fuel_settings['fuel-plugin-ovs']['support_nsh'] {
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
+    }
9
+    if $fuel_settings['fuel-plugin-ovs']['support_nsh_dpdk'] {
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
+    }
12
+    exec { 'ovs install':
13
+        command => '/usr/bin/apt-get -y --force-yes install $packages'
14
+    }
21 15
 } elsif $operatingsystem == 'CentOS' {
22 16
 }

+ 0
- 22
deployment_scripts/puppet/manifests/ovs-install-controller.pp View File

@@ -1,22 +0,0 @@
1
-$fuel_settings = parseyaml(file('/etc/controller.yaml'))
2
-if $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
-}

+ 0
- 22
deployment_scripts/puppet/manifests/ovs-install-primary-controller.pp View File

@@ -1,22 +0,0 @@
1
-$fuel_settings = parseyaml(file('/etc/primary-controller.yaml'))
2
-if $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
-}

+ 9
- 9
environment_config.yaml View File

@@ -1,16 +1,16 @@
1 1
 attributes:
2
-    use_dpdk:
2
+    support_dpdk:
3 3
       type: "checkbox"
4 4
       weight: 20
5 5
       value: false
6
-      label: "Use dpdk"
7
-    dpdk-bind-nic:
8
-      value: 'eth2'
9
-      label: 'Network device'
10
-      weight: 40
11
-      type: "text"
12
-    use_dppd:
6
+      label: "support DPDK"
7
+    support_nsh:
13 8
       type: "checkbox"
14 9
       weight: 20
15 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"

+ 2
- 2
metadata.yaml View File

@@ -1,9 +1,9 @@
1 1
 # Plugin name
2 2
 name: fuel-plugin-ovs
3 3
 # Human-readable name for your plugin
4
-title: Openvswitch with NSH support
4
+title: Openvswitch with NSH/DPDK support
5 5
 # Plugin version
6
-version: '0.5.2'
6
+version: '0.8.0'
7 7
 # Description
8 8
 description: 'This plugin provides to deploy openvswitch with nsh'
9 9
 # Required fuel version

+ 0
- 27
ovs-nsh/Dockerfile View File

@@ -1,27 +0,0 @@
1
-#!/bin/bash
2
-
3
-FROM ubuntu:14.04.3
4
-
5
-RUN rm -rf /lib/modules
6
-RUN apt-get update
7
-RUN 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
-
12
-RUN ln -s /lib/modules/3.13.0-76-generic /lib/modules/`uname -r`
13
-
14
-RUN apt-get install -y pkg-config unzip liblua5.2-dev libpcap-dev libedit-dev libncurses5-dev libncursesw5-dev
15
-
16
-RUN echo "ALL ALL=NOPASSWD: ALL" > /etc/sudoers.d/open-sudo
17
-RUN chmod 0440 /etc/sudoers.d/open-sudo
18
-
19
-ADD ./patches /patches
20
-
21
-ADD ./build-ovs-nsh.sh /build-ovs-nsh.sh
22
-RUN chmod +x /build-ovs-nsh.sh
23
-RUN /build-ovs-nsh.sh
24
-
25
-ADD ./build-ovs-nsh-dpdk.sh /build-ovs-nsh-dpdk.sh
26
-RUN chmod +x /build-ovs-nsh-dpdk.sh
27
-RUN /build-ovs-nsh-dpdk.sh

+ 0
- 50
ovs-nsh/build-ovs-nsh-dpdk.sh View File

@@ -1,50 +0,0 @@
1
-#!/bin/bash
2
-
3
-DPDK_VER=2.1.0
4
-
5
-OVS_COMMIT=121daded51b9798fe3722824b27a05c16806cbd1
6
-RTE_TARGET=x86_64-native-linuxapp-gcc
7
-PATCHES="060679 060680 060681 060682 060683 060684 060685"
8
-URL_OVS=https://github.com/openvswitch/ovs.git
9
-URL_DPDK=http://dpdk.org/browse/dpdk/snapshot/dpdk-${DPDK_VER}.tar.gz
10
-
11
-wget ${URL_DPDK}
12
-tar -xzvf dpdk-${DPDK_VER}.tar.gz
13
-cd dpdk-${DPDK_VER}
14
-sed -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
18
-cd /
19
-tar -czvf dpdk-${DPDK_VER}.tar.gz dpdk-${DPDK_VER}
20
-cd dpdk-${DPDK_VER}
21
-make install T=${RTE_TARGET}
22
-find . | grep "\.o$" | xargs rm -rf
23
-cd /
24
-tar czvf dpdk-${DPDK_VER}.bin.tar.gz dpdk-${DPDK_VER}
25
-
26
-git clone ${URL_OVS} openvswitch-dpdk
27
-cd openvswitch-dpdk
28
-git checkout ${OVS_COMMIT} -b development
29
-for patch in ${PATCHES}
30
-do
31
-        patch -p1 < /patches/${patch}.patch
32
-done
33
-export RTE_SDK=/dpdk-${DPDK_VER}
34
-export DPDK_BUILD=${RTE_SDK}/${RTE_TARGET}
35
-./boot.sh
36
-./configure --with-dpdk=$DPDK_BUILD
37
-sed -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;
38
-cd openvswitch-2.4.90;DEB_BUILD_OPTIONS='parallel=8 nocheck' fakeroot debian/rules binary
39
-
40
-
41
-cd /
42
-wget https://01.org/sites/default/files/downloads/intel-data-plane-performance-demonstrators/dppd-prox-v021.zip
43
-unzip dppd-prox-v021.zip
44
-export RTE_SDK=/dpdk-${DPDK_VER}
45
-export RTE_TARGET=x86_64-native-linuxapp-gcc
46
-cd /dppd-PROX-v021
47
-export DPPD_DIR=`pwd`; make
48
-find . | grep "\.o$" | xargs rm -rf
49
-cd /
50
-tar czvf dppd-prox-v021.bin.tar.gz dppd-PROX-v021

+ 14
- 0
ovs_build/Dockerfile View File

@@ -0,0 +1,14 @@
1
+#!/bin/bash
2
+
3
+FROM ubuntu:14.04.3
4
+
5
+RUN apt-get update -y
6
+
7
+RUN rm -rf /lib/modules
8
+RUN apt-get install -y linux-headers-3.13.0-76-generic
9
+RUN ln -s /lib/modules/3.13.0-76-generic /lib/modules/`uname -r`
10
+
11
+RUN apt-get build-dep openvswitch -y
12
+RUN apt-get -y install devscripts dpkg-dev git wget
13
+
14
+ADD ./  /ovs_build

+ 37
- 0
ovs_build/build-ovs-dpdk.sh View File

@@ -0,0 +1,37 @@
1
+#!/bin/bash
2
+
3
+DPDK_VER=2.1.0
4
+
5
+export RTE_TARGET=x86_64-native-linuxapp-gcc
6
+export RTE_SDK=/dpdk-${DPDK_VER}
7
+export DPDK_BUILD=${RTE_SDK}/${RTE_TARGET}
8
+
9
+OVS_COMMIT=121daded51b9798fe3722824b27a05c16806cbd1
10
+URL_OVS=https://github.com/openvswitch/ovs.git
11
+URL_DPDK=http://dpdk.org/browse/dpdk/snapshot/dpdk-${DPDK_VER}.tar.gz
12
+
13
+cd /
14
+wget ${URL_DPDK}
15
+tar -xzvf dpdk-${DPDK_VER}.tar.gz
16
+cd dpdk-${DPDK_VER}
17
+sed -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
21
+make install T=${RTE_TARGET}
22
+
23
+cd /
24
+git clone ${URL_OVS} openvswitch
25
+cd openvswitch
26
+git checkout ${OVS_COMMIT} -b development
27
+
28
+export DEB_BUILD_OPTIONS='parallel=8 nocheck'
29
+sed -i "s/2.4.90/2.4.90.dpdk/g" debian/changelog
30
+sed -i "s/DATAPATH_CONFIGURE_OPTS.*=.*//" debian/rules
31
+sed -i "2iDATAPATH_CONFIGURE_OPTS='--with-dpdk=$DPDK_BUILD'" debian/rules
32
+sed -i "s/DATAPATH_CONFIGURE_OPTS.*=.*//" debian/rules.modules
33
+sed -i "2iDATAPATH_CONFIGURE_OPTS='--with-dpdk=$DPDK_BUILD'" debian/rules.modules
34
+debian/rules build
35
+fakeroot debian/rules binary
36
+
37
+cp /*.deb /build

+ 41
- 0
ovs_build/build-ovs-nsh-dpdk.sh View File

@@ -0,0 +1,41 @@
1
+#!/bin/bash
2
+
3
+DPDK_VER=2.1.0
4
+
5
+export RTE_TARGET=x86_64-native-linuxapp-gcc
6
+export RTE_SDK=/dpdk-${DPDK_VER}
7
+export DPDK_BUILD=${RTE_SDK}/${RTE_TARGET}
8
+
9
+OVS_COMMIT=121daded51b9798fe3722824b27a05c16806cbd1
10
+PATCHES="060679 060680 060681 060682 060683 060684 060685"
11
+URL_OVS=https://github.com/openvswitch/ovs.git
12
+URL_DPDK=http://dpdk.org/browse/dpdk/snapshot/dpdk-${DPDK_VER}.tar.gz
13
+
14
+cd /
15
+wget ${URL_DPDK}
16
+tar -xzvf dpdk-${DPDK_VER}.tar.gz
17
+cd dpdk-${DPDK_VER}
18
+sed -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
22
+make install T=${RTE_TARGET}
23
+
24
+cd /
25
+git clone ${URL_OVS} openvswitch
26
+cd openvswitch
27
+git checkout ${OVS_COMMIT} -b development
28
+for patch in ${PATCHES}
29
+do
30
+    patch -p1 < /ovs_build/patches/${patch}.patch
31
+done
32
+export DEB_BUILD_OPTIONS='parallel=8 nocheck'
33
+sed -i "s/2.4.90/2.4.90.nshdpdk/g" debian/changelog
34
+sed -i "s/DATAPATH_CONFIGURE_OPTS.*=.*//" debian/rules
35
+sed -i "2iDATAPATH_CONFIGURE_OPTS='--with-dpdk=$DPDK_BUILD'" debian/rules
36
+sed -i "s/DATAPATH_CONFIGURE_OPTS.*=.*//" debian/rules.modules
37
+sed -i "2iDATAPATH_CONFIGURE_OPTS='--with-dpdk=$DPDK_BUILD'" debian/rules.modules
38
+debian/rules build
39
+fakeroot debian/rules binary
40
+
41
+cp /*.deb /build

ovs-nsh/build-ovs-nsh.sh → ovs_build/build-ovs-nsh.sh View File

@@ -4,13 +4,17 @@ OVS_COMMIT=121daded51b9798fe3722824b27a05c16806cbd1
4 4
 PATCHES="060679 060680 060681 060682 060683 060684 060685"
5 5
 URL_OVS=https://github.com/openvswitch/ovs.git
6 6
 
7
+cd /
7 8
 git clone ${URL_OVS} openvswitch
8 9
 cd openvswitch
9 10
 git checkout ${OVS_COMMIT} -b development
10 11
 for patch in ${PATCHES}
11 12
 do
12
-        patch -p1 < /patches/${patch}.patch
13
+    patch -p1 < /ovs_build/patches/${patch}.patch
13 14
 done
14 15
 
15
-./boot.sh;./configure;make dist;tar -xzf openvswitch-2.4.90.tar.gz
16
-cd openvswitch-2.4.90;dpkg-checkbuilddeps;DEB_BUILD_OPTIONS='parallel=8 nocheck' fakeroot debian/rules binary
16
+export DEB_BUILD_OPTIONS='parallel=8 nocheck'
17
+sed -i "s/2.4.90/2.4.90.nsh/g" debian/changelog
18
+debian/rules build
19
+fakeroot debian/rules binary
20
+cp /*.deb /build

ovs-nsh/patches/060679.patch → ovs_build/patches/060679.patch View File


ovs-nsh/patches/060680.patch → ovs_build/patches/060680.patch View File


ovs-nsh/patches/060681.patch → ovs_build/patches/060681.patch View File


ovs-nsh/patches/060682.patch → ovs_build/patches/060682.patch View File


ovs-nsh/patches/060683.patch → ovs_build/patches/060683.patch View File


ovs-nsh/patches/060684.patch → ovs_build/patches/060684.patch View File


ovs-nsh/patches/060685.patch → ovs_build/patches/060685.patch View File


+ 5
- 12
pre_build_hook View File

@@ -20,18 +20,11 @@ function build_pkg {
20 20
       pushd "${DIR}/repositories/${1}/"
21 21
       download_dependencies ${1}
22 22
       popd
23
-      cd ${DIR}/ovs-nsh
24
-      sudo docker build -t ovs-nsh .
25
-      container_id=`sudo docker run -d ovs-nsh`
26
-      sudo docker cp $container_id:/openvswitch/openvswitch-common_2.4.90-1_amd64.deb ${DIR}/repositories/ubuntu/ovs/
27
-      sudo docker cp $container_id:/openvswitch/openvswitch-datapath-dkms_2.4.90-1_all.deb ${DIR}/repositories/ubuntu/ovs/
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/
23
+      cd ${DIR}/ovs_build
24
+      sudo docker build -t ovs_build .
25
+      sudo docker run -v ${DIR}/repositories/ubuntu/ovs-nsh:/build -ti  ovs_build /ovs_build/build-ovs-nsh.sh
26
+      sudo docker run -v ${DIR}/repositories/ubuntu/ovs-dpdk:/build -ti  ovs_build /ovs_build/build-ovs-dpdk.sh
27
+      sudo docker run -v ${DIR}/repositories/ubuntu/ovs-nsh-dpdk:/build -ti  ovs_build /ovs_build/build-ovs-nsh-dpdk.sh
35 28
       ;;
36 29
     *) echo "Not supported system"; exit 1;;
37 30
   esac

+ 0
- 24
repositories/ubuntu/dpdk/dpdk-install.sh View File

@@ -1,24 +0,0 @@
1
-#!/bin/bash
2
-
3
-NICS=$1
4
-INSTALL_HOME=/usr/share/dpdk/
5
-rm -rf $INSTALL_HOME ; mkdir -p $INSTALL_HOME
6
-cd $INSTALL_HOME
7
-wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk/dpdk-2.1.0.bin.tar.gz
8
-tar xzvf dpdk-2.1.0.bin.tar.gz
9
-rm -rf dpdk-2.1.0.bin.tar.gz
10
-wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk/dpdk.init -O /etc/init.d/dpdk
11
-chmod +x /etc/init.d/dpdk
12
-wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk/dpdk.conf -O /etc/default/dpdk.conf
13
-sed "s/DPDK_NIC_MAPPINGS=.*/DPDK_NIC_MAPPINGS=${NICS}/" -i /etc/default/dpdk.conf
14
-service dpdk start
15
-
16
-INSTALL_HOME=/usr/share/ovs-dpdk/
17
-rm -rf $INSTALL_HOME ; mkdir -p $INSTALL_HOME
18
-cd $INSTALL_HOME
19
-wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk/openvswitch-datapath-dkms_2.4.90-1_all.deb
20
-dpkg -i openvswitch-datapath-dkms_2.4.90-1_all.deb
21
-wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk/openvswitch-common_2.4.90-1_amd64.deb
22
-dpkg -i openvswitch-common_2.4.90-1_amd64.deb
23
-wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dpdk/openvswitch-switch_2.4.90-1_amd64.deb
24
-dpkg -i openvswitch-switch_2.4.90-1_amd64.deb

+ 0
- 6
repositories/ubuntu/dpdk/dpdk.conf View File

@@ -1,6 +0,0 @@
1
-DPDK_NUM_HUGEPAGES=${DPDK_NUM_HUGEPAGES:-2048}
2
-DPDK_HUGEPAGE_MOUNT=${DPDK_HUGEPAGE_MOUNT:-/dev/hugepages}
3
-DPDK_NIC_MAPPINGS=eth1
4
-DPDK_ALLOCATE_HUGEPAGES=True
5
-DPDK_INTERFACE_DRIVER='igb_uio'
6
-DPDK_HUGEPAGE_MOUNT_PAGESIZE=''

+ 0
- 147
repositories/ubuntu/dpdk/dpdk.init View File

@@ -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
-#
17
-echo "sourcing config"
18
-source /etc/default/dpdk.conf
19
-
20
-RTE_SDK=${RTE_SDK:-/usr/share/dpdk/dpdk-2.1.0}
21
-RTE_TARGET=${RTE_TARGET:-x86_64-native-linuxapp-gcc}
22
-DPDK_DIR=$RTE_SDK
23
-
24
-
25
-remove_igb_uio_module(){
26
-    sudo rmmod igb_uio
27
-}
28
-
29
-unbind_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
-
54
-free_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
-
71
-load_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
-
82
-bind_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
-
93
-bind_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
-
100
-alloc_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
-
119
-cmd_start(){
120
-    echo "mounting hugepages"
121
-    alloc_hugepages
122
-    echo "loading DPDK_INTERFACE_DRIVER diver"
123
-    load_igb_uio_module
124
-    bind_nics
125
-}
126
-cmd_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
-}
134
-case "$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
-        ;;
145
-esac
146
-
147
-exit 0

+ 0
- 9
repositories/ubuntu/dppd/dppd-install.sh View File

@@ -1,9 +0,0 @@
1
-#!/bin/bash
2
-set -eux
3
-INSTALL_HOME=/usr/share/dppd/
4
-rm -rf $INSTALL_HOME ; mkdir -p $INSTALL_HOME
5
-cd $INSTALL_HOME
6
-apt-get install -y pkg-config liblua5.2-dev libpcap-dev libedit-dev libncurses5-dev libncursesw5-dev
7
-wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/dppd/dppd-prox-v021.bin.tar.gz
8
-tar xzvf dppd-prox-v021.bin.tar.gz
9
-rm -rf dppd-prox-v021.bin.tar.gz

+ 0
- 12
repositories/ubuntu/ovs/ovs-install.sh View File

@@ -1,12 +0,0 @@
1
-#!/bin/bash
2
-set -eux
3
-
4
-INSTALL_HOME=/usr/share/ovs/
5
-rm -rf $INSTALL_HOME ; mkdir -p $INSTALL_HOME
6
-cd $INSTALL_HOME
7
-wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/ovs/openvswitch-datapath-dkms_2.4.90-1_all.deb
8
-dpkg -i openvswitch-datapath-dkms_2.4.90-1_all.deb
9
-wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/ovs/openvswitch-common_2.4.90-1_amd64.deb
10
-dpkg -i openvswitch-common_2.4.90-1_amd64.deb
11
-wget http://10.20.0.2:8080/plugins/fuel-plugin-ovs-0.5/repositories/ubuntu/ovs/openvswitch-switch_2.4.90-1_amd64.deb
12
-dpkg -i openvswitch-switch_2.4.90-1_amd64.deb

+ 0
- 16
tasks.yaml View File

@@ -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 1
 - id: ovs_install_compute
18 2
   role: ['compute']
19 3
   stage: pre_deployment

Loading…
Cancel
Save