Continuous Delivery and Infrastructure as Code

44
Sascha Möllering | ZANOX.de AG Continuous Delivery and Infrastructure as Code

description

Continuous Delivery and Infrastructure as Code W-JAX 2013 slides

Transcript of Continuous Delivery and Infrastructure as Code

Page 1: Continuous Delivery and Infrastructure as Code

Sascha Möllering | ZANOX.de AG

Continuous Delivery and Infrastructure as Code

Page 2: Continuous Delivery and Infrastructure as Code

About me

Sascha MölleringSoftware Engineering Team Lead

[email protected]

http://www.der-maschinenstuermer.de/

@sascha242

Page 3: Continuous Delivery and Infrastructure as Code

TABLE OF CONTENTS• Problem?• Solution!• Continuous Delivery • Infrastructure as Code• Chef and JBoss• Q&A

Page 4: Continuous Delivery and Infrastructure as Code

TABLE OF CONTENTS• Problem?• Solution!• Continuous Delivery • Infrastructure as Code• Chef and JBoss• Q&A

Page 5: Continuous Delivery and Infrastructure as Code
Page 6: Continuous Delivery and Infrastructure as Code

Problem?• Situation two years ago:

– Manual server setup– Manual deployment– Deployed files contain a lot of changes– Rollbacks difficult– Time slots for deployments (biweekly)– Windows environment– ...

Page 7: Continuous Delivery and Infrastructure as Code
Page 8: Continuous Delivery and Infrastructure as Code

TABLE OF CONTENTS• Problem?• Solution!• Continuous Delivery • Infrastructure as Code• Chef and JBoss• Q&A

Page 9: Continuous Delivery and Infrastructure as Code

Solution!• Now:

– Automated deployments – Infrastructure as Code– Only small changes – Rollbacks are easy– Deploy whenever you want!– Linux environment– ...

Page 10: Continuous Delivery and Infrastructure as Code
Page 11: Continuous Delivery and Infrastructure as Code

DELIVER

HIGH QUALITY SOFTWARE

AT LOW RISK

FAST,

ANYTIME

BY THE PRODUCT TEAMS THEMSELVES!!!

Page 12: Continuous Delivery and Infrastructure as Code

Solution!• Etsy• Github• Flickr• Facebook• Amazon

25 deployments / day

40 deployments / day

60 deployments / day

Up to 100 deployments / day

Deployment every 11.6 sec

Page 13: Continuous Delivery and Infrastructure as Code

TABLE OF CONTENTS• Problem?• Solution!• Continuous Delivery • Infrastructure as Code• Chef and JBoss• Q&A

Page 16: Continuous Delivery and Infrastructure as Code
Page 17: Continuous Delivery and Infrastructure as Code

Continuous Delivery• Standardize

– Naming conventions – Platform– Infrastructure

• Fully automated release processes to Live-System

• Empower teams to release by themselves

Page 18: Continuous Delivery and Infrastructure as Code

Continuous Delivery• Automate all the tests• Introduce ATDD/BDD patterns• Static code analysis• Automated quality gates

Page 19: Continuous Delivery and Infrastructure as Code

Continuous Delivery

Page 20: Continuous Delivery and Infrastructure as Code

Continuous Delivery

Page 21: Continuous Delivery and Infrastructure as Code

Continuous Delivery

Metrics

Monitoring

Alerting

Page 22: Continuous Delivery and Infrastructure as Code

Continuous Delivery

Metrics

Monitoring

Alerting

Page 23: Continuous Delivery and Infrastructure as Code

Continuous Delivery

Monitoring

Page 24: Continuous Delivery and Infrastructure as Code

Continuous Delivery

Monitoring

Page 25: Continuous Delivery and Infrastructure as Code

TABLE OF CONTENTS• Problem?• Solution!• Continuous Delivery • Infrastructure as Code• Chef and JBoss• Q&A

Page 26: Continuous Delivery and Infrastructure as Code

Infrastructure as Code• Infrastructure is treated like code

– tag, branch and release – testing

• Predictable outcome• Removing manual steps• Tools like Chef or Puppet

Page 27: Continuous Delivery and Infrastructure as Code
Page 28: Continuous Delivery and Infrastructure as Code

Infrastructure as Code

"Chef is like a little system admin robot ... you tell it how you want your system configured, and it will do all the dirty work.”

Page 29: Continuous Delivery and Infrastructure as Code

Infrastructure as Code

Page 30: Continuous Delivery and Infrastructure as Code

Infrastructure as Code

Page 31: Continuous Delivery and Infrastructure as Code

Infrastructure as Code

Page 32: Continuous Delivery and Infrastructure as Code

Infrastructure as Code

Page 33: Continuous Delivery and Infrastructure as Code

Infrastructure as Code

Page 34: Continuous Delivery and Infrastructure as Code

TABLE OF CONTENTS• Problem?• Solution!• Continuous Delivery • Infrastructure as Code• Chef and JBoss• Q&A

Page 36: Continuous Delivery and Infrastructure as Code

Chef & JBoss

• Automatic deployment of JBoss AS using Chef

• Components:• JBoss EAP 5/6 preconfigured in SVN• Jmxtrans for monitoring• DataSources managed in SVN• Stage is a system-property• Twiddle is used to apply node-specific

configurations

Page 37: Continuous Delivery and Infrastructure as Code

Chef & JBoss

Page 38: Continuous Delivery and Infrastructure as Code

Chef & JBoss

Page 39: Continuous Delivery and Infrastructure as Code

Chef & JBossEAP 5:

EAP 6:

Page 40: Continuous Delivery and Infrastructure as Code

Chef & JBoss

• Wrapper around twiddle.sh• Parameters piped into a txt-file• After server-start:

• Txt-file analyzed• If file contains twiddle-commands• Twiddle-commands executed

Page 41: Continuous Delivery and Infrastructure as Code

Chef & JBoss

Fabric

Page 42: Continuous Delivery and Infrastructure as Code

Chef & JBoss• Fabric

– Python library and command-line tool – Streamlining the use of SSH– Application deployment– Used to deploy apps from Nexus– https://github.com/fabric/fabric

Page 43: Continuous Delivery and Infrastructure as Code

Lessons learned• Infrastructure as Code is hard• Continuous Delivery is hard• But: mindset change is even harder• Safety net is necessary• Continuous improvement• There is no „silver bullet“

Page 44: Continuous Delivery and Infrastructure as Code