CSIT-1264: Job for per-patch VPP perf testing 23/13123/62
authorVratko Polak <vrpolak@cisco.com>
Mon, 13 Aug 2018 13:40:41 +0000 (15:40 +0200)
committerVratko Polak <vrpolak@cisco.com>
Thu, 6 Sep 2018 11:55:08 +0000 (13:55 +0200)
Most logic is in CSIT repository.

+ Hardcode topology type of vpp-csit-verify-perf-{stream}- job.
+ Introduce gerrit related parameters to enable Sandbox testing.
+ Add the parameters to vpp-csit and csit-vpp perf verify jobs.

Change-Id: I8643b4ba352122c51289db923f0d0ebe597d08e4
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
jjb/csit/csit.yaml
jjb/global-macros.yaml
jjb/vpp/clone-csit-run-main.sh [new file with mode: 0644]
jjb/vpp/include-raw-vpp-csit-verify-perf.sh [deleted file]
jjb/vpp/vpp.yaml

index 842064f..013b373 100644 (file)
             project: '{project}'
         - gerrit-parameter:
             branch: '{branch}'
+        - gerrit-refspec-parameter
+        - gerrit-event-type-parameter
+        - gerrit-event-comment-text-parameter
 
     scm:
         - gerrit-trigger-scm:
index d34e4e2..8bca2e0 100644 (file)
             default: '{arch}'
             description: "Architecture parameter"
 
+- parameter:
+    name: gerrit-event-type-parameter
+    parameters:
+        - string:
+            name: GERRIT_EVENT_TYPE
+            default: ''
+            description: "GERRIT_EVENT_TYPE parameter not given by trigger"
+
+- parameter:
+    name: gerrit-event-comment-text-parameter
+    parameters:
+        - string:
+            name: GERRIT_EVENT_COMMENT_TEXT
+            default: ''
+            description: "GERRIT_EVENT_COMMENT_TEXT parameter not given by trigger"
+
+- parameter:
+    name: gerrit-csit-refspec-parameter
+    parameters:
+        - string:
+            name: CSIT_REF
+            default: ''
+            description: "GERRIT_REFSPEC parameter to override separately cloned CSIT repository, leave empty for autodetection / no override."
+            # FIXME: Wrap long lines.
+
 ##### SCMS
 - scm:
     name: git-scm
diff --git a/jjb/vpp/clone-csit-run-main.sh b/jjb/vpp/clone-csit-run-main.sh
new file mode 100644 (file)
index 0000000..f37d8e7
--- /dev/null
@@ -0,0 +1,38 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2018 Cisco and/or its affiliates.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -exuo pipefail
+
+# Clone CSIT git repository and proceed with entry script located there.
+#
+# Variables read:
+# - WORKSPACE - Jenkins workspace to create csit subdirectory in.
+# - CSIT_REF - Override ref of CSIT git repository to checkout.
+# Directories updated:
+# - ${WORKSPACE}/csit - Created, holding a checked out CSIT repository.
+# - Multiple other side effects by entry script(s), see CSIT repository.
+
+cd "${WORKSPACE}"
+git clone https://gerrit.fd.io/r/csit --depth=1 --no-single-branch --no-checkout
+pushd "${WORKSPACE}/csit"
+if [[ -n "${CSIT_REF-}" ]]; then
+    git fetch --depth=1 https://gerrit.fd.io/r/csit "${CSIT_REF}"
+    git checkout FETCH_HEAD
+else
+    git checkout HEAD
+fi
+popd
+csit_entry_dir="${WORKSPACE}/csit/resources/libraries/bash/entry"
+source "${csit_entry_dir}/with_oper_for_vpp.sh" "per_patch_perf.sh"
diff --git a/jjb/vpp/include-raw-vpp-csit-verify-perf.sh b/jjb/vpp/include-raw-vpp-csit-verify-perf.sh
deleted file mode 100644 (file)
index c593048..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-#!/bin/bash
-
-set -xeu -o pipefail
-
-if [[ ${GERRIT_EVENT_TYPE} == 'comment-added' ]]; then
-    TRIGGER=`echo ${GERRIT_EVENT_COMMENT_TEXT} \
-        | grep -oE '(perftest$|perftest[[:space:]].+$)'`
-else
-    TRIGGER=''
-fi
-# Export test type.
-export TEST_TAG="VERIFY-PERF-PATCH"
-# Export test tags as string.
-export TEST_TAG_STRING=${TRIGGER#$"perftest"}
-
-# Get CSIT branch from which to test from
-# running build-root/scripts/csit-test-branch
-if [ -x build-root/scripts/csit-test-branch ]; then
-    CSIT_BRANCH=`build-root/scripts/csit-test-branch`;
-fi
-
-# check CSIT_BRANCH value
-if [ "$CSIT_BRANCH" == "" ]; then
-    echo "CSIT_BRANCH not provided => 'latest' will be used"
-    CSIT_BRANCH="latest"
-fi
-
-# clone csit
-git clone --depth 1 --no-single-branch https://gerrit.fd.io/r/csit
-
-# if the git clone fails, complain clearly and exit
-if [ $? != 0 ]; then
-    echo "Failed to run: git clone --depth 1 --no-single-branch https://gerrit.fd.io/r/csit"
-    exit 1
-fi
-
-cp build-root/*.deb csit/
-if [ -e dpdk/vpp-dpdk-dkms*.deb ]
-then
-    cp dpdk/vpp-dpdk-dkms*.deb csit/
-else
-    cp /w/dpdk/vpp-dpdk-dkms*.deb csit/ 2>/dev/null || :
-    cp /var/cache/apt/archives/vpp-dpdk-dkms*.deb csit/ 2>/dev/null || :
-fi
-
-cd csit
-
-if [ "$CSIT_BRANCH" == "latest" ]; then
-    # set required CSIT branch_id based on VPP master branch; by default use 'oper'
-    case "$VPP_BRANCH" in
-        master )
-            BRANCH_ID="oper"
-            ;;
-        stable/1710 )
-            BRANCH_ID="oper-rls1710"
-            ;;
-        stable/1801 )
-            BRANCH_ID="oper-rls1801"
-            ;;
-        * )
-            BRANCH_ID="oper"
-    esac
-
-    # get the latest verified version of the required branch
-    CSIT_BRANCH=$(echo $(git branch -r | grep -E "${BRANCH_ID}-[0-9]+" | tail -n 1))
-
-    if [ "${CSIT_BRANCH}" == "" ]; then
-        echo "No verified CSIT branch found - exiting"
-        exit 1
-    fi
-
-    # remove 'origin/' from the branch name
-    CSIT_BRANCH=$(echo ${CSIT_BRANCH#origin/})
-fi
-
-# checkout the required csit branch
-git checkout ${CSIT_BRANCH}
-
-if [ $? != 0 ]; then
-    echo "Failed to checkout the required CSIT branch: ${CSIT_BRANCH}"
-    exit 1
-fi
-
-# execute csit bootstrap script if it exists
-if [ ! -e bootstrap-verify-perf.sh ]
-then
-    echo 'ERROR: No bootstrap-verify-perf.sh found'
-    exit 1
-fi
-
-# make sure that bootstrap-verify-perf.sh is executable
-chmod +x bootstrap-verify-perf.sh
-# run the script
-./bootstrap-verify-perf.sh *.deb
-
-# vim: ts=4 ts=4 sts=4 et :
index 7da9e38..cfcbe81 100644 (file)
@@ -56,7 +56,7 @@
     name: vpp-misc
     jobs:
         - 'vpp-csit-verify-virl-{stream}'
-        - 'vpp-csit-verify-hw-perf-{stream}'
+        - 'vpp-csit-verify-perf-{stream}-2n-skx'
         - 'vpp-checkstyle-verify-{stream}'
     project: 'vpp'
     stream:
             max-failed-builds: 1
             fixed-delay: 90
 
-
-
 - job-template:
     name: 'vpp-verify-{stream}-{os}'
 
             maven-version: 'mvn33-new'
 
 - job-template:
-    name: 'vpp-csit-verify-hw-perf-{stream}'
+    name: 'vpp-csit-verify-perf-{stream}-2n-skx'
 
     project-type: freestyle
     node: '{os}-basebuild-8c-32g'
-    concurrent: false
+    concurrent: true
 
     logrotate:
         daysToKeep: '{build-days-to-keep}'
         - os-parameter:
             os: '{os}'
         - repo-name-parameter:
-            repo-name: '{repo-stream-part}.ubuntu.xenial.main'
-        - is-csit-vpp-job-parameter:
-            is-csit-vpp-job: 'True'
+            repo-name: '{repo-stream-part}.ubuntu.bionic.main'
+        - gerrit-refspec-parameter
+        - gerrit-event-type-parameter
+        - gerrit-event-comment-text-parameter
+        - gerrit-csit-refspec-parameter
+        - string:
+            name: CSIT_PERF_TRIAL_DURATION
+            default: "1.0"
+            description: "Duration of a trial measurement in BMRR tests."
+        - string:
+            name: CSIT_PERF_TRIAL_MULTIPLICITY
+            default: "30"
+            description: "Number of subsamples for BMRR tests."
 
     scm:
         - gerrit-trigger-scm:
 
     wrappers:
         - fdio-infra-wrappers-non-activity-timeout:
-            build-timeout: 30
+            build-timeout: 300
 
     triggers:
         - gerrit:
                 notbuilt: false
 
     builders:
-        - shell: 'echo "VPP_BRANCH={branch}" > $WORKSPACE/variables.prop'
-        - inject:
-            properties-file: variables.prop
-        - shell:
-            !include-raw-escape:
-                - ../scripts/setup_vpp_dpdk_dev_env.sh
-                - include-raw-vpp-build.sh
         - shell:
             !include-raw-escape:
-                - include-raw-vpp-csit-verify-perf.sh
+                - clone-csit-run-main.sh
 
     publishers:
         - archive-artifacts:
-            artifacts: 'csit/archive/*.*'
+            artifacts: 'csit_new/*.*, csit_parent/*.*'
             latest-only: false
 
         - robot-report:
-            output-path: 'csit/archive/*.*'
+            output-path: 'csit_new/'
 
         - fdio-infra-shiplogs:
             maven-version: 'mvn33-new'