vm_setup: Install extra dependencies from a separate function

Since most of the sources are executed in a background, there's a
race happening between different instances of package maangers
which are called to install extra packages (for QAT and QEMU).
This mainly concerns apt-get which will not wait for locks on
given files to be released, it simply exits when they are still
held.

To avoid this, simply install all the extra packages from a separate
function before calling routine for a given source.

Running these builds in a background is still not safe in that regard,
since code of the actual source may want to perform a similar tasks,
however, this patch should at least mitigate the issue in its current
form.

Change-Id: Iede83793e1cc739cd3bc5dd4dee90f9c81d55f63
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2786
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
This commit is contained in:
Michal Berger 2020-06-05 16:41:45 +02:00 committed by Tomasz Zawadzki
parent 0ccf1fc36b
commit a66c52fd5c

View File

@ -74,8 +74,6 @@ function install_refspdk() {
function install_qat() {
install libudev-devel || install libudev-dev
kernel_maj=$(uname -r | cut -d'.' -f1)
kernel_min=$(uname -r | cut -d'.' -f2)
@ -160,12 +158,6 @@ function install_qemu() {
# Stock QEMU is used for vhost. A special fork
# is used to test OCSSDs. Install both.
# Packaged QEMU
install qemu-system-x86 qemu-img \
|| install qemu-system-x86 qemu-utils \
|| install qemu
# Forked QEMU
SPDK_QEMU_BRANCH=spdk-5.0.0
mkdir -p "$GIT_REPOS/qemu"
@ -273,6 +265,18 @@ function install_git() {
exec $SHELL
}
function install_extra_pkgs() {
if [[ $INSTALL_QAT == true ]]; then
install libudev-devel || install libudev-dev
fi
if [[ $INSTALL_QEMU == true ]]; then
install qemu-system-x86 qemu-img \
|| install qemu-system-x86 qemu-utils \
|| install qemu
fi
}
GIT_VERSION=2.25.1
: ${GIT_REPO_SPDK=https://github.com/spdk/spdk.git}
export GIT_REPO_SPDK
@ -331,6 +335,8 @@ sources+=(install_fio)
sudo mkdir -p /usr/{,local}/src
sudo mkdir -p "$GIT_REPOS"
install_extra_pkgs
if [[ $INSTALL_REFSPDK == true ]]; then
# Serialize builds as refspdk depends on spdk
install_spdk