Added use case "Forwaring Rate At Maximum Offered Load"
[samplevnf.git] / VNFs / DPPD-PROX / helper-scripts / openstackrapid / deploycentos2.sh
1 #!/bin/bash
2
3 ##
4 ## Copyright (c) 2010-2018 Intel Corporation
5 ##
6 ## Licensed under the Apache License, Version 2.0 (the "License");
7 ## you may not use this file except in compliance with the License.
8 ## You may obtain a copy of the License at
9 ##
10 ##     http://www.apache.org/licenses/LICENSE-2.0
11 ##
12 ## Unless required by applicable law or agreed to in writing, software
13 ## distributed under the License is distributed on an "AS IS" BASIS,
14 ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 ## See the License for the specific language governing permissions and
16 ## limitations under the License.
17 ##
18 # The following line is commented since this was a workaround for a problem with the content of /etc/resolv.conf.
19 # That file could contain DNS information coming from the dataplane which might be wrong. A solution is to confire the correct DNS for the dataplne
20 # in OpenStack.  DNS might be slowing down ssh access. We don't need that for our dataplane benchmarking purposes
21 # sudo sed -i '/#UseDNS yes/c\UseDNS no' /etc/ssh/sshd_config
22 sudo sh -c '(echo "export RTE_TARGET=\"build\"";echo "export RTE_SDK=\"/root/dpdk\"";echo "export AESNI_MULTI_BUFFER_LIB_PATH=\"/home/centos/intel-ipsec-mb-0.50\"";) >> /root/.bashrc'
23 export RTE_TARGET=build
24 export RTE_SDK=/home/centos/dpdk
25 export AESNI_MULTI_BUFFER_LIB_PATH=/home/centos/intel-ipsec-mb-0.50
26 # Mounting huge pages to be used by DPDK
27 sudo mkdir -p /mnt/huge
28 sudo umount `awk '/hugetlbfs/ { print $2 }' /proc/mounts` >/dev/null 2>&1
29 sudo mount -t hugetlbfs nodev /mnt/huge/
30 sudo sh -c '(echo "vm.nr_hugepages = 1024") > /etc/sysctl.conf'
31
32 # Downloading the Multi-buffer library. Note that the version to download is linked to the DPDK version being used
33 cd /home/centos
34 wget https://github.com/01org/intel-ipsec-mb/archive/v0.50.zip
35 unzip v0.50.zip
36 cd $AESNI_MULTI_BUFFER_LIB_PATH
37 make
38 sudo make install
39 # Clone and compile DPDK
40 cd /home/centos/
41 git clone http://dpdk.org/git/dpdk
42 # Runtime scripts are assuming /root as the directory for PROX
43 sudo ln -s /home/centos/dpdk /root/dpdk
44 cd $RTE_SDK
45 git checkout v18.08
46 make config T=x86_64-native-linuxapp-gcc
47 # The next sed lines make sure that we can compile DPDK 17.11 with a relatively new OS. Using a newer DPDK (18.5) should also resolve this issue
48 #sudo sed -i '/CONFIG_RTE_LIBRTE_KNI=y/c\CONFIG_RTE_LIBRTE_KNI=n' /home/centos/dpdk/build/.config
49 #sudo sed -i '/CONFIG_RTE_LIBRTE_PMD_KNI=y/c\CONFIG_RTE_LIBRTE_PMD_KNI=n' /home/centos/dpdk/build/.config
50 #sudo sed -i '/CONFIG_RTE_KNI_KMOD=y/c\CONFIG_RTE_KNI_KMOD=n' /home/centos/dpdk/build/.config
51 #sudo sed -i '/CONFIG_RTE_KNI_PREEMPT_DEFAULT=y/c\CONFIG_RTE_KNI_PREEMPT_DEFAULT=n' /home/centos/dpdk/build/.config
52 # Compile with MB library
53 sed -i '/CONFIG_RTE_LIBRTE_PMD_AESNI_MB=n/c\CONFIG_RTE_LIBRTE_PMD_AESNI_MB=y' /home/centos/dpdk/build/.config
54 make 
55
56 # Clone and compile PROX
57 cd /home/centos
58 git clone https://git.opnfv.org/samplevnf
59 cd /home/centos/samplevnf/VNFs/DPPD-PROX
60 git checkout ffc6be26
61 make
62 sudo ln -s /home/centos/samplevnf/VNFs/DPPD-PROX /root/prox
63
64 # Enabling tuned with the realtime-virtual-guest profile
65 cd /home/centos/
66 wget http://linuxsoft.cern.ch/cern/centos/7/rt/x86_64/Packages/tuned-profiles-realtime-2.8.0-5.el7_4.2.noarch.rpm
67 wget http://linuxsoft.cern.ch/cern/centos/7/rt/x86_64/Packages/tuned-profiles-nfv-guest-2.8.0-5.el7_4.2.noarch.rpm
68 # Install with --nodeps. The latest CentOS cloud images come with a tuned version higher than 2.8. These 2 packages however
69 # do not depend on v2.8 and also work with tuned 2.9. Need to be careful in the future
70 sudo rpm -ivh /home/centos/tuned-profiles-realtime-2.8.0-5.el7_4.2.noarch.rpm --nodeps
71 sudo rpm -ivh /home/centos/tuned-profiles-nfv-guest-2.8.0-5.el7_4.2.noarch.rpm --nodeps
72 # Although we do no know how many cores the VM will have when begin deployed for real testing, we already put a number for the
73 # isolated CPUs so we can start the realtime-virtual-guest profile. If we don't, that command will fail.
74 # When the VM will be instantiated, the check_kernel_params service will check for the real number of cores available to this VM 
75 # and update the realtime-virtual-guest-variables.conf accordingly.
76 echo "isolated_cores=1" | sudo tee -a /etc/tuned/realtime-virtual-guest-variables.conf
77 sudo tuned-adm profile realtime-virtual-guest
78
79 # Install the check_tuned_params service to make sure that the grub cmd line has the right cpus in isolcpu. The actual number of cpu's
80 # assigned to this VM depends on the flavor used. We don't know at this time what that will be.
81 sudo cp -r /home/centos/check_prox_system_setup.sh /usr/local/libexec/
82 sudo cp -r /home/centos/check-prox-system-setup.service /etc/systemd/system/
83 sudo systemctl daemon-reload
84 sudo systemctl enable check-prox-system-setup.service