Merge "Fix Yamllint violations in Docker Custom jobs"
authorFatih Degirmenci <fatih.degirmenci@ericsson.com>
Fri, 13 Oct 2017 06:57:01 +0000 (06:57 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Fri, 13 Oct 2017 06:57:01 +0000 (06:57 +0000)
20 files changed:
jjb/apex/apex.yml
jjb/apex/apex.yml.j2
jjb/armband/armband-ci-jobs.yml
jjb/bottlenecks/bottlenecks-run-suite.sh
jjb/ci_gate_security/anteater-report-to-gerrit.sh
jjb/daisy4nfv/daisy4nfv-build.sh
jjb/daisy4nfv/daisy4nfv-upload-artifact.sh
jjb/kvmfornfv/kvmfornfv.yml
jjb/octopus/octopus.yml
jjb/releng/automate.yml
jjb/releng/htmlize/doc-build.sh [moved from utils/test/testapi/htmlize/doc-build.sh with 100% similarity]
jjb/releng/htmlize/htmlize.py [moved from utils/test/testapi/htmlize/htmlize.py with 100% similarity]
jjb/releng/htmlize/push-doc-artifact.sh [moved from utils/test/testapi/htmlize/push-doc-artifact.sh with 100% similarity]
jjb/releng/opnfv-docs.yml
jjb/releng/opnfv-lint.yml
jjb/storperf/storperf-daily-jobs.yml
utils/jenkins-jnlp-connect.sh
utils/test/reporting/reporting/utils/reporting_utils.py
utils/test/reporting/reporting/yardstick/reporting-status.py
utils/test/reporting/reporting/yardstick/template/index-status-tmpl.html

index 2e11592..4ec6efb 100644 (file)
             - 'apex-run.*'
 
     triggers:
-      - timed: '' #'0 1 * * *'
+      - timed: ''  # '0 1 * * *'
 
     builders:
       - description-setter:
index d49b6ea..3141549 100644 (file)
             - 'apex-run.*'
 
     triggers:
-      - timed: '' #'0 1 * * *'
+      - timed: ''  # '0 1 * * *'
 
     builders:
       - description-setter:
index f8ed352..1aa9df6 100644 (file)
@@ -36,6 +36,7 @@
     #        euphrates
     # -------------------------------
     pod:
+      # yamllint disable rule:key-duplicates
       - armband-baremetal:
           <<: *baremetal
           <<: *euphrates
@@ -51,6 +52,7 @@
       - armband-virtual:
           <<: *virtual
           <<: *master
+    # yamllint enable rule:key-duplicates
     # -------------------------------
     #       scenarios
     # -------------------------------
index f0b8a40..c349062 100644 (file)
@@ -72,7 +72,7 @@ if [[ $SUITE_NAME == *posca* ]]; then
 
     set +e
 
-    sudo pip install virtualenv
+    sudo -H pip install virtualenv
 
     cd ${RELENG_REPO}/modules
     sudo virtualenv venv
index de1fdd7..6710862 100644 (file)
@@ -15,11 +15,14 @@ if [[ -e securityaudit.log ]] ; then
 
     grep 'ERROR' securityaudit.log | awk -F"ERROR - " '{ print $2 }' | tr -d "\'\"" > shortlog
 
-    ssh -p 29418 gerrit.opnfv.org \
-        "gerrit review -p $GERRIT_PROJECT \
-        -m \"$(cat shortlog)\" \
-        $GERRIT_PATCHSET_REVISION \
-        --notify NONE"
+    # Only report to Gerrit when there are errors to report.
+    if [[ -s shortlog ]]; then
+        ssh -p 29418 gerrit.opnfv.org \
+            "gerrit review -p $GERRIT_PROJECT \
+            -m \"$(cat shortlog)\" \
+            $GERRIT_PATCHSET_REVISION \
+            --notify NONE"
+    fi
 
     exit $EXITSTATUS
 fi
index 925f68e..a081b3b 100755 (executable)
@@ -31,6 +31,8 @@ cd $WORKSPACE
     echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
     echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.bin"
     echo "OPNFV_ARTIFACT_SHA512SUM=$(sha512sum $OUTPUT_DIR/opnfv-$OPNFV_ARTIFACT_VERSION.bin | cut -d' ' -f1)"
+    echo "OPNFV_ARTIFACT_URL_ISO=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
+    echo "OPNFV_ARTIFACT_SHA512SUM_ISO=$(sha512sum $OUTPUT_DIR/opnfv-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
     echo "OPNFV_BUILD_URL=$BUILD_URL"
 ) > $WORKSPACE/opnfv.properties
 
index 6b0aec5..def4f6a 100755 (executable)
@@ -50,13 +50,15 @@ cd $WORKSPACE
 # upload artifact and additional files to google storage
 gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.bin \
     gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.bin > gsutil.bin.log 2>&1
+gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso \
+    gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso >> gsutil.bin.log 2>&1
 gsutil cp $WORKSPACE/opnfv.properties \
     gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
 if [[ ! "$JOB_NAME" =~ (verify|merge) ]]; then
     gsutil cp $WORKSPACE/opnfv.properties \
     gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
 elif [[ "$JOB_NAME" =~ "merge" ]]; then
-    echo "Uploaded Daisy4nfv BIN for a merged change"
+    echo "Uploaded Daisy4nfv artifacts for a merged change"
 fi
 
 gsutil -m setmeta \
index 2e542ac..ad497e9 100644 (file)
@@ -12,7 +12,7 @@
       - euphrates:
           branch: 'stable/{stream}'
           gs-pathname: '/{stream}'
-          disabled: false
+          disabled: true
     #####################################
     # patch verification phases
     #####################################
index f51db1b..fb6263d 100644 (file)
@@ -1,3 +1,4 @@
+---
 ################################
 # job configuration for Octopus
 ################################
@@ -7,17 +8,17 @@
     project: '{name}'
 
     jobs:
-        - 'octopus-verify-{stream}'
+      - 'octopus-verify-{stream}'
 
     stream:
-        - master:
-            branch: '{stream}'
-            gs-pathname: ''
-            disabled: false
-        - euphrates:
-            branch: 'stable/{stream}'
-            gs-pathname: '/{stream}'
-            disabled: false
+      - master:
+          branch: '{stream}'
+          gs-pathname: ''
+          disabled: false
+      - euphrates:
+          branch: 'stable/{stream}'
+          gs-pathname: '/{stream}'
+          disabled: false
 
 - job-template:
     name: 'octopus-verify-{stream}'
     disabled: '{obj:disabled}'
 
     parameters:
-        - project-parameter:
-            project: '{project}'
-            branch: '{branch}'
-        - 'opnfv-build-ubuntu-defaults'
+      - project-parameter:
+          project: '{project}'
+          branch: '{branch}'
+      - 'opnfv-build-ubuntu-defaults'
 
     scm:
-        - git-scm-gerrit
+      - git-scm-gerrit
 
     triggers:
-        - gerrit:
-            server-name: 'gerrit.opnfv.org'
-            trigger-on:
-                - patchset-created-event:
-                    exclude-drafts: 'false'
-                    exclude-trivial-rebase: 'false'
-                    exclude-no-code-change: 'false'
-                - draft-published-event
-                - comment-added-contains-event:
-                    comment-contains-value: 'recheck'
-                - comment-added-contains-event:
-                    comment-contains-value: 'reverify'
-            projects:
-              - project-compare-type: 'ANT'
-                project-pattern: '{project}'
-                branches:
-                  - branch-compare-type: 'ANT'
-                    branch-pattern: '**/{branch}'
-                disable-strict-forbidden-file-verification: 'true'
-                forbidden-file-paths:
-                  - compare-type: ANT
-                    pattern: 'docs/**|.gitignore'
+      - gerrit:
+          server-name: 'gerrit.opnfv.org'
+          trigger-on:
+            - patchset-created-event:
+                exclude-drafts: 'false'
+                exclude-trivial-rebase: 'false'
+                exclude-no-code-change: 'false'
+            - draft-published-event
+            - comment-added-contains-event:
+                comment-contains-value: 'recheck'
+            - comment-added-contains-event:
+                comment-contains-value: 'reverify'
+          projects:
+            - project-compare-type: 'ANT'
+              project-pattern: '{project}'
+              branches:
+                - branch-compare-type: 'ANT'
+                  branch-pattern: '**/{branch}'
+              disable-strict-forbidden-file-verification: 'true'
+              forbidden-file-paths:
+                - compare-type: ANT
+                  pattern: 'docs/**|.gitignore'
 
     builders:
-        - shell: |
-            echo "Nothing to verify!"
+      - shell: |
+          echo "Nothing to verify!"
index c7e34b2..de7fcd6 100644 (file)
     name: 'testapi-doc-build'
     builders:
       - shell: |
-          bash ./utils/test/testapi/htmlize/doc-build.sh
+          bash ./jjb/releng/htmlize/doc-build.sh
 
 - builder:
     name: 'upload-doc-artifact'
     builders:
       - shell: |
-          bash ./utils/test/testapi/htmlize/push-doc-artifact.sh
+          bash ./jjb/releng/htmlize/push-doc-artifact.sh
 
 - builder:
     name: 'reporting-automate-generate-doc-macro'
index afe8523..7402745 100644 (file)
           doc-version: ''
           gs-pathname: ''
           disabled: false
-      - danube:
+      - euphrates:
           branch: 'stable/{stream}'
-          doc-version: '3.0'
+          doc-version: '5.0.0'
           gs-pathname: '/{stream}/{doc-version}'
-          disabled: true
+          disabled: false
 
 ########################
 # job templates
index b51779f..93a1b7d 100644 (file)
                 comment-contains-value: 'reverify'
           projects:
             - project-compare-type: 'REG_EXP'
-              project-pattern: 'octopus|releng-anteater|pharos'
+              project-pattern: 'armband|fuel|octopus|pharos|releng-anteater'
               branches:
                 - branch-compare-type: 'ANT'
                   branch-pattern: '**/{branch}'
index ebc7823..3c9e527 100644 (file)
       - build-name:
           name: '$BUILD_NUMBER Scenario: $DEPLOY_SCENARIO'
       - timeout:
-          timeout: '30'
+          timeout: '45'
           abort: true
+      - fix-workspace-permissions
 
     parameters:
       - project-parameter:
index 13cb025..cd81f29 100755 (executable)
@@ -52,7 +52,7 @@ main () {
     fi
 
     if [[ $(whoami) != "root" ]]; then
-      if sudo -l | grep "requiretty  | grep -v "\!requiretty"; then
+      if sudo -l | grep "requiretty"  | grep -v "\!requiretty"; then
         echo "please comment out Defaults requiretty from /etc/sudoers"
         exit 1
       fi
index 235bd6e..6c0d5a2 100644 (file)
@@ -205,25 +205,34 @@ def getScenarioStatus(installer, version):
     except URLError:
         print "GetScenarioStatus: error when calling the API"
 
-    scenario_results = {}
-    result_dict = {}
+    x86 = 'x86'
+    aarch64 = 'aarch64'
+    scenario_results = {x86: {}, aarch64: {}}
+    result_dict = {x86: {}, aarch64: {}}
     if test_results is not None:
         for test_r in test_results:
             if (test_r['stop_date'] != 'None' and
                     test_r['criteria'] is not None):
-                if not test_r['scenario'] in scenario_results.keys():
-                    scenario_results[test_r['scenario']] = []
-                scenario_results[test_r['scenario']].append(test_r)
-
-        for scen_k, scen_v in scenario_results.items():
-            # scenario_results[k] = v[:LASTEST_TESTS]
-            s_list = []
-            for element in scen_v:
-                if element['criteria'] == 'SUCCESS':
-                    s_list.append(1)
+                scenario_name = test_r['scenario']
+                if 'arm' in test_r['pod_name']:
+                    if not test_r['scenario'] in scenario_results[aarch64]:
+                        scenario_results[aarch64][scenario_name] = []
+                    scenario_results[aarch64][scenario_name].append(test_r)
                 else:
-                    s_list.append(0)
-            result_dict[scen_k] = s_list
+                    if not test_r['scenario'] in scenario_results[x86]:
+                        scenario_results[x86][scenario_name] = []
+                    scenario_results[x86][scenario_name].append(test_r)
+
+        for key in scenario_results:
+            for scen_k, scen_v in scenario_results[key].items():
+                # scenario_results[k] = v[:LASTEST_TESTS]
+                s_list = []
+                for element in scen_v:
+                    if element['criteria'] == 'SUCCESS':
+                        s_list.append(1)
+                    else:
+                        s_list.append(0)
+                result_dict[key][scen_k] = s_list
 
     # return scenario_results
     return result_dict
index 6584f4e..10cacf0 100644 (file)
@@ -11,109 +11,159 @@ import os
 
 import jinja2
 
-import reporting.utils.scenarioResult as sr
-import reporting.utils.reporting_utils as rp_utils
-from scenarios import config as cf
+from reporting.utils.scenarioResult import ScenarioResult
+from reporting.utils import reporting_utils as utils
+from scenarios import config as blacklist
 
-installers = rp_utils.get_config('general.installers')
-versions = rp_utils.get_config('general.versions')
-PERIOD = rp_utils.get_config('general.period')
 
 # Logger
-logger = rp_utils.getLogger("Yardstick-Status")
-reportingDate = datetime.datetime.now().strftime("%Y-%m-%d %H:%M")
-
-logger.info("*******************************************")
-logger.info("*   Generating reporting scenario status  *")
-logger.info("*   Data retention = %s days              *" % PERIOD)
-logger.info("*                                         *")
-logger.info("*******************************************")
-
-
-# For all the versions
-for version in versions:
-    # For all the installers
-    for installer in installers:
-        # get scenarios results data
-        scenario_results = rp_utils.getScenarioStatus(installer, version)
-        if 'colorado' == version:
-            stable_result = rp_utils.getScenarioStatus(installer,
-                                                       'stable/colorado')
-            for k, v in stable_result.items():
-                if k not in scenario_results.keys():
-                    scenario_results[k] = []
-                scenario_results[k] += stable_result[k]
-        scenario_result_criteria = {}
-
-        for s in scenario_results.keys():
-            if installer in cf.keys() and s in cf[installer].keys():
-                scenario_results.pop(s)
-
-        # From each scenarios get results list
-        for s, s_result in scenario_results.items():
-            logger.info("---------------------------------")
-            logger.info("installer %s, version %s, scenario %s", installer,
-                        version, s)
-
-            ten_criteria = len(s_result)
-            ten_score = 0
-            for v in s_result:
-                ten_score += v
-
-            LASTEST_TESTS = rp_utils.get_config(
-                'general.nb_iteration_tests_success_criteria')
-            four_result = s_result[:LASTEST_TESTS]
-            four_criteria = len(four_result)
-            four_score = 0
-            for v in four_result:
-                four_score += v
-
-            s_status = str(rp_utils.get_percent(four_result, s_result))
-            s_four_score = str(four_score) + '/' + str(four_criteria)
-            s_ten_score = str(ten_score) + '/' + str(ten_criteria)
-            s_score_percent = rp_utils.get_percent(four_result, s_result)
-
-            if '100' == s_status:
-                logger.info(">>>>> scenario OK, save the information")
-            else:
-                logger.info(">>>> scenario not OK, last 4 iterations = %s, \
-                            last 10 days = %s" % (s_four_score, s_ten_score))
-
-            # Save daily results in a file
-            path_validation_file = ("./display/" + version +
-                                    "/yardstick/scenario_history.txt")
-
-            if not os.path.exists(path_validation_file):
-                with open(path_validation_file, 'w') as f:
-                    info = 'date,scenario,installer,details,score\n'
-                    f.write(info)
-
-            with open(path_validation_file, "a") as f:
-                info = (reportingDate + "," + s + "," + installer +
-                        "," + s_ten_score + "," +
-                        str(s_score_percent) + "\n")
-                f.write(info)
-
-            scenario_result_criteria[s] = sr.ScenarioResult(s_status,
-                                                            s_four_score,
-                                                            s_ten_score,
-                                                            s_score_percent)
-
-            logger.info("--------------------------")
-
-        templateLoader = jinja2.FileSystemLoader(".")
-        templateEnv = jinja2.Environment(loader=templateLoader,
-                                         autoescape=True)
-
-        TEMPLATE_FILE = "./reporting/yardstick/template/index-status-tmpl.html"
-        template = templateEnv.get_template(TEMPLATE_FILE)
-
-        outputText = template.render(scenario_results=scenario_result_criteria,
-                                     installer=installer,
-                                     period=PERIOD,
-                                     version=version,
-                                     date=reportingDate)
-
-        with open("./display/" + version +
-                  "/yardstick/status-" + installer + ".html", "wb") as fh:
-            fh.write(outputText)
+LOG = utils.getLogger("Yardstick-Status")
+
+
+def get_scenario_data(version, installer):
+    scenarios = utils.getScenarioStatus(installer, version)
+
+    if 'colorado' == version:
+        data = utils.getScenarioStatus(installer, 'stable/colorado')
+        for archi, value in data.items():
+            for k, v in value.items():
+                if k not in scenarios[archi]:
+                    scenarios[archi][k] = []
+                scenarios[archi][k].extend(data[archi][k])
+
+    for archi, value in scenarios.items():
+        for scenario in value:
+            if installer in blacklist and scenario in blacklist[installer]:
+                scenarios[archi].pop(scenario)
+
+    return scenarios
+
+
+def write_history_data(version,
+                       scenario,
+                       installer,
+                       archi,
+                       ten_score,
+                       percent):
+    # Save daily results in a file
+    history_file = './display/{}/yardstick/scenario_history.txt'.format(
+        version)
+
+    if not os.path.exists(history_file):
+        with open(history_file, 'w') as f:
+            f.write('date,scenario,installer,details,score\n')
+
+    date = datetime.datetime.now().strftime("%Y-%m-%d %H:%M")
+    if installer == 'fuel':
+        installer = '{}@{}'.format(installer, archi)
+    with open(history_file, "a") as f:
+        info = '{},{},{},{},{}\n'.format(date,
+                                         scenario,
+                                         installer,
+                                         ten_score,
+                                         percent)
+        f.write(info)
+
+
+def generate_page(scenario_data, installer, period, version, architecture):
+    date = datetime.datetime.now().strftime("%Y-%m-%d %H:%M")
+
+    templateLoader = jinja2.FileSystemLoader(".")
+    template_env = jinja2.Environment(loader=templateLoader,
+                                      autoescape=True)
+
+    template_file = "./reporting/yardstick/template/index-status-tmpl.html"
+    template = template_env.get_template(template_file)
+
+    if installer == 'fuel':
+        installer = '{}@{}'.format(installer, architecture)
+
+    output_text = template.render(scenario_results=scenario_data,
+                                  installer=installer,
+                                  period=period,
+                                  version=version,
+                                  date=date)
+
+    page_file = './display/{}/yardstick/status-{}.html'.format(version,
+                                                               installer)
+    with open(page_file, 'wb') as f:
+        f.write(output_text)
+
+
+def do_statistic(data):
+    ten_score = 0
+    for v in data:
+        ten_score += v
+
+    last_count = utils.get_config(
+        'general.nb_iteration_tests_success_criteria')
+    last_data = data[:last_count]
+    last_score = 0
+    for v in last_data:
+        last_score += v
+
+    percent = utils.get_percent(last_data, data)
+    status = str(percent)
+    last_score = '{}/{}'.format(last_score, len(last_data))
+    ten_score = '{}/{}'.format(ten_score, len(data))
+
+    if '100' == status:
+        LOG.info(">>>>> scenario OK, save the information")
+    else:
+        LOG.info(">>>> scenario not OK, last 4 iterations = %s, \
+                    last 10 days = %s" % (last_score, ten_score))
+
+    return last_score, ten_score, percent, status
+
+
+def generate_reporting_page(version, installer, archi, scenarios, period):
+    scenario_data = {}
+
+    # From each scenarios get results list
+    for scenario, data in scenarios.items():
+        LOG.info("---------------------------------")
+
+        LOG.info("installer %s, version %s, scenario %s",
+                 installer,
+                 version,
+                 scenario)
+        last_score, ten_score, percent, status = do_statistic(data)
+        write_history_data(version,
+                           scenario,
+                           installer,
+                           archi,
+                           ten_score,
+                           percent)
+        scenario_data[scenario] = ScenarioResult(status,
+                                                 last_score,
+                                                 ten_score,
+                                                 percent)
+
+        LOG.info("--------------------------")
+    if scenario_data:
+        generate_page(scenario_data, installer, period, version, archi)
+
+
+def main():
+    installers = utils.get_config('general.installers')
+    versions = utils.get_config('general.versions')
+    period = utils.get_config('general.period')
+
+    LOG.info("*******************************************")
+    LOG.info("*   Generating reporting scenario status  *")
+    LOG.info("*   Data retention = %s days              *" % period)
+    LOG.info("*                                         *")
+    LOG.info("*******************************************")
+
+    # For all the versions
+    for version in versions:
+        # For all the installers
+        for installer in installers:
+            # get scenarios results data
+            scenarios = get_scenario_data(version, installer)
+            for k, v in scenarios.items():
+                generate_reporting_page(version, installer, k, v, period)
+
+
+if __name__ == '__main__':
+    main()
index f9b8524..3db32e5 100644 (file)
@@ -70,7 +70,8 @@
             <li class="active"><a href="http://testresults.opnfv.org/reporting/index.html">Home</a></li>
             <li><a href="status-apex.html">Apex</a></li>
             <li><a href="status-compass.html">Compass</a></li>
-            <li><a href="status-fuel.html">Fuel</a></li>
+            <li><a href="status-fuel@x86.html">Fuel@x86</a></li>
+            <li><a href="status-fuel@aarch64.html">Fuel@aarch64</a></li>
             <li><a href="status-joid.html">Joid</a></li>
           </ul>
         </nav>