2018-10-01 18:47:23 +00:00
|
|
|
#!/usr/bin/env bash
|
2017-11-15 22:15:06 +00:00
|
|
|
|
|
|
|
# Virtual Machine environment requirements:
|
|
|
|
# 8 GiB of RAM (for DPDK)
|
|
|
|
# enable intel_kvm on your host machine
|
|
|
|
|
|
|
|
# The purpose of this script is to provide a simple procedure for spinning up a new
|
|
|
|
# virtual test environment capable of running our whole test suite. This script, when
|
2018-12-04 19:27:57 +00:00
|
|
|
# applied to a fresh install of fedora 26 or ubuntu 16,18 server will install all of the
|
|
|
|
# necessary dependencies to run almost the complete test suite. The main exception being VHost.
|
|
|
|
# Vhost requires the configuration of a second virtual machine. instructions for how to configure
|
2017-11-15 22:15:06 +00:00
|
|
|
# that vm are included in the file TEST_ENV_SETUP_README inside this repository
|
|
|
|
|
|
|
|
# it is important to enable nesting for vms in kernel command line of your machine for the vhost tests.
|
|
|
|
# in /etc/default/grub
|
|
|
|
# append the following to the GRUB_CMDLINE_LINUX line
|
|
|
|
# intel_iommu=on kvm-intel.nested=1
|
|
|
|
|
|
|
|
# We have made a lot of progress with removing hardcoded paths from the tests,
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2018-06-22 17:57:00 +00:00
|
|
|
VM_SETUP_PATH=$(readlink -f ${BASH_SOURCE%/*})
|
|
|
|
|
2018-06-26 20:47:41 +00:00
|
|
|
UPGRADE=false
|
|
|
|
INSTALL=false
|
2019-01-07 19:40:59 +00:00
|
|
|
CONF="librxe,iscsi,rocksdb,fio,flamegraph,tsocks,qemu,vpp,libiscsi,nvmecli,qat,ocf"
|
2019-05-22 11:27:53 +00:00
|
|
|
LIBRXE_INSTALL=true
|
2018-06-26 20:47:41 +00:00
|
|
|
|
2018-12-04 19:27:57 +00:00
|
|
|
OSID=$(source /etc/os-release && echo $ID)
|
|
|
|
PACKAGEMNG='undefined'
|
|
|
|
|
2018-09-26 21:01:25 +00:00
|
|
|
function install_rxe_cfg()
|
|
|
|
{
|
|
|
|
if echo $CONF | grep -q librxe; then
|
|
|
|
# rxe_cfg is used in the NVMe-oF tests
|
|
|
|
# The librxe-dev repository provides a command line tool called rxe_cfg which makes it
|
|
|
|
# very easy to use Soft-RoCE. The build pool utilizes this command line tool in the absence
|
|
|
|
# of any real RDMA NICs to simulate one for the NVMe-oF tests.
|
|
|
|
if hash rxe_cfg 2> /dev/null; then
|
|
|
|
echo "rxe_cfg is already installed. skipping"
|
|
|
|
else
|
|
|
|
if [ -d librxe-dev ]; then
|
|
|
|
echo "librxe-dev source already present, not cloning"
|
|
|
|
else
|
|
|
|
git clone "${GIT_REPO_LIBRXE}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
./librxe-dev/configure --libdir=/usr/lib64/ --prefix=
|
|
|
|
make -C librxe-dev -j${jobs}
|
|
|
|
sudo make -C librxe-dev install
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
function install_iscsi_adm()
|
|
|
|
{
|
|
|
|
if echo $CONF | grep -q iscsi; then
|
|
|
|
# iscsiadm is used in the iscsi_tgt tests
|
|
|
|
# The version of iscsiadm that ships with fedora 26 was broken as of November 3 2017.
|
|
|
|
# There is already a bug report out about it, and hopefully it is fixed soon, but in the event that
|
|
|
|
# that version is still broken when you do your setup, the below steps will fix the issue.
|
|
|
|
CURRENT_VERSION=$(iscsiadm --version)
|
|
|
|
OPEN_ISCSI_VER='iscsiadm version 6.2.0.874'
|
|
|
|
if [ "$CURRENT_VERSION" == "$OPEN_ISCSI_VER" ]; then
|
|
|
|
if [ ! -d open-iscsi-install ]; then
|
|
|
|
mkdir -p open-iscsi-install/patches
|
|
|
|
sudo dnf download --downloaddir=./open-iscsi-install --source iscsi-initiator-utils
|
|
|
|
rpm2cpio open-iscsi-install/$(ls ~/open-iscsi-install) | cpio -D open-iscsi-install -idmv
|
|
|
|
mv open-iscsi-install/00* open-iscsi-install/patches/
|
|
|
|
git clone "${GIT_REPO_OPEN_ISCSI}" open-iscsi-install/open-iscsi
|
|
|
|
|
|
|
|
# the configurations of username and email are needed for applying patches to iscsiadm.
|
|
|
|
git -C open-iscsi-install/open-iscsi config user.name none
|
|
|
|
git -C open-iscsi-install/open-iscsi config user.email none
|
|
|
|
|
|
|
|
git -C open-iscsi-install/open-iscsi checkout 86e8892
|
2019-06-12 07:48:32 +00:00
|
|
|
for patch in $(ls open-iscsi-install/patches); do
|
2018-09-26 21:01:25 +00:00
|
|
|
git -C open-iscsi-install/open-iscsi am ../patches/$patch
|
|
|
|
done
|
|
|
|
sed -i '427s/.*/-1);/' open-iscsi-install/open-iscsi/usr/session_info.c
|
|
|
|
make -C open-iscsi-install/open-iscsi -j${jobs}
|
|
|
|
sudo make -C open-iscsi-install/open-iscsi install
|
|
|
|
else
|
|
|
|
echo "custom open-iscsi install located, not reinstalling"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2018-11-13 20:35:16 +00:00
|
|
|
function install_qat()
|
|
|
|
{
|
2019-06-25 15:36:33 +00:00
|
|
|
|
|
|
|
if [ "$PACKAGEMNG" = "dnf" ]; then
|
|
|
|
sudo dnf install -y libudev-devel
|
|
|
|
elif [ "$PACKAGEMNG" = "apt-get" ]; then
|
|
|
|
sudo apt-get install -y libudev-dev
|
|
|
|
fi
|
|
|
|
|
2018-11-13 20:35:16 +00:00
|
|
|
if echo $CONF | grep -q qat; then
|
|
|
|
qat_tarball=$(basename $DRIVER_LOCATION_QAT)
|
|
|
|
kernel_maj=$(uname -r | cut -d'.' -f1)
|
|
|
|
kernel_min=$(uname -r | cut -d'.' -f2)
|
|
|
|
|
|
|
|
sudo modprobe -r qat_c62x
|
|
|
|
if [ -d /QAT ]; then
|
|
|
|
sudo rm -rf /QAT/
|
|
|
|
fi
|
|
|
|
|
|
|
|
sudo mkdir /QAT
|
|
|
|
|
|
|
|
wget $DRIVER_LOCATION_QAT
|
|
|
|
sudo cp $qat_tarball /QAT/
|
|
|
|
(cd /QAT && sudo tar zxof /QAT/$qat_tarball)
|
|
|
|
|
|
|
|
#The driver version 1.7.l.4.3.0-00033 contains a reference to a deprecated function. Remove it so the build won't fail.
|
|
|
|
if [ $kernel_maj -le 4 ]; then
|
|
|
|
if [ $kernel_min -le 17 ]; then
|
|
|
|
sudo sed -i 's/rdtscll(timestamp);/timestamp = rdtsc_ordered();/g' \
|
|
|
|
/QAT/quickassist/utilities/osal/src/linux/kernel_space/OsalServices.c || true
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
(cd /QAT && sudo ./configure --enable-icp-sriov=host && sudo make install)
|
|
|
|
|
|
|
|
if sudo service qat_service start; then
|
|
|
|
echo "failed to start the qat service. Something may be wrong with your device or package."
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2018-09-26 21:01:25 +00:00
|
|
|
function install_rocksdb()
|
|
|
|
{
|
|
|
|
if echo $CONF | grep -q rocksdb; then
|
|
|
|
# Rocksdb is installed for use with the blobfs tests.
|
|
|
|
if [ ! -d /usr/src/rocksdb ]; then
|
|
|
|
git clone "${GIT_REPO_ROCKSDB}"
|
|
|
|
git -C ./rocksdb checkout spdk-v5.6.1
|
|
|
|
sudo mv rocksdb /usr/src/
|
|
|
|
else
|
|
|
|
sudo git -C /usr/src/rocksdb checkout spdk-v5.6.1
|
|
|
|
echo "rocksdb already in /usr/src. Not checking out again"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
function install_fio()
|
|
|
|
{
|
|
|
|
if echo $CONF | grep -q fio; then
|
|
|
|
# This version of fio is installed in /usr/src/fio to enable
|
|
|
|
# building the spdk fio plugin.
|
|
|
|
if [ ! -d /usr/src/fio ]; then
|
|
|
|
if [ ! -d fio ]; then
|
|
|
|
git clone "${GIT_REPO_FIO}"
|
|
|
|
sudo mv fio /usr/src/
|
|
|
|
else
|
|
|
|
sudo mv fio /usr/src/
|
|
|
|
fi
|
|
|
|
(
|
|
|
|
git -C /usr/src/fio checkout master &&
|
|
|
|
git -C /usr/src/fio pull &&
|
|
|
|
git -C /usr/src/fio checkout fio-3.3 &&
|
|
|
|
make -C /usr/src/fio -j${jobs} &&
|
|
|
|
sudo make -C /usr/src/fio install
|
|
|
|
)
|
|
|
|
else
|
|
|
|
echo "fio already in /usr/src/fio. Not installing"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
function install_flamegraph()
|
|
|
|
{
|
|
|
|
if echo $CONF | grep -q flamegraph; then
|
|
|
|
# Flamegraph is used when printing out timing graphs for the tests.
|
|
|
|
if [ ! -d /usr/local/FlameGraph ]; then
|
|
|
|
git clone "${GIT_REPO_FLAMEGRAPH}"
|
|
|
|
mkdir -p /usr/local
|
|
|
|
sudo mv FlameGraph /usr/local/FlameGraph
|
|
|
|
else
|
|
|
|
echo "flamegraph already installed. Skipping"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
function install_qemu()
|
|
|
|
{
|
|
|
|
if echo $CONF | grep -q qemu; then
|
|
|
|
# Qemu is used in the vhost tests.
|
2018-12-07 11:43:06 +00:00
|
|
|
SPDK_QEMU_BRANCH=spdk-3.0.0
|
2018-09-26 21:01:25 +00:00
|
|
|
mkdir -p qemu
|
|
|
|
if [ ! -d "qemu/$SPDK_QEMU_BRANCH" ]; then
|
|
|
|
git -C ./qemu clone "${GIT_REPO_QEMU}" -b "$SPDK_QEMU_BRANCH" "$SPDK_QEMU_BRANCH"
|
|
|
|
else
|
|
|
|
echo "qemu already checked out. Skipping"
|
|
|
|
fi
|
|
|
|
|
|
|
|
declare -a opt_params=("--prefix=/usr/local/qemu/$SPDK_QEMU_BRANCH")
|
|
|
|
|
|
|
|
# Most tsocks proxies rely on a configuration file in /etc/tsocks.conf.
|
|
|
|
# If using tsocks, please make sure to complete this config before trying to build qemu.
|
|
|
|
if echo $CONF | grep -q tsocks; then
|
|
|
|
if hash tsocks 2> /dev/null; then
|
|
|
|
opt_params+=(--with-git='tsocks git')
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# The qemu configure script places several output files in the CWD.
|
|
|
|
(cd qemu/$SPDK_QEMU_BRANCH && ./configure "${opt_params[@]}" --target-list="x86_64-softmmu" --enable-kvm --enable-linux-aio --enable-numa)
|
|
|
|
|
|
|
|
make -C ./qemu/$SPDK_QEMU_BRANCH -j${jobs}
|
|
|
|
sudo make -C ./qemu/$SPDK_QEMU_BRANCH install
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
function install_vpp()
|
|
|
|
{
|
|
|
|
if echo $CONF | grep -q vpp; then
|
2018-06-25 12:44:59 +00:00
|
|
|
if [ -d /usr/local/src/vpp ]; then
|
2018-09-26 21:01:25 +00:00
|
|
|
echo "vpp already cloned."
|
2018-06-25 12:44:59 +00:00
|
|
|
if [ ! -d /usr/local/src/vpp/build-root ]; then
|
2018-09-26 21:01:25 +00:00
|
|
|
echo "build-root has not been done"
|
2019-07-03 15:12:39 +00:00
|
|
|
echo "remove the $(pwd) and start again"
|
2018-09-26 21:01:25 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
git clone "${GIT_REPO_VPP}"
|
2018-06-25 12:44:59 +00:00
|
|
|
git -C ./vpp checkout v19.01.1
|
|
|
|
git -C ./vpp cherry-pick 97dcf5bd26ca6de580943f5d39681f0144782c3d
|
|
|
|
git -C ./vpp cherry-pick f5dc9fbf814865b31b52b20f5bf959e9ff818b25
|
|
|
|
|
|
|
|
# Following patch for VPP is required due to the VPP tries to close
|
|
|
|
# connections to the non existing applications after timeout.
|
|
|
|
# It causes intermittent VPP application segfaults in our tests
|
|
|
|
# when few instances of VPP clients connects and disconnects several
|
|
|
|
# times.
|
|
|
|
# This workaround is only for VPP v19.01.1 and should be solved in
|
|
|
|
# the next release.
|
|
|
|
git -C ./vpp apply ${VM_SETUP_PATH}/patch/vpp/workaround-dont-notify-transport-closing.patch
|
|
|
|
|
|
|
|
# Installing required dependencies for building VPP
|
|
|
|
yes | make -C ./vpp install-dep
|
|
|
|
|
|
|
|
make -C ./vpp build -j${jobs}
|
|
|
|
|
|
|
|
sudo mv ./vpp /usr/local/src/
|
2018-09-26 21:01:25 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
function install_nvmecli()
|
|
|
|
{
|
|
|
|
if echo $CONF | grep -q nvmecli; then
|
2018-09-26 21:32:07 +00:00
|
|
|
SPDK_NVME_CLI_BRANCH=spdk-1.6
|
2018-09-26 21:01:25 +00:00
|
|
|
if [ ! -d nvme-cli ]; then
|
2018-09-26 21:32:07 +00:00
|
|
|
git clone "${GIT_REPO_SPDK_NVME_CLI}" -b "$SPDK_NVME_CLI_BRANCH"
|
2018-09-26 21:01:25 +00:00
|
|
|
else
|
|
|
|
echo "nvme-cli already checked out. Skipping"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
function install_libiscsi()
|
|
|
|
{
|
|
|
|
if echo $CONF | grep -q libiscsi; then
|
|
|
|
# We currently don't make any changes to the libiscsi repository for our tests, but it is possible that we will need
|
|
|
|
# to later. Cloning from git is just future proofing the machines.
|
|
|
|
if [ ! -d libiscsi ]; then
|
|
|
|
git clone "${GIT_REPO_LIBISCSI}"
|
|
|
|
else
|
|
|
|
echo "libiscsi already checked out. Skipping"
|
|
|
|
fi
|
|
|
|
( cd libiscsi && ./autogen.sh && ./configure --prefix=/usr/local/libiscsi)
|
|
|
|
make -C ./libiscsi -j${jobs}
|
|
|
|
sudo make -C ./libiscsi install
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2019-01-07 19:40:59 +00:00
|
|
|
function install_ocf()
|
|
|
|
{
|
|
|
|
local version="v18.12"
|
|
|
|
local targetdir="/usr/src/ocf"
|
|
|
|
|
|
|
|
if echo $CONF | grep -q ocf; then
|
|
|
|
if [ ! -d "$targetdir" ]; then
|
2019-02-25 23:03:58 +00:00
|
|
|
sudo -E git clone "${GIT_REPO_OCF}" "$targetdir" -b "$version"
|
2019-01-07 19:40:59 +00:00
|
|
|
else
|
|
|
|
echo "OCF already installed. Skipping"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2018-06-26 20:47:41 +00:00
|
|
|
function usage()
|
|
|
|
{
|
2018-12-04 19:27:57 +00:00
|
|
|
echo "This script is intended to automate the environment setup for a linux virtual machine."
|
2018-06-26 20:47:41 +00:00
|
|
|
echo "Please run this script as your regular user. The script will make calls to sudo as needed."
|
|
|
|
echo ""
|
|
|
|
echo "./vm_setup.sh"
|
2018-06-19 19:22:48 +00:00
|
|
|
echo " -h --help"
|
2018-12-04 19:27:57 +00:00
|
|
|
echo " -u --upgrade Run $PACKAGEMNG upgrade"
|
|
|
|
echo " -i --install-deps Install $PACKAGEMNG based dependencies"
|
2018-06-19 19:22:48 +00:00
|
|
|
echo " -t --test-conf List of test configurations to enable (${CONF})"
|
2018-06-22 17:57:00 +00:00
|
|
|
echo " -c --conf-path Path to configuration file"
|
2018-06-26 20:47:41 +00:00
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
2018-12-04 19:27:57 +00:00
|
|
|
# Get package manager #
|
|
|
|
if hash dnf &>/dev/null; then
|
|
|
|
PACKAGEMNG=dnf
|
|
|
|
elif hash apt-get &>/dev/null; then
|
|
|
|
PACKAGEMNG=apt-get
|
|
|
|
else
|
|
|
|
echo 'Supported package manager not found. Script supports "dnf" and "apt-get".'
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $PACKAGEMNG == 'apt-get' ] && [ $OSID != 'ubuntu' ]; then
|
|
|
|
echo 'Located apt-get package manager, but it was tested for Ubuntu only'
|
|
|
|
fi
|
|
|
|
if [ $PACKAGEMNG == 'dnf' ] && [ $OSID != 'fedora' ]; then
|
|
|
|
echo 'Located dnf package manager, but it was tested for Fedora only'
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Parse input arguments #
|
2018-06-22 17:57:00 +00:00
|
|
|
while getopts 'iuht:c:-:' optchar; do
|
2018-06-26 20:47:41 +00:00
|
|
|
case "$optchar" in
|
|
|
|
-)
|
|
|
|
case "$OPTARG" in
|
|
|
|
help) usage;;
|
|
|
|
upgrade) UPGRADE=true;;
|
|
|
|
install-deps) INSTALL=true;;
|
2018-06-19 19:22:48 +00:00
|
|
|
test-conf=*) CONF="${OPTARG#*=}";;
|
2018-06-22 17:57:00 +00:00
|
|
|
conf-path=*) CONF_PATH="${OPTARG#*=}";;
|
2018-06-26 20:47:41 +00:00
|
|
|
*) echo "Invalid argument '$OPTARG'"
|
|
|
|
usage;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
h) usage;;
|
|
|
|
u) UPGRADE=true;;
|
|
|
|
i) INSTALL=true;;
|
2018-06-19 19:22:48 +00:00
|
|
|
t) CONF="$OPTARG";;
|
2018-06-22 17:57:00 +00:00
|
|
|
c) CONF_PATH="$OPTARG";;
|
2018-06-26 20:47:41 +00:00
|
|
|
*) echo "Invalid argument '$OPTARG'"
|
|
|
|
usage;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2018-09-26 15:23:44 +00:00
|
|
|
if [ ! -z "$CONF_PATH" ]; then
|
|
|
|
if [ ! -f "$CONF_PATH" ]; then
|
|
|
|
echo Configuration file does not exist: "$CONF_PATH"
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
source "$CONF_PATH"
|
|
|
|
fi
|
2018-06-22 17:57:00 +00:00
|
|
|
fi
|
|
|
|
|
2018-09-26 20:27:23 +00:00
|
|
|
cd ~
|
|
|
|
|
2019-06-25 10:15:48 +00:00
|
|
|
: ${GIT_REPO_SPDK=https://github.com/spdk/spdk.git}; export GIT_REPO_SPDK
|
2018-09-26 15:23:44 +00:00
|
|
|
: ${GIT_REPO_DPDK=https://github.com/spdk/dpdk.git}; export GIT_REPO_DPDK
|
|
|
|
: ${GIT_REPO_LIBRXE=https://github.com/SoftRoCE/librxe-dev.git}; export GIT_REPO_LIBRXE
|
|
|
|
: ${GIT_REPO_OPEN_ISCSI=https://github.com/open-iscsi/open-iscsi}; export GIT_REPO_OPEN_ISCSI
|
|
|
|
: ${GIT_REPO_ROCKSDB=https://review.gerrithub.io/spdk/rocksdb}; export GIT_REPO_ROCKSDB
|
|
|
|
: ${GIT_REPO_FIO=http://git.kernel.dk/fio.git}; export GIT_REPO_FIO
|
|
|
|
: ${GIT_REPO_FLAMEGRAPH=https://github.com/brendangregg/FlameGraph.git}; export GIT_REPO_FLAMEGRAPH
|
|
|
|
: ${GIT_REPO_QEMU=https://github.com/spdk/qemu}; export GIT_REPO_QEMU
|
|
|
|
: ${GIT_REPO_VPP=https://gerrit.fd.io/r/vpp}; export GIT_REPO_VPP
|
|
|
|
: ${GIT_REPO_LIBISCSI=https://github.com/sahlberg/libiscsi}; export GIT_REPO_LIBISCSI
|
|
|
|
: ${GIT_REPO_SPDK_NVME_CLI=https://github.com/spdk/nvme-cli}; export GIT_REPO_SPDK_NVME_CLI
|
2018-11-07 13:56:55 +00:00
|
|
|
: ${GIT_REPO_INTEL_IPSEC_MB=https://github.com/spdk/intel-ipsec-mb.git}; export GIT_REPO_INTEL_IPSEC_MB
|
2018-11-13 20:35:16 +00:00
|
|
|
: ${DRIVER_LOCATION_QAT=https://01.org/sites/default/files/downloads/intelr-quickassist-technology/qat1.7.l.4.3.0-00033.tar.gz}; export DRIVER_LOCATION_QAT
|
2019-02-19 17:44:28 +00:00
|
|
|
: ${GIT_REPO_OCF=https://github.com/Open-CAS/ocf}; export GIT_REPO_OCF
|
2018-06-22 17:57:00 +00:00
|
|
|
|
2018-02-12 09:46:23 +00:00
|
|
|
jobs=$(($(nproc)*2))
|
|
|
|
|
2018-06-26 20:47:41 +00:00
|
|
|
if $UPGRADE; then
|
2018-12-04 19:27:57 +00:00
|
|
|
if [ $PACKAGEMNG == 'apt-get' ]; then
|
|
|
|
sudo $PACKAGEMNG update
|
|
|
|
fi
|
|
|
|
sudo $PACKAGEMNG upgrade -y
|
2018-06-26 20:47:41 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if $INSTALL; then
|
2018-12-04 19:27:57 +00:00
|
|
|
sudo $PACKAGEMNG install -y git
|
2018-06-26 20:47:41 +00:00
|
|
|
fi
|
2018-06-18 22:48:48 +00:00
|
|
|
|
2018-09-26 20:27:23 +00:00
|
|
|
mkdir -p spdk_repo/output
|
2018-06-18 22:48:48 +00:00
|
|
|
|
2018-09-26 20:27:23 +00:00
|
|
|
if [ -d spdk_repo/spdk ]; then
|
2018-06-18 22:48:48 +00:00
|
|
|
echo "spdk source already present, not cloning"
|
|
|
|
else
|
2018-09-26 20:27:23 +00:00
|
|
|
git -C spdk_repo clone "${GIT_REPO_SPDK}"
|
2018-06-18 22:48:48 +00:00
|
|
|
fi
|
2018-09-26 20:27:23 +00:00
|
|
|
git -C spdk_repo/spdk config submodule.dpdk.url "${GIT_REPO_DPDK}"
|
2018-11-07 13:56:55 +00:00
|
|
|
git -C spdk_repo/spdk config submodule.intel-ipsec-mb.url "${GIT_REPO_INTEL_IPSEC_MB}"
|
2018-09-26 20:27:23 +00:00
|
|
|
git -C spdk_repo/spdk submodule update --init --recursive
|
2018-06-18 22:48:48 +00:00
|
|
|
|
2018-06-26 20:47:41 +00:00
|
|
|
if $INSTALL; then
|
2019-04-05 21:17:26 +00:00
|
|
|
sudo spdk_repo/spdk/scripts/pkgdep.sh
|
2018-06-18 22:48:48 +00:00
|
|
|
|
2018-12-04 19:27:57 +00:00
|
|
|
if [ $PACKAGEMNG == 'dnf' ]; then
|
|
|
|
if echo $CONF | grep -q tsocks; then
|
|
|
|
sudo dnf install -y tsocks
|
|
|
|
fi
|
|
|
|
|
|
|
|
sudo dnf install -y \
|
|
|
|
valgrind \
|
|
|
|
jq \
|
|
|
|
nvme-cli \
|
|
|
|
ceph \
|
|
|
|
gdb \
|
|
|
|
fio \
|
|
|
|
librbd-devel \
|
|
|
|
kernel-devel \
|
|
|
|
gflags-devel \
|
|
|
|
libasan \
|
|
|
|
libubsan \
|
|
|
|
autoconf \
|
|
|
|
automake \
|
|
|
|
libtool \
|
|
|
|
libmount-devel \
|
|
|
|
iscsi-initiator-utils \
|
|
|
|
isns-utils-devel \
|
|
|
|
pmempool \
|
|
|
|
perl-open \
|
|
|
|
glib2-devel \
|
|
|
|
pixman-devel \
|
|
|
|
astyle-devel \
|
|
|
|
elfutils \
|
|
|
|
elfutils-libelf-devel \
|
|
|
|
flex \
|
|
|
|
bison \
|
|
|
|
targetcli \
|
|
|
|
perl-Switch \
|
|
|
|
librdmacm-utils \
|
|
|
|
libibverbs-utils \
|
|
|
|
gdisk \
|
|
|
|
socat \
|
|
|
|
sshfs \
|
|
|
|
sshpass \
|
|
|
|
python3-pandas \
|
|
|
|
btrfs-progs \
|
|
|
|
rpm-build \
|
2019-05-10 13:37:50 +00:00
|
|
|
iptables \
|
2019-06-11 13:46:41 +00:00
|
|
|
clang-analyzer \
|
2019-05-10 13:37:50 +00:00
|
|
|
bc
|
2018-12-04 19:27:57 +00:00
|
|
|
|
|
|
|
elif [ $PACKAGEMNG == 'apt-get' ]; then
|
|
|
|
echo "Package perl-open is not available at Ubuntu repositories" >&2
|
|
|
|
|
|
|
|
if echo $CONF | grep -q tsocks; then
|
|
|
|
sudo apt-get install -y tsocks
|
|
|
|
fi
|
2018-06-19 19:22:48 +00:00
|
|
|
|
2018-12-04 19:27:57 +00:00
|
|
|
# asan an ubsan have to be installed together to not mix up gcc versions
|
|
|
|
if sudo apt-get install -y libasan5; then
|
|
|
|
sudo apt-get install -y libubsan1
|
|
|
|
else
|
|
|
|
echo "Latest libasan5 is not available" >&2
|
|
|
|
echo " installing libasan2 and corresponding libubsan0" >&2
|
|
|
|
sudo apt-get install -y libasan2
|
|
|
|
sudo apt-get install -y libubsan0
|
|
|
|
fi
|
2019-05-22 11:27:53 +00:00
|
|
|
if ! sudo apt-get install -y rdma-core; then
|
|
|
|
echo "Package rdma-core is avaliable at Ubuntu 18 [universe] repositorium" >&2
|
|
|
|
sudo apt-get install -y rdmacm-utils
|
|
|
|
sudo apt-get install -y ibverbs-utils
|
|
|
|
else
|
|
|
|
LIBRXE_INSTALL=false
|
|
|
|
fi
|
2018-12-04 19:27:57 +00:00
|
|
|
if ! sudo apt-get install -y libpmempool1; then
|
|
|
|
echo "Package libpmempool1 is available at Ubuntu 18 [universe] repositorium" >&2
|
|
|
|
fi
|
2019-06-11 13:46:41 +00:00
|
|
|
if ! sudo apt-get install -y clang-tools; then
|
|
|
|
echo "Package clang-tools is available at Ubuntu 18 [universe] repositorium" >&2
|
|
|
|
fi
|
2019-05-22 09:53:03 +00:00
|
|
|
if ! sudo apt-get install -y --no-install-suggests --no-install-recommends open-isns-utils; then
|
2018-12-04 19:27:57 +00:00
|
|
|
echo "Package open-isns-utils is available at Ubuntu 18 [universe] repositorium" >&2
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Package name for Ubuntu 18 is targetcli-fb but for Ubuntu 16 it's targetcli
|
|
|
|
if ! sudo apt-get install -y targetcli-fb; then
|
|
|
|
sudo apt-get install -y targetcli
|
|
|
|
fi
|
|
|
|
|
|
|
|
sudo apt-get install -y \
|
|
|
|
valgrind \
|
|
|
|
jq \
|
|
|
|
nvme-cli \
|
|
|
|
ceph \
|
|
|
|
gdb \
|
|
|
|
fio \
|
|
|
|
librbd-dev \
|
|
|
|
linux-headers-generic \
|
|
|
|
libgflags-dev \
|
|
|
|
autoconf \
|
|
|
|
automake \
|
|
|
|
libtool \
|
|
|
|
libmount-dev \
|
|
|
|
open-iscsi \
|
|
|
|
libglib2.0-dev \
|
|
|
|
libpixman-1-dev \
|
|
|
|
astyle \
|
|
|
|
elfutils \
|
|
|
|
libelf-dev \
|
|
|
|
flex \
|
|
|
|
bison \
|
|
|
|
libswitch-perl \
|
|
|
|
gdisk \
|
|
|
|
socat \
|
|
|
|
sshfs \
|
|
|
|
sshpass \
|
|
|
|
python3-pandas \
|
2019-05-10 13:37:50 +00:00
|
|
|
btrfs-tools \
|
|
|
|
bc
|
2018-12-04 19:27:57 +00:00
|
|
|
|
|
|
|
# rpm-build is not used
|
|
|
|
# iptables installed by default
|
|
|
|
|
|
|
|
else
|
|
|
|
echo "Package manager is undefined, skipping INSTALL step"
|
|
|
|
fi
|
2018-06-26 20:47:41 +00:00
|
|
|
fi
|
|
|
|
|
2017-11-15 22:15:06 +00:00
|
|
|
sudo mkdir -p /usr/src
|
|
|
|
|
2019-05-22 11:27:53 +00:00
|
|
|
if [ $LIBRXE_INSTALL = true ]; then
|
|
|
|
#Ubuntu18 integrates librxe to rdma-core, libibverbs-dev no longer ships infiniband/driver.h.
|
|
|
|
#Don't compile librxe on ubuntu18 or later version, install package rdma-core instead.
|
|
|
|
install_rxe_cfg&
|
|
|
|
fi
|
2018-09-26 21:01:25 +00:00
|
|
|
install_iscsi_adm&
|
|
|
|
install_rocksdb&
|
|
|
|
install_fio&
|
|
|
|
install_flamegraph&
|
|
|
|
install_qemu&
|
|
|
|
install_vpp&
|
|
|
|
install_nvmecli&
|
|
|
|
install_libiscsi&
|
2018-11-13 20:35:16 +00:00
|
|
|
install_qat&
|
2019-01-07 19:40:59 +00:00
|
|
|
install_ocf&
|
2018-09-26 21:01:25 +00:00
|
|
|
|
|
|
|
wait
|
2017-11-15 22:15:06 +00:00
|
|
|
# create autorun-spdk.conf in home folder. This is sourced by the autotest_common.sh file.
|
|
|
|
# By setting any one of the values below to 0, you can skip that specific test. If you are
|
|
|
|
# using your autotest platform to do sanity checks before uploading to the build pool, it is
|
|
|
|
# probably best to only run the tests that you believe your changes have modified along with
|
|
|
|
# Scanbuild and check format. This is because running the whole suite of tests in series can
|
|
|
|
# take ~40 minutes to complete.
|
2018-04-19 23:45:58 +00:00
|
|
|
if [ ! -e ~/autorun-spdk.conf ]; then
|
|
|
|
cat > ~/autorun-spdk.conf << EOF
|
2017-11-15 22:15:06 +00:00
|
|
|
# assign a value of 1 to all of the pertinent tests
|
|
|
|
SPDK_BUILD_DOC=1
|
2018-10-25 18:30:19 +00:00
|
|
|
SPDK_BUILD_SHARED_OBJECT=1
|
2017-11-15 22:15:06 +00:00
|
|
|
SPDK_RUN_CHECK_FORMAT=1
|
|
|
|
SPDK_RUN_SCANBUILD=1
|
|
|
|
SPDK_RUN_VALGRIND=1
|
2018-10-25 18:30:19 +00:00
|
|
|
SPDK_TEST_CRYPTO=1
|
2019-01-28 12:21:57 +00:00
|
|
|
SPDK_RUN_FUNCTIONAL_TEST=1
|
2017-11-15 22:15:06 +00:00
|
|
|
SPDK_TEST_UNITTEST=1
|
|
|
|
SPDK_TEST_ISCSI=1
|
2018-04-09 18:21:44 +00:00
|
|
|
SPDK_TEST_ISCSI_INITIATOR=1
|
2017-11-15 22:15:06 +00:00
|
|
|
SPDK_TEST_NVME=1
|
2018-10-25 18:30:19 +00:00
|
|
|
SPDK_TEST_NVME_CLI=1
|
2017-11-15 22:15:06 +00:00
|
|
|
SPDK_TEST_NVMF=1
|
|
|
|
SPDK_TEST_RBD=1
|
|
|
|
SPDK_TEST_BLOCKDEV=1
|
|
|
|
SPDK_TEST_EVENT=1
|
|
|
|
SPDK_TEST_BLOBFS=1
|
2018-04-03 23:07:39 +00:00
|
|
|
SPDK_TEST_PMDK=1
|
2018-04-09 18:21:44 +00:00
|
|
|
SPDK_TEST_LVOL=1
|
2018-10-25 18:30:19 +00:00
|
|
|
SPDK_TEST_JSON=1
|
2019-01-07 19:40:59 +00:00
|
|
|
SPDK_TEST_OCF=1
|
2017-11-15 22:15:06 +00:00
|
|
|
SPDK_RUN_ASAN=1
|
|
|
|
SPDK_RUN_UBSAN=1
|
2018-10-25 18:30:19 +00:00
|
|
|
# doesn't work on vm
|
|
|
|
SPDK_TEST_IOAT=0
|
|
|
|
# requires some extra configuration. see TEST_ENV_SETUP_README
|
|
|
|
SPDK_TEST_VHOST=0
|
|
|
|
SPDK_TEST_VHOST_INIT=0
|
|
|
|
# Not configured here
|
|
|
|
SPDK_RUN_INSTALLED_DPDK=0
|
|
|
|
|
2017-11-15 22:15:06 +00:00
|
|
|
EOF
|
2018-04-19 23:45:58 +00:00
|
|
|
fi
|