From 1e009906b8a25e4f25dacd1a3bab7801bdd57b44 Mon Sep 17 00:00:00 2001 From: fmenguy Date: Mon, 17 May 2021 14:01:20 +0200 Subject: NFVBENCH-209 Fix NFVbench loopvm build failed on testpmd step Change-Id: I0715b46b34b382176f2e06798deeede402b4c2fd Signed-off-by: fmenguy --- nfvbenchvm/dib/build-image.sh | 24 +++++++++---------- .../nfvbenchvm/post-install.d/02-pip-package | 8 +++++++ .../nfvbenchvm/post-install.d/02-testpmd-script | 28 ---------------------- .../nfvbenchvm/post-install.d/50-pip-package | 8 ------- .../nfvbenchvm/static/etc/rc.d/rc.local.loopvm | 15 ++++++------ requirements.txt | 2 +- 6 files changed, 28 insertions(+), 57 deletions(-) create mode 100755 nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/02-pip-package delete mode 100755 nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/02-testpmd-script delete mode 100755 nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/50-pip-package diff --git a/nfvbenchvm/dib/build-image.sh b/nfvbenchvm/dib/build-image.sh index f27ce77..fd710c5 100755 --- a/nfvbenchvm/dib/build-image.sh +++ b/nfvbenchvm/dib/build-image.sh @@ -49,24 +49,24 @@ set -e gs_url=artifacts.opnfv.org/nfvbench/images # image version number -__version__=0.13 +__version__=0.14 loopvm_image_name=nfvbenchvm_centos-$__version__ generator_image_name=nfvbenchvm_centos-generator-$__version__ function build_image { # if image exists skip building echo "Checking if image exists in google storage..." - # if command -v gsutil >/dev/null; then - # if gsutil -q stat gs://$gs_url/$1.qcow2; then - # echo "Image already exists at http://$gs_url/$1.qcow2" - # echo "Build is skipped" - # exit 0 - # fi - # echo "Image does not exist in google storage, starting build..." - # echo - # else - # echo "Cannot check image availability in OPNFV artifact repository (gsutil not available)" - # fi + if command -v gsutil >/dev/null; then + if gsutil -q stat gs://$gs_url/$1.qcow2; then + echo "Image already exists at http://$gs_url/$1.qcow2" + echo "Build is skipped" + exit 0 + fi + echo "Image does not exist in google storage, starting build..." + echo + else + echo "Cannot check image availability in OPNFV artifact repository (gsutil not available)" + fi # check if image is already built locally if [ -f $1.qcow2 ]; then diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/02-pip-package b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/02-pip-package new file mode 100755 index 0000000..9707841 --- /dev/null +++ b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/02-pip-package @@ -0,0 +1,8 @@ +#!/bin/bash + +cd /tmp +wget https://bootstrap.pypa.io/get-pip.py +python3 get-pip.py + +pip3 install setuptools wheel pbr +pip3 install pyyaml diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/02-testpmd-script b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/02-testpmd-script deleted file mode 100755 index f18ed60..0000000 --- a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/02-testpmd-script +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -if [ $DIB_DEV_IMAGE != "loopvm" ]; then - exit 0 -fi - -DPDK=dpdk-18.02 -DPDK_UNTAR=dpdk-18.02 - -# pick up the kernel version for the target image -kernel_version=`ls -t /lib/modules | awk 'NR==1 {print}'` - -mkdir dpdk -wget http://fast.dpdk.org/rel/$DPDK.tar.xz -tar xfJ $DPDK.tar.xz -cd $DPDK_UNTAR - -export RTE_KERNELDIR=/lib/modules/$kernel_version/build -export ARCH=x86 -make -j4 install T=x86_64-native-linuxapp-gcc - -cp x86_64-native-linuxapp-gcc/app/testpmd ../dpdk -cp x86_64-native-linuxapp-gcc/kmod/igb_uio.ko ../dpdk -echo "set promisc all off" > /dpdk/testpmd_cmd.txt - -cd .. -rm -f $DPDK.tar.xz -rm -rf $DPDK_UNTAR diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/50-pip-package b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/50-pip-package deleted file mode 100755 index 9707841..0000000 --- a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/50-pip-package +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -cd /tmp -wget https://bootstrap.pypa.io/get-pip.py -python3 get-pip.py - -pip3 install setuptools wheel pbr -pip3 install pyyaml diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/static/etc/rc.d/rc.local.loopvm b/nfvbenchvm/dib/elements/nfvbenchvm/static/etc/rc.d/rc.local.loopvm index a83e7ba..bc14902 100644 --- a/nfvbenchvm/dib/elements/nfvbenchvm/static/etc/rc.d/rc.local.loopvm +++ b/nfvbenchvm/dib/elements/nfvbenchvm/static/etc/rc.d/rc.local.loopvm @@ -168,16 +168,15 @@ if [ $PCI_ADDRESS_1 ] && [ $PCI_ADDRESS_2 ]; then logger "NFVBENCHVM: Using pci $PCI_ADDRESS_1 ($INTF_MAC1)" logger "NFVBENCHVM: Using pci $PCI_ADDRESS_2 ($INTF_MAC2)" # Configure the forwarder - if [ -z "`lsmod | grep igb_uio`" ]; then - modprobe uio - insmod /dpdk/igb_uio.ko - fi if [ "$FORWARDER" == "testpmd" ]; then echo "Configuring testpmd..." - # Binding ports to DPDK - dpdk-devbind -b igb_uio $PCI_ADDRESS_1 - dpdk-devbind -b igb_uio $PCI_ADDRESS_2 - screen -dmSL testpmd /dpdk/testpmd \ + modprobe uio_pci_generic + mkdir /dpdk + echo "set promisc all off" > /dpdk/testpmd_cmd.txt + # Binding ports to DPDK VFIO or UIO + dpdk-devbind -b vfio-pci $PCI_ADDRESS_1 || dpdk-devbind -b uio_pci_generic $PCI_ADDRESS_1 + dpdk-devbind -b vfio-pci $PCI_ADDRESS_2 || dpdk-devbind -b uio_pci_generic $PCI_ADDRESS_2 + screen -dmSL testpmd testpmd \ -c $CORE_MASK \ -n 4 \ -- \ diff --git a/requirements.txt b/requirements.txt index b002c68..7c74119 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ bitmath>=1.3.1.1 paramiko>=1.14.0 prettytable>=0.7.2 pytz>=2016.4 -six>=1.10.0 +six==1.15.0 python-glanceclient==3.2.2 python-neutronclient>=7.3.0 python-novaclient>=17.3.0 -- cgit 1.2.3-korg