Download pdf - DevOps on AWS

Transcript
Page 1: DevOps on AWS

© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Mohammad Nofal, Technical Account Manager – AWSMicha Hernandez Van Leuffen, CEO - Wercker

May 2016

DevOps on AWS:Deep Dive on Continuous Delivery

and the AWS Developer Tools

Page 2: DevOps on AWS

https://secure.flickr.com/photos/mgifford/4525333972

Why are we here today?

Page 3: DevOps on AWS

Software moves faster today

Software creation and distribution is easier and faster than ever:• Startups can now take on giants with little to

no funding ahead of time• Getting your software into the hands of

millions is a download away• Your ability to move fast is paramount to your

ability to fight off disruption

Page 4: DevOps on AWS

What tools do you need to move fast?

Releasing software in this new software driven world requires a number of things:• Tools to manage the flow of your software

development release process• Tools to properly test and inspect your code for defects

and potential issues• Tools to deploy your applications

Page 5: DevOps on AWS

First, we need to understand a little bit about software release processes

https://www.flickr.com/photos/jurvetson/5201796697/

Page 6: DevOps on AWS

• Integration tests with other systems

• Load testing• UI tests• Penetration

testing

Release processes have four major phases

Source Build Test Production

• Check-in source code such as .java files.

• Peer review new code

• Compile code• Unit tests• Style checkers • Code metrics• Create

container images

• Deployment to production environments

Page 7: DevOps on AWS

Release processes levels

Source Build Test Production

Continuous integration

Continuous delivery

Continuous deployment

Page 8: DevOps on AWS

Release Processes levels

Source Build Test Production

Continuous integration

Continuous deployment

Our focus todayContinuous delivery

Page 9: DevOps on AWS

Continuous Delivery Benefits

Improve developer productivity

Find and address bugs quickly

Deliver updates fasterAutomate the software release process

Page 10: DevOps on AWS

A look back at development at Amazon..

https://secure.flickr.com/photos/pixelthing/15806918992/

Page 11: DevOps on AWS

2001

Development transformation at Amazon: 2001-2009

2009

monolithic application + teams

microservices + 2 pizza teams

Page 12: DevOps on AWS

Things went muchbetter under this model and teams were releasingfaster than ever, but we felt that wecould still improve.

Page 13: DevOps on AWS

In 2009, we ran a study to find out where inefficienciesmight still exist

Page 14: DevOps on AWS

We were just waiting.

WaitWrite Code WaitBuild

Code WaitDeploy to Test

Deploy to

Prod

Page 15: DevOps on AWS

We were just waiting.

WaitWrite Code WaitBuild

Code WaitDeploy to Test

Deploy to

Prod

Mins Days Mins Days Mins Days Mins

Page 16: DevOps on AWS

We were just waiting.

WaitWrite Code WaitBuild

Code WaitDeploy to Test

Deploy to

Prod

Weeks

Mins Days Mins Days Mins Days Mins

Page 17: DevOps on AWS

We were just waiting.

WaitWrite Code WaitBuild

Code WaitDeploy to Test

Deploy to

Prod

Weeks

Mins Days Mins Days Mins Days Mins

Page 18: DevOps on AWS

We built tools to automate our software release process

https://secure.flickr.com/photos/lindseygee/5894617854/

Page 19: DevOps on AWS

Automated actions and transitions; from check-in to production

Development benefits:• Faster• Safer• Simplification &

standardization• Visualization of the

process

Pipelines

Page 20: DevOps on AWS

Continuous delivery service for fast and reliable application updates

Model and visualize your software release process

Builds, tests, and deploys your code every time there is a code change

Integrates with 3rd party tools and AWS

AWS CodePipeline

Page 21: DevOps on AWS

AWS CodePipeline Benefits

Improved quality

Rapid delivery Get started fast

Configurable workflow Easy to integrate

Page 22: DevOps on AWS

Source

SourceGitHub

Build

JenkinsOnEC2Jenkins

Deploy

JavaAppElastic Beanstalk

PipelineStage

Action

Transition

CodePipelineMyApplication

Page 23: DevOps on AWS

Source

SourceGitHub

Build

JenkinsOnEC2Jenkins

Deploy

JavaAppElastic Beanstalk

NotifyDevelopersLambda

CodePipelineMyApplication

Parallel actions

Page 24: DevOps on AWS

Source

SourceGitHub

Build

JenkinsOnEC2Jenkins

Deploy

JavaAppElastic Beanstalk

NotifyDevelopersLambda

TestAPIRunscope

CodePipelineMyApplication

Sequential actions

Page 25: DevOps on AWS

8. Retrieve build artifact

EC2 instance

CodePipeline

Source

SourceGitHub

Build

JenkinsOnEC2Jenkins

Deploy

JavaAppElastic Beanstalk

Source Artifact

S3

Build Artifact

S3

5. Get source artifact

1. Get Changes

6. Store build artifact

3. Poll for Job

4. Acknowledge Job

7. Put Success

9. Deploy build artifact

Elastic BeanstalkWeb container

Java App

MyApplication

Page 26: DevOps on AWS

We have a strong partner list, and it’s growingSource Build Test Deploy

Page 27: DevOps on AWS

AWS service integrations

Source Invoke Logic Deploy

AWS Elastic BeanstalkAmazon S3

AWS CodeDeploy

AWS LambdaAWS CodeCommit

Page 28: DevOps on AWS

Building your application development release pipeline

https://www.flickr.com/photos/seattlemunicipalarchives/12504672623/

Page 29: DevOps on AWS
Page 30: DevOps on AWS
Page 31: DevOps on AWS
Page 32: DevOps on AWS

Host your code!

https://www.flickr.com/photos/61979637@N03/10385540904

Page 33: DevOps on AWS

Fully-managed git service

Store your code securely

Fully integrated with AWS IAM

Store anything, anytime

Integrates with familiar git tools

AWS CodeCommit

Page 34: DevOps on AWS

AWS CodeCommit

Use standard git toolsScalability, availability, and durability of Amazon S3Encryption at rest with customer-specific keys

git pull/push CodeCommit

Git objects inAmazon S3

Git index inAmazon DynamoDB

Encryption keyin AWS KMS

SSH or HTTPS

Page 35: DevOps on AWS
Page 36: DevOps on AWS

Build & test your application

https://secure.flickr.com/photos/spenceyc/7481166880

Page 37: DevOps on AWS

Building Your Code

“Building” code typically refers to languages that require compiled binaries:• .NET languages: C#, F#, VB.net, etc.• Java and related languages: Java, Scala,

JRuby• Go• iOS languages: Swift, Objective-CWe also refer to the process of creating Docker container images as “building” the image. EC2

Page 38: DevOps on AWS

No Building Required!

Many languages don’t require building. These are considered interpreted languages:• PHP• Ruby• Python• Node.js

You can just deploy your code!

EC2

Page 39: DevOps on AWS

Testing Your Code

Testing is both a science and an art form!Goals for testing your code:• Want to confirm desired functionality• Catch programming syntax errors• Standardize code patterns and format• Reduce bugs due to non-desired application

usage and logic failures• Make applications more secure

Page 40: DevOps on AWS
Page 41: DevOps on AWS

Deploying your applications

https://secure.flickr.com/photos/simononly/15386966677

Page 42: DevOps on AWS

Automates code deployments to any instance

Handles the complexity of updating your applications

Avoid downtime during application deployment

Deploy to Amazon EC2 or on-premisesservers, in any language and on any operating system

Integrates with 3rd party tools and AWS

AWS CodeDeploy

Page 43: DevOps on AWS

appspec.yml Exampleversion: 0.0os: linuxfiles:

- source: /destination: /var/www/html

permissions:- object: /var/www/htmlpattern: “*.html”owner: rootgroup: rootmode: 755

hooks:ApplicationStop:- location: scripts/deregister_from_elb.sh

BeforeInstall:- location: scripts/install_dependencies.sh

ApplicationStart:- location: scripts/start_httpd.sh

ValidateService:- location: scripts/test_site.sh- location: scripts/register_with_elb.sh

Page 44: DevOps on AWS

appspec.yml Exampleversion: 0.0os: linuxfiles:

- source: /destination: /var/www/html

permissions:- object: /var/www/htmlpattern: “*.html”owner: rootgroup: rootmode: 755

hooks:ApplicationStop:- location: scripts/deregister_from_elb.sh

BeforeInstall:- location: scripts/install_dependencies.sh

ApplicationStart:- location: scripts/start_httpd.sh

ValidateService:- location: scripts/test_site.sh- location: scripts/register_with_elb.sh

• Remove/add instance to ELB• Install dependency packages• Start Apache• Confirm successful deploy• More!

• Send application files to one directory and configuration files to another

• Set specific permissions on specific directories & files

• Version and OS are the only mandatory sections

Page 45: DevOps on AWS

v2 v2 v2 v2 v2 v2

one at a time

half at a time

all at once

v2 v2 v2 v1 v1 v1

v2 v1 v1 v1 v1 v1 Agent Agent

Dev Deployment group

ORProd Deployment group

Agent

AgentAgent

Agent Agent

Agent

Choose Deployment Speed and Group

Page 46: DevOps on AWS
Page 47: DevOps on AWS
Page 48: DevOps on AWS
Page 49: DevOps on AWS
Page 50: DevOps on AWS
Page 51: DevOps on AWS
Page 52: DevOps on AWS

https://www.flickr.com/photos/spacex/16510243060/

Launching to Production

Page 53: DevOps on AWS

Launching to Production

After you’ve built and tested your code and hopefully gone through a few pre-production deploys, its time for the real thing!You’ll want think about:• Impact to customers• Impact to infrastructure• Impact to business

How can we track these and communicate deploys?

Page 54: DevOps on AWS

Extend AWS CodePipeline Using Custom Actions

Update tickets Provision resources

Update dashboards Send notifications Security scan

Mobile testing

Page 55: DevOps on AWS

What Extension Method Should I Use?

Lambda Custom Action

Short-running tasks are easy to build Can perform any type of workload

Long-running tasks need more work Control over links displayed in console

Node.js, Python, and Java support Any language support

Runs on AWS Can run on-premises

No servers to provision or manage Requires compute resources

Page 56: DevOps on AWS
Page 57: DevOps on AWS
Page 58: DevOps on AWS
Page 59: DevOps on AWS
Page 60: DevOps on AWS
Page 61: DevOps on AWS
Page 62: DevOps on AWS
Page 63: DevOps on AWS
Page 64: DevOps on AWS
Page 65: DevOps on AWS
Page 66: DevOps on AWS
Page 67: DevOps on AWS
Page 68: DevOps on AWS
Page 69: DevOps on AWS
Page 70: DevOps on AWS
Page 71: DevOps on AWS
Page 72: DevOps on AWS
Page 73: DevOps on AWS
Page 74: DevOps on AWS
Page 75: DevOps on AWS
Page 76: DevOps on AWS
Page 77: DevOps on AWS
Page 78: DevOps on AWS
Page 79: DevOps on AWS
Page 80: DevOps on AWS
Page 81: DevOps on AWS
Page 82: DevOps on AWS
Page 83: DevOps on AWS

SummaryWe’ve seen a quick run through today of the benefits of continuous delivery on our software release process:• Continuous integration (build/test) helps shrink our

feedback loop greatly• We can get our software out in front of our users much

more rapidly• By moving faster we can actually ensure better quality• CodePipeline allows for integration with almost any

service or tool you can think of!• Plus visualization of what’s going on!

Page 84: DevOps on AWS

Try it out todayTest out CodePipeline and spin up a full continuous delivery pipeline using the Starter Kit

bit.ly/AWSCodeStarterKit

Page 85: DevOps on AWS

Resources to learn more:• Continuous integration: https://aws.amazon.com/devops/continuous-integration/• Continuous delivery: https://aws.amazon.com/devops/continuous-delivery/

• CodePipeline• https://aws.amazon.com/codepipeline/• https://aws.amazon.com/documentation/codepipeline/

• CodeDeploy• https://aws.amazon.com/codedeploy/• https://aws.amazon.com/documentation/codedeploy/• https://github.com/awslabs/aws-codedeploy-samples

• Code Services Starter Kit: http://bit.ly/AWSCodeStarterKit

But wait, there’s more!

Page 86: DevOps on AWS

Thank you!


Recommended