From 68444d67424763ad483df9c02732847e243c4887 Mon Sep 17 00:00:00 2001 From: Thomas F Herbert Date: Wed, 8 Feb 2017 19:26:57 -0500 Subject: Build OVS 2.6 with DPDK 16.11 Get DPDK 16.11 from upstream. Insure that NSH special build still works. Change-Id: Iade3090ed6e80e9a7a62049a0b46af2a00e200fb Signed-off-by: Thomas F Herbert --- build/BuildAndTestOVS.sh | 9 ++-- build/build_dpdk_rpm.sh | 111 ++++++++++++++--------------------------------- build/build_ovs_rpm.sh | 83 +++++++++++++---------------------- build/config | 6 +-- ci/buildovs.sh | 8 ++-- ci/clean.sh | 14 +++--- 6 files changed, 82 insertions(+), 149 deletions(-) diff --git a/build/BuildAndTestOVS.sh b/build/BuildAndTestOVS.sh index 57d2d2d..6017c14 100755 --- a/build/BuildAndTestOVS.sh +++ b/build/BuildAndTestOVS.sh @@ -133,7 +133,7 @@ export TOPDIR=$BUILD_BASE export TMP_RELEASE_DIR=$TOPDIR/release export CACHE_DIR=$TOPDIR/cache -export TMPDIR=$TOPDIR/scratch +export TEMPDIR=$TOPDIR/scratch export RPMDIR=$TOPDIR/rpmbuild @@ -161,8 +161,11 @@ echo echo "===============================" echo copy rpms to release dir echo -cp $RPMDIR/RPMS/x86_64/* $TMP_RELEASE_DIR -rm $RPMDIR/RPMS/x86_64/* +cp $RPMDIR/RPMS/x86_64/*.rpm $TMP_RELEASE_DIR || true +rm $RPMDIR/RPMS/x86_64/*.rpm || true +cp $BUILD_BASE/rpms/*.rpm $TMP_RELEASE_DIR || true +cp $BUILD_BASE/ovsrpm/ovs/rpm/rpmbuild/RPMS/x86_64/*.rpm $TMP_RELEASE_DIR || true +cp $BUILD_BASE/ovsrpm/ovs/rpm/rpmbuild/RPMS/no_arch/*.rpm $TMP_RELEASE_DIR || true # # Build OVS without DPDK, apply patches and build kmod. diff --git a/build/build_dpdk_rpm.sh b/build/build_dpdk_rpm.sh index f088a4a..08ba498 100755 --- a/build/build_dpdk_rpm.sh +++ b/build/build_dpdk_rpm.sh @@ -49,17 +49,28 @@ if [ -z $DPDK_REPO_URL ]; then DPDK_REPO_URL=http://dpdk.org/git/dpdk fi if [ -z $DPDK_VERSION ]; then - DPDK_VERSION=2.2.0 + DPDK_VERSION=16.11 +fi +export REPO_PATH="/etc/yum.repos.d/fdio-release.repo" +if [ ! -f $REPO_PATH ]; then + echo "-------------------------------------------" + echo install upstream repo - Use fd.io nexus repo for now + echo until dpdk rpm is in epel or Centos NFV SIG + FDIORELEASE=$(mktemp) + cat - > $FDIORELEASE <<"_EOF" +[fdio-release] +name=fd.io release branch latest merge +baseurl=https://nexus.fd.io/content/repositories/fd.io.master.centos7/ +enabled=1 +gpgcheck=0 +_EOF + sudo cp $FDIORELEASE $REPO_PATH + sudo chmod 644 $REPO_PATH fi HOME=`pwd` TOPDIR=$HOME -TMPDIR=$TOPDIR/rpms - -if [ -d $TMPDIR ] -then - rm -rf $TMPDIR -fi +TEMPDIR=$TOPDIR/rpms function install_pre_reqs() { echo "----------------------------------------" @@ -67,87 +78,31 @@ function install_pre_reqs() { echo sudo yum -y install gcc make python-devel openssl-devel kernel-devel graphviz \ kernel-debug-devel autoconf automake rpm-build redhat-rpm-config \ - libtool python-twisted-core desktop-file-utils groff PyQt4 + libtool python-twisted-core desktop-file-utils groff PyQt4 \ + yum-utils } -mkdir -p $TMPDIR - -cd $TMPDIR - -install_pre_reqs - -mkdir -p $HOME/rpmbuild/RPMS -mkdir -p $HOME/rpmbuild/SOURCES -mkdir -p $HOME/rpmbuild/SPECS -mkdir -p $HOME/rpmbuild/SRPMS - -RPMDIR=$HOME/rpmbuild - -# -# Use Fedora copr spec file -# -echo "---------------------" -echo "Get copr distribution git" -mkdir -p copr -cd copr -git clone https://github.com/tfherbert/dpdk-snap.git -cd dpdk-snap -git checkout $COPR_DPDK_VERSION -echo "---------------------" -echo "Apply dpdk dpdk spec file patch" -echo -git apply $HOME/patches/spec_file_add_virtio_patch.patch -echo "---------------------" -echo "Copy in local dpdk patches" -echo -cp $HOME/patches/dpdk-16.04-virtio-devargs.patch $TMPDIR/copr/dpdk-snap - -echo "---------------------" -echo "Build DPDK RPM version $DPDK_VERSION" -echo -cd $TMPDIR -git clone $DPDK_REPO_URL -cd dpdk -if [[ "$DPDK_VERSION" =~ "master" ]]; then - git checkout master - snapgit=`git log --pretty=oneline -n1|cut -c1-8` -else - git checkout v$DPDK_VERSION - snapgit=`grep "define snapver" $TMPDIR/copr/dpdk-snap/dpdk.spec | cut -c25-33` +if [ ! -d $TEMPDIR ]; then + mkdir -p $TEMPDIR fi -cp $TMPDIR/copr/dpdk-snap/dpdk.spec $TMPDIR/dpdk -cp $TMPDIR/copr/dpdk-snap/dpdk.spec $RPMDIR/SPECS -cp $TMPDIR/copr/dpdk-snap/*.patch $TMPDIR/copr/dpdk-snap/sources $TMPDIR/copr/dpdk-snap/dpdk-snapshot.sh $RPMDIR/SOURCES -snapser=`git log --pretty=oneline | wc -l` -makever=`make showversion` -basever=`echo ${makever} | cut -d- -f1` -prefix=dpdk-${basever:0:5} - -archive=${prefix}.tar.gz -DPDK_VERSION=$basever +install_pre_reqs -echo "-------------------------------" -echo "Creating ${archive}" -echo -git archive --prefix=${prefix}/ HEAD | gzip -9 > ${archive} -cp ${archive} $RPMDIR/SOURCES/ -echo "-------------------------------" -echo building RPM for DPDK version $DPDK_VERSION -echo -rpmbuild -bb --define "_topdir $RPMDIR" dpdk.spec +cd $TEMPDIR +echo "---------------------------------" +echo Download DPDK RPMs +yumdownloader dpdk-$DPDK_VERSION +yumdownloader dpdk-devel-$DPDK_VERSION +yumdownloader dpdk-debuginfo-$DPDK_VERSION +yumdownloader dpdk-doc-$DPDK_VERSION +yumdownloader dpdk-examples-$DPDK_VERSION +yumdownloader dpdk-tools-$DPDK_VERSION -echo "-------------------------------" -echo Delete all rpms from $HOME -echo -set +e -rm $HOME/*.rpm -set -e echo "-------------------------------" echo Copy dpdk RPM echo -cp $RPMDIR/RPMS/x86_64/*.rpm $HOME +cp $TEMPDIR/*.rpm $HOME exit 0 diff --git a/build/build_ovs_rpm.sh b/build/build_ovs_rpm.sh index 0972dd9..eff1201 100755 --- a/build/build_ovs_rpm.sh +++ b/build/build_ovs_rpm.sh @@ -55,7 +55,7 @@ done HOME=`pwd` TOPDIR=$HOME -TMPDIR=$TOPDIR/ovsrpm +TEMPDIR=$TOPDIR/ovsrpm BUILDDIR=$HOME BUILD_BASE=$BUILDDIR @@ -65,9 +65,9 @@ source $BUILDDIR/functions.sh echo "---------------------------------------" echo "Clean out old working dir." echo -if [ -d $TMPDIR ] +if [ -d $TEMPDIR ] then - rm -rf $TMPDIR + rm -rf $TEMPDIR fi function install_pre_reqs() { @@ -76,19 +76,20 @@ function install_pre_reqs() { echo sudo yum -y install gcc make python-devel openssl-devel kernel-devel graphviz \ kernel-debug-devel autoconf automake rpm-build redhat-rpm-config \ - libtool python-twisted-core desktop-file-utils groff PyQt4 + libtool python-twisted-core desktop-file-utils groff PyQt4 \ + selinux-policy-devel libpcap libpcap-devel libcap-ng-devel } function apply_nsh_patches() { echo "-------------------------------------------" echo "Clone NSH patch and copy patch files." echo - cd $TMPDIR + cd $TEMPDIR if [ -e ovs_nsh_patches ]; then rm -rf ovs_nsh_patches fi git clone https://github.com/yyang13/ovs_nsh_patches.git - cp $TMPDIR/ovs_nsh_patches/*.patch $RPMDIR/SOURCES - cd $TMPDIR + cp $TEMPDIR/ovs_nsh_patches/*.patch $RPMDIR/SOURCES + cd $TEMPDIR if [ -e buildovsnsh ]; then rm -rf buildovsnsh fi @@ -120,63 +121,38 @@ mkdir -p $HOME/rpmbuild/SPECS mkdir -p $HOME/rpmbuild/SRPMS -mkdir -p $TMPDIR +mkdir -p $TEMPDIR install_pre_reqs -cd $TMPDIR +cd $TEMPDIR if [ ! -z $DPDK ]; then - echo "----------------------------------" - echo "Build OVS for dpdk. Use Fedora copr repo" - echo - echo "----------------------------------" - echo "Clone Fedora copr repo and copy files." - echo - git clone https://github.com/tfherbert/ovs-snap.git - cd ovs-snap - git checkout $COPR_OVS_VERSION - echo "-----------------------------------" - cp $TMPDIR/ovs-snap/openvswitch.spec $RPMDIR/SPECS - cp $TMPDIR/ovs-snap/* $RPMDIR/SOURCES - snapgit=`grep "define snapver" $TMPDIR/ovs-snap/openvswitch.spec | cut -c26-33` - echo "-----------------------------------------------" - echo "Remove any old installed ovs and dpdk rpms." - echo cleanrpms if [ -z $DPDK_VERSION ]; then - DPDK_VERSION=16.04.0 + DPDK_VERSION=16.11 fi echo "-------------------------------------------" echo "Install dpdk and dpdk development rpms for version $DPDK_VERSION" echo - sudo rpm -ivh $HOME/dpdk-${DPDK_VERSION:0:1}*.rpm + sudo rpm -ivh $HOME/dpdk-${DPDK_VERSION}*.rpm sudo rpm -ivh $HOME/dpdk-devel*.rpm echo "----------------------------------------" echo "Copy DPDK RPM to SOURCES" echo cp $HOME/*.rpm $RPMDIR/SOURCES - echo "--------------------------------------------" - echo "Get commit from $snapgit User Space OVS version $TAG" - echo - cd $TMPDIR + cd $TEMPDIR git clone $OVS_REPO_URL - cd $TMPDIR/ovs - git checkout $snapgit - echo "--------------------------------------------" - echo "Creating snapshot, $archive with name same as in spec file." + cd $TEMPDIR/ovs + git checkout v$OVSTAG + echo "----------------------------------------------------" + echo "Build openvswitch RPM for version $OVSTAG" echo - snapser=`git log --pretty=oneline | wc -l` - basever=`grep AC_INIT configure.ac | cut -d' ' -f2 | cut -d, -f1` - prefix=openvswitch-${basever} - archive=${prefix}-${snapser}.git${snapgit}.tar.gz - git archive --prefix=${prefix}-${snapser}.git${snapgit}/ HEAD | gzip -9 > $RPMDIR/SOURCES/${archive} - cd $TMPDIR/ovs-snap echo "--------------------------------------------" - echo "Build openvswitch RPM" - echo - rpmbuild -bb -vv --define "_topdir `echo $RPMDIR`" $setnocheck openvswitch.spec + ./boot.sh + ./configure + make rpm-fedora RPMBUILD_OPT="--with dpdk --without check" else echo "-------------------------------------------------" echo "Build OVS without DPDK:" @@ -186,10 +162,10 @@ else echo "Remove old rpms." echo cleanrpms - cd $TMPDIR + cd $TEMPDIR git clone $OVS_REPO_URL - cd $TMPDIR/ovs - git checkout $OVS_VERSION + cd $TEMPDIR/ovs + git checkout $OVS_FORK_COMMIT_FOR_NSH echo "--------------------------------------------" echo "Get commit from $snapgit User Space OVS version $TAG" echo @@ -220,7 +196,7 @@ else echo "--------------------------------------------" echo "Creating snapshot, $archive with name same as in spec file." echo - cd $TMPDIR/ovs + cd $TEMPDIR/ovs git archive --prefix=${prefix}-${snapser}.NSH${snapgit}/ HEAD | gzip -9 > $RPMDIR/SOURCES/${archive} echo "--------------------------------------------" echo "Build openvswitch RPM" @@ -235,13 +211,13 @@ if [ ! -z $kmod ]; then echo "--------------------------------------------" echo Build Open vswitch kernel module echo - cd $TMPDIR + cd $TEMPDIR if [ -e ovs ]; then rm -rf ovs fi git clone $OVS_REPO_URL - cd $TMPDIR/ovs - git checkout $OVS_VERSION + cd $TEMPDIR/ovs + git checkout $OVS_FORK_COMMIT_FOR_NSH echo "--------------------------------------------" echo "Get commit from $snapgit User Space OVS version $TAG" echo @@ -275,7 +251,7 @@ if [ ! -z $kmod ]; then echo "--------------------------------------------" echo "Creating snapshot, $archive with name same as in spec file." echo - cd $TMPDIR/ovs + cd $TEMPDIR/ovs git archive --prefix=${prefix}-${snapser}.NSH${snapgit}/ HEAD | gzip -9 > $RPMDIR/SOURCES/${archive} echo "--------------------------------------------" echo "Building openvswitch kernel module RPM" @@ -284,6 +260,7 @@ if [ ! -z $kmod ]; then rpmbuild -bb -vv -D "kversion $kernel_version" -D "kflavors default" --define "_topdir `echo $RPMDIR`" $setnocheck openvswitch-kmod.spec fi -cp $RPMDIR/RPMS/x86_64/*.rpm $HOME +cp $RPMDIR/RPMS/x86_64/*.rpm $HOME || true +cp $TEMPDIR/ovs/rpm/rpmbuild/RPMS/x86_64/*.rpm $HOME || true exit 0 diff --git a/build/config b/build/config index 7d4b22f..b266f52 100644 --- a/build/config +++ b/build/config @@ -21,7 +21,7 @@ # built from the top of current master. The tag uses the current ovs naming and # release convention. This option can be overriden in the command line. # -export OVSTAG=2.4.0 +export OVSTAG=2.6.0 # # when NOCHECK is yes, the ovs rpm is build with the --without check option which # Disables running "make check" as the RPM is built. @@ -36,11 +36,11 @@ export PATCH=none # export WITH_DPDK=yes export DPDK_PATCH=none -export DPDK_VERSION=16.04-rc4 +export DPDK_VERSION=16.11 # # OVS VERSION or commit for OVS without DPDK # -export OVS_VERSION=7d433ae57ebb90cd68e8fa948a096f619ac4e2d8 +export OVS_FORK_COMMIT_FOR_NSH=7d433ae57ebb90cd68e8fa948a096f619ac4e2d8 # # VERSION for DPDK and OVS with DPDK determined by COPR commit # diff --git a/ci/buildovs.sh b/ci/buildovs.sh index 5270f03..eefd380 100755 --- a/ci/buildovs.sh +++ b/ci/buildovs.sh @@ -56,7 +56,7 @@ export TOPDIR=$BUILD_BASE export TMP_RELEASE_DIR=$TOPDIR/release export CACHE_DIR=$TOPDIR/cache -export TMPDIR=$TOPDIR/scratch +export TEMPDIR=$TOPDIR/scratch export RPMDIR=$TOPDIR/rpmbuild mkdir -p $RPMDIR/RPMS @@ -89,10 +89,10 @@ echo "Cleanup temporary dirs" echo cd $BUILD_BASE -if [ -d $TMPDIR ] +if [ -d $TEMPDIR ] then - echo rm -rf $TMPDIR - rm -rf $TMPDIR + echo rm -rf $TEMPDIR + rm -rf $TEMPDIR fi # copy artifacts. diff --git a/ci/clean.sh b/ci/clean.sh index 7dab0ea..48c648e 100755 --- a/ci/clean.sh +++ b/ci/clean.sh @@ -29,14 +29,12 @@ fi export BUILD_BASE=$WORKSPACE source $BUILD_BASE/../build/functions.sh - +cd $BUILD_BASE cleanrpms -set +e -rm -rf ovsrpm -rm -rf rpmbuild -rm -rf rpms -rm -rf build -rm *.rpm +rm -rf ovsrpm || true +rm -rf rpmbuild || true +rm -rf rpms || true +#rm -rf release || true +rm *.rpm || true ccache -C || true -set -e exit 0 -- cgit 1.2.3-korg