CPS performance plots start at 0 48/21348/1 master
authordanielhanrahan <daniel.hanrahan@est.tech>
Thu, 30 May 2024 09:35:06 +0000 (10:35 +0100)
committerdanielhanrahan <daniel.hanrahan@est.tech>
Thu, 30 May 2024 09:35:06 +0000 (10:35 +0100)
Change the plot limits so that 0 is always included.

Issue-ID: CPS-2192
Change-Id: If16802e58925c078c972e0bb0020b3a16ddcee02
Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech>
jjb/metal3/job_docker_image_building.yml [deleted file]
jjb/metal3/projects.yml
jjb/onap/cps/cps-performance-test-jobs.yaml
jjb/onap/cps/k6-performance-tests-trigger.sh [new file with mode: 0755]
jjb/onap/cps/prepare-performance-tests-data.sh
jjb/onap/global-templates-onap-java.yaml

diff --git a/jjb/metal3/job_docker_image_building.yml b/jjb/metal3/job_docker_image_building.yml
deleted file mode 100644 (file)
index 2e5543d..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
----
-#
-# ============LICENSE_START=======================================================
-#  Copyright (C) 2019 Nordix Foundation.
-# ================================================================================
-# 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.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-
-# Description:
-# ============
-# This file contains job template definition for Docker image building.
-# This job can be triggered manually or through a Github pull request. It creates a
-# pipeline job. The pipeline scripts are maintained in Nordix/metal3-dev-tools repository.
-
-- job-template:
-    id: docker_image_building
-    name: '{job_prefix}_docker_image_building'
-    description: "Docker image builder job."
-    project-type: pipeline
-    defaults: global
-    disabled: False
-    concurrent: True
-    parameters:
-    - string:
-        name: ghprbActualCommit
-        default: 'main'
-        description: 'CI Repo branch for triggering manual build'
-
-    properties:
-    - build-discarder:
-        days-to-keep: 30
-        num-to-keep: 300
-        artifact-days-to-keep: -1
-        artifact-num-to-keep: -1
-
-    triggers:
-    - timed: "@midnight"
-
-    pipeline-scm:
-      scm:
-      - git:
-          url: "{ci_github_repo}"
-          credentials-id: "{ci_github_jenkins_credentials_id}"
-          branches:
-            - '{branch|main}'
-          name: 'origin'
-          refspec: '+refs/heads/*:refs/remotes/origin/*'
-          wipe-workspace: True
-          honor-refspec: True
-          shallow-clone: False
-      script-path: 'ci/jobs/{id}.pipeline'
-      lightweight-checkout: False
index eab6bdd257533c9352cc248bd7646588cdbed610..e3283b74b7a1cb00afd8ed4bfd238973f4af3766 100644 (file)
@@ -34,7 +34,6 @@
     ci_github_whitelist_org:
     - nordix-metal3
     jobs:
-    - docker_image_building
     - update_nordix_repos
     - periodic_fullstack_building
     - fullstack_building_test
         - main:
             capm3_release_branch: main
             bmo_release_branch: main
-            schedule: "H 1 * * TUE,THU,SAT"
+            schedule: "H 1 * * 2,4,6"
         - release-1-7:
             capm3_release_branch: release-1.7
             bmo_release_branch: release-0.6
-            schedule: "H 1 * * MON"
+            schedule: "H 1 * * 1"
         - release-1-6:
             capm3_release_branch: release-1.6
             bmo_release_branch: release-0.5
-            schedule: "H 1 * * WED"
+            schedule: "H 1 * * 3"
         - release-1-5:
             capm3_release_branch: release-1.5
             bmo_release_branch: release-0.4
-            schedule: "H 1 * * FRI"
+            schedule: "H 1 * * 5"
         exclude:
         - image_os: centos
     - capm3_periodic_e2e_k8s_upgrade_tests_prow:
             capm3_release_branch: main
             bmo_release_branch: main
             capm3_target_branch: main
-            schedule: "H 4 * * MON"
+            schedule: "H 4 * * 1"
         - 1-28-1-29:
             k8s_version_upgrade_from: v1.28.1
             k8s_version_upgrade_to: v1.29.0
             capm3_release_branch: main
             bmo_release_branch: main
             capm3_target_branch: main
-            schedule: "H 4 * * THU"
+            schedule: "H 4 * * 4"
         - 1-27-1-28:
             k8s_version_upgrade_from: v1.27.4
             k8s_version_upgrade_to: v1.28.1
             capm3_release_branch: main
             bmo_release_branch: main
             capm3_target_branch: main
-            schedule: "H 4 * * FRI"
+            schedule: "H 4 * * 5"
         - 1-29-1-30:
             k8s_version_upgrade_from: v1.29.0
             k8s_version_upgrade_to: v1.30.0
             capm3_release_branch: release-1.7
             bmo_release_branch: release-0.6
             capm3_target_branch: release-1-7
-            schedule: "H 4 * * TUE"
+            schedule: "H 4 * * 2"
         - 1-28-1-29:
             k8s_version_upgrade_from: v1.28.1
             k8s_version_upgrade_to: v1.29.0
             capm3_release_branch: release-1.6
             bmo_release_branch: release-0.5
             capm3_target_branch: release-1-6
-            schedule: "H 4 * * WED"
+            schedule: "H 4 * * 3"
         - 1-26-1-27:
             k8s_version_upgrade_from: v1.26.4
             k8s_version_upgrade_to: v1.27.4
             capm3_release_branch: release-1.5
             bmo_release_branch: release-0.4
             capm3_target_branch: release-1-5
-            schedule: "H 4 * * SAT"
+            schedule: "H 4 * * 6"
         exclude:
         - image_os: centos
     - capm3_periodic_e2e_ephemeral_tests:
index 06d76a707ff9f719de164b8b0b1f7c065efc57e8..6676742794896d7edc3947d8bb2d1e198bd04059 100644 (file)
 
     jobs:
         - 'onap-{project-name}-performance-tests-plots'
+
+- project:
+      name: cps-k6-tests
+      project: cps
+      project-name: cps
+      timer: "15 7 * * *"
+
+      jobs:
+          - 'onap-{project-name}-performance-test-k6'
diff --git a/jjb/onap/cps/k6-performance-tests-trigger.sh b/jjb/onap/cps/k6-performance-tests-trigger.sh
new file mode 100755 (executable)
index 0000000..edff9fe
--- /dev/null
@@ -0,0 +1,57 @@
+#!/bin/bash
+#
+# Copyright 2024 Nordix Foundation.
+#
+# 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 -o errexit  # Exit on most errors
+set -o nounset  # Disallow expansion of unset variables
+set -o pipefail # Use last non-zero exit code in a pipeline
+set -o xtrace   # Trace logging
+
+#############################################################################################################################
+################################################ M A I N ####################################################################
+#############################################################################################################################
+cd "$WORKSPACE"
+
+# Check if cps repository directory exists
+if [ -d "cps" ]; then
+  # If it exists, wipe the directory
+  echo "wiping the old cps repository..."
+  rm -rf cps
+fi
+
+# Check if build-logs exists
+if [ -d "build-logs" ]; then
+  # If it exists, wipe the directory
+  echo "wiping the old build-logs directory..."
+  rm -rf "build-logs"
+fi
+
+mkdir "build-logs"
+
+# Close the cps repository
+git clone https://gerrit.nordix.org/onap/cps
+cd cps
+
+# Build latest images
+mvn -B clean install -DskipTests -Dcheckstyle.skip
+
+working_directory=$(pwd)
+
+# Provide execute permission to runner script
+chmod 777 "$working_directory/k6-tests/run-k6-tests.sh"
+
+# Run all k6 tests and save the logs
+"$working_directory/k6-tests/run-k6-tests.sh" 2>&1 | tee "$WORKSPACE/build-logs/k6-build.log"
index 276ea4735f929581686309f75cf5c191748f3fd3..34bcfdc41231477170578162923ab2e9c52100d3 100755 (executable)
@@ -150,7 +150,7 @@ set terminal pngcairo size 1500,600
 set output "${chartFileName}"
 set xlabel "Build"
 set ylabel "Percentage of limit %"
-set yrange [0 < * < 80 : 120 < *]
+set yrange [0 : 120 < *]
 set xtics rotate
 plot '$dataFile' using (column(0)):2:xtic(sprintf("%d", column(1))) with linespoints title "measured", \
      100 with lines linestyle 2 title "100% limit"
index 63d1ba923f0dff5a751e7987629c69e878f686ca..78e89745639b3013e4d0e2d1ce922dbad82b29b2 100644 (file)
       - shell:
           !include-raw-escape: ./verify-policy-csit.sh
 
+# A job to plot the result of cps performance test
 - job-template:
     name: 'onap-{project-name}-performance-tests-plots'
     disabled_job_var: false
           dir: "."
           files: "cpsStableTestsPerformanceReview.html,ncmpStableTestsPerformanceReview.html,cpsUnstableTestsPerformanceReview.html,ncmpUnstableTestsPerformanceReview.html"
 
+# A job to trigger performance test which are based on K6 Framework on cps project
+- job-template:
+    name: 'onap-{project-name}-performance-test-k6'
+    disabled_job_var: false
+    node: xerces-cps-hw
+    wipe_workspace: false
+
+    triggers:
+      - timed: '{timer}'
+
+    builders:
+      - shell:
+          !include-raw-escape: ./cps/k6-performance-tests-trigger.sh
+
+# A job to perform performance test which are based on Spock-Groovy Framework on cps project
 - job-template:
     name: 'onap-{project-name}-{stream}-performance-test-java'
     disabled_job_var: false