Donnerstag, 19. September 13
“How automated cloud infrastructure setups
can help with Continuous Delivery”
Edmund Haselwanter, eh@cloudbau.de, @ehaselwanter

Donnerstag, 19. September 13
Why Continuous Delivery?
For most companies, IT functions as the nervous system and provides
an increasing amount of the organizational muscle mass. Most critical
business functions are entirely automated within IT, and 95% of all
capital projects depend on IT to get done. Today, nearly every business
decision will result in at least one IT change.
„IT REVOLUTION MANIFESTO“, http://itrevolution.com

Theory of
Constraints

→

→
E.M. Goldratt, 1984

cloudbau
Donnerstag, 19. September 13

Gene Kim, Kevin Behr,
George Spafford, 2013
Continuous Delivery
Wikipedia: http://en.wikipedia.org/wiki/Continuous_delivery

â—Ź
â—Ź
â—Ź
â—Ź

Version Control
Continuous Integration
Automated Testing
Continuous Deployment

cloudbau
Donnerstag, 19. September 13
We got the software development part right!
Request

Approve

Develop

Test

WaterScrum

Deploy

- Fall

The core, chronic conflict that every IT
leader faces is the need to
simultaneously enable faster time to
market (i.e., make as many changes as
you can), while providing stable, secure
and reliable IT services (i.e., make as
few changes as you can). 
Gene Kim

„Lowering risk of change through tools and culture“
John Allspaw, Paul Hammond, 2009 (Flickr)

small changes, often
reproducible

Donnerstag, 19. September 13

culture change Dev+Ops

standardized

cloudbau

expect failure
feedback (e.g. tests/metrics/...)
The Last Mile: Dev/Test/Prod Parity
â—Ź
â—Ź
â—Ź
â—Ź
â—Ź
â—Ź
â—Ź
â—Ź

Hardware configuration (e.g. amount of RAM, HDD vs. SSD)
Software used (e.g. sqlite in dev, mysql in prod)
Software/library versions
Deployment (e.g. automated for test, manual for prod)
System configuration (debug flags, logging)
External dependencies (dev: payment mocked out vs. prod: real gateway)
Database contents (huge prod DB with millions of entries vs. few entries in dev)
Operating system (e.g. dev: Mac OS X, prod: Linux)

See also http://12factor.net/

cloudbau
Donnerstag, 19. September 13
The Last Mile: Dev/Test/Prod Parity
â—Ź
â—Ź

Log level “normal” to chatty on production

â—Ź
â—Ź

Changes in external dependencies (Sun Java to Oracle Java)

â—Ź
â—Ź
â—Ź
â—Ź

SQL Query no problem in dev environment but too slow for production data

â—Ź
â—Ź

Snowflake back-port: Live Tuning of Kernel/Mysql parameters, got lost after re-install

CI build broken due to minor version change in upstream mocking framework (0.4.1 to
0.4.2)

Sessions invalid in production due to time difference on multiple servers. No problem in
dev environment (just one app and one db server)

Different hardware: 32 vs. 64 bit. libraries missing
Different hardware: optimized CPU flags on CI system. build not working in prod
Staging In-house, Prod AWS Cloud: Latency ok during staging test, problem on
production

Development on Mac OSX/Windows, deploy on Linux: File not found (case sensitive)

See also http://12factor.net/

cloudbau
Donnerstag, 19. September 13
Getting to the solution...

cloudbau
Donnerstag, 19. September 13
Infrastructure as Code

Application

Environment

Infrastructure

cloudbau
Donnerstag, 19. September 13
Building Blocks: Tools and Culture
Config-DB

CPUVirt.
Binary-Repo

StorageVirt.
SDN

System Description
Orchestration

Prod Env

Programmable Infrastructure (Cloud)

Continuos Delivery

Anti-Fragile Organizations

Cross-Functional Teams

Processes and Culture

cloudbau
Donnerstag, 19. September 13

Dev Env

Executeable System Description

Continuous Build
DevOps

Stage Env
First... automate and equalize all
environments
â—Ź
â—Ź
â—Ź
â—Ź
â—Ź

Chef/Puppet/Cfengine/.... for config
Dependency management (for programming languages, packages etc.)
Dependency management for config scripts as well (e.g. Berkshelf for chef)
Everything in version control
Infrastructure can still be different...

cloudbau
Donnerstag, 19. September 13
... then use a cloud to equalize
infrastructure!

â—Ź
â—Ź
â—Ź

Encode the infrastructure as well
Describe all the pieces of the infrastructure in code
Now it’s code: it can be dynamic!

cloudbau
Donnerstag, 19. September 13
But ... There be dragons
Infrastructure as Code => We need a process

Source
Code
Test

X

Compiler
Artifact

cloudbau
Donnerstag, 19. September 13
The implementation patterns using OSS

â—Ź OpenStack / Eucalyptus / ...
â—Ź Chef/Puppet/Cfengine/ ...
â—Ź Jenkins (Building and testing the SW but also
infrastructures)

â—Ź NetflixOSS (Asgard + Aminate)

cloudbau
Donnerstag, 19. September 13
New Question in the Cloud Era: What is my
deploy Artifact

â—Ź The Software Package itself
â—Ź The whole VM
â—Ź A prepared container
â—Ź ...

cloudbau
Donnerstag, 19. September 13
The Software Package is the Artifact

â—Ź The build artifact is a binary.
â—Ź Use IaaS API to create the environment
â—Ź Deployment is after the server creation
â—Ź Deploy with automation or any other tool
â—Ź The whole VM
● “from source” is just a special case

cloudbau
Donnerstag, 19. September 13
HP Cloud + Jenkins + Puppet

Binary Repo

HP Cloud Servers
(OpenStack)

Jenkins

Puppet Modules

cloudbau
Donnerstag, 19. September 13
The VM itself is the Artifact

â—Ź Build artifact is a image (optimal for stateless service)
â—Ź Only install needed, there is no upgrade/deploy
â—Ź IaaS must support Loadbalancer as a service (or something similar)
â—Ź Orchestration for deployment steps needed

cloudbau
Donnerstag, 19. September 13
Jenkins + AWS + Asgard + Aminate + Chef

Jenkins

Aminate

AMIs

Asgard

+ Chef

AWS EC2 (ASG + ELB)

cloudbau
Donnerstag, 19. September 13
A container is the Artifact

â—Ź
â—Ź
â—Ź
â—Ź
â—Ź

cloudbau
Donnerstag, 19. September 13

Optimization of the VM idea
Transportable lightweight OS containers (e.g. LXC/docker)
Very often back to upgrade/deploy
Needs external orchestration as well
Very new toolchain emerging (docker/maestro)
https://www.docker.io/the_whole_story/

cloudbau
Donnerstag, 19. September 13
Jenkins + docker + cfengine + Aminate +
Chef

Jenkins

Docker

Host VM

Maestro

+ cfengine

AWS EC2 (ASG + ELB)

cloudbau
Donnerstag, 19. September 13
Cloud can help with developer environments
as well

â—Ź
â—Ź
â—Ź
â—Ź

cloudbau
Donnerstag, 19. September 13

Have your own environment
Brings the production setup to the developer
One description for local VM and Cloud environment (Dev/Prod)
Needs external orchestration as well
OpenStack + Vagrant + Chef
Chef Repo / Server

Binary Repo
Jenkins

Vagrant

cloudbau
Donnerstag, 19. September 13

OpenStack Servers
One more Thing: Other Areas Cloud can
help

â—Ź Persistent Data: Copy/Clone Production Data to test migrations
â—Ź Debugging: Developer can stand up whole environment (even with data)
â—Ź Backup/Restore (snapshot whole images/servers for rollback)

cloudbau
Donnerstag, 19. September 13
What’s missing in the OpenSource
Ecosystem?

â—Ź Better Orchestration/ Pipeline support in Jenkins (Commercial CI-Servers
are advanced here)

â—Ź OpenSource Orchestration Engines (like OpenStack Heat)
â—Ź NetflixOSS working on OpenStack

cloudbau
Donnerstag, 19. September 13
Don’t forget about Operations

● Cloud/App-Monitoring Solutions (Nagios won’t cut it in dynamic
environments)

â—Ź Logfiles
â—Ź Metric driven autoscaling

cloudbau
Donnerstag, 19. September 13
Thank you! Questions?

cloudbau
Donnerstag, 19. September 13

How automated cloud infrastructure setups can help with Continuous Delivery

  • 1.
  • 2.
    “How automated cloudinfrastructure setups can help with Continuous Delivery” Edmund Haselwanter, eh@cloudbau.de, @ehaselwanter Donnerstag, 19. September 13
  • 3.
    Why Continuous Delivery? Formost companies, IT functions as the nervous system and provides an increasing amount of the organizational muscle mass. Most critical business functions are entirely automated within IT, and 95% of all capital projects depend on IT to get done. Today, nearly every business decision will result in at least one IT change. „IT REVOLUTION MANIFESTO“, http://itrevolution.com Theory of Constraints → → E.M. Goldratt, 1984 cloudbau Donnerstag, 19. September 13 Gene Kim, Kevin Behr, George Spafford, 2013
  • 4.
    Continuous Delivery Wikipedia: http://en.wikipedia.org/wiki/Continuous_delivery â—Ź â—Ź â—Ź â—Ź VersionControl Continuous Integration Automated Testing Continuous Deployment cloudbau Donnerstag, 19. September 13
  • 5.
    We got thesoftware development part right! Request Approve Develop Test WaterScrum Deploy - Fall The core, chronic conflict that every IT leader faces is the need to simultaneously enable faster time to market (i.e., make as many changes as you can), while providing stable, secure and reliable IT services (i.e., make as few changes as you can).  Gene Kim „Lowering risk of change through tools and culture“ John Allspaw, Paul Hammond, 2009 (Flickr) small changes, often reproducible Donnerstag, 19. September 13 culture change Dev+Ops standardized cloudbau expect failure feedback (e.g. tests/metrics/...)
  • 6.
    The Last Mile:Dev/Test/Prod Parity â—Ź â—Ź â—Ź â—Ź â—Ź â—Ź â—Ź â—Ź Hardware configuration (e.g. amount of RAM, HDD vs. SSD) Software used (e.g. sqlite in dev, mysql in prod) Software/library versions Deployment (e.g. automated for test, manual for prod) System configuration (debug flags, logging) External dependencies (dev: payment mocked out vs. prod: real gateway) Database contents (huge prod DB with millions of entries vs. few entries in dev) Operating system (e.g. dev: Mac OS X, prod: Linux) See also http://12factor.net/ cloudbau Donnerstag, 19. September 13
  • 7.
    The Last Mile:Dev/Test/Prod Parity ● ● Log level “normal” to chatty on production ● ● Changes in external dependencies (Sun Java to Oracle Java) ● ● ● ● SQL Query no problem in dev environment but too slow for production data ● ● Snowflake back-port: Live Tuning of Kernel/Mysql parameters, got lost after re-install CI build broken due to minor version change in upstream mocking framework (0.4.1 to 0.4.2) Sessions invalid in production due to time difference on multiple servers. No problem in dev environment (just one app and one db server) Different hardware: 32 vs. 64 bit. libraries missing Different hardware: optimized CPU flags on CI system. build not working in prod Staging In-house, Prod AWS Cloud: Latency ok during staging test, problem on production Development on Mac OSX/Windows, deploy on Linux: File not found (case sensitive) See also http://12factor.net/ cloudbau Donnerstag, 19. September 13
  • 8.
    Getting to thesolution... cloudbau Donnerstag, 19. September 13
  • 9.
  • 10.
    Building Blocks: Toolsand Culture Config-DB CPUVirt. Binary-Repo StorageVirt. SDN System Description Orchestration Prod Env Programmable Infrastructure (Cloud) Continuos Delivery Anti-Fragile Organizations Cross-Functional Teams Processes and Culture cloudbau Donnerstag, 19. September 13 Dev Env Executeable System Description Continuous Build DevOps Stage Env
  • 11.
    First... automate andequalize all environments â—Ź â—Ź â—Ź â—Ź â—Ź Chef/Puppet/Cfengine/.... for config Dependency management (for programming languages, packages etc.) Dependency management for config scripts as well (e.g. Berkshelf for chef) Everything in version control Infrastructure can still be different... cloudbau Donnerstag, 19. September 13
  • 12.
    ... then usea cloud to equalize infrastructure! ● ● ● Encode the infrastructure as well Describe all the pieces of the infrastructure in code Now it’s code: it can be dynamic! cloudbau Donnerstag, 19. September 13
  • 13.
    But ... Therebe dragons Infrastructure as Code => We need a process Source Code Test X Compiler Artifact cloudbau Donnerstag, 19. September 13
  • 14.
    The implementation patternsusing OSS â—Ź OpenStack / Eucalyptus / ... â—Ź Chef/Puppet/Cfengine/ ... â—Ź Jenkins (Building and testing the SW but also infrastructures) â—Ź NetflixOSS (Asgard + Aminate) cloudbau Donnerstag, 19. September 13
  • 15.
    New Question inthe Cloud Era: What is my deploy Artifact â—Ź The Software Package itself â—Ź The whole VM â—Ź A prepared container â—Ź ... cloudbau Donnerstag, 19. September 13
  • 16.
    The Software Packageis the Artifact ● The build artifact is a binary. ● Use IaaS API to create the environment ● Deployment is after the server creation ● Deploy with automation or any other tool ● The whole VM ● “from source” is just a special case cloudbau Donnerstag, 19. September 13
  • 17.
    HP Cloud +Jenkins + Puppet Binary Repo HP Cloud Servers (OpenStack) Jenkins Puppet Modules cloudbau Donnerstag, 19. September 13
  • 18.
    The VM itselfis the Artifact â—Ź Build artifact is a image (optimal for stateless service) â—Ź Only install needed, there is no upgrade/deploy â—Ź IaaS must support Loadbalancer as a service (or something similar) â—Ź Orchestration for deployment steps needed cloudbau Donnerstag, 19. September 13
  • 19.
    Jenkins + AWS+ Asgard + Aminate + Chef Jenkins Aminate AMIs Asgard + Chef AWS EC2 (ASG + ELB) cloudbau Donnerstag, 19. September 13
  • 20.
    A container isthe Artifact â—Ź â—Ź â—Ź â—Ź â—Ź cloudbau Donnerstag, 19. September 13 Optimization of the VM idea Transportable lightweight OS containers (e.g. LXC/docker) Very often back to upgrade/deploy Needs external orchestration as well Very new toolchain emerging (docker/maestro)
  • 21.
  • 22.
    Jenkins + docker+ cfengine + Aminate + Chef Jenkins Docker Host VM Maestro + cfengine AWS EC2 (ASG + ELB) cloudbau Donnerstag, 19. September 13
  • 23.
    Cloud can helpwith developer environments as well â—Ź â—Ź â—Ź â—Ź cloudbau Donnerstag, 19. September 13 Have your own environment Brings the production setup to the developer One description for local VM and Cloud environment (Dev/Prod) Needs external orchestration as well
  • 24.
    OpenStack + Vagrant+ Chef Chef Repo / Server Binary Repo Jenkins Vagrant cloudbau Donnerstag, 19. September 13 OpenStack Servers
  • 25.
    One more Thing:Other Areas Cloud can help â—Ź Persistent Data: Copy/Clone Production Data to test migrations â—Ź Debugging: Developer can stand up whole environment (even with data) â—Ź Backup/Restore (snapshot whole images/servers for rollback) cloudbau Donnerstag, 19. September 13
  • 26.
    What’s missing inthe OpenSource Ecosystem? ● Better Orchestration/ Pipeline support in Jenkins (Commercial CI-Servers are advanced here) ● OpenSource Orchestration Engines (like OpenStack Heat) ● NetflixOSS working on OpenStack cloudbau Donnerstag, 19. September 13
  • 27.
    Don’t forget aboutOperations ● Cloud/App-Monitoring Solutions (Nagios won’t cut it in dynamic environments) ● Logfiles ● Metric driven autoscaling cloudbau Donnerstag, 19. September 13
  • 28.