diff options
Diffstat (limited to 'systems')
-rw-r--r-- | systems/README.md | 4 | ||||
-rwxr-xr-x | systems/build_base_machine.sh | 31 | ||||
-rwxr-xr-x | systems/centos/build_base_machine.sh | 4 | ||||
-rwxr-xr-x | systems/centos/prepare_python_env.sh | 4 | ||||
-rwxr-xr-x | systems/debian/build_base_machine.sh | 39 | ||||
-rwxr-xr-x | systems/debian/prepare_python_env.sh | 28 | ||||
-rwxr-xr-x | systems/rhel/7.2/build_base_machine.sh | 10 | ||||
-rwxr-xr-x | systems/rhel/7.2/prepare_python_env.sh | 4 | ||||
-rwxr-xr-x | systems/rhel/7.3/build_base_machine.sh | 10 | ||||
-rwxr-xr-x | systems/rhel/7.3/prepare_python_env.sh | 4 | ||||
-rwxr-xr-x | systems/rhel/7.5/build_base_machine.sh | 111 | ||||
-rwxr-xr-x | systems/rhel/7.5/prepare_python_env.sh | 28 | ||||
-rwxr-xr-x | systems/ubuntu/14.04/build_base_machine.sh | 2 |
13 files changed, 252 insertions, 27 deletions
diff --git a/systems/README.md b/systems/README.md index d72aae65..ca6557ea 100644 --- a/systems/README.md +++ b/systems/README.md @@ -12,3 +12,7 @@ On a freshly built system, run the following with a super user privilege or with password less sudo access. ./build_base_machine.sh + +If you want to use vsperf in trafficgen-mode ONLY, then add a parameter. + +./build_base_machine.sh trafficgen diff --git a/systems/build_base_machine.sh b/systems/build_base_machine.sh index 59712b96..37b74ffe 100755 --- a/systems/build_base_machine.sh +++ b/systems/build_base_machine.sh @@ -68,15 +68,30 @@ else die "$distro_dir is not yet supported" fi -if [ ! -d /lib/modules/`uname -r`/build ] ; then - die "Kernel devel is not available for active kernel. It can be caused by recent kernel update. Please reboot and run $0 again." +if [ $# -eq 0 ]; then + echo "No parameters provided - continuing with Lib checking" + if [ ! -d /lib/modules/`uname -r`/build ] ; then + die "Kernel devel is not available for active kernel. It can be caused by recent kernel update. Please reboot and run $0 again." + fi fi -# download and compile DPDK, OVS and QEMU -if [ -f ../src/Makefile ] ; then - cd ../src - make || die "Make failed" - cd - +if [ $# -eq 0 ]; then + echo "No parameters provided - continuing with SRC Download and Compile" + # download and compile DPDK, OVS and QEMU + if [ -f ../src/Makefile ] ; then + cd ../src + make || die "Make failed" + cd - + else + die "Make failed; No Makefile" + fi else - die "Make failed; No Makefile" + echo "Downloading and compiling only T-Rex" + if [ -f ../src/trex/Makefile ]; then + cd ../src/trex/ + make || die "Make failed" + cd - + else + die "Make failed; No Makefile" + fi fi diff --git a/systems/centos/build_base_machine.sh b/systems/centos/build_base_machine.sh index 95f9e211..0e1ed830 100755 --- a/systems/centos/build_base_machine.sh +++ b/systems/centos/build_base_machine.sh @@ -76,8 +76,8 @@ sudo yum -y install centos-release-scl-rh # install python34 packages and git-review tool yum -y install $(echo " -rh-python34 -rh-python34-python-tkinter +rh-python36 +rh-python36-python-tkinter git-review " | grep -v ^#) # prevent ovs vanilla from building from source due to kernel incompatibilities diff --git a/systems/centos/prepare_python_env.sh b/systems/centos/prepare_python_env.sh index 108ba1f6..4f5c0065 100755 --- a/systems/centos/prepare_python_env.sh +++ b/systems/centos/prepare_python_env.sh @@ -21,8 +21,8 @@ if [ -d "$VSPERFENV_DIR" ] ; then exit fi -scl enable rh-python34 " -virtualenv "$VSPERFENV_DIR" --python /opt/rh/rh-python34/root/usr/bin/python3 +scl enable rh-python36 " +virtualenv "$VSPERFENV_DIR" --python /opt/rh/rh-python36/root/usr/bin/python3 source "$VSPERFENV_DIR"/bin/activate pip install -r ../requirements.txt " diff --git a/systems/debian/build_base_machine.sh b/systems/debian/build_base_machine.sh new file mode 100755 index 00000000..cc3f1eb8 --- /dev/null +++ b/systems/debian/build_base_machine.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# +# Build a base machine for Debian style distro +# +# Copyright 2020 OPNFV +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Contributors: +# Sridhar K. N. Rao Spirent Communications + +# This is meant to be used only for Containerized VSPERF. + +# Synchronize package index files +apt-get -y update +apt-get -y install curl +apt-get -y install git +apt-get -y install wget +apt-get -y install python3-venv + +# Make and Compilers +apt-get -y install make +apt-get -y install automake +apt-get -y install gcc +apt-get -y install g++ +apt-get -y install libssl1.1 +apt-get -y install libxml2 +apt-get -y install zlib1g-dev +apt-get -y install scapy diff --git a/systems/debian/prepare_python_env.sh b/systems/debian/prepare_python_env.sh new file mode 100755 index 00000000..7c3b530b --- /dev/null +++ b/systems/debian/prepare_python_env.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# +# Prepare Python environment for vsperf execution on Debian systems +# +# Copyright 2020 OPNFV, Spirent Communications +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +if [ -d "$VSPERFENV_DIR" ] ; then + echo "Directory $VSPERFENV_DIR already exists. Skipping python virtualenv creation." + exit +fi + +# enable virtual environment in a subshell + +(python3 -m venv "$VSPERFENV_DIR" +source "$VSPERFENV_DIR"/bin/activate +pip install -r ../requirements.txt) diff --git a/systems/rhel/7.2/build_base_machine.sh b/systems/rhel/7.2/build_base_machine.sh index 198f39d7..c0f367ab 100755 --- a/systems/rhel/7.2/build_base_machine.sh +++ b/systems/rhel/7.2/build_base_machine.sh @@ -93,14 +93,14 @@ enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo EOT -# install python34 packages and git-review tool +# install python36 packages and git-review tool yum -y install $(echo " -rh-python34 -rh-python34-python-tkinter +rh-python36 +rh-python36-python-tkinter " | grep -v ^#) -# cleanup python 34 repo file -rm -f /etc/yum.repos.d/python34.repo +# cleanup python 36 repo file +rm -f /etc/yum.repos.d/python36.repo # Create hugepage dirs mkdir -p /dev/hugepages diff --git a/systems/rhel/7.2/prepare_python_env.sh b/systems/rhel/7.2/prepare_python_env.sh index 047d6961..b7506568 100755 --- a/systems/rhel/7.2/prepare_python_env.sh +++ b/systems/rhel/7.2/prepare_python_env.sh @@ -21,8 +21,8 @@ if [ -d "$VSPERFENV_DIR" ] ; then exit fi -scl enable rh-python34 " -virtualenv "$VSPERFENV_DIR" --python /opt/rh/rh-python34/root/usr/bin/python3 +scl enable rh-python36 " +virtualenv "$VSPERFENV_DIR" --python /opt/rh/rh-python36/root/usr/bin/python3 source "$VSPERFENV_DIR"/bin/activate pip install -r ../requirements.txt " diff --git a/systems/rhel/7.3/build_base_machine.sh b/systems/rhel/7.3/build_base_machine.sh index ae527214..42c36e4c 100755 --- a/systems/rhel/7.3/build_base_machine.sh +++ b/systems/rhel/7.3/build_base_machine.sh @@ -93,14 +93,14 @@ enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo EOT -# install python34 packages and git-review tool +# install python36 packages and git-review tool yum -y install $(echo " -rh-python34 -rh-python34-python-tkinter +rh-python36 +rh-python36-python-tkinter " | grep -v ^#) -# cleanup python 34 repo file -rm -f /etc/yum.repos.d/python34.repo +# cleanup python 36 repo file +rm -f /etc/yum.repos.d/python36.repo # Create hugepage dirs mkdir -p /dev/hugepages diff --git a/systems/rhel/7.3/prepare_python_env.sh b/systems/rhel/7.3/prepare_python_env.sh index 047d6961..b7506568 100755 --- a/systems/rhel/7.3/prepare_python_env.sh +++ b/systems/rhel/7.3/prepare_python_env.sh @@ -21,8 +21,8 @@ if [ -d "$VSPERFENV_DIR" ] ; then exit fi -scl enable rh-python34 " -virtualenv "$VSPERFENV_DIR" --python /opt/rh/rh-python34/root/usr/bin/python3 +scl enable rh-python36 " +virtualenv "$VSPERFENV_DIR" --python /opt/rh/rh-python36/root/usr/bin/python3 source "$VSPERFENV_DIR"/bin/activate pip install -r ../requirements.txt " diff --git a/systems/rhel/7.5/build_base_machine.sh b/systems/rhel/7.5/build_base_machine.sh new file mode 100755 index 00000000..deb4e8a2 --- /dev/null +++ b/systems/rhel/7.5/build_base_machine.sh @@ -0,0 +1,111 @@ +#!/bin/bash +# +# Build a base machine for RHEL 7.3 +# +# Copyright 2016 OPNFV, Intel Corporation & Red Hat Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Contributors: +# Aihua Li, Huawei Technologies. +# Martin Klozik, Intel Corporation. +# Abdul Halim, Intel Corporation. +# Christian Trautman, Red Hat Inc. + +# Make and Compilers +pkglist=(\ + automake\ + fuse-devel\ + gcc\ + gcc-c++\ + glib2-devel\ + glibc\ + kernel-devel\ + openssl-devel\ + pixman-devel\ + sysstat\ +) + +# Tools +pkglist=( + "${pkglist[@]}"\ + git\ + libtool\ + libpcap-devel\ + libnet\ + net-tools\ + openssl\ + openssl-devel\ + pciutils\ + socat\ + tk-devel\ + wget\ + numactl\ + numactl-devel\ + libpng-devel\ + sshpass\ +) + +# python tools for proper QEMU, DPDK, and OVS make +pkglist=( + "${pkglist[@]}"\ + python-six\ +) + +# install RHEL compatible epel for sshpass +yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm + +# Iterate installing each package. If packages fail to install, record those +# packages and exit with an error message on completion. Customer may need to +# add repo locations and subscription levels. +failedinstall=() +for pkg in ${pkglist[*]}; do + echo "Installing ${pkg}" + yum -y install ${pkg} || failedinstall=("${failedinstall[*]}" "$pkg") +done + +if [ "${#failedinstall[*]}" -gt 0 ]; then + echo "The following packages failed to install. Please add appropriate repo\ + locations and/or subscription levels. Then run the build script again." + for fail in ${failedinstall[*]}; do + echo $fail + done + exit 1 +fi + +# install SCL for python34 by adding a repo to find its location to install it +cat <<'EOT' >> /etc/yum.repos.d/python34.repo +[centos-sclo-rh] +name=CentOS-7 - SCLo rh +baseurl=http://mirror.centos.org/centos/7/sclo/$basearch/rh/ +gpgcheck=0 +enabled=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo +EOT + +# install python36 packages and git-review tool +yum -y install $(echo " +rh-python36 +rh-python36-python-tkinter +" | grep -v ^#) + +# cleanup python 36 repo file +rm -f /etc/yum.repos.d/python36.repo + +# Create hugepage dirs +mkdir -p /dev/hugepages + +# prevent upstream from building from source due to kernel incompatibilities +sed -i s/'SUBBUILDS = src_vanilla'/'#SUBBUILDS = src_vanilla'/ ../src/Makefile +sed -i s/'SUBDIRS += dpdk'/'#SUBDIRS += dpdk'/ ../src/Makefile +sed -i s/'SUBDIRS += ovs'/'#SUBDIRS += ovs'/ ../src/Makefile diff --git a/systems/rhel/7.5/prepare_python_env.sh b/systems/rhel/7.5/prepare_python_env.sh new file mode 100755 index 00000000..b7506568 --- /dev/null +++ b/systems/rhel/7.5/prepare_python_env.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# +# Prepare Python environment for vsperf execution on RHEL 7.3 systems. +# +# Copyright 2016-2017 OPNFV, Intel Corporation, Red Hat Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +if [ -d "$VSPERFENV_DIR" ] ; then + echo "Directory $VSPERFENV_DIR already exists. Skipping python virtualenv creation." + exit +fi + +scl enable rh-python36 " +virtualenv "$VSPERFENV_DIR" --python /opt/rh/rh-python36/root/usr/bin/python3 +source "$VSPERFENV_DIR"/bin/activate +pip install -r ../requirements.txt +" diff --git a/systems/ubuntu/14.04/build_base_machine.sh b/systems/ubuntu/14.04/build_base_machine.sh index a0e6895c..5501cab2 100755 --- a/systems/ubuntu/14.04/build_base_machine.sh +++ b/systems/ubuntu/14.04/build_base_machine.sh @@ -75,7 +75,7 @@ python3-setuptools python3-dbus python3-dev python3-tk -libpython3.4 +libpython3.6 python3-reportlab # libs |