NIWeek 2012: Fire and Forget / Bulletproof Builds Using Continuous Integration With LabVIEW

28
PUSHING THE LIMITS OF LABVIEW Fire and Forget: Bulletproof Builds Using Continuous Integration With LabVIEW Omar Mussa JKI Senior Engineer & Professional Services Manager http://xkcd.com/974/

description

Slides from JKI's NIWeek 2012 technical session, "Fire and Forget: Bulletproof Builds Using Continuous Integration With LabVIEW," presented by Omar Mussa. With continuous integration (CI), you never have to manually build code. A build server automatically builds the application when new code changes are checked in and sends reports when problems are encountered. Learn how JKI created an automated CI system for LabVIEW code using free, off-the- shelf tools.

Transcript of NIWeek 2012: Fire and Forget / Bulletproof Builds Using Continuous Integration With LabVIEW

Page 1: NIWeek 2012: Fire and Forget / Bulletproof Builds Using Continuous Integration With LabVIEW

PUSHING THE LIMITS OF LABVIEW

Fire and Forget:Bulletproof Builds Using Continuous Integration With LabVIEW

Omar MussaJKI Senior Engineer & Professional Services Manager

http://xkcd.com/974/

Page 2: NIWeek 2012: Fire and Forget / Bulletproof Builds Using Continuous Integration With LabVIEW

PUSHING THE LIMITS OF LABVIEW

Continuous Integration with LabVIEW

What is Continuous Integration?What is Jenkins?Build Automation ProcessConsiderations for LabVIEW Build Automation

2

Page 3: NIWeek 2012: Fire and Forget / Bulletproof Builds Using Continuous Integration With LabVIEW

PUSHING THE LIMITS OF LABVIEW

Continuous Integration with LabVIEW

What is Continuous Integration?What is Jenkins?Build Automation ProcessConsiderations for LabVIEW Build Automation

3

Page 5: NIWeek 2012: Fire and Forget / Bulletproof Builds Using Continuous Integration With LabVIEW

PUSHING THE LIMITS OF LABVIEW

What is Continuous Integration?

End to end automation of your build and release process...

5

Page 6: NIWeek 2012: Fire and Forget / Bulletproof Builds Using Continuous Integration With LabVIEW

PUSHING THE LIMITS OF LABVIEW

Continuous Integration with LabVIEW

What is Continuous Integration?What is Jenkins?Build Automation ProcessConsiderations for LabVIEW Build Automation

6

Page 7: NIWeek 2012: Fire and Forget / Bulletproof Builds Using Continuous Integration With LabVIEW

PUSHING THE LIMITS OF LABVIEW

About Jenkins

Open Source (Est. ~2007)Many usersMany pluginsSome learning curve but overall easy to useHas GUI

7

Page 8: NIWeek 2012: Fire and Forget / Bulletproof Builds Using Continuous Integration With LabVIEW

PUSHING THE LIMITS OF LABVIEW

What Problems Does Jenkins Solve?

Build Triggering (Web Hooks or SCC Polling) Build Execution Order (Build Pipelines, etc) Build History Unit Test History Build Failure Notification

8

Page 9: NIWeek 2012: Fire and Forget / Bulletproof Builds Using Continuous Integration With LabVIEW

PUSHING THE LIMITS OF LABVIEW

Poking around in Jenkins

Let’s take a look around ...

9

Page 10: NIWeek 2012: Fire and Forget / Bulletproof Builds Using Continuous Integration With LabVIEW

PUSHING THE LIMITS OF LABVIEW

Continuous Integration with LabVIEW

What is Continuous Integration?What is Jenkins?Build Automation ProcessConsiderations for LabVIEW Build Automation

10

Image via: http://xkcd.com/303/

Page 11: NIWeek 2012: Fire and Forget / Bulletproof Builds Using Continuous Integration With LabVIEW

PUSHING THE LIMITS OF LABVIEW

Build Planning

Q. When do we start making builds of our project?A. As early and often as possible.

11

Page 12: NIWeek 2012: Fire and Forget / Bulletproof Builds Using Continuous Integration With LabVIEW

PUSHING THE LIMITS OF LABVIEW

LabVIEW Build Types

Lots of deliverables can be built using LabVIEW

12

Package PPL Source Zip

EXE Installer DLL

Page 13: NIWeek 2012: Fire and Forget / Bulletproof Builds Using Continuous Integration With LabVIEW

PUSHING THE LIMITS OF LABVIEW

LabVIEW Build Process

Typical LabVIEW Build and Release Process

13

Page 14: NIWeek 2012: Fire and Forget / Bulletproof Builds Using Continuous Integration With LabVIEW

PUSHING THE LIMITS OF LABVIEW

LabVIEW Build Process using CI

Typical CI Server Automated Build Process

14

Page 15: NIWeek 2012: Fire and Forget / Bulletproof Builds Using Continuous Integration With LabVIEW

PUSHING THE LIMITS OF LABVIEW

Direct Business Value Benefits

15

Page 16: NIWeek 2012: Fire and Forget / Bulletproof Builds Using Continuous Integration With LabVIEW

PUSHING THE LIMITS OF LABVIEW

Voila!

Our demo build server revisited ...

16

Page 17: NIWeek 2012: Fire and Forget / Bulletproof Builds Using Continuous Integration With LabVIEW

PUSHING THE LIMITS OF LABVIEW

Basic Build Automation Development

17

Image via: http://xkcd.com/303/

Page 18: NIWeek 2012: Fire and Forget / Bulletproof Builds Using Continuous Integration With LabVIEW

PUSHING THE LIMITS OF LABVIEW

Continuous Integration with LabVIEW

What is Continuous Integration?What is Jenkins?Build Automation ProcessConsiderations for LabVIEW Build Automation

18

Page 19: NIWeek 2012: Fire and Forget / Bulletproof Builds Using Continuous Integration With LabVIEW

PUSHING THE LIMITS OF LABVIEW

LabVIEW from the Command Line

Easiest way to call LabVIEW Build VIs is via command line!

Use Batch File from CI Software Requires some design considerations

Forcing batch file to wait for build to complete Error handling

19

Page 20: NIWeek 2012: Fire and Forget / Bulletproof Builds Using Continuous Integration With LabVIEW

PUSHING THE LIMITS OF LABVIEW

LabVIEW from the Command Line

Calling LabVIEW.exe from the command line... LabVIEW can only receive one set of command line

parameters per call LabVIEW must be closed before new build is started [ProgramFiles]LabVIEW.exe “[path to VI]” -- [user

arguments] Build VI must be set to “Run When Opened”

20

Page 21: NIWeek 2012: Fire and Forget / Bulletproof Builds Using Continuous Integration With LabVIEW

PUSHING THE LIMITS OF LABVIEW

LabVIEW from the Command Line

Use Application Property node to read command line arguments

LabVIEW is ALWAYS the 0th element

Best Practice Pass the build number to your build VI

21

Page 22: NIWeek 2012: Fire and Forget / Bulletproof Builds Using Continuous Integration With LabVIEW

PUSHING THE LIMITS OF LABVIEW

When Builds Break ...

Demo of package build server error detection

22

Page 23: NIWeek 2012: Fire and Forget / Bulletproof Builds Using Continuous Integration With LabVIEW

PUSHING THE LIMITS OF LABVIEW

Build Design Considerations

Separate project build steps for pipeliningSeparate project build steps for distributing buildsAvoid SCC commits within build workspaces during build process

Only want to trigger builds from developer commits, not from build process itself

Generally means that build number is passed to build process (via Jenkins)

Avoid development on build server itself

23

Page 24: NIWeek 2012: Fire and Forget / Bulletproof Builds Using Continuous Integration With LabVIEW

PUSHING THE LIMITS OF LABVIEW

Build Time Considerations

CI Server Impact on Short Build Times Fast feedback to developer isolates debugging Platform for unit test execution

CI Server Impact on Long Build Times Builds are still run ~daily Not ‘stuck’ at end of project with broken build Frees up a lot of developer time that would otherwise be

wasted waiting for builds to execute.

24

Page 25: NIWeek 2012: Fire and Forget / Bulletproof Builds Using Continuous Integration With LabVIEW

PUSHING THE LIMITS OF LABVIEW

JKI’s Continuous Build ToolChain

25

JKI VI Tester

Page 26: NIWeek 2012: Fire and Forget / Bulletproof Builds Using Continuous Integration With LabVIEW

PUSHING THE LIMITS OF LABVIEW

Questions

Questions?Thank you for participating!

26

Page 27: NIWeek 2012: Fire and Forget / Bulletproof Builds Using Continuous Integration With LabVIEW

PUSHING THE LIMITS OF LABVIEW

Need Help?

Let JKI build your CI system.Automated Build VIs

Source Code Control IntegrationUnit Test Design

Cloud-hosted Build ServersJenkins Setup, Integration, and Maintenance

Reliable, Repeatable, Secure.27

Page 28: NIWeek 2012: Fire and Forget / Bulletproof Builds Using Continuous Integration With LabVIEW

PUSHING THE LIMITS OF LABVIEW

Contact Us

jki.net /contact

28