Merge lp:~canonical-platform-qa/qa-jenkins-jobs/performance-jobs into lp:qa-jenkins-jobs

Proposed by Sergio Cazzolato
Status: Merged
Approved by: Max Brustkern
Approved revision: 211
Merged at revision: 206
Proposed branch: lp:~canonical-platform-qa/qa-jenkins-jobs/performance-jobs
Merge into: lp:qa-jenkins-jobs
Diff against target: 272 lines (+170/-59)
4 files modified
jobs/macros.yaml (+14/-7)
jobs/performance/jobs.yaml (+156/-0)
scripts/performance/run_performance_qakit.sh (+0/-21)
scripts/performance/run_performance_tests.sh (+0/-31)
To merge this branch: bzr merge lp:~canonical-platform-qa/qa-jenkins-jobs/performance-jobs
Reviewer Review Type Date Requested Status
Max Brustkern (community) Approve
platform-qa-bot continuous-integration Approve
Review via email: mp+316625@code.launchpad.net

Commit message

jobs for performance tests execution

To post a comment you must log in.
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
206. By Sergio Cazzolato

Adding triggers and wrappers

Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
207. By Sergio Cazzolato

Fix for device ip in job

Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Max Brustkern (nuclearbob) wrote :

Some diff questions, but in general I think this will work well.

Revision history for this message
Sergio Cazzolato (sergio-j-cazzolato) wrote :

Answers and questions in diff

Revision history for this message
Max Brustkern (nuclearbob) wrote :

Responded!

208. By Sergio Cazzolato

reusing grafana setup between perf and tests

Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Max Brustkern (nuclearbob) wrote :
Download full text (4.8 KiB)

I get an error when attempting a deployment:

./scripts/deploy-jobs.sh
+ dirname ./scripts/deploy-jobs.sh
+ cd ./scripts
+ pwd
+ JOB_PATH=/home/max/bzr/merges/performance-jobs/scripts/../jobs
+ ARGS=update
+ make -C /home/max/bzr/merges/performance-jobs/scripts/../jobs
make: Entering directory '/home/max/bzr/merges/performance-jobs/jobs'
make -C auto-upgrade-testing
make[1]: Entering directory '/home/max/bzr/merges/performance-jobs/jobs/auto-upgrade-testing'
../../scripts/generate-upgrade-testing-profiles-from-branch.sh > profiles
make[1]: Leaving directory '/home/max/bzr/merges/performance-jobs/jobs/auto-upgrade-testing'
make: Leaving directory '/home/max/bzr/merges/performance-jobs/jobs'
+ python -m jenkins_jobs.cmd update -r /home/max/bzr/merges/performance-jobs/scripts/../jobs
INFO:root:Updating jobs in ['/home/max/bzr/merges/performance-jobs/jobs', '/home/max/bzr/merges/performance-jobs/jobs/performance', '/home/max/bzr/merges/performance-jobs/jobs/iso-testing', '/home/max/bzr/merges/performance-jobs/jobs/mp-ci-autoland', '/home/max/bzr/merges/performance-jobs/jobs/ubiquity', '/home/max/bzr/merges/performance-jobs/jobs/auto-upgrade-testing', '/home/max/bzr/merges/performance-jobs/jobs/ubuntu-system-tests', '/home/max/bzr/merges/performance-jobs/jobs/vis'] ([])
/usr/lib/python2.7/dist-packages/jenkins/__init__.py:527: DeprecationWarning: get_plugins_info() is deprecated, use get_plugins()
  DeprecationWarning)
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/lib/python2.7/dist-packages/jenkins_jobs/cmd.py", line 390, in <module>
    main()
  File "/usr/lib/python2.7/dist-packages/jenkins_jobs/cmd.py", line 191, in main
    execute(options, config)
  File "/usr/lib/python2.7/dist-packages/jenkins_jobs/cmd.py", line 372, in execute
    n_workers=options.n_workers)
  File "/usr/lib/python2.7/dist-packages/jenkins_jobs/builder.py", line 348, in update_jobs
    self.load_files(input_fn)
  File "/usr/lib/python2.7/dist-packages/jenkins_jobs/builder.py", line 293, in load_files
    self.parser.parse(in_file)
  File "/usr/lib/python2.7/dist-packages/jenkins_jobs/parser.py", line 128, in parse
    self.parse_fp(fp)
  File "/usr/lib/python2.7/dist-packages/jenkins_jobs/parser.py", line 97, in parse_fp
    data = local_yaml.load(utils.wrap_stream(fp), search_path=self.path)
  File "/usr/lib/python2.7/dist-packages/jenkins_jobs/local_yaml.py", line 325, in load
    return yaml.load(stream, functools.partial(LocalLoader, **kwargs))
  File "/usr/lib/python2.7/dist-packages/yaml/__init__.py", line 71, in load
    return loader.get_single_data()
  File "/usr/lib/python2.7/dist-packages/yaml/constructor.py", line 37, in get_single_data
    node = self.get_single_node()
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 36, in get_single_node
    document = self.compose_document()
  File "/usr/lib/python2.7/dist-packages/jenkins_jobs/local_yaml.py", line 166, in compose_document
    node = self.compose_node(None, None)
  File "/usr/lib/python2.7/...

Read more...

review: Needs Fixing
209. By Sergio Cazzolato

Minor fixes

Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
210. By Sergio Cazzolato

Fixing issues

Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
211. By Sergio Cazzolato

minor fix on parameters

Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Max Brustkern (nuclearbob) wrote :

If you've tested the deployment of these, they should be ready to go.

review: Approve
Revision history for this message
Sergio Cazzolato (sergio-j-cazzolato) wrote :

I tested the deployment and there are no errors now.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'jobs/macros.yaml'
2--- jobs/macros.yaml 2017-02-03 18:18:46 +0000
3+++ jobs/macros.yaml 2017-02-08 00:13:12 +0000
4@@ -20,21 +20,29 @@
5 cat media_info
6
7 - builder:
8- name: grafana-upload
9+ name: grafana-setup
10 builders:
11 - shell: |
12- if [ -z "$BUILDSTAMP" ] ; then
13- BUILDSTAMP=$(grep -o '([0-9.]\+)' media_info | tr -d '()')
14- fi
15 bzr branch lp:custom-grafana-integration $WORKSPACE/grafana-integration
16- export GRAFANA_INTEGRATION_PATH=$WORKSPACE/grafana-integration
17+ cat > $WORKSPACE/grafana.conf <<EOF
18 export MONGO_HOST=10.25.236.10
19 export MONGO_PORT=27017
20 export CARBON_HOST=10.25.236.71
21 export CARBON_PORT=2003
22 export MSG_CHUNK_SIZE=500
23 export MSG_WAIT=30
24- ### Add global_info
25+ export GRAFANA_INTEGRATION_PATH=$WORKSPACE/grafana-integration
26+ EOF
27+
28+- builder:
29+ name: grafana-upload
30+ builders:
31+ - grafana-setup:
32+ - shell: |
33+ source $WORKSPACE/grafana.conf
34+ if [ -z "$BUILDSTAMP" ] ; then
35+ BUILDSTAMP=$(grep -o '([0-9.]\+)' media_info | tr -d '()')
36+ fi
37 cat > global_info.json <<EOF
38 {{
39 "device": "{device}",
40@@ -46,7 +54,6 @@
41 "build": "$BUILDSTAMP"
42 }}
43 EOF
44- ### Run grafana integration and send data to grafana server ###
45 $GRAFANA_INTEGRATION_PATH/run_script sync-tests -rt xunit -rf {xunit_file} -if global_info.json -m tests_01 -t $(date +%s)
46
47 - publisher: # This publisher archives all job artifacts
48
49=== added directory 'jobs/performance'
50=== added file 'jobs/performance/jobs.yaml'
51--- jobs/performance/jobs.yaml 1970-01-01 00:00:00 +0000
52+++ jobs/performance/jobs.yaml 2017-02-08 00:13:12 +0000
53@@ -0,0 +1,156 @@
54+# vim: sw=4 ts=4 et
55+
56+# QA Jenkins Jobs
57+# Copyright 2017 Canonical Ltd.
58+
59+# This program is free software: you can redistribute it and/or modify it
60+# under the terms of the GNU General Public License version 3, as published
61+# by the Free Software Foundation.
62+
63+# This program is distributed in the hope that it will be useful, but
64+# WITHOUT ANY WARRANTY; without even the implied warranties of
65+# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
66+# PURPOSE. See the GNU General Public License for more details.
67+
68+# You should have received a copy of the GNU General Public License along
69+# with this program. If not, see <http://www.gnu.org/licenses/>.
70+
71+# The project stanza describes all jobs and parameters
72+- project:
73+ name: performance-desktop
74+ device: 'desktop'
75+ model:
76+ - amd-gfx
77+ - intel-gfx
78+ - nvidia-gfx
79+ release:
80+ - xenial
81+ - zesty
82+ arch: 'amd64'
83+ unity8-mode:
84+ - deb
85+ - snap
86+ jobs:
87+ - 'kpi-tests-{device}-{model}-{release}-{arch}-unity8-{unity8-mode}'
88+
89+- project:
90+ name: performance-board
91+ device: 'board'
92+ model: 'dragonboard'
93+ arch: 'arm64'
94+ release: 'core_16'
95+ unity8-mode: 'snap'
96+ jobs:
97+ - 'kpi-tests-{device}-{model}-{release}-{arch}-unity8-{unity8-mode}'
98+
99+# builder stanzas describe reusable build steps
100+- builder:
101+ name: setup-env
102+ builders:
103+ - shell: |
104+ rm -rf *
105+ mkdir $WORKSPACE/results
106+
107+- builder:
108+ name: branch-bzr-project
109+ builders:
110+ - shell: |
111+ bzr branch {project-url} {project-name}
112+
113+- builder:
114+ name: run-performance-tests
115+ builders:
116+ - shell: |
117+ set -ex
118+ BUILDID=$(date +%Y%m%d)
119+ cat > job.json <<EOF
120+ {{
121+ "job_queue": "$DEVICE_QUEUE",
122+ "provision_data": {{
123+ "distro": "{release}"
124+ }},
125+ "test_data": {{
126+ "test_cmds": [
127+ "bzr branch $PERFORMANCE_TESTS_BRANCH ubuntu-performance-tests",
128+ "mkdir artifacts",
129+ "cd ubuntu-performance-tests && KPI_OS_BUILD=$BUILDID KPI_DEVICE_IP={{device_ip}} $ITER_PARAMS $EXEC_PARAMS $ENV_PARAMS ./run_tests desktop",
130+ "cp ubuntu-performance-tests/tests/tests.log artifacts"
131+ ]
132+ }}
133+ }}
134+ EOF
135+ python3 qakit/qakit/testflinger/runner.py -d job.json -o testflinger.log -t 7200 -a artifacts.tgz
136+ tar -xzf artifacts.tgz
137+ cp artifacts/tests.log $WORKSPACE/results/tests.log
138+
139+- builder:
140+ name: sync-grafana
141+ builders:
142+ - grafana-setup
143+ - shell: |
144+ set -ex
145+ source $WORKSPACE/grafana.conf
146+ $GRAFANA_INTEGRATION_PATH/run_script sync-perf -l $WORKSPACE/results/tests.log -m performance_01 -t $(date +%s)
147+
148+- job-template:
149+ name: kpi-tests-{device}-{model}-{release}-{arch}-unity8-{unity8-mode}
150+ description: |
151+ Run performance tests
152+ Defined in lp:qa-jenkins-jobs
153+ node: 'jenkins-slave-2'
154+ triggers:
155+ - timed: 'H H * * *'
156+ wrappers:
157+ - timeout:
158+ timeout: 180
159+ fail: true
160+ parameters:
161+ - string:
162+ name: PERFORMANCE_TESTS_BRANCH
163+ default: lp:ubuntu-performance-tests
164+ description: "Launchpad branch of ubuntu-performance-tests from which to run tests."
165+ - string:
166+ name: QAKIT_BRANCH
167+ default: lp:qakit
168+ description: Launchpad branch of qakit project to use testflinger.
169+ - string:
170+ name: GRAFANA_INTEGRATION_BRANCH
171+ default: lp:custom-grafana-integration
172+ description: "Launchpad branch of custom-grafana-integration project to process the performnace results."
173+ - string:
174+ name: RELEASE
175+ default: '{release}'
176+ description: "The given alternate distro will be used if specified."
177+ - string:
178+ name: DEVICE_QUEUE
179+ default: '{model}'
180+ description: "The device where it is going to be executed."
181+ - string:
182+ name: ITER_PARAMS
183+ default: KPI_DEFAULT_RETRIES=1 KPI_APPLAUNCH_RETRIES=0 KPI_WEBBROWSER_RETRIES=0 KPI_DROMAEO_RETRIES=0
184+ description: "Iterations for tests"
185+ - string:
186+ name: EXECUTION_PARAMETERS
187+ default: KPI_SSH_TIMEOUT=600000 KPI_USER=ubuntu
188+ description: "Parametes used to execute the tests"
189+ - string:
190+ name: ENV_PARAMS
191+ default: KPI_DEVICE_TYPE={device} KPI_DEVICE_MODEL={model} KPI_OS_RELEASE={release} KPI_OS_ARCH={arch} KPI_UNITY8_MODE={unity8-mode}
192+ description: "Environment parameters"
193+ builders:
194+ - setup-env:
195+ - branch-bzr-project:
196+ project-url: '$QAKIT_BRANCH'
197+ project-name: 'qakit'
198+ - branch-bzr-project:
199+ project-url: '$PERFORMANCE_TESTS_BRANCH'
200+ project-name: 'ubuntu-performance'
201+ - run-performance-tests:
202+ device: '{device}'
203+ model: '{model}'
204+ release: '{release}'
205+ arch: '{arch}'
206+ unity8-mode: '{unity8-mode}'
207+ - sync-grafana:
208+ publishers:
209+ - archive-artifacts
210
211=== removed directory 'scripts/performance'
212=== removed file 'scripts/performance/run_performance_qakit.sh'
213--- scripts/performance/run_performance_qakit.sh 2016-09-21 22:09:51 +0000
214+++ scripts/performance/run_performance_qakit.sh 1970-01-01 00:00:00 +0000
215@@ -1,21 +0,0 @@
216-#!/bin/bash
217-
218-# QA Jenkins Jobs
219-# Copyright 2016 Canonical Ltd.
220-#
221-# This program is free software: you can redistribute it and/or modify it
222-# under the terms of the GNU General Public License version 3, as published
223-# by the Free Software Foundation.
224-#
225-# This program is distributed in the hope that it will be useful, but
226-# WITHOUT ANY WARRANTY; without even the implied warranties of
227-# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
228-# PURPOSE. See the GNU General Public License for more details.
229-#
230-# You should have received a copy of the GNU General Public License along
231-# with this program. If not, see <http://www.gnu.org/licenses/>.
232-
233-set -ex
234-
235-python3 $QAKIT_PATH/qakit/prodenv/perf/sync_perf.py save $KPI_LOG
236-python3 $QAKIT_PATH/qakit/prodenv/perf/sync_perf.py update -b $BUILD_NUMBER -c $CHANNEL -d $DEVICE
237
238=== removed file 'scripts/performance/run_performance_tests.sh'
239--- scripts/performance/run_performance_tests.sh 2016-08-25 19:48:42 +0000
240+++ scripts/performance/run_performance_tests.sh 1970-01-01 00:00:00 +0000
241@@ -1,31 +0,0 @@
242-#!/bin/bash
243-
244-# QA Jenkins Jobs
245-# Copyright 2016 Canonical Ltd.
246-#
247-# This program is free software: you can redistribute it and/or modify it
248-# under the terms of the GNU General Public License version 3, as published
249-# by the Free Software Foundation.
250-#
251-# This program is distributed in the hope that it will be useful, but
252-# WITHOUT ANY WARRANTY; without even the implied warranties of
253-# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
254-# PURPOSE. See the GNU General Public License for more details.
255-#
256-# You should have received a copy of the GNU General Public License along
257-# with this program. If not, see <http://www.gnu.org/licenses/>.
258-
259-set -ex
260-
261-cd $PERFORMANCE_TESTS_PATH
262-export PYTHONPATH=$PERFORMANCE_TESTS_PATH
263-
264-if [ $RUN_TESTS = true ]; then
265- python3 kpi/runner.py -k applaunch -s $ANDROID_SERIAL -i $APPLAUNCH_ITERS -w 15
266- python3 kpi/runner.py -k reboot -s $ANDROID_SERIAL -i $REBOOT_ITERS
267- python3 kpi/runner.py -k idlecputime -s $ANDROID_SERIAL -i $CPU_ITERS -t 120
268- python3 kpi/runner.py -k webbrowser -s $ANDROID_SERIAL -i $WEB_BROWSER_ITERS
269- python3 kpi/runner.py -k dashqmlmetrics -s $ANDROID_SERIAL -i $DASH_ITERS -t
270-else
271- python3 kpi/runner.py -k fake -s $ANDROID_SERIAL
272-fi

Subscribers

People subscribed via source and target branches