forked from ctrautma/vmscripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_rpms.sh
executable file
·131 lines (111 loc) · 5.64 KB
/
setup_rpms.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
set -x
VIOMMU="NO"
DPDK_BUILD="NO"
progname=$0
function usage () {
cat <<EOF
Usage: $progname [-v enable viommu]
EOF
exit 0
}
while getopts hvu FLAG; do
case $FLAG in
v) echo "VIOMMU is enabled"
VIOMMU="YES";;
u) echo "Building upstream DPDK"
DPDK_BUILD="YES";;
h) echo "found $opt" ; usage ;;
\?) usage ;;
esac
done
shift $(($OPTIND - 1))
yum install libibverbs -y
yum install -y nmap-ncat tcpdump
# netperf & iperf
yum install -y gcc-c++ make gcc
netperf=netperf-20160222
wget http://netqe-infra01.knqe.lab.eng.bos.redhat.com/share/tools/${netperf}.tar.bz2 -O /tmp/${netperf}.tar.bz2
tar -jxvf /tmp/${netperf}.tar.bz2
pushd ${netperf}
# add support for IBM new system arch ppc64le
sed -i "/ppc64/i\ppc64le:Linux:*:*)\n\ echo powerpc64le-unknown-linux-gnu\n\ exit ;;" config.guess
./configure && make && make install
popd
IPERF_FILE="iperf-2.0.10.tar.gz"
wget http://netqe-infra01.knqe.lab.eng.bos.redhat.com/share/tools/${IPERF_FILE}
tar -zxvf ${IPERF_FILE}
BUILD_DIR="${IPERF_FILE%.tar.gz}"
cd ${BUILD_DIR}
# add support for IBM new system arch ppc64le
sed -i "/ppc64/i\ppc64le:Linux:*:*)\n\ echo powerpc64le-unknown-linux-gnu\n\ exit ;;" config.guess
./configure && make && make install
rm -f ${IPERF_FILE}
rm -Rf IPERF*
rm -f ${netperf}.tar.gz
rm -Rf netperf*
SYS_ARCH=$(uname -m)
SERVER="download-node-02.eng.bos.redhat.com"
mkdir -p /root/tuned/28 /root/tuned/27 /root/dpdkrpms/1711-9 /root/dpdkrpms/1711-10 /root/dpdkrpms/1711-13 /root/dpdkrpms/1711-14
wget http://$SERVER/brewroot/packages/tuned/2.7.1/5.el7fdb/noarch/tuned-2.7.1-5.el7fdb.noarch.rpm -P /root/tuned/27/.
wget http://$SERVER/brewroot/packages/tuned/2.7.1/5.el7fdb/noarch/tuned-profiles-cpu-partitioning-2.7.1-5.el7fdb.noarch.rpm -P /root/tuned/27/.
wget http://$SERVER/brewroot/packages/tuned/2.7.1/5.el7fdb/noarch/tuned-profiles-nfv-2.7.1-5.el7fdb.noarch.rpm -P /root/tuned/27/.
wget http://$SERVER/brewroot/packages/tuned/2.7.1/5.el7fdb/noarch/tuned-profiles-realtime-2.7.1-5.el7fdb.noarch.rpm -P /root/tuned/27/.
wget http://$SERVER/brewroot/packages/tuned/2.8.0/2.el7fdp/noarch/tuned-2.8.0-2.el7fdp.noarch.rpm -P /root/tuned/28/.
wget http://$SERVER/brewroot/packages/tuned/2.8.0/2.el7fdp/noarch/tuned-profiles-cpu-partitioning-2.8.0-2.el7fdp.noarch.rpm -P /root/tuned/28/.
wget http://$SERVER/brewroot/packages/dpdk/17.11/9.el7fdb/$SYS_ARCH/dpdk-17.11-9.el7fdb.$SYS_ARCH.rpm -P /root/dpdkrpms/1711-9/
wget http://$SERVER/brewroot/packages/dpdk/17.11/9.el7fdb/$SYS_ARCH/dpdk-tools-17.11-9.el7fdb.$SYS_ARCH.rpm -P /root/dpdkrpms/1711-9/
wget http://$SERVER/brewroot/packages/dpdk/17.11/10.el7fdb/$SYS_ARCH/dpdk-17.11-10.el7fdb.$SYS_ARCH.rpm -P /root/dpdkrpms/1711-10/
wget http://$SERVER/brewroot/packages/dpdk/17.11/10.el7fdb/$SYS_ARCH/dpdk-tools-17.11-10.el7fdb.$SYS_ARCH.rpm -P /root/dpdkrpms/1711-10/
wget http://$SERVER/brewroot/packages/dpdk/17.11/13.el7/$SYS_ARCH/dpdk-17.11-13.el7.$SYS_ARCH.rpm -P /root/dpdkrpms/1711-13/
wget http://$SERVER/brewroot/packages/dpdk/17.11/13.el7/$SYS_ARCH/dpdk-tools-17.11-13.el7.$SYS_ARCH.rpm -P /root/dpdkrpms/1711-13/
wget http://$SERVER/brewroot/packages/dpdk/17.11/13.el8/$SYS_ARCH/dpdk-17.11-13.el8.ppc64le.rpm -P /root/dpdkrpms/1711-13/
wget http://$SERVER/brewroot/packages/dpdk/17.11/13.el8/$SYS_ARCH/dpdk-tools-17.11-13.el8.ppc64le.rpm -P /root/dpdkrpms/1711-13/
wget http://$SERVER/brewroot/packages/dpdk/17.11/14.el7/$SYS_ARCH/dpdk-17.11-14.el7.ppc64le.rpm -P /root/dpdkrpms/1711-14/
wget http://$SERVER/brewroot/packages/dpdk/17.11/14.el7/$SYS_ARCH/dpdk-tools-17.11-14.el7.ppc64le.rpm -P /root/dpdkrpms/1711-14/
wget http://$SERVER/brewroot/packages/dpdk/17.11/14.el8/$SYS_ARCH/dpdk-17.11-14.el8.ppc64le.rpm -P /root/dpdkrpms/1711-14/
wget http://$SERVER/brewroot/packages/dpdk/17.11/14.el8/$SYS_ARCH/dpdk-tools-17.11-14.el8.ppc64le.rpm -P /root/dpdkrpms/1711-14/
if [ "$DPDK_BUILD" == "YES" ]
then
# install upstream dpdk version
DPDK_VER="master"
yum install -y kernel-devel numactl-devel git
cd /root
git clone git://dpdk.org/dpdk
cd dpdk
git checkout $DPDK_VER
export RTE_TARGET=$SYS_ARCH-native-linuxapp-gcc
make install T=$RTE_TARGET
cd ..
fi
# Detect OS name and version from systemd based os-release file
. /etc/os-release
if [ $VERSION_ID == "7.4" ] || [ $VERSION_ID == "7.3" ]
then
rpm -Uvh /root/tuned/28/tuned-2.8.0-2.el7fdp.noarch.rpm
rpm -ivh /root/tuned/28/tuned-profiles-cpu-partitioning-2.8.0-2.el7fdp.noarch.rpm
else
yum install -y tuned-profiles-cpu-partitioning
fi
rpm -ivh http://$SERVER/brewroot/packages/driverctl/0.95/1.el7fdparch/noarch/driverctl-0.95-1.el7fdparch.noarch.rpm
# Isolated CPU list
#ISOLCPUS=`lscpu | grep "NUMA node0" | awk '{print $4}'`
#if [ `echo $ISOLCPUS | awk /'^0,'/` ]
# then
# ISOLCPUS=`echo $ISOLCPUS | cut -c 3-`
#elif [ `echo $ISOLCPUS | awk /'^0-'/` ]
# then
# ISOLCPUS=`echo $ISOLCPUS | sed s/'^0-'/'1-'/`
#fi
#echo $ISOLCPUS
#sed -i 's/\(GRUB_CMDLINE_LINUX.*\)"$/\1/g' /etc/default/grub
#if [ "$VIOMMU" == "NO" ]; then
# sed -i "s/GRUB_CMDLINE_LINUX.*/& default_hugepagesz=1G hugepagesz=1G nohz=on nohz_full=$ISOLCPUS rcu_nocbs=$ISOLCPUS tuned.non_isolcpus=00000001 intel_pstate=disable nosoftlockup\"/g" /etc/default/grub
#elif [ "$VIOMMU" == "YES" ]; then
# sed -i "s/GRUB_CMDLINE_LINUX.*/& default_hugepagesz=1G hugepagesz=1G intel_iommu=on nohz=on nohz_full=$ISOLCPUS rcu_nocbs=$ISOLCPUS tuned.non_isolcpus=00000001 intel_pstate=disable nosoftlockup\"/g" /etc/default/grub
#fi
#echo -e "isolated_cores=$ISOLCPUS" >> /etc/tuned/cpu-partitioning-variables.conf
#sed -i "s/GRUB_TERMINAL=\"serial console\"/GRUB_TERMINAL=\"console\"/" /etc/default/grub
#grub2-mkconfig -o /boot/grub2/grub.cfg
#systemctl start tuned
#sleep 10
#tuned-adm profile cpu-partitioning