Merge "CSIT-513: Publish vpp make test doc"
authorVanessa Rene Valderrama <vvalderrama@linuxfoundation.org>
Thu, 2 Feb 2017 19:22:17 +0000 (19:22 +0000)
committerGerrit Code Review <gerrit@fd.io>
Thu, 2 Feb 2017 19:22:17 +0000 (19:22 +0000)
12 files changed:
jenkins-scripts/basic_settings.sh
jjb/csit/csit.yaml
jjb/csit/include-raw-csit-report.sh [new file with mode: 0644]
jjb/global-macros.yaml
jjb/hc2vpp/csit-hc2vpp.yaml
jjb/hc2vpp/include-raw-hc2vpp-csit-integration.sh
jjb/hc2vpp/include-raw-hc2vpp-csit-verify-prebuild.sh
jjb/tldk/gtest-build.sh [new file with mode: 0755]
jjb/tldk/include-raw-build.sh [changed mode: 0644->0755]
jjb/tldk/tldk.yaml
packer/provision/basebuild.sh
packer/provision/baseline.sh

index 37ca057..7790496 100755 (executable)
@@ -17,6 +17,9 @@ case "$(facter operatingsystem)" in
 
     # attach to the fd.io.dev apt repo
     echo 'deb http://nexus.fd.io/content/repositories/fd.io.dev/ ./' >> /etc/apt/sources.list
+
+    # Configure Ubuntu mirror
+    perl -pi -e 'unless(m{(security|fd\.io)}){ s{://[^/]+/}{://ca.archive.ubuntu.com/} }' /etc/apt/sources.list
     ;;
   *)
     # Do nothing on other distros for now
index 7347498..ad622be 100644 (file)
@@ -11,6 +11,7 @@
         - 'csit-vpp-verify-perf-master-nightly-all'
         - 'csit-docs-merge-{stream}'
         - 'csit-docs-verify-{stream}'
+        - 'csit-report-merge-{stream}'
 
     project: 'csit'
     branch: 'master'
           build-timeout: '1440'
 
     triggers:
-        - timed: '0 20 * * *'
+        - timed: '0 20 * * Sun,Tue,Thu'
 
     builders:
         - shell: 'echo "BRANCH_ID={branch-id}" > $WORKSPACE/variables.prop'
         - fdio-infra-shiplogs:
             maven-version: 'mvn33-new'
 
+- job-template:
+    name: 'csit-report-merge-{stream}'
+
+    project-type: freestyle
+    node: 'ubuntu1604-basebuild-4c-4g'
+    concurrent: false
+
+    logrotate:
+        daysToKeep: '{build-days-to-keep}'
+        numToKeep: '{build-num-to-keep}'
+        artifactDaysToKeep: '{build-artifact-days-to-keep}'
+        artifactNumToKeep: '{build-artifact-num-to-keep}'
+
+    parameters:
+        - project-parameter:
+            project: '{project}'
+        - gerrit-parameter:
+            branch: '{branch}'
+        - maven-exec:
+            maven-version: 'mvn33-new'
+
+    scm:
+        - gerrit-trigger-scm:
+            credentials-id: 'jenkins-gerrit-credentials'
+            refspec: '$GERRIT_REFSPEC'
+            choosing-strategy: 'default'
+
+    wrappers:
+        - fdio-infra-wrappers:
+            build-timeout: '{build-timeout}'
+        - fdio-infra-wrappers-non-activity-timeout:
+            build-timeout: 360
+
+    triggers:
+        - gerrit:
+            server-name: 'Primary'
+            trigger-on:
+                - comment-added-contains-event:
+                    comment-contains-value: 'run-report'
+            projects:
+              - project-compare-type: 'ANT'
+                project-pattern: '{project}'
+                branches:
+                  - branch-compare-type: 'ANT'
+                    branch-pattern: '**/{branch}'
+            skip-vote:
+                successful: true
+                failed: true
+                unstable: true
+                notbuilt: true
+
+    builders:
+        - maven-target:
+            maven-version: 'mvn33-new'
+            goals: '--version'
+            settings: 'csit-settings'
+            settings-type: cfp
+            global-settings: 'global-settings'
+            global-settings-type: cfp
+        - provide-maven-settings:
+            settings-file: 'csit-settings'
+            global-settings-file: 'global-settings'
+        - shell:
+            !include-raw-escape: include-raw-csit-report.sh
+
+    publishers:
+        - archive:
+            artifacts: 'resources/tools/report_gen/csit.report.tar.gz'
+            allow-empty: 'true'
+            fingerprint: false
+            only-if-success: true
+            default-excludes: false
+
+        - fdio-infra-shiplogs:
+            maven-version: 'mvn33-new'
+
 - parameter:
     name: test-type-parameter
     parameters:
diff --git a/jjb/csit/include-raw-csit-report.sh b/jjb/csit/include-raw-csit-report.sh
new file mode 100644 (file)
index 0000000..40144f2
--- /dev/null
@@ -0,0 +1,63 @@
+#!/bin/bash
+
+set -xe -o pipefail
+
+[ "$DOCS_REPO_URL" ] || DOCS_REPO_URL="https://nexus.fd.io/content/sites/site"
+[ "$PROJECT_PATH" ] || PROJECT_PATH=io/fd/csit
+[ "$DOC_DIR" ] || DOC_DIR=resources/tools/report_gen
+[ "$BUILD_DIR" ] || BUILD_DIR=${DOC_DIR}/_build
+[ "$SITE_DIR" ] || SITE_DIR=build-root/docs/deploy-site
+[ "$RESOURCES_DIR" ] || RESOURCES_DIR=${SITE_DIR}/src/site/resources/report
+[ "$MVN" ] || MVN="/opt/apache/maven/bin/mvn"
+
+cd ${DOC_DIR}
+chmod +x ./run_report.sh
+./run_report.sh ${GERRIT_BRANCH}
+
+retval=$?
+if [ ${retval} -ne "0" ]; then
+  echo "Report generation failed!"
+exit ${retval}
+fi
+
+if [[ ${JOB_NAME} == *merge* ]]; then
+
+  cd ${WORKSPACE}
+
+  mkdir -p ${RESOURCES_DIR}
+  mv -f ${BUILD_DIR}/* ${RESOURCES_DIR}
+  cd ${SITE_DIR}
+
+  cat > pom.xml << EOF
+  <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>io.fd.csit</groupId>
+    <artifactId>docs</artifactId>
+    <version>1.0.0</version>
+    <packaging>pom</packaging>
+    <properties>
+      <generateReports>false</generateReports>
+    </properties>
+    <build>
+      <extensions>
+        <extension>
+          <groupId>org.apache.maven.wagon</groupId>
+          <artifactId>wagon-webdav-jackrabbit</artifactId>
+          <version>2.9</version>
+        </extension>
+      </extensions>
+    </build>
+    <distributionManagement>
+      <site>
+        <id>fdio-site</id>
+        <url>dav:${DOCS_REPO_URL}/${PROJECT_PATH}/${GERRIT_BRANCH}</url>
+      </site>
+    </distributionManagement>
+  </project>
+EOF
+
+  ${MVN} site:site site:deploy -gs "${GLOBAL_SETTINGS_FILE}" -s "${SETTINGS_FILE}" -T 4C
+
+  cd -
+
+fi
index f3171a9..2493c2b 100644 (file)
             default: '{is-csit-vpp-job}'
             description: "Parameter is True if this is a CSIT vpp job."
 
+- parameter:
+    name: stream-parameter
+    parameters:
+        - string:
+            name: STREAM
+            default: '{stream}'
+            description: "Stream job parameter to be used in shell scripts."
+
 
 ##### SCMS
 - scm:
index 94e4699..f4ad748 100644 (file)
@@ -5,13 +5,14 @@
         - 'hc2vpp-csit-integration-{stream}-{os}'
         - 'hc2vpp-csit-verify-{stream}-{os}'
     project: 'hc2vpp'
-    branch: 'master'
-    branch-id: 'master'
     build-artifact-num-to-keep: 10
     stream:
         - master:
             branch: 'master'
             repo-stream-part: 'master'
+        - '1701':
+            branch: 'stable/1701'
+            repo-stream-part: 'stable.1701'
     os:
         - ubuntu1404:
             repo-os-part: 'ubuntu.trusty.main'
@@ -21,7 +22,7 @@
     name: 'hc2vpp-csit-integration-{stream}-{os}'
 
     project-type: freestyle
-    node: 'ubuntu1604-basebuild-4c-4g'
+    node: 'ubuntu1404-basebuild-4c-4g'
     concurrent: true
 
     logrotate:
@@ -35,6 +36,8 @@
             project: '{project}'
         - os-parameter:
             os: '{os}'
+        - stream-parameter:
+            stream: '{stream}'
 
     scm:
         - git-scm:
@@ -47,7 +50,7 @@
 
     triggers:
         - reverse:
-            jobs: 'hc2vpp-verify-{stream}-{os}'
+            jobs: 'hc2vpp-integration-{stream}-{os}'
             result: 'success'
 
     prebuilders:
@@ -76,7 +79,7 @@
     name: 'hc2vpp-csit-verify-{stream}-{os}'
 
     project-type: maven
-    node: 'ubuntu1604-basebuild-4c-4g'
+    node: 'ubuntu1404-basebuild-4c-4g'
     concurrent: true
 
     logrotate:
@@ -96,6 +99,8 @@
             maven: 'mvn33-new'
         - maven-exec:
             maven-version: 'mvn33-new'
+        - stream-parameter:
+            stream: '{stream}'
 
     scm:
         - gerrit-trigger-scm:
index 9bc42ad..915ca8c 100644 (file)
@@ -2,7 +2,11 @@
 set -xeu -o pipefail
 
 # Clone csit and start tests
-git clone https://gerrit.fd.io/r/csit --branch master
+if [ ${STREAM} == 'master' ]; then
+    git clone https://gerrit.fd.io/r/csit --branch master
+else
+    git clone https://gerrit.fd.io/r/csit --branch 'rls'${STREAM}
+fi
 
 # If the git clone fails, complain clearly and exit
 if [ $? != 0 ]; then
@@ -20,7 +24,11 @@ else
     # make sure that bootstrap.sh is executable
     chmod +x bootstrap-hc2vpp-integration.sh
     # run the script
-    ./bootstrap-hc2vpp-integration.sh
+    if [ ${STREAM} == 'master' ]; then
+        ./bootstrap-hc2vpp-integration.sh ${STREAM}
+    else
+        ./bootstrap-hc2vpp-integration.sh 'stable.'${STREAM}
+    fi
 fi
 
 # vim: ts=4 ts=4 sts=4 et :
index 62b495e..3ce8344 100644 (file)
@@ -1,18 +1,29 @@
 #!/bin/bash
 set -xeu -o pipefail
 
-current_dir = `pwd`
+current_dir=`pwd`
 cd ${WORKSPACE}
 
-# Clone csit and run package download script
-git clone https://gerrit.fd.io/r/csit --branch master
+# Get CSIT branch from which to test from
+# running build-root/scripts/csit-test-branch
+if [ -f csit-test-branch ]; then
+    chmod +x csit-test-branch
+    CSIT_BRANCH=`./csit-test-branch`
+fi
+
+# Clone csit and start tests
+git clone https://gerrit.fd.io/r/csit --branch ${CSIT_BRANCH}
 
 # If the git clone fails, complain clearly and exit
 if [ $? != 0 ]; then
-    echo "Failed to run: git clone https://gerrit.fd.io/r/csit --branch master"
+    echo "Failed to run: git clone https://gerrit.fd.io/r/csit --branch ${CSIT_BRANCH}"
     exit
 fi
 
-./csit/resources/tools/download_hc_build_pkgs.sh
+if [ ${STREAM} == 'master' ]; then
+    ./csit/resources/tools/download_hc_build_pkgs.sh ${STREAM}
+else
+    ./csit/resources/tools/download_hc_build_pkgs.sh 'stable.'${STREAM}
+fi
 
 cd ${current_dir}
diff --git a/jjb/tldk/gtest-build.sh b/jjb/tldk/gtest-build.sh
new file mode 100755 (executable)
index 0000000..764e280
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/bash
+set -e -o pipefail
+echo $WORKSPACE
+git clone https://github.com/google/googletest.git $WORKSPACE/googletest
+cmake $WORKSPACE/googletest/CMakeLists.txt
+make -C $WORKSPACE/googletest
+echo GTEST_DIR=$WORKSPACE/googletest/googletest > gtest-env.prop
+echo GMOCK_DIR=$WORKSPACE/googletest/googlemock >> gtest-env.prop
+
+echo "*******************************************************************"
+echo "* GTEST BUILD SUCCESSFULLY COMPLETED"
+echo "*******************************************************************"
+
old mode 100644 (file)
new mode 100755 (executable)
index f4ba63b..a1b0a8e
@@ -28,8 +28,16 @@ fi
 echo "sha1sum of this script: ${0}"
 sha1sum $0
 
+# Make TLDK
 make
 
 echo "*******************************************************************"
 echo "* TLDK BUILD SUCCESSFULLY COMPLETED"
 echo "*******************************************************************"
+
+# Run unit tests application
+$WORKSPACE/x86_64-native-linuxapp-gcc/app/gtest-rfc --lcores=0 -n 2
+
+echo "*******************************************************************"
+echo "* TLDK UNIT TESTS SUCCESSFUL"
+echo "*******************************************************************"
index 1b96105..f235704 100644 (file)
             branch: '{branch}'
 
     builders:
+        - shell:
+            !include-raw-escape: gtest-build.sh
+        - inject:
+            properties-file: gtest-env.prop
         - shell:
             !include-raw-escape: include-raw-build.sh
 
                 notbuilt: true
 
     builders:
+        - shell:
+            !include-raw-escape: gtest-build.sh
+        - inject:
+            properties-file: gtest-env.prop
         - shell:
             !include-raw-escape: include-raw-build.sh
 
             branch: '{branch}'
 
     builders:
+        - shell:
+            !include-raw-escape: gtest-build.sh
+        - inject:
+            properties-file: gtest-env.prop
         - shell:
             !include-raw-escape: include-raw-build.sh
 
index 7354455..0d8a902 100644 (file)
@@ -121,7 +121,7 @@ ubuntu_systems() {
 
     # DEB Install VPP packages to shorten build times
     echo "---> Installing VPP DEB_DEPENDS packages $(date +'%Y%m%dT%H%M%S')"
-    VPP_PKGS="curl build-essential autoconf automake bison libssl-dev ccache debhelper dkms git libtool libganglia1-dev libapr1-dev dh-systemd libconfuse-dev git-review exuberant-ctags cscope indent"
+    VPP_PKGS="curl build-essential autoconf automake bison libssl-dev ccache debhelper dkms git libtool libganglia1-dev libapr1-dev dh-systemd libconfuse-dev git-review exuberant-ctags cscope indent pkg-config"
     apt install -y ${VPP_PKGS}
 
     # DEB Install latest kernel and uio
index e33821c..6fcc1b0 100644 (file)
@@ -49,7 +49,7 @@ rh_systems() {
     # separate group installs from package installs since a non-existing
     # group with dnf based systems (F21+) will fail the install if such
     # a group does not exist
-    yum install -y -q unzip xz puppet git perl-XML-XPath wget make
+    yum install -y -q unzip xz puppet git git-review perl-XML-XPath wget make
 
     # All of our systems require Java (because of Jenkins)
     # Install all versions of the OpenJDK devel but force 1.7.0 to be the
@@ -75,6 +75,10 @@ rh_systems() {
             alternatives --set java_sdk_openjdk /usr/lib/jvm/java-1.7.0-openjdk.x86_64
         ;;
     esac
+
+    # Needed to parse OpenStack commands used by infra
+    # stack commands to initialize Heat template based systems.
+    yum install -y jq
 }
 
 ubuntu_systems() {
@@ -105,7 +109,7 @@ EOF
 
     # add in stuff we know we need
     echo "---> Installing base packages"
-    apt-get install -qq unzip xz-utils puppet git libxml-xpath-perl make wget > /dev/null
+    apt-get install -qq unzip xz-utils puppet git git-review libxml-xpath-perl make wget > /dev/null
 
     # install Java 7
     echo "---> Configuring OpenJDK"
@@ -121,17 +125,14 @@ EOF
     update-alternatives --set java /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java
     update-alternatives --set javac /usr/lib/jvm/java-7-openjdk-amd64/bin/javac
 
+    # Needed to parse OpenStack commands used by infra
+    # stack commands to initialize Heat template based systems.
+    apt-get install -qq jq > /dev/null
+
     # disable unattended upgrades & daily updates
     echo '---> Disabling automatic daily upgrades'
-    apt-get remove unattended-upgrades
-    if [ -f /usr/bin/systemctl ]
-    then
-        systemctl stop apt.systemd.daily
-        systemctl disable apt.systemd.daily
-    else
-        /etc/init.d/unattended-upgrades stop
-        update-rc.d -f unattended-upgrades remove
-    fi
+    sed -ine 's/"1"/"0"/g' /etc/apt/apt.conf.d/10periodic
+    echo 'APT::Periodic::Unattended-Upgrade "0";' >> /etc/apt/apt.conf.d/10periodic
 }
 
 all_systems() {