Continuous Integration in a Java Environment. Developers / Time.

Slides:



Advertisements
Similar presentations
Change Management on the Cheap: Tortoise SVN and Ant Two Tools for your Applications Implementation Toolkit Joe Tseng North Slope Solutions
Advertisements

Continuous integration, delivery and deployment Primož Gabrijelčič thedelphigeek.com Primož Gabrijelčič thedelphigeek.com.
Page 1 October 31, 2000 An Introduction to Large-Scale Software Development Steve Varnau Core HP-UX Operation October 31, 2000.
Introduction to Maven 2.0 An open source build tool for Enterprise Java projects Mahen Goonewardene.
Continuous Integration (CI) By Jim Rush Version Control Build Test Report.
Jenkins User Conference San Francisco, Sept #jenkinsconf Business Process Model & Notation (BPMN) Workflows in Jenkins Max Spring Cisco
1. What is Subversion? Why do we need CM? Basic concepts Repositories Options Setup Clients Options Setup Operation Troubleshooting Slide 2.
Developing in CAS. Why? As distributed you edit CAS 3 with Eclipse and build with Maven 2 – Best Practice for Release Engineering – Difficult edit-debug.
Eralp Erat Senior Software Developer MCP,MCAD.NET,MCSD.NET.
Copyright  2002, Medical Present Value, Inc. All rights reserved. Copyright © 2010 Texas Education Agency. All rights reserved. TEA confidential and proprietary.
Validata Release Coordinator Accelerated application delivery through automated end-to-end release management.
Roadmap to Continuous Integration Testing and Benefits Gowri Selka, Walgreens Natalie Koltun, Walgreens May 20th, 2014 ©2013 Walgreen Co. All rights reserved.
CVS Selim Çıracı Ahmet Kara Metin Tekkalmaz. CVS – Open Source Version Control System Outline What are Version Control Systems? And why do we need them?
CS 501 : An Introduction to SCM & GForge An Introduction to SCM & GForge Lin Guo
Low level CASE: Source Code Management. Source Code Management  Also known as Configuration Management  Source Code Managers are tools that: –Archive.
Source Code Management Or Configuration Management: How I learned to Stop Worrying and Hate My Co-workers Less.
Source Control Repositories for Enabling Team Working Svetlin Nakov Telerik Corporation
Improving Software Quality with Continuous Integration
Continuous Integration Demonstration. Agenda 1.Continuous Integration Basics 2.Live Demonstration 3.Bamboo Concepts 4.Advantages 5.Version 2.0 Features.
By John Boal  Continuous Integration [CI] ◦ Automating the build process ◦ Build the entire system each time any new.
CONTINUOUS INTEGRATION, DELIVERY & DEPLOYMENT ONE CLICK DELIVERY.
THE CONTINUOUS DELIVERY ZONE Craig Berntson Chief Software Gardener Mojo Software Worx.
Version Control with Subversion. What is Version Control Good For? Maintaining project/file history - so you don’t have to worry about it Managing collaboration.
Ch 1. Introduction Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2012.
Craig Berntson Chief Software Gardener Mojo Software Worx Branches and Merges are Bears, Oh My!
Maven & Bamboo CONTINUOUS INTEGRATION. QA in a large organization In a large organization that manages over 100 applications and over 20 developers, implementing.
AUTOBUILD Build and Deployment Automation Solution.
MAVEN-BLUEMARTINI Yannick Robin. What is maven-bluemartini?  maven-bluemartini is Maven archetypes for Blue Martini projects  Open source project on.
Craig Berntson
Sumedha Rubasinghe October,2009 Introduction to Programming Tools.
Creating a Maintainable Software Ecosystem Jeremy D. Miller November 27th, 2007.
Subversion, an Open Source Version Control System An Introduction.
AUTOBUILD Build and Deployment Automation Solution.
1 Lecture 19 Configuration Management Software Engineering.
INFSOM-RI Juelich, 10 June 2008 ETICS - Maven From competition, to collaboration.
Design and Programming Chapter 7 Applied Software Project Management, Stellman & Greene See also:
Agile Development Infrastructure MUUG – June 13, 2006 Steve Moffat.
Contents 1.Introduction, architecture 2.Live demonstration 3.Extensibility.
Confidential Continuous Integration Framework (CIF) 5/18/2004.
Chapter 1 Introducing Ant. What is ant? Ant is a build tool  Automate the tasks of compiling code, running test, and packaging the results for redistribution.
Lecture XIII: Continuous Integration CS 4593 Cloud-Oriented Big Data and Software Engineering.
(1) Introduction to Continuous Integration Philip Johnson Collaborative Software Development Laboratory Information and Computer Sciences University of.
(1) Introduction to Continuous Integration Philip Johnson Collaborative Software Development Laboratory Information and Computer Sciences University of.
SPI NIGHTLIES Alex Hodgkins. SPI nightlies  Build and test various software projects each night  Provide a nightlies summary page that displays all.
Build and Deployment Process Understand NCI’s DevOps and continuous integration requirements Understand NCI’s build and distribution requirements.
Software Deployment & Release 26/03/2015 1EN-ICE.
Neil Kidd Developer Tools Technical Specialist Microsoft UK.
Build Tools 1. Building a program for a large project is usually managed by a build tool that controls the various steps involved. These steps may include:
Cruise Training Introduction of Continuous Integration.
8/29/10 Maven Repository Management with Nexus Jim McMahon.
JRA1 Meeting – 09/02/ Software Configuration Management and Integration EGEE is proposed as a project funded by the European Union under contract.
Maven. Introduction Using Maven (I) – Installing the Maven plugin for Eclipse – Creating a Maven Project – Building the Project Understanding the POM.
Source Control Repositories for Enabling Team Working Doncho Minkov Telerik Corporation
NALINI S. NAUTIYAL SYSTEM SOFTWARE DIVISION Subversion.
Avoiding the Pitfalls of Database Change Automation Cindy Bean Sr. Software Consultant DBmaestro SQLSaturday #514 – Houston, May 14, 2016.
ALM Deployment Pipeline Implementation. Create a Repeatable, Reliable Process for Releasing Software. Automate Almost Everything Keep Everything in Version.
1 © Agitar Software, 2007 Automated Unit Testing with AgitarOne Presented by Eamon McCormick Senior Solutions Consultant, Agitar Software Inc. Presented.
Joonas Sirén, Technology Architect, Emerging Technologies Accenture
Agenda:- DevOps Tools Chef Jenkins Puppet Apache Ant Apache Maven Logstash Docker New Relic Gradle Git.
Open-O Integration Project Introduction
Maven 04 March
Continuous Integration (CI)
X in [Integration, Delivery, Deployment]
YeahMobi CD Practice based on Container -- openstack meetup
Continuous Integration in a Java Environment
Module 01 ETICS Overview ETICS Online Tutorials
Continuous Integration
Continuous Integration Tool
Bringing more value out of automation testing
Continuous Integration
Presentation transcript:

Continuous Integration in a Java Environment

Developers / Time

Continuous Integration Teams integrate their work multiple times per day. Each integration is verified by an automated build Significantly reduces integration problems Develop cohesive software more rapidly Source: Martin Fowler

Five Principles of Continuous Integration Environments based on stability Maintain a code repository Commit frequently and build every commit Make the build self-testing Store every build

Environments Based on Stability

Environments based on stability Create server environments to model code stability Promote code to stricter environments as quality improves.

Production Environment Hardware Application servers – 8 application server 12 cores, 48 GB RAM – 10 web server 2 cores, 2 GB RAM Database servers – 4 web databases 4 cores, 16 GB, 2 SSD – 1 application database 12 cores, 48 GB RAM, 15 SSD

Stage Environment Hardware Application servers – 7 application server 4 cores, 4 GB RAM – 2 web server 2 cores, 2 GB RAM Database servers – 1 web database 4 cores, 16 GB, 8 SAS – 1 application database 8 cores, 16 GB RAM, 16 SATA Continuous Integration Server 2 cores, 4 GB RAM, 1 SATA

Test Environment Hardware Each team of 8 developers has a test environment – VM server 4 cores, 16 GB RAM – Database servers 4 cores, 24 GB RAM, 8 SATA drives Continuous Integration Server 8 cores, 16 GB RAM, 1 SATA drive

Dev Environment Hardware Application servers – Workstations with 4 cores, 8 GB RAM – One per developer Database servers – Shared with Test environment

Maintain a Code Repository

From CVS to Subversion Non-locking Atomic commits Good tool support Good enough branching Source of record for build server

Branching Make a copy of the code Isolation from other work Why not always branch?

Merging Extra complexity Hard integration Not continuous

Trunk – Where integration happens Committing Stable code to trunk Trunk is the source of record for the main build server When instability is introduced, stabilization is first priority

Release Branch/Tag Tag projects that need multiple versions Branch projects that need a single version Monthly create a release branch: – buslib → buslib-release (no version numbers!) – Not merged back to trunk Off cycle releases: – Cherry-pick small changes from trunk – Code reviewed

Commit Frequently Build Every Commit

Why are you afraid to commit? Change your habits – Commit small, functional changes – Unit tests! – Team owns the code, not the individual

The code builds on my box... Source code repository is the source of record Build server settles disputes – Only gets code from SVN Build server the final authority on stability/quality

Build every commit Why compile frequently? Why not integrate frequently? Agile principles – If it hurts, do it more often. – Many difficult activities can be made much more straightforward by doing them more frequently. – Reduce time between defect introduction and removal Automate the build – Key to continuous integration

Free Continuous Integration Servers Cruise Control (ThoughtWorks) – Yucky XML configuration – Commercial version (Cruise) is a rewrite Continuum (Apache) – Great Maven support – No plugins, ok user interface, and slow builds Hudson (Oracle) – Self updating and easy to administor – Many useful plugins – Great user interface – Scale out with additional nodes – Best by a wide margin

Build Server Hardware Maven and Java = lots of memory Compile and unit test = lots of CPU Static analysis = lots and lots of CPU 8 cores, 16GB RAM, 2 SATA Ubuntu Linux 8 parallel builds KEEP IT FAST

Make the Build Self-Testing

Guidelines to improving software quality Individual programmers <50% efficient at finding their own bugs Multiple quality methods = more defects discovered – Use 3 or more methods for >90% defect removal Most effective methods – design inspections – code inspections – Testing Source:

Actual Clearwater code – find the bugs if (summaryTable.size() == 0 || summaryTable == null) String stacktrace = getStackTrace(e, " "); stacktrace.replaceAll("\n", " "); if(lot.getTaxLotTransaction() == trade) if (total != Double.NaN && Math.abs(total ) > 1e-8) public abstract class AbstractReportController { private Logger _log = Logger.getLogger ("abstractFrontOfficeController"); private void func1() { List val = someFunction(); func2(val == null ? null : 25d); } private void func2(double d) {... }

Actual Clearwater code – find the bugs if (summaryTable.size() == 0 || summaryTable == null) String stacktrace = getStackTrace(e, " "); stacktrace.replaceAll("\n", " ");// replaceAll doesn't work like this // not only using == instead of equals(), but unrelated data types if(lot.getTaxLotTransaction() == trade) // doesn't work, have to use Double.isNaN() if (total != Double.NaN && Math.abs(total ) > 1e-8) // mismatched logger public abstract class AbstractReportController { private Logger _log = Logger.getLogger ("abstractFrontOfficeController"); private void func1() { List val = someFunction(); func2(val == null ? null : 25d);// NPE if val == null, promotions to Double } private void func2(double d) {... }

Self Testing Builds System Tests – End-to-end test – Often take minutes to hours to run Unit tests – Fast No database or file system – Focused Pinpoint problems – Best method for verifying builds

Automated Quality with Continuous Integration Static code analysis – Looks for common java bugs (Findbugs, PMD) – Check for code compliance (Checkstyle) Unit test analysis – Measure coverage (Cobertura) – Look for hotspots, areas of low testing and high complexity (SONAR)

SONAR + Hudson Hudson builds the code SONAR runs after each build SONAR alert thresholds can 'break' the build Automate quality improvements

SONAR Dashboard

SONAR Defect Detection: Violation Drilldown

SONAR Test Coverage: Clouds

SONAR Design Analysis: Package Cycles

System Regression test In general – Long running tests are sometime necessary – Cannot test every build – Test as often as possible – Localize defect to single build Our tests – 12 hours for a full run – Every night – Takes hours of manual labor – Binary search to pinpoint

Store Every Build (within reason)

Ant vs Maven Ant – IDE generated files – Large and ugly – Not portable Maven – Small XML configuration – Great cross platform support – Automatic dependency download – Just works (most of the time)

Maven Versions Use release versions for 3 rd party libraries Version internal libraries that need multiple active copies Use release branches and no version for service oriented libraries (database model)

Artifact Repository Keep built libraries in local Maven repository Nexus proxies Maven Central and stores local libraries Hudson pushes to Nexus Hudson keeps builds of deployable project

Automate Code Deployment Deploy the Hudson-built code only, no developer builds One click deploy from Hudson Deploy code first to staging environment then production Few deployment defects since adopting this method

Automated Database Deployment with Liquibase SQL scripts in subversion Deployed: – Dev – Test Hudson Integration – Immediate – Scheduled – After code deployment Used to build DBA release script Make scripts repeatable!

Questions?

Resources Hudson ( SONAR ( Nexus ( Maven ( Liquibase ( SVN (