Lava: More clearly split baremetal and kvm tests
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Thu, 1 Dec 2016 17:25:04 +0000 (12:25 -0500)
committerFrancis Deslauriers <francis.deslauriers@efficios.com>
Sat, 10 Dec 2016 23:56:42 +0000 (18:56 -0500)
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
jobs/lttng-baremetal-tests.yaml
scripts/lttng-baremetal-tests/lava-submit.py
scripts/lttng-baremetal-tests/run-baremetal-benchmarks.sh [new file with mode: 0644]
scripts/lttng-baremetal-tests/run-baremetal-tests.sh [new file with mode: 0644]
scripts/lttng-baremetal-tests/run-benchmarks.sh [deleted file]
scripts/lttng-baremetal-tests/run-kvm-tests.sh [new file with mode: 0644]
scripts/lttng-baremetal-tests/run-tests.sh [deleted file]

index 14972be15f1dca4ab4dd8626ce5c7b9e321470d0..8583cdc9238939fa4fc5bcb2e9ec8bdf2e89ae8d 100644 (file)
@@ -1,22 +1,20 @@
 - defaults:
-    name: baremetal_tests
+    name: baremetal_benchmarks
     description: |
       Runs baremetal kernel tests over different combination of kernel and lttng configurations.
-    logrotate:
-      numToKeep: 5
 
     triggers:
       - pollscm:
           cron: "@hourly"
+    logrotate:
+      numToKeep: 10
 
-    project-type: freestyle
-    node: 'master'
     properties:
       - throttle:
           max-total: 2
           option: 'category'
           categories:
-            - 'kvm-tests'
+            - 'baremetal-tests'
     project-type: freestyle
     node: 'master'
     wrappers:
@@ -31,7 +29,7 @@
           properties-content: |
             TOOLS_BRANCH={lttngversion}
             UST_BRANCH={lttngversion}
-            BUILD_DEVICE=kvm
+            BUILD_DEVICE=baremetal
     publishers:
       - email:
           recipients: 'francis.deslauriers@efficios.com'
           block: true
       - inject:
           properties-file: properties.txt
-      - shell: !include-raw-escape: scripts/lttng-baremetal-tests/run-tests.sh
+      - shell: !include-raw-escape: scripts/lttng-baremetal-tests/run-baremetal-benchmarks.sh
+
 
 - defaults:
-    name: baremetal_benchmarks
-    defaults: lttng-baremetal-tests
+    name: kvm_tests
     description: |
-      Runs baremetal kernel benchmarks over different combination of kernel and lttng configurations.
-
-    logrotate:
-      numToKeep: 5
-
+      Runs baremetal kernel tests over different combination of kernel and lttng configurations.
+    project-type: freestyle
+    node: 'master'
+    properties:
+      - throttle:
+          max-total: 2
+          option: 'category'
+          categories:
+            - 'kvm-tests'
     triggers:
       - pollscm:
           cron: "@hourly"
+    logrotate:
+      numToKeep: 10
 
-    project-type: freestyle
-    node: 'master'
+    wrappers:
+      - workspace-cleanup
+      - timestamps
+      - ansicolor
+      - credentials-binding:
+          - text:
+              credential-id: jenkins_lava_key
+              variable: LAVA_FRDESO_TOKEN
+      - inject:
+          properties-content: |
+            BUILD_DEVICE=kvm
+            TOOLS_BRANCH={lttngversion}
+            UST_BRANCH={lttngversion}
+    scm:
+      - git:
+          url: git://git-mirror.internal.efficios.com/lttng/lttng-tools.git
+          branches:
+            - "{lttngversion}"
+          shallow-clone: true
+          skip-tag: true
+          fastpoll: true
+          basedir: src/lttng-tools
+      - git:
+          url: git://git-mirror.internal.efficios.com/lttng/lttng-modules.git
+          branches:
+            - "{lttngversion}"
+          shallow-clone: true
+          skip-tag: true
+          fastpoll: true
+          basedir: src/lttng-modules
+      - git:
+          url: git://git-mirror.internal.efficios.com/kernel/stable/linux-stable.git
+          branches:
+            - "{kversion}"
+          shallow-clone: true
+          skip-tag: true
+          fastpoll: true
+          basedir: src/linux
 
-## Templates
-- job-template:
-    name: baremetal_tests_k{kversion}_l{lttngversion}
+    publishers:
+      - email:
+          recipients: 'francis.deslauriers@efficios.com'
+    builders:
+      - shell: !include-raw-escape: scripts/lttng-baremetal-tests/generate-properties-master.sh
+      - trigger-builds:
+        - project: "build_kernel_PARAM"
+          property-file: 'properties.txt'
+          block: true
+      - inject:
+          properties-file: properties.txt
+      - shell: !include-raw-escape: scripts/lttng-baremetal-tests/run-kvm-tests.sh
+
+- defaults:
+    name: baremetal_tests
     description: |
       Runs baremetal kernel tests over different combination of kernel and lttng configurations.
+    project-type: freestyle
+    node: 'master'
     properties:
       - throttle:
           max-total: 2
           option: 'category'
           categories:
             - 'baremetal-tests'
+    triggers:
+      - pollscm:
+          cron: "@hourly"
+    logrotate:
+      numToKeep: 10
+
     wrappers:
       - workspace-cleanup
       - timestamps
               variable: LAVA_FRDESO_TOKEN
       - inject:
           properties-content: |
+            UST_BRANCH={lttngversion}
             BUILD_DEVICE=baremetal
     scm:
       - git:
           block: true
       - inject:
           properties-file: properties.txt
-      - shell: !include-raw-escape: scripts/lttng-baremetal-tests/run-benchmarks.sh
+      - shell: !include-raw-escape: scripts/lttng-baremetal-tests/run-baremetal-tests.sh
 
 - job-template:
     name: baremetal_benchmarks_k{kversion}_l{lttngversion}
-    description: |
-      Runs baremetal kernel benchmarks over different combination of kernel and lttng configurations.
-    defaults: lttng-baremetal-tests
-    logrotate:
-      numToKeep: 5
+    defaults: baremetal_benchmarks
+- job-template:
+    name: kvm_tests_k{kversion}_l{lttngversion}
+    defaults: kvm_tests
+- job-template:
+    name: baremetal_tests_k{kversion}_l{lttngversion}
+    defaults: baremetal_tests
 
 - job-template:
     name: baremetal_tests_k{kversion}_l{lttngversion}_canary
     defaults: baremetal_tests
+- job-template:
+    name: kvm_tests_k{kversion}_l{lttngversion}_canary
+    defaults: kvm_tests
 - job-template:
     name: baremetal_benchmarks_k{kversion}_l{lttngversion}_canary
     defaults: baremetal_benchmarks
+
 - job-template:
-    name: baremetal_tests_k{kversion}_l{lttngversion}
-    defaults: baremetal_tests
-- job-template:
-    name: baremetal_benchmarks_k{kversion}_l{lttngversion}
-    defaults: baremetal_benchmarks
+    name: kvm_tests_kmainline_l{lttngversion}
+    defaults: kvm_tests
+    triggers:
+      - pollscm:
+          cron: "@daily"
+    scm:
+      - git:
+          url: git://git-mirror.internal.efficios.com/lttng/lttng-tools.git
+          branches:
+            - "{lttngversion}"
+          shallow-clone: true
+          skip-tag: true
+          fastpoll: true
+          basedir: src/lttng-tools
+      - git:
+          url: git://git-mirror.internal.efficios.com/lttng/lttng-modules.git
+          branches:
+            - "{lttngversion}"
+          shallow-clone: true
+          skip-tag: true
+          fastpoll: true
+          basedir: src/lttng-modules
+      - git:
+          url: git://git-mirror.internal.efficios.com/kernel/stable/linux-stable.git
+          refspec: "+refs/tags/*:refs/remotes/origin/tags/*"
+          branches:
+            - "master"
+          fastpoll: true
+          basedir: src/linux
+
 - job-template:
     name: baremetal_tests_kmainline_l{lttngversion}
     defaults: baremetal_tests
             - "master"
           fastpoll: true
           basedir: src/linux
-
+    wrappers:
+      - workspace-cleanup
+      - timestamps
+      - ansicolor
+      - credentials-binding:
+          - text:
+              credential-id: jenkins_lava_key
+              variable: LAVA_FRDESO_TOKEN
+      - inject:
+          properties-content: |
+            BUILD_DEVICE=baremetal
+    builders:
+      - shell: !include-raw-escape: scripts/lttng-baremetal-tests/generate-properties-master.sh
+      - trigger-builds:
+        - project: "build_kernel_PARAM"
+          property-file: 'properties.txt'
+          block: true
+      - inject:
+          properties-file: properties.txt
+      - shell: !include-raw-escape: scripts/lttng-baremetal-tests/run-baremetal-benchmarks.sh
 - job-template:
     name: baremetal_benchmarks_kmainline_l{lttngversion}
     defaults: baremetal_benchmarks
           block: true
       - inject:
           properties-file: properties.txt
-      - shell: !include-raw-escape: scripts/lttng-baremetal-tests/run-benchmarks.sh
+      - shell: !include-raw-escape: scripts/lttng-baremetal-tests/run-baremetal-benchmarks.sh
 
 - job:
     name: build_kernel_PARAM
     concurrent: true
 
     logrotate:
-      numToKeep: 2
+      numToKeep: 20
     node: 'x86-64'
 
     wrappers:
       - stable-2.8
       - stable-2.9
     jobs:
-      - 'baremetal_tests_k{kversion}_l{lttngversion}'
+      - 'kvm_tests_k{kversion}_l{lttngversion}'
       - 'baremetal_benchmarks_k{kversion}_l{lttngversion}'
+      - 'baremetal_tests_k{kversion}_l{lttngversion}'
 
 - project:
     name: lttng-kernel-tests-oldkernel
     lttngversion:
       - stable-2.7
     jobs:
+      - 'kvm_tests_k{kversion}_l{lttngversion}':
       - 'baremetal_tests_k{kversion}_l{lttngversion}':
       - 'baremetal_benchmarks_k{kversion}_l{lttngversion}':
 
     lttngversion:
       - v2.8.1
     jobs:
+      - 'kvm_tests_k{kversion}_l{lttngversion}_canary'
       - 'baremetal_tests_k{kversion}_l{lttngversion}_canary'
       - 'baremetal_benchmarks_k{kversion}_l{lttngversion}_canary'
 
     lttngversion:
       - v2.8.1
     jobs:
+      - 'kvm_tests_kmainline_l{lttngversion}'
       - 'baremetal_tests_kmainline_l{lttngversion}'
       - 'baremetal_benchmarks_kmainline_l{lttngversion}'
index 5b71da87484947d0a4dd8dfbd363bfa1d2cd5ec4..b4407330cac9581f3718e970d95e93eea5b379b2 100644 (file)
@@ -29,8 +29,9 @@ HOSTNAME = 'lava-master.internal.efficios.com'
 SCP_PATH = 'scp://jenkins-lava@storage.internal.efficios.com'
 
 class TestType(Enum):
-    benchmarks=1
-    tests=2
+    baremetal_benchmarks=1
+    baremetal_tests=2
+    kvm_tests=3
 
 def get_job_bundle_content(server, job):
     bundle_sha = server.scheduler.job_status(str(job))['bundle_sha1']
@@ -121,7 +122,7 @@ def get_boot_cmd():
 def get_config_cmd(build_device):
     packages=['bsdtar', 'psmisc', 'wget', 'python3', 'python3-pip', \
             'libglib2.0-dev', 'libffi-dev', 'elfutils', 'libdw-dev', \
-            'libelf-dev', 'libmount-dev', 'libxml2']
+            'libelf-dev', 'libmount-dev', 'libxml2', 'libpfm4-dev']
     command = OrderedDict({
         'command': 'lava_command_run',
         'parameters': {
@@ -146,7 +147,7 @@ def get_config_cmd(build_device):
                 ])
     return command
 
-def get_benchmarks_cmd():
+def get_baremetal_benchmarks_cmd():
     command = OrderedDict({
         'command': 'lava_test_shell',
         'parameters': {
@@ -165,7 +166,18 @@ def get_benchmarks_cmd():
                     'git-repo': 'https://github.com/lttng/lttng-ci.git',
                     'revision': 'master',
                     'testdef': 'lava/baremetal-tests/failing-open-enoent.yml'
-                },
+                }
+                ],
+            'timeout': 18000
+            }
+        })
+    return command
+
+def get_baremetal_tests_cmd():
+    command = OrderedDict({
+        'command': 'lava_test_shell',
+        'parameters': {
+            'testdef_repos': [
                 {
                     'git-repo': 'https://github.com/lttng/lttng-ci.git',
                     'revision': 'master',
@@ -177,7 +189,7 @@ def get_benchmarks_cmd():
         })
     return command
 
-def get_tests_cmd():
+def get_kvm_tests_cmd():
     command = OrderedDict({
         'command': 'lava_test_shell',
         'parameters': {
@@ -298,35 +310,48 @@ def main():
     parser.add_argument('-uc', '--ust-commit', required=False)
     args = parser.parse_args()
 
-    if args.type in 'benchmarks':
-        test_type = TestType.benchmarks
-    elif args.type in 'tests':
-        test_type = TestType.tests
+    if args.type in 'baremetal-benchmarks':
+        test_type = TestType.baremetal_benchmarks
+    elif args.type in 'baremetal-tests':
+        test_type = TestType.baremetal_tests
+    elif args.type in 'kvm-tests':
+        test_type = TestType.kvm_tests
     else:
         print('argument -t/--type {} unrecognized. Exiting...'.format(args.type))
         return -1
 
-    if test_type is TestType.benchmarks:
+    if test_type is TestType.baremetal_benchmarks:
         j = create_new_job(args.jobname, build_device='x86')
         j['actions'].append(get_deploy_cmd_x86(args.jobname, args.kernel, args.kmodule, args.lmodule))
-    elif test_type  is TestType.tests:
+    elif test_type is TestType.baremetal_tests:
+        j = create_new_job(args.jobname, build_device='x86')
+        j['actions'].append(get_deploy_cmd_x86(args.jobname, args.kernel, args.kmodule, args.lmodule))
+    elif test_type  is TestType.kvm_tests:
         j = create_new_job(args.jobname, build_device='kvm')
         j['actions'].append(get_deploy_cmd_kvm(args.jobname, args.kernel, args.kmodule, args.lmodule))
 
     j['actions'].append(get_boot_cmd())
 
-    if test_type is TestType.benchmarks:
+    if test_type is TestType.baremetal_benchmarks:
         j['actions'].append(get_config_cmd('x86'))
         j['actions'].append(get_env_setup_cmd('x86', args.tools_commit))
-        j['actions'].append(get_benchmarks_cmd())
+        j['actions'].append(get_baremetal_benchmarks_cmd())
         j['actions'].append(get_results_cmd(stream_name='benchmark-kernel'))
-    elif test_type  is TestType.tests:
+    elif test_type is TestType.baremetal_tests:
+        if args.ust_commit is None:
+            print('Tests runs need -uc/--ust-commit options. Exiting...')
+            return -1
+        j['actions'].append(get_config_cmd('x86'))
+        j['actions'].append(get_env_setup_cmd('x86', args.tools_commit, args.ust_commit))
+        j['actions'].append(get_baremetal_tests_cmd())
+        j['actions'].append(get_results_cmd(stream_name='tests-kernel'))
+    elif test_type  is TestType.kvm_tests:
         if args.ust_commit is None:
             print('Tests runs need -uc/--ust-commit options. Exiting...')
             return -1
         j['actions'].append(get_config_cmd('kvm'))
         j['actions'].append(get_env_setup_cmd('kvm', args.tools_commit, args.ust_commit))
-        j['actions'].append(get_tests_cmd())
+        j['actions'].append(get_kvm_tests_cmd())
         j['actions'].append(get_results_cmd(stream_name='tests-kernel'))
     else:
         assert False, 'Unknown test type'
@@ -345,7 +370,7 @@ def main():
 
     passed, failed=check_job_all_test_cases_state_count(server, jobid)
 
-    if test_type is TestType.tests:
+    if test_type is TestType.kvm_tests:
         print_test_output(server, jobid)
 
     print('Job ended with {} status.'.format(jobstatus))
diff --git a/scripts/lttng-baremetal-tests/run-baremetal-benchmarks.sh b/scripts/lttng-baremetal-tests/run-baremetal-benchmarks.sh
new file mode 100644 (file)
index 0000000..4e2a1ee
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/bash -xeu
+# Copyright (C) 2016 - Francis Deslauriers <francis.deslauriers@efficios.com>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+echo 'At this point, we built the modules and kernel if we needed to.'
+echo 'We can now launch the lava job using those artefacts'
+git clone https://github.com/lttng/lttng-ci
+
+set +x
+python lttng-ci/scripts/lttng-baremetal-tests/lava-submit.py \
+                          -t baremetal-benchmarks \
+                          -j "$JOB_NAME" \
+                          -l "$LAVA_FRDESO_TOKEN" \
+                          -k "$STORAGE_KERNEL_IMAGE" \
+                          -km "$STORAGE_LINUX_MODULES" \
+                          -lm "$STORAGE_LTTNG_MODULES" \
+                          -tc "$LTTNG_TOOLS_COMMIT_ID"
diff --git a/scripts/lttng-baremetal-tests/run-baremetal-tests.sh b/scripts/lttng-baremetal-tests/run-baremetal-tests.sh
new file mode 100644 (file)
index 0000000..abe5619
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/bash -xeu
+# Copyright (C) 2016 - Francis Deslauriers <francis.deslauriers@efficios.com>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+echo 'At this point, we built the modules and kernel if we needed to.'
+echo 'We can now launch the lava job using those artefacts'
+git clone https://github.com/lttng/lttng-ci
+
+set +x
+python lttng-ci/scripts/lttng-baremetal-tests/lava-submit.py \
+                          -t baremetal-tests \
+                          -j "$JOB_NAME" \
+                          -l "$LAVA_FRDESO_TOKEN" \
+                          -k "$STORAGE_KERNEL_IMAGE" \
+                          -km "$STORAGE_LINUX_MODULES" \
+                          -lm "$STORAGE_LTTNG_MODULES" \
+                          -tc "$LTTNG_TOOLS_COMMIT_ID" \
+                          -uc "$LTTNG_UST_COMMIT_ID"
diff --git a/scripts/lttng-baremetal-tests/run-benchmarks.sh b/scripts/lttng-baremetal-tests/run-benchmarks.sh
deleted file mode 100644 (file)
index 7029812..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash -xeu
-# Copyright (C) 2016 - Francis Deslauriers <francis.deslauriers@efficios.com>
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-echo 'At this point, we built the modules and kernel if we needed to.'
-echo 'We can now launch the lava job using those artefacts'
-git clone https://github.com/lttng/lttng-ci
-
-set +x
-python lttng-ci/scripts/lttng-baremetal-tests/lava-submit.py \
-                          -t benchmarks \
-                          -j "$JOB_NAME" \
-                          -l "$LAVA_FRDESO_TOKEN" \
-                          -k "$STORAGE_KERNEL_IMAGE" \
-                          -km "$STORAGE_LINUX_MODULES" \
-                          -lm "$STORAGE_LTTNG_MODULES" \
-                          -tc "$LTTNG_TOOLS_COMMIT_ID"
diff --git a/scripts/lttng-baremetal-tests/run-kvm-tests.sh b/scripts/lttng-baremetal-tests/run-kvm-tests.sh
new file mode 100644 (file)
index 0000000..417a5e5
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/bash -xeu
+# Copyright (C) 2016 - Francis Deslauriers <francis.deslauriers@efficios.com>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+echo 'At this point, we built the modules and kernel if we needed to.'
+echo 'We can now launch the lava job using those artefacts'
+git clone https://github.com/lttng/lttng-ci
+
+set +x
+python lttng-ci/scripts/lttng-baremetal-tests/lava-submit.py \
+                          -t kvm-tests \
+                          -j "$JOB_NAME" \
+                          -l "$LAVA_FRDESO_TOKEN" \
+                          -k "$STORAGE_KERNEL_IMAGE" \
+                          -km "$STORAGE_LINUX_MODULES" \
+                          -lm "$STORAGE_LTTNG_MODULES" \
+                          -tc "$LTTNG_TOOLS_COMMIT_ID" \
+                          -uc "$LTTNG_UST_COMMIT_ID"
diff --git a/scripts/lttng-baremetal-tests/run-tests.sh b/scripts/lttng-baremetal-tests/run-tests.sh
deleted file mode 100644 (file)
index 6219ad1..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash -xeu
-# Copyright (C) 2016 - Francis Deslauriers <francis.deslauriers@efficios.com>
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-echo 'At this point, we built the modules and kernel if we needed to.'
-echo 'We can now launch the lava job using those artefacts'
-git clone https://github.com/lttng/lttng-ci
-
-set +x
-python lttng-ci/scripts/lttng-baremetal-tests/lava-submit.py \
-                          -t tests \
-                          -j "$JOB_NAME" \
-                          -l "$LAVA_FRDESO_TOKEN" \
-                          -k "$STORAGE_KERNEL_IMAGE" \
-                          -km "$STORAGE_LINUX_MODULES" \
-                          -lm "$STORAGE_LTTNG_MODULES" \
-                          -tc "$LTTNG_TOOLS_COMMIT_ID" \
-                          -uc "$LTTNG_UST_COMMIT_ID"
This page took 0.031976 seconds and 4 git commands to generate.