continuous delivery of embedded systems embedded meetup

Post on 14-Jan-2017

275 Views

Category:

Software

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

@meekrosoft

Continuous Delivery of Embedded Systems

Mike Long@meekrosoft

@meekrosoft

But first...

http://ndcoslo.com/page/embedded-c-cpp-and-dplus...Community Tuesday

Who is Mike Long?● Doer: Embedded software, CoDe & DevOps

● Trainer: git, jenkins, docker, TDD

● Speaker: coming to a conference near you!

● Manager: Co-owner Praqma, CEO Praqma Norway

@meekrosoft

Agenda:- What is Continuous Delivery?- What are the challenges in Embedded?- What techniques can we take advantage

of?- How can we test embedded software?- Who has done this already?

@meekrosofthttps://www.flickr.com/photos/philia17/15601597778/

@meekrosoft

Professional software development1. Take a copy of the codebase for existing product2. Carefully document its current algorithms3. Add changes surrounded by ifdefs4. Test for months5. Commit the code as a new project that will “hopefully”

get merged to the in the future6. Compile on my laptop7. Ship!

@meekrosoft

What is Continuous Delivery?

@meekrosoft

Agile Manifesto

● Four doctrines, twelve Principles

# 1

# 7

@meekrosoft

Continuous Integration

@meekrosoft

The ideal Embedded process1. Fetch the latest source (which is up to date with

release)2. Branch, implement feature, test3. Push4. CI5. CD6. Canary deployment7. Real-time production feedback

@meekrosoft

Release trains

@meekrosoft

Release trains

@meekrosoft

Challenges

@meekrosofthttp://www.lego.com/en-us/minifigures/characters/computer-programmer-0c248844ec9d4245a5c17479a208e45b

Solo work

@meekrosoft

Fire and forget codebases?

@meekrosoft

@meekrosoft

Production-like environment???

@meekrosoft

@meekrosoft

Versioning

@meekrosoft

The red thread of traceability

We want to know: what it is compatible with, what it depends on, where it was built, what its test results were, its source version, and the task that spawned the change

@meekrosoft

http://semver.org

@meekrosoft

Examples

myapplication-1.0.0-alpha+001.sha.5114f85

Artifact Name

@meekrosoft

Examples

myapplication-1.0.0-alpha+001.sha.5114f85

Major.minor.patch

@meekrosoft

Examples

myapplication-1.0.0-alpha+001.sha.5114f85

Prerelease version

@meekrosoft

Examples

myapplication-1.0.0-alpha+001.sha.5114f85

Build number

@meekrosoft

Examples

myapplication-1.0.0-alpha+001.sha.5114f85

git short SHA

@meekrosoft

Examples

myapplication-1.0.0-SNAPSHOT+001.sha.5114f85

SNAPSHOT

@meekrosoft

@meekrosoft

@meekrosoft

Build

@meekrosofthttp://blog.codinghorror.com/the-f5-key-is-not-a-build-process/

If your "build process" is the F5 key, you have a problem…..Get your build process out of the IDE and into a build script.

@meekrosoft

What’s missing?

Traceability: Can I find out exactly the environment for this build?

Reproducibility: Can I build something from last year with the same results?

@meekrosoft

@meekrosoft

@meekrosoft

@meekrosoft

A Traceability ecosystem

@meekrosoft

Configuration as code

Linux slaveLinux

slaveLinux slaveLinux

slavesDockerfile

Vagrant file

Windowsslaves

Puppet file

WindowsslavesWindows

slaves

Jenkins Jobs

JobDSL

@meekrosoft

Build in a box

Jenkins Master

ArtifactoryDocker container

Linux slaveLinux

slaveLinux slaveLinux

slaveLinux slaveLinux

slave

Windowsslave

Vagrant VM

WindowsslaveWindows

slaveWindowsslaveWindows

slave

PuppetMaster

@meekrosoft

Testing

@meekrosoft

Airbus engineers employed the latest and greatest formal methods, and provided model checking and formal proofs of all of their avionics code. Meanwhile, according to the story, Boeing performed extensive design review and testing, and made all their software engineers fly on the first test flights. The general upshot of the story was that most of us (it seemed) felt more comfortable flying on Boeing aircraft. (It would be interesting to see if that would still be the majority opinion in the software engineering community.)

https://www.cerias.purdue.edu/site/blog/post/short_random_thought_on_testing/#When:16:40:35Z

Eugene H. Spafford, Professor & Executive Director, Purdue University

@meekrosoft

@meekrosoft

System Tests ✓

@meekrosoft

System Tests- Control power- Program devices- Control Actuators- Sense results

@meekrosoft

System Tests

Component Tests

✓✓

@meekrosoft

System Tests

Component Tests

✓✓

@meekrosoft

@meekrosoft

Test everywhere

Test on your host for:● Feedback speed, debuggingBut also test on target because:● Compilers/hardware are different● Endiness/overflow/underflow behave

differently● Ship them if you can!

@meekrosoft

www.xethru.com

ASIC Quality – Continuous Delivery

@meekrosoft

Pro Tips

@meekrosoft

// #ifdef MY_PROD_V1

Avoid using the preprocessor for variants● It makes builds slow● Lowers cohesion● Also hinders understandability

@meekrosoft

Only build your binaries once

Efficiency - time to feedbackSafety - ship what you test

@meekrosoft

Amplify feedback loops

TDD

Red

RefactorGreen

Learn Measure

Build

Product

Data

Ideas

Continuous IntegrationContinuous DeliveryBDDAutomated DeploymentCustomer Feedback

@meekrosoft

Dev Env is competitive advantage

Attrition vs. Late follower vs.

Unhappy customers vs.

RecruitmentFirst to marketRaving fandom

@meekrosoft

Summary

@meekrosoft

https://ww

w.flickr.com

/photos/22423670@N

08/14260168597

@meekrosoft

@meekrosoft

The researchers praised Tesla for the way the vehicle handled the

bogus commands and how the car maker responded to their findings.

@meekrosoft

In late July, Fiat Chrysler issued a recall for more than 1.4 million vehicles after

hackers Charlie Miller and Chris Valasek showed how to use bugs in the onboard software of the Jeep Cherokee to shut it

down remotely.

@meekrosoft

Agenda:- What is Continuous Delivery? ✓- What are the challenges in Embedded? ✓- What techniques can we take advantage

of? ✓- How can we test embedded software? ✓- Who has done this already? ✓

@meekrosoft

Questions?

mike@praqma.com@meekrosoft

top related