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

Proposed by Sergio Cazzolato
Status: Superseded
Proposed branch: lp:~canonical-platform-qa/qa-jenkins-jobs/iso-footprint-jobs
Merge into: lp:qa-jenkins-jobs
Diff against target: 326 lines (+186/-79)
5 files modified
jobs/iso-testing/jobs.yaml (+11/-17)
jobs/macros.yaml (+25/-10)
jobs/performance/jobs.yaml (+150/-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/iso-footprint-jobs
Reviewer Review Type Date Requested Status
Canonical Platform QA Jenkins Pending
Review via email: mp+316703@code.launchpad.net

This proposal has been superseded by a proposal from 2017-02-08.

Commit message

Update iso footprint jobs to support new grafana scripts

To post a comment you must log in.
214. By Sergio Cazzolato

Adding #!/bin/bash to scripts

215. By Sergio Cazzolato

minor change

216. By Sergio Cazzolato

Merge with trunk

Unmerged revisions

Preview Diff

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

Subscribers

People subscribed via source and target branches