Local Documentation Builds
[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
23 # Mounting huge pages to be used by DPDK
24 sudo mkdir -p /mnt/huge
25 sudo umount `awk '/hugetlbfs/ { print $2 }' /proc/mounts` >/dev/null 2>&1
26 sudo mount -t hugetlbfs nodev /mnt/huge/
27 sudo sh -c '(echo "vm.nr_hugepages = 1024") > /etc/sysctl.conf'
28
29 # Downloading the Multi-buffer library. Note that the version to download is linked to the DPDK version being used
30 cd /home/centos
31 wget https://github.com/01org/intel-ipsec-mb/archive/v0.50.zip
32 unzip v0.50.zip
33 # AESNI_MULTI_BUFFER_LIB_PATH should be already set in deploycentos1.sh
34 export  AESNI_MULTI_BUFFER_LIB_PATH=/home/centos/intel-ipsec-mb-0.50
35 cd $AESNI_MULTI_BUFFER_LIB_PATH
36 make
37 sudo make install
38 # Clone and compile DPDK
39 cd /home/centos/
40 git clone http://dpdk.org/git/dpdk
41 cd dpdk
42 git checkout v18.05
43 export RTE_TARGET=build
44 export RTE_SDK=/home/centos/dpdk
45 make config T=x86_64-native-linuxapp-gcc
46 # 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
47 #sudo sed -i '/CONFIG_RTE_LIBRTE_KNI=y/c\CONFIG_RTE_LIBRTE_KNI=n' /home/centos/dpdk/build/.config
48 #sudo sed -i '/CONFIG_RTE_LIBRTE_PMD_KNI=y/c\CONFIG_RTE_LIBRTE_PMD_KNI=n' /home/centos/dpdk/build/.config
49 #sudo sed -i '/CONFIG_RTE_KNI_KMOD=y/c\CONFIG_RTE_KNI_KMOD=n' /home/centos/dpdk/build/.config
50 #sudo sed -i '/CONFIG_RTE_KNI_PREEMPT_DEFAULT=y/c\CONFIG_RTE_KNI_PREEMPT_DEFAULT=n' /home/centos/dpdk/build/.config
51 # Compile with MB library
52 sed -i '/CONFIG_RTE_LIBRTE_PMD_AESNI_MB=n/c\CONFIG_RTE_LIBRTE_PMD_AESNI_MB=y' /home/centos/dpdk/build/.config
53 make 
54 # Runtime scripts are assuming /root as the directory for PROX
55 sudo ln -s /home/centos/dpdk /root/dpdk
56
57 # Clone and compile PROX
58 cd /home/centos
59 git clone https://git.opnfv.org/samplevnf
60 cd /home/centos/samplevnf/VNFs/DPPD-PROX
61 git checkout 4d59d3530d1c41734f15423142e64eb9c929c717
62 # Compiling PROX with the crc=soft option because offloaded CRC calculation causes problems on multiple VIM environments. This will of course slow
63 # down the performance of the generator.
64 make crc=soft
65 sudo ln -s /home/centos/samplevnf/VNFs/DPPD-PROX /root/prox
66
67 # Enabling tuned with the realtime-virtual-guest profile
68 cd /home/centos/
69 wget http://linuxsoft.cern.ch/cern/centos/7/rt/x86_64/Packages/tuned-profiles-realtime-2.8.0-5.el7_4.2.noarch.rpm
70 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
71 # Install with --nodeps. The latest CentOS cloud images come with a tuned version higher than 2.8. These 2 packages however
72 # do not depend on v2.8 and also work with tuned 2.9. Need to be careful in the future
73 sudo rpm -ivh /home/centos/tuned-profiles-realtime-2.8.0-5.el7_4.2.noarch.rpm --nodeps
74 sudo rpm -ivh /home/centos/tuned-profiles-nfv-guest-2.8.0-5.el7_4.2.noarch.rpm --nodeps
75 # 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
76 # isolated CPUs so we can start the realtime-virtual-guest profile. If we don't, that command will fail.
77 # When the VM will be instantiated, the check_kernel_params service will check for the real number of cores available to this VM 
78 # and update the realtime-virtual-guest-variables.conf accordingly.
79 echo "isolated_cores=1" | sudo tee -a /etc/tuned/realtime-virtual-guest-variables.conf
80 sudo tuned-adm profile realtime-virtual-guest
81
82 # 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
83 # assigned to this VM depends on the flavor used. We don't know at this time what that will be.
84 sudo cp -r /home/centos/check_prox_system_setup.sh /usr/local/libexec/
85 sudo cp -r /home/centos/check-prox-system-setup.service /etc/systemd/system/
86 sudo systemctl daemon-reload
87 sudo systemctl enable check-prox-system-setup.service