+ All Categories
Home > Documents > It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License...

It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License...

Date post: 29-May-2020
Category:
Upload: others
View: 2 times
Download: 0 times
Share this document with a friend
52
It’s not an embedded Linux distribution – It creates a custom one for you. Elizabeth Flanagan Intel Corporation April 11, 2011 Delivering Predictability: The Yocto Project Autobuilder, Automated Sanity Testing, License Collection, and Build Statistics Tracking
Transcript
Page 1: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

It’s not an embedded Linux distribution –It creates a custom one for you.

Elizabeth FlanaganIntel Corporation

April 11, 2011

Delivering Predictability: The Yocto Project Autobuilder, Automated Sanity Testing, License Collection, and Build Statistics Tracking

Page 2: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

2/52

Being proactive about code quality

● Reproducible builds● Identify bugs and fix early and often● Reduce time needed for code stabilization● Avoid integration headaches● Build performance history● Manage the chaos● License compliance● Deep QA Testing

Page 3: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

3/52

Being proactive about code quality

Maximizing your ability to respond to changes in a complex embedded

ecosystem.

Page 4: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

4/52

Being proactive about code quality

Reduce Software Development Lifecycle Churn.

Page 5: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

5/52

Complexities

Our Recipe

Page 6: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

6/52

Complexities

Our Recipe

qemuarm

qemumips

qemuppc qemux86_64

qemux86

Page 7: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

7/52

Complexities

Our Recipe

qemuarm

qemumips

qemuppc qemux86_64

qemux86

Our Recipe

qemuarm

qemumips

qemuppc qemux86_64

qemux86

mpc8315e atom-pc

beagleboard routerstation

Page 8: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

8/52

Complexities

Our Recipe

qemuarm

qemumips

qemuppc qemux86_64

qemux86

mpc8315e atom-pc

beagleboard routerstation

emenlow

Jasperforestn450 sandybridge

crownbayCrownbay-noemgd

Page 9: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

9/52

Complexities

● One recipe● 5 architectures● 4 core BSP● 6 non-core BSPs in meta-intel● 15 x-compiles● But....

Page 10: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

10/52

Complexities

● One recipe● 16 theoretical different image types

per arch * 15 architectures– Not all arches support all image

types● 240 total theoretically possible

images– sato, lsb, sdk....

Page 11: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

11/52

Complexities

If we're not proactive about code quality, lots of things can go wrong.....

Page 12: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

12/52

Complexities

It's only going to get more complex

Page 13: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

13/52

What we need

– Reproducible builds– Basic QA– License tracking– Finding the pain points

Page 14: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

14/52

Delivering Predictability

Sanity Testing

License Wrangling

Build Statistics

Autobuilder Poky

Yocto Project

Page 15: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

15/52

Delivering Predictability

Sanity Testing

License Wrangling

Build Statistics

Autobuilder Poky

Yocto Project

Page 16: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

16/52

Autobuilders

● Production Autobuilders● Quickly respond to a fast changing

code base● Avoid “Works on my machine”-itis● Find race conditions● Find host dependent issues● Find bad commits● Help bisect build failures● Help find dependency chain

breakage

Page 17: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

17/52

Autobuilders

● Developer Autobuilders● Test cross-compilation before

commit● Production style builds● Small OS footprint● Build what you want to build

Page 18: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

18/52

Autobuilders

● Yocto autobuilder● buildbot based● git://git.yoctoproject.org/poky-

autobuilder.git● Setup in under 5 minutes!

Page 19: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

19/52

Autobuilders

● Prerequisites:● Python 2.6● python-twisted● python-jinja2● python-twisted-mail● sqllite

Page 20: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

20/52

Autobuilders

● Comes with● Basic pokyABConfig.py● Helper scripts● Easy Installer

Page 21: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

21/52

Set up your own!

cd ~git clone git://git.yoctoproject.org/poky-autobuilder.gitcd poky-autobuilder./scripts/poky-setup-autobuilder bothsource ~/.profile;cd ../poky-master; make startcd ../poky-slave; make start

Page 22: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

22/52

Live Demo

Page 23: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

23/52

Delivering Predictability

Sanity Testing

License Wrangling

Build Statistics

Autobuilder Poky

Yocto Project

Page 24: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

24/52

Sanity Testing

● Extensible● Frees up QA resources● Reproducible smoke testing● Multiarch/multiimage scenarios● Can run automatically post build via local.conf● Or via an autobuilder

Page 25: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

25/52

Sanity Testing

Sanity Test Bitbake Class

Architecture/image based test scenario

Test library/runner

Test helper scripts

Page 26: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

26/52

Sanity Testing

meta/classes/imagetest-qemu.bbclass

scripts/qemuimage-tests/scenario/${ARCH}/*

scripts/qemuimage-testlib and runners

scripts/qemuimage-tests/{sanity|tools}/*

Page 27: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

27/52

Sanity Testing

● Test suite● Architecture and image based scenarios ● Very easy to add already existing tests

Page 28: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

28/52

Sanity Testing

sanity sshsanity scpsanity dmesgsanity zypper_helpsanity zypper_searchsanity rpm_querysanity connmansanity shutdown

Page 29: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

29/52

Sanity Testing

● Tests● bash/expect based test scripts● called via test runners in scripts/sanity ● Tests stored in qemuimage-testlib

●More secure to create tap devs with poky-gen-tapdevs.

Page 30: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

30/52

Sanity Testing

● Gotchas:● QEMU user NOPASSWD● More secure to create tap devs with poky-gen-tapdevs.

● For headless, see wiki docs: https://wiki.pokylinux.org/wiki/Enabling_Automation_Test_in_Poky

Page 31: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

31/52

Delivering Predictability

Sanity Testing

License Wrangling

Build Statistics

Autobuilder Poky

Yocto Project

Page 32: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

32/52

License Wrangling

● Verify image compatibility to required license type● non-GPLv3

● Provides an entire package directory tree● Actual licenses ● Generics.

● Helps maintain license compliance

Page 33: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

33/52

License Wrangling

Recipe contains:● LICENSE

● Tells license.bbclass the common license type● Symlink from license wrangling output to a generic

● LIC_FILES_CHECKSUM● License file URI● Checksum● Where we get the specific license

Page 34: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

34/52

License Wrangling

License are found in:

${POKYBASE}/build/tmp/deploy/images/licenses

Page 35: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

35/52

Delivering Predictability

Sanity Testing

License Wrangling

Build Statistics

Autobuilder Poky

Yocto Project

Page 36: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

36/52

Build Statistics

Build level:● Host info● Elapsed build time● CPU usage● Build failure information

Page 37: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

37/52

Build Statistics

Package level:●List of events triggered●Elapsed event time●CPU usage●Event failure information

Page 38: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

38/52

Build Statistics

PackageEvent

Build

EventEvent

PackageEventEventEvent

build/tmp/deploy/images/licenses/:poky-image-minimal-qemux86`-- 201103251310 |-- build_stats |-- autoconf-native-2.65-r2 | |-- do_compile | |-- do_configure | |-- do_fetch | |-- do_install | |-- do_patch | |-- do_populate_sysroot | |-- do_setscene | `-- do_unpack |-- automake-native-1.11.1-r1 | |-- do_compile | |-- do_configure | |-- do_fetch | |-- do_install | |-- do_patch | |-- do_populate_sysroot | |-- do_setscene | `-- do_unpack

Image Type

Page 39: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

39/52

Build Statistics

Gives us:● Performance indicators● Track down issues

● CPU/Dependancy/IO bound ●Visualize your build performance

● Patch to pybootchart

Page 40: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

40/52

Build Statistics Visualization

Time

Page 41: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

41/52

Build Statistics Visualization

Page 42: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

42/52

Build Statistics Visualization

Page 43: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

43/52

Build Statistics Visualization

Page 44: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

44/52

Build Statistics Visualization

Page 45: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

45/52

Where do we go from here?

Page 46: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

46/52

Where do we go from here?

Autobuilder:●Meta-targets●Helper script integration into main config●Continuous integration

Page 47: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

47/52

Where do we go from here?

License tracking:●More generic license files●Better LICENSE field parsing

Page 48: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

48/52

Where do we go from here?

Build Statistics:●Collect even more data.

● Image size w/o free space.●Better data visualization.

● Web based

Page 49: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

49/52

Production autobuilder

Page 50: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

50/52

Resources● http://www.yoctoproject.org

● http://git.yoctoproject.org/cgit/cgit.cgi/poky-autobuilder/

● http://autobuilder.yoctoproject.org

● pybootchartgui patch for build statistics● https://wiki.pokylinux.org/wiki/Enabling_Automation_Test_in_Poky

Page 51: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

51/52

Legal InformationINFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL® PRODUCTS. EXCEPT AS PROVIDED IN INTEL'S TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS, INTEL ASSUMES NO LIABILITY WHATSOEVER, AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY RELATING TO SALE AND/OR USE OF INTEL PRODUCTS, INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT, OR OTHER INTELLECTUAL PROPERTY RIGHT.

Intel may make changes to specifications, product descriptions, and plans at any time, without notice.

All dates provided are subject to change without notice.

Intel is a trademark of Intel Corporation in the U.S. and other countries.

*Other names and brands may be claimed as the property of others.

Copyright © 2009, Intel Corporation. All rights are protected.

Page 52: It’s not an embedded Linux distribution – It creates a ... · Sanity Testing, License Collection, and Build Statistics Tracking. 2/52 Being proactive about code qualityFile Size:

52/52


Recommended