From fea1ecd0af94bcb4b30c1d5c412ff69d014eb0c9 Mon Sep 17 00:00:00 2001 From: Tim Rozet Date: Fri, 27 Jul 2018 23:26:48 -0400 Subject: CPERF: Adds log collecting job Makes it so logs will always be collected even when CSIT itself fails. Change-Id: Ie854d92950edb515141343fd8b26216a010c55b4 Signed-off-by: Tim Rozet --- jjb/3rd_party_ci/odl-netvirt.yaml | 13 ++++++++++++- jjb/apex/apex-snapshot-deploy.sh | 1 + jjb/cperf/cperf-ci-jobs.yaml | 35 +++++++++++++++++++++++++++++++++++ jjb/cperf/cperf-upload-logs-csit.sh | 10 ++++++++++ 4 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 jjb/cperf/cperf-upload-logs-csit.sh (limited to 'jjb') diff --git a/jjb/3rd_party_ci/odl-netvirt.yaml b/jjb/3rd_party_ci/odl-netvirt.yaml index 98c85db19..bb7d21e11 100644 --- a/jjb/3rd_party_ci/odl-netvirt.yaml +++ b/jjb/3rd_party_ci/odl-netvirt.yaml @@ -150,7 +150,7 @@ abort-all-job: true - multijob: name: csit - condition: SUCCESSFUL + condition: ALWAYS projects: - name: cperf-apex-csit-master predefined-parameters: | @@ -163,6 +163,17 @@ node-parameters: true kill-phase-on: FAILURE abort-all-job: false + - multijob: + name: csit-collect-logs + condition: ALWAYS + projects: + - name: cperf-upload-logs-csit + predefined-parameters: | + ODL_BRANCH=$BRANCH + OS_VERSION=$OS_VERSION + node-parameters: true + kill-phase-on: FAILURE + abort-all-job: false - multijob: name: postprocess condition: ALWAYS diff --git a/jjb/apex/apex-snapshot-deploy.sh b/jjb/apex/apex-snapshot-deploy.sh index 6a8a140bd..1e47c8297 100644 --- a/jjb/apex/apex-snapshot-deploy.sh +++ b/jjb/apex/apex-snapshot-deploy.sh @@ -52,6 +52,7 @@ if [ -d "$SNAP_CACHE" ]; then latest_snap=$(ls ${SNAP_CACHE} | grep tar.gz | tail -n 1) if [ -n "$latest_snap" ]; then local_snap_checksum=$(sha512sum ${SNAP_CACHE}/${latest_snap} | cut -d' ' -f1) + echo "Local snap checksum is: ${local_snap_checksum}" fi else mkdir -p ${SNAP_CACHE} diff --git a/jjb/cperf/cperf-ci-jobs.yaml b/jjb/cperf/cperf-ci-jobs.yaml index 59afb89c8..c792a63d0 100644 --- a/jjb/cperf/cperf-ci-jobs.yaml +++ b/jjb/cperf/cperf-ci-jobs.yaml @@ -22,6 +22,7 @@ jobs: - 'cperf-{installer}-{testsuite}-{stream}' + - 'cperf-upload-logs-csit' ################################ # job template @@ -54,6 +55,35 @@ builders: - 'cperf-{testsuite}-builder' +- job-template: + name: 'cperf-upload-logs-csit' + + concurrent: true + + disabled: false + scm: + - git-scm-gerrit + parameters: + - project-parameter: + project: '{project}' + branch: '{branch}' + - cperf-parameter: + testsuite: 'csit' + gs-pathname: '{gs-pathname}' + docker-tag: '{docker-tag}' + stream: '{stream}' + + # yamllint enable rule:line-length + properties: + - logrotate-default + - throttle: + max-per-node: 1 + max-total: 10 + option: 'project' + + builders: + - 'cperf-upload-logs-csit' + ######################## # parameter macros ######################## @@ -188,3 +218,8 @@ docker rmi opnfv/cperf:$tag >/dev/null done fi + +- builder: + name: cperf-upload-logs-csit + builders: + - shell: !include-raw: ./cperf-upload-logs-csit.sh diff --git a/jjb/cperf/cperf-upload-logs-csit.sh b/jjb/cperf/cperf-upload-logs-csit.sh new file mode 100644 index 000000000..7bf91df8b --- /dev/null +++ b/jjb/cperf/cperf-upload-logs-csit.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +set -o errexit +set -o nounset +set -o pipefail + +LOGS_LOCATION=/tmp/robot_results +UPLOAD_LOCATION=artifacts.opnfv.org/cperf/cperf-apex-csit-${ODL_BRANCH}/${BUILD_NUMBER}/ +echo "Uploading robot logs to ${UPLOAD_LOCATION}" +gsutil -m cp -r -v ${LOGS_LOCATION} gs://${UPLOAD_LOCATION} > gsutil.latest_logs.log -- cgit 1.2.3-korg