diff mbox series

[ovs-dev,v1,3/4] travis: split cache and set target for

Message ID 1574237704-5076-1-git-send-email-Lance.Yang@arm.com
State Changes Requested
Headers show
Series Fix issues and enable Travis CI on arm | expand

Commit Message

Lance Yang Nov. 20, 2019, 8:15 a.m. UTC
To compile OvS with DPDK in some Travis jobs, it is necessary to set the
build target and split the dpdk cache directory according to different CPU
architectures.

Reviewed-by: Yanqin Wei <Yanqin.Wei@arm.com>
Reviewed-by: Malvika Gupta <Malvika.Gupta@arm.com>
Signed-off-by: Lance Yang <Lance.Yang@arm.com>
---
 .travis/linux-build.sh | 32 +++++++++++++++++++++-----------
 1 file changed, 21 insertions(+), 11 deletions(-)

Comments

Ilya Maximets Nov. 21, 2019, 7:39 p.m. UTC | #1
On 20.11.2019 9:15, Lance Yang wrote:
> To compile OvS with DPDK in some Travis jobs, it is necessary to set the
> build target and split the dpdk cache directory according to different CPU
> architectures.
> 
> Reviewed-by: Yanqin Wei <Yanqin.Wei@arm.com>
> Reviewed-by: Malvika Gupta <Malvika.Gupta@arm.com>
> Signed-off-by: Lance Yang <Lance.Yang@arm.com>
> ---
>  .travis/linux-build.sh | 32 +++++++++++++++++++++-----------
>  1 file changed, 21 insertions(+), 11 deletions(-)


According to this thread:
https://travis-ci.community/t/no-cache-support-on-arm64/5416/20

The arch name should be included now in the cache key, so this
should not be an issue.  Could you, please, re-check?

Best regards, Ilya Maximets.
Lance Yang Nov. 22, 2019, 9:35 a.m. UTC | #2
Hi Ilya,

Thanks for your comments.

> -----Original Message-----
> From: Ilya Maximets <i.maximets@ovn.org>
> Sent: Friday, November 22, 2019 3:39 AM
> To: Lance Yang (Arm Technology China) <Lance.Yang@arm.com>; ovs-
> dev@openvswitch.org
> Cc: Jieqiang Wang (Arm Technology China) <Jieqiang.Wang@arm.com>; Gavin Hu (Arm
> Technology China) <Gavin.Hu@arm.com>; Jingzhao Ni (Arm Technology China)
> <Jingzhao.Ni@arm.com>; dwilder@us.ibm.com; nd <nd@arm.com>; Ruifeng Wang (Arm
> Technology China) <Ruifeng.Wang@arm.com>
> Subject: Re: [ovs-dev] [PATCH v1 3/4] travis: split cache and set target for
>
> On 20.11.2019 9:15, Lance Yang wrote:
> > To compile OvS with DPDK in some Travis jobs, it is necessary to set
> > the build target and split the dpdk cache directory according to
> > different CPU architectures.
> >
> > Reviewed-by: Yanqin Wei <Yanqin.Wei@arm.com>
> > Reviewed-by: Malvika Gupta <Malvika.Gupta@arm.com>
> > Signed-off-by: Lance Yang <Lance.Yang@arm.com>
> > ---
> >  .travis/linux-build.sh | 32 +++++++++++++++++++++-----------
> >  1 file changed, 21 insertions(+), 11 deletions(-)
>
>
> According to this thread:
> https://travis-ci.community/t/no-cache-support-on-arm64/5416/20
>
> The arch name should be included now in the cache key, so this should not be an issue.
> Could you, please, re-check?
>
[Lance]
I rechecked Travis CI. I found the cache conflict issue was solved. But the upload cache function on arm is still not successful. I will remove cache split in v2.
> Best regards, Ilya Maximets.
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
diff mbox series

Patch

diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh
index 4e74973..557f397 100755
--- a/.travis/linux-build.sh
+++ b/.travis/linux-build.sh
@@ -6,7 +6,7 @@  set -x
 CFLAGS_FOR_OVS="-g -O2"
 SPARSE_FLAGS=""
 EXTRA_OPTS="--enable-Werror"
-TARGET="x86_64-native-linuxapp-gcc"
+TARGET=""
 
 function install_kernel()
 {
@@ -85,32 +85,42 @@  function install_kernel()
 function install_dpdk()
 {
     local DPDK_VER=$1
-    local VERSION_FILE="dpdk-dir/travis-dpdk-cache-version"
-
+    if [ -z "$TARGET" -a -z "$TRAVIS_ARCH" ] ||
+       [ "$TRAVIS_ARCH" == "amd64" ]; then
+        TARGET="x86_64-native-linuxapp-gcc"
+    else
+        echo "Target is unknown"
+        exit 1
+    fi
+    local DPDK_CACHE="dpdk-dir/${TARGET}-cache"
+    local VERSION_FILE="${DPDK_CACHE}/travis-dpdk-cache-version"
     if [ "${DPDK_VER##refs/*/}" != "${DPDK_VER}" ]; then
         # Avoid using cache for git tree build.
-        rm -rf dpdk-dir
+        rm -rf ${DPDK_CACHE}
 
         DPDK_GIT=${DPDK_GIT:-https://dpdk.org/git/dpdk}
-        git clone --single-branch $DPDK_GIT dpdk-dir -b "${DPDK_VER##refs/*/}"
-        pushd dpdk-dir
+        git clone --single-branch \
+                  $DPDK_GIT ${DPDK_CACHE} -b "${DPDK_VER##refs/*/}"
+        pushd ${DPDK_CACHE}
         git log -1 --oneline
     else
         if [ -f "${VERSION_FILE}" ]; then
             VER=$(cat ${VERSION_FILE})
             if [ "${VER}" = "${DPDK_VER}" ]; then
-                EXTRA_OPTS="${EXTRA_OPTS} --with-dpdk=$(pwd)/dpdk-dir/build"
-                echo "Found cached DPDK ${VER} build in $(pwd)/dpdk-dir"
+                EXTRA_OPTS="${EXTRA_OPTS} \
+                    --with-dpdk=$(pwd)/${DPDK_CACHE}/build"
+                echo "Found cached DPDK ${VER} build in \
+                      $(pwd)/${DPDK_CACHE}"
                 return
             fi
         fi
         # No cache or version mismatch.
-        rm -rf dpdk-dir
+        rm -rf ${DPDK_CACHE}
         wget https://fast.dpdk.org/rel/dpdk-$1.tar.xz
         tar xvf dpdk-$1.tar.xz > /dev/null
         DIR_NAME=$(tar -tf dpdk-$1.tar.xz | head -1 | cut -f1 -d"/")
-        mv ${DIR_NAME} dpdk-dir
-        pushd dpdk-dir
+        mv ${DIR_NAME} ${DPDK_CACHE}
+        pushd ${DPDK_CACHE}
     fi
 
     make config CC=gcc T=$TARGET