Infrastructure as Code

32
Infrastructure as Code Merging Development and Operations for a more effective application development process FIN talk Ryan Roark Clement Yu Robert Greiner February 19, 2014

Transcript of Infrastructure as Code

Page 1: Infrastructure as Code

Infrastructure as CodeMerging Development and Operations for a more

effective application development process

FIN talkRyan RoarkClement Yu

Robert Greiner

February 19, 2014

Page 2: Infrastructure as Code

Table of Contents1. The Problem

2. Infrastructure

3. Application

4. Code

5. Putting it all together

6. AWS Goodness

7. Wrapping Up

Page 3: Infrastructure as Code

CHAPTERThe Problem(s)

Page 4: Infrastructure as Code

Developers

• Take requirements• Write Code• Write Tests (Maybe)• Manual Testing• Refactor

• Developers create

Page 5: Infrastructure as Code

Operations

• Server Admins• DBAs• Release• Networking• Security• Monitoring

• Operators maintain

People who deal with applications after they are created

Page 6: Infrastructure as Code

Typical Software Development Flow

Write Code(Dev)

Create Tests Run all TestsDeploy to Dev/QA (Ops)

Integration Tests

QA TestsDeploy to

UAT

More Testing – Regression

(QA)

Performance Tests

Configure Production

Environment

Buy Hardware

Install OS / Software

Provision Database

Upgrade RAM

Deploy to Production

Manual

Time Consuming

Page 7: Infrastructure as Code

Poll: How long does it take to provision a new

server at your client?

Page 8: Infrastructure as Code

SpaceX launches 1 rocket every 4 weeks

Page 9: Infrastructure as Code

DevOps

DevOps is the practice of operations and development engineers participating together in the entire service lifecycle, from design through the development process to production support. (TheAgileAdmin)

Page 10: Infrastructure as Code

The New Normal

It’s up to us as developers to help enable our operations counterparts. We can use our skills to teach others how to make their jobs easier, so our jobs become easier.

This requires developers to gain skills in operations: networking, OS, patching, deployments, etc…

Every systems administrator should know Ruby and every Developer should know how to configure an automated deployment on a Windows or Linux server they setup themselves

Page 11: Infrastructure as Code

CHAPTERInfrastructure

Page 12: Infrastructure as Code

Infrastructure Automation• Write your code and write the infrastructure it

runs on• Servers, Networking, Users, etc…

• Documented, Repeatable, and Fast

• Fixing Deployment Pains• A/B Deployments (blue/green)

• Rolling Deployments

Page 13: Infrastructure as Code

Infrastructure Tooling• CloudFormation for AWS

• Template driven design with JSON

• Templates versioned like code

• AWS::CloudFormation::Init• Bootstrap other processes

• OPSWorks & Elastic BeanStalk for AWS

• Demo CloudFormation

Page 14: Infrastructure as Code

Non-AWS Infrastructure• Manual Labor

• Server admin physical installation

• Error Prone

• Chef-Provisioning

• VMWare VirtualCenter

• Heat for OpenStack

• Azure PaaS

Page 15: Infrastructure as Code

CHAPTERApplication

Page 16: Infrastructure as Code

Configuration Management

• Transform any server quickly• Build it as a web server, DB server, etc.• Automate build process

• Install and configuration steps are saved as code• Re-configure quickly• Avoid dependency issues

Page 17: Infrastructure as Code

Configuration Tools

• Powerful• Robust• Written

in Ruby• Developer-

friendly• Steep learning

curve for sys-admins

• Mature• Built for sys-

admins• Easy JSON

data structure• Master pushes

changes to agents

• AWS version of Chef

• Free to use with instances

Page 18: Infrastructure as Code

CHAPTERCode

Page 19: Infrastructure as Code

Continuous IntegrationDeploy your code quickly, consistently,

and often• Practice Deploying Code

• Detect problems faster• Automatically build code & run tests

• Eliminate the “well it works on my machine”

dilemma

• Encourages public shaming

Page 20: Infrastructure as Code

CI in the Sky Cloud• Code Deploy

• Hook into source control and automate your

deployments to an elastic set of resources

• Code Pipeline• Continuous delivery and software release automation

• Code Commit• Code is ‘closer’ to servers it runs on

• Integrates with CodeDeploy and CodePipeline

• Demo Code Deploy

Page 21: Infrastructure as Code

Automation outside AWS• Jenkins

• Self hosted CI Server

• Travis-CI• Hosted CI Server

• TFS / VisualStudio.com• Does a little of EVERYTHING

• Easily integrate with Azure

Page 22: Infrastructure as Code

SummaryINFRASTRUCTURE

• Automatically provision physical hardware

• Unique deployment strategies

• Documented and versioned environment configurations

APPLICATION

• Transform a server into web or database server

• Reduce number of steps in configuration

CODE

• Automatically build, test, and deploy code

• Identify issues quickly by performing often

Page 23: Infrastructure as Code

CHAPTERPutting it all

together

Page 24: Infrastructure as Code

Putting it all together

Infrastructure Provisioning Application Provisioning Code Provisioning

Now it’s your turn

Developers Operations Dev + Ops

Page 25: Infrastructure as Code

2015 AWS DevOps Challenge

Design and implement a fully-automated AWS environment suitable for hosting and operating a complex open-source application.

The current plan is to have a panel of judges decide the winning team’s presentation and demo of solution

Monitor

• Dashboard Status Overview

Alert

• Active Push Notifications on Error

Log

• Application / OS log management

Audit

• Complete History of Interactions

Provision

• On-Demand Environment

Manage

• Live Changes to Environment

Deploy

• Automated Application Deployment

Patch

• Live Changes to Application

Page 26: Infrastructure as Code

What’s in it for me?

Gain real world, hands-on experience with automated provisioning (infrastructure, application, code)

Showcase your skills to the Dallas officeGain experience on the AWS platformTeam up to design a solution that

outperforms the competitionWin a trip to the AWS re:Invent 2015

conference in Las Vegas, NV on October 6-8, 2015

Page 27: Infrastructure as Code

You heard right… Your score will (probably) be determined by Judges

Page 28: Infrastructure as Code

CHAPTERAWS Goodness

Page 29: Infrastructure as Code

New AWS ServicesAt re:Invent, AWS released a number of new services

to their line-up. Here are the highlights.

Lambda Aurora

EC2 Container

Service

Page 30: Infrastructure as Code

CHAPTERWrapping Up

Page 31: Infrastructure as Code

The Automation Dream• Automation is our client’s and your friend

• Automation is hard work

• Free to experiment• AWS Free Tier

• Azure Free Trial