how automated cloud infrastructure setups can help with continuous delivery

28
Donnerstag, 19. September 13

Upload: edmund-siegfried-haselwanter

Post on 06-May-2015

403 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: How automated cloud infrastructure setups can help with Continuous Delivery

Donnerstag, 19. September 13

Page 2: How automated cloud infrastructure setups can help with Continuous Delivery

“How automated cloud infrastructure setups can help with Continuous Delivery”Edmund Haselwanter, [email protected], @ehaselwanter

Donnerstag, 19. September 13

Page 3: How automated cloud infrastructure setups can help with Continuous Delivery

cloudbau

Why Continuous Delivery?

„IT REVOLUTION MANIFESTO“, http://itrevolution.com

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.

Gene Kim, Kevin Behr, George Spafford, 2013

E.M. Goldratt, 1984

Theory of Constraints → →

Donnerstag, 19. September 13

Page 4: How automated cloud infrastructure setups can help with Continuous Delivery

cloudbau

Wikipedia: http://en.wikipedia.org/wiki/Continuous_delivery

● Version Control

● Continuous Integration

● Automated Testing

● Continuous Deployment

Continuous Delivery

Donnerstag, 19. September 13

Page 5: How automated cloud infrastructure setups can help with Continuous Delivery

cloudbau

We got the so!ware development part right!

The core, chronic con!ict 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). 

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

small changes, o!en

reproducible

standardized

Request Approve

Test Deploy

Develop

Water-

Scrum

- FallGene Kim

expect failure

culture change Dev+Ops

feedback (e.g. tests/metrics/...)

Donnerstag, 19. September 13

Page 6: How automated cloud infrastructure setups can help with Continuous Delivery

cloudbau

The Last Mile: Dev/Test/Prod Parity

● Hardware con#guration (e.g. amount of RAM, HDD vs. SSD)

● So$ware used (e.g. sqlite in dev, mysql in prod)

● So$ware/library versions

● Deployment (e.g. automated for test, manual for prod)

● System con#guration (debug !ags, 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/

Donnerstag, 19. September 13

Page 7: How automated cloud infrastructure setups can help with Continuous Delivery

cloudbau

The Last Mile: Dev/Test/Prod Parity

● Log level “normal” to chatty on production

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

● Changes in external dependencies (Sun Java to Oracle Java)

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

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

● Different hardware: 32 vs. 64 bit. libraries missing

● Different hardware: optimized CPU !ags on CI system. build not working in prod

● Staging In-house, Prod AWS Cloud: Latency ok during staging test, problem on production

● Snow!ake back-port: Live Tuning of Kernel/Mysql parameters, got lost a$er re-install

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

See also http://12factor.net/

Donnerstag, 19. September 13

Page 8: How automated cloud infrastructure setups can help with Continuous Delivery

cloudbau

● ] Getting to the solution...

Donnerstag, 19. September 13

Page 9: How automated cloud infrastructure setups can help with Continuous Delivery

cloudbau

Application

Infrastructure as Code

Infrastructure

Environment

Donnerstag, 19. September 13

Page 10: How automated cloud infrastructure setups can help with Continuous Delivery

cloudbau

Building Blocks: Tools and Culture

CPU-Virt.

Storage-Virt.

SDN

Con!g-DB

Programmable Infrastructure (Cloud) Executeable System Description

Processes and Culture

Continuos Delivery

DevOpsCross-Functional Teams

Continuous Build

Anti-Fragile Organizations

Binary-Repo System DescriptionOrchestration

Prod Env Stage Env Dev Env

Donnerstag, 19. September 13

Page 11: How automated cloud infrastructure setups can help with Continuous Delivery

cloudbau

● Chef/Puppet/Cfengine/.... for con#g

● Dependency management (for programming languages, packages etc.)

● Dependency management for con#g scripts as well (e.g. Berkshelf for chef)

● Everything in version control

● Infrastructure can still be different...

First... automate and equalize all environments

Donnerstag, 19. September 13

Page 12: How automated cloud infrastructure setups can help with Continuous Delivery

cloudbau

● Encode the infrastructure as well

● Describe all the pieces of the infrastructure in code

● Now it’s code: it can be dynamic!

... then use a cloud to equalize infrastructure!

Donnerstag, 19. September 13

Page 13: How automated cloud infrastructure setups can help with Continuous Delivery

cloudbau

Infrastructure as Code => We need a process

But ... There be dragons

Source Code

Compiler

Artifact

Test X

Donnerstag, 19. September 13

Page 14: How automated cloud infrastructure setups can help with Continuous Delivery

cloudbau

● OpenStack / Eucalyptus / ...

● Chef/Puppet/Cfengine/ ...

● Jenkins (Building and testing the SW but also infrastructures)

● Net"ixOSS (Asgard + Aminate)

The implementation patterns using OSS

Donnerstag, 19. September 13

Page 15: How automated cloud infrastructure setups can help with Continuous Delivery

cloudbau

● The So!ware Package itself

● The whole VM

● A prepared container

● ...

New Question in the Cloud Era: What is my deploy Artifact

Donnerstag, 19. September 13

Page 16: How automated cloud infrastructure setups can help with Continuous Delivery

cloudbau

● The build artifact is a binary.

● Use IaaS API to create the environment

● Deployment is a!er the server creation

● Deploy with automation or any other tool

● The whole VM

● “from source” is just a special case

The So!ware Package is the Artifact

Donnerstag, 19. September 13

Page 17: How automated cloud infrastructure setups can help with Continuous Delivery

cloudbau

HP Cloud + Jenkins + Puppet

Jenkins

Binary Repo

Puppet Modules

HP Cloud Servers

(OpenStack)

Donnerstag, 19. September 13

Page 18: How automated cloud infrastructure setups can help with Continuous Delivery

cloudbau

● 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

The VM itself is the Artifact

Donnerstag, 19. September 13

Page 19: How automated cloud infrastructure setups can help with Continuous Delivery

cloudbau

Jenkins + AWS + Asgard + Aminate + Chef

AMIsJenkins Asgard

AWS EC2 (ASG + ELB)

Aminate

+ Chef

Donnerstag, 19. September 13

Page 20: How automated cloud infrastructure setups can help with Continuous Delivery

cloudbau

● Optimization of the VM idea

● Transportable lightweight OS containers (e.g. LXC/docker)

● Very o$en back to upgrade/deploy

● Needs external orchestration as well

● Very new toolchain emerging (docker/maestro)

A container is the Artifact

Donnerstag, 19. September 13

Page 21: How automated cloud infrastructure setups can help with Continuous Delivery

cloudbau

https://www.docker.io/the_whole_story/

Donnerstag, 19. September 13

Page 22: How automated cloud infrastructure setups can help with Continuous Delivery

cloudbau

Jenkins + docker + cfengine + Aminate + Chef

Host VM Jenkins Maestro

AWS EC2 (ASG + ELB)

Docker

+ cfengine

Donnerstag, 19. September 13

Page 23: How automated cloud infrastructure setups can help with Continuous Delivery

cloudbau

● 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

Cloud can help with developer environments as well

Donnerstag, 19. September 13

Page 24: How automated cloud infrastructure setups can help with Continuous Delivery

cloudbau

OpenStack + Vagrant + Chef

JenkinsBinary Repo

Chef Repo / Server

OpenStack Servers

Vagrant

Donnerstag, 19. September 13

Page 25: How automated cloud infrastructure setups can help with Continuous Delivery

cloudbau

● 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)

One more Thing: Other Areas Cloud can help

Donnerstag, 19. September 13

Page 26: How automated cloud infrastructure setups can help with Continuous Delivery

cloudbau

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

● OpenSource Orchestration Engines (like OpenStack Heat)

● Net"ixOSS working on OpenStack

What’s missing in the OpenSource Ecosystem?

Donnerstag, 19. September 13

Page 27: How automated cloud infrastructure setups can help with Continuous Delivery

cloudbau

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

● Log#les

● Metric driven autoscaling

Don’t forget about Operations

Donnerstag, 19. September 13

Page 28: How automated cloud infrastructure setups can help with Continuous Delivery

cloudbau

Thank you! Questions?

Donnerstag, 19. September 13