test/common: parallelize vm_setup.sh
We can significantly speed up the vm_setup.sh process by installing dependencies in parallel. Change-Id: I424efdf6da26a7f1394fbdca1cb6129e7329fc16 Signed-off-by: Seth Howell <seth.howell@intel.com> Reviewed-on: https://review.gerrithub.io/426981 Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Karol Latecki <karol.latecki@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
5ae7353072
commit
a0a92be2df
@ -27,6 +27,230 @@ INSTALL=false
|
||||
CONF="librxe,iscsi,rocksdb,fio,flamegraph,tsocks,qemu,vpp,libiscsi,nvmecli"
|
||||
CONF_PATH="${VM_SETUP_PATH}/vm_setup.conf"
|
||||
|
||||
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
|
||||
for patch in `ls open-iscsi-install/patches`; do
|
||||
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
|
||||
}
|
||||
|
||||
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.
|
||||
SPDK_QEMU_BRANCH=spdk-2.12
|
||||
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
|
||||
# Vector packet processing (VPP) is installed for use with iSCSI tests.
|
||||
# At least on fedora 28, the yum setup that vpp uses is deprecated and fails.
|
||||
# The actions taken under the vpp_setup script are necessary to fix this issue.
|
||||
if [ -d vpp_setup ]; then
|
||||
echo "vpp setup already done."
|
||||
else
|
||||
echo "%_topdir $HOME/vpp_setup/src/rpm" >> ~/.rpmmacros
|
||||
sudo dnf install perl-generators
|
||||
mkdir -p ~/vpp_setup/src/rpm
|
||||
mkdir -p vpp_setup/src/rpm/BUILD vpp_setup/src/rpm/RPMS vpp_setup/src/rpm/SOURCES \
|
||||
vpp_setup/src/rpm/SPECS vpp_setup/src/rpm/SRPMS
|
||||
dnf download --downloaddir=./vpp_setup/src/rpm --source redhat-rpm-config
|
||||
rpm -ivh ~/vpp_setup/src/rpm/redhat-rpm-config*
|
||||
sed -i s/"Requires: (annobin if gcc)"//g ~/vpp_setup/src/rpm/SPECS/redhat-rpm-config.spec
|
||||
rpmbuild -ba ~/vpp_setup/src/rpm/SPECS/*.spec
|
||||
sudo dnf remove -y --noautoremove redhat-rpm-config
|
||||
sudo rpm -Uvh ~/vpp_setup/src/rpm/RPMS/noarch/*
|
||||
fi
|
||||
|
||||
if [ -d vpp ]; then
|
||||
echo "vpp already cloned."
|
||||
if [ ! -d vpp/build-root ]; then
|
||||
echo "build-root has not been done"
|
||||
echo "remove the `pwd` and start again"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
git clone "${GIT_REPO_VPP}"
|
||||
git -C ./vpp checkout v18.01.1
|
||||
# VPP 18.01.1 does not support OpenSSL 1.1.
|
||||
# For compilation, a compatibility package is used temporarily.
|
||||
sudo dnf install -y --allowerasing compat-openssl10-devel
|
||||
# Installing required dependencies for building VPP
|
||||
yes | make -C ./vpp install-dep
|
||||
|
||||
make -C ./vpp pkg-rpm -j${jobs}
|
||||
# Reinstall latest OpenSSL devel package.
|
||||
sudo dnf install -y --allowerasing openssl-devel
|
||||
sudo dnf install -y \
|
||||
./vpp/build_root/vpp-lib-18.01.1-release.x86_64.rpm \
|
||||
./vpp/build_root/vpp-devel-18.01.1-release.x86_64.rpm \
|
||||
./vpp/build_root/vpp-18.01.1-release.x86_64.rpm
|
||||
# Since hugepage configuration is done via spdk/scripts/setup.sh,
|
||||
# this default config is not needed.
|
||||
#
|
||||
# NOTE: Parameters kernel.shmmax and vm.max_map_count are set to
|
||||
# very low count and cause issues with hugepage total sizes above 1GB.
|
||||
sudo rm -f /etc/sysctl.d/80-vpp.conf
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function install_nvmecli()
|
||||
{
|
||||
if echo $CONF | grep -q nvmecli; then
|
||||
if [ ! -d nvme-cli ]; then
|
||||
git clone "${GIT_REPO_SPDK_NVME_CLI}"
|
||||
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
|
||||
}
|
||||
|
||||
function usage()
|
||||
{
|
||||
echo "This script is intended to automate the environment setup for a fedora linux virtual machine."
|
||||
@ -136,206 +360,19 @@ if $INSTALL; then
|
||||
sshfs
|
||||
fi
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
for patch in `ls open-iscsi-install/patches`; do
|
||||
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
|
||||
|
||||
sudo mkdir -p /usr/src
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
if echo $CONF | grep -q qemu; then
|
||||
# Qemu is used in the vhost tests.
|
||||
SPDK_QEMU_BRANCH=spdk-2.12
|
||||
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
|
||||
|
||||
if echo $CONF | grep -q vpp; then
|
||||
# Vector packet processing (VPP) is installed for use with iSCSI tests.
|
||||
# At least on fedora 28, the yum setup that vpp uses is deprecated and fails.
|
||||
# The actions taken under the vpp_setup script are necessary to fix this issue.
|
||||
if [ -d vpp_setup ]; then
|
||||
echo "vpp setup already done."
|
||||
else
|
||||
echo "%_topdir $HOME/vpp_setup/src/rpm" >> ~/.rpmmacros
|
||||
sudo dnf install perl-generators
|
||||
mkdir -p ~/vpp_setup/src/rpm
|
||||
mkdir -p vpp_setup/src/rpm/BUILD vpp_setup/src/rpm/RPMS vpp_setup/src/rpm/SOURCES \
|
||||
vpp_setup/src/rpm/SPECS vpp_setup/src/rpm/SRPMS
|
||||
dnf download --downloaddir=./vpp_setup/src/rpm --source redhat-rpm-config
|
||||
rpm -ivh ~/vpp_setup/src/rpm/redhat-rpm-config*
|
||||
sed -i s/"Requires: (annobin if gcc)"//g ~/vpp_setup/src/rpm/SPECS/redhat-rpm-config.spec
|
||||
rpmbuild -ba ~/vpp_setup/src/rpm/SPECS/*.spec
|
||||
sudo dnf remove -y --noautoremove redhat-rpm-config
|
||||
sudo rpm -Uvh ~/vpp_setup/src/rpm/RPMS/noarch/*
|
||||
fi
|
||||
|
||||
if [ -d vpp ]; then
|
||||
echo "vpp already cloned."
|
||||
if [ ! -d vpp/build-root ]; then
|
||||
echo "build-root has not been done"
|
||||
echo "remove the `pwd` and start again"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
git clone "${GIT_REPO_VPP}"
|
||||
git -C ./vpp checkout v18.01.1
|
||||
# VPP 18.01.1 does not support OpenSSL 1.1.
|
||||
# For compilation, a compatibility package is used temporarily.
|
||||
sudo dnf install -y --allowerasing compat-openssl10-devel
|
||||
# Installing required dependencies for building VPP
|
||||
yes | make -C ./vpp install-dep
|
||||
|
||||
make -C ./vpp pkg-rpm -j${jobs}
|
||||
# Reinstall latest OpenSSL devel package.
|
||||
sudo dnf install -y --allowerasing openssl-devel
|
||||
sudo dnf install -y \
|
||||
./vpp/build_root/vpp-lib-18.01.1-release.x86_64.rpm \
|
||||
./vpp/build_root/vpp-devel-18.01.1-release.x86_64.rpm \
|
||||
./vpp/build_root/vpp-18.01.1-release.x86_64.rpm
|
||||
# Since hugepage configuration is done via spdk/scripts/setup.sh,
|
||||
# this default config is not needed.
|
||||
#
|
||||
# NOTE: Parameters kernel.shmmax and vm.max_map_count are set to
|
||||
# very low count and cause issues with hugepage total sizes above 1GB.
|
||||
sudo rm -f /etc/sysctl.d/80-vpp.conf
|
||||
fi
|
||||
fi
|
||||
|
||||
if echo $CONF | grep -q nvmecli; then
|
||||
if [ ! -d nvme-cli ]; then
|
||||
git clone "${GIT_REPO_SPDK_NVME_CLI}"
|
||||
else
|
||||
echo "nvme-cli already checked out. Skipping"
|
||||
fi
|
||||
fi
|
||||
|
||||
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
|
||||
install_rxe_cfg&
|
||||
install_iscsi_adm&
|
||||
install_rocksdb&
|
||||
install_fio&
|
||||
install_flamegraph&
|
||||
install_qemu&
|
||||
install_vpp&
|
||||
install_nvmecli&
|
||||
install_libiscsi&
|
||||
|
||||
wait
|
||||
# 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
|
||||
|
Loading…
Reference in New Issue
Block a user