AWS Summit Auckland - Application Delivery Patterns for Developers

Post on 20-Jan-2017

147 views 0 download

Transcript of AWS Summit Auckland - Application Delivery Patterns for Developers

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

Shiva Narayanaswamy, Solution Architect, Amazon Web Services

Nick Walker, Systems Engineer, Vend

Application Delivery Patterns for

Developers

Technical 401

Business

101 Technical

201 Technical

301 Technical

401 Technical

Session Depth

Agenda: Application Delivery Patterns

• Why?

• What?

• How?

• The Vend Journey

• What the…?

• X Commandments

• What next?

Mission Statement

Deliver better features to customers, quickly, securely,

more reliably, and cheaper.

http://www.space.com/images/i/000/034/954/original/blue-origin-test-fires-new-rocket-engine-3.jpg

Deliver “Hello World”

package main

import “fmt”

func main() {

fmt.Printf(“Hello, World.\n”)

}

#!/path/to/python

print “Hello World!”

using System;

using System.Collections.Generic;

using System.Text;

namespace ConsoleApplication1 {

class Program {

static void Main(string[] args) {

Console.WriteLine("Hello, world!");

Console.ReadLine()

}

}

}

#!/path/to/ruby

puts "Hello World!";

var http = require('http');

http.createServer(function (request, response) {

response.writeHead(200, {'Content-Type': 'text/plain'});

response.end('Hello World\n');

}).listen(8080);

Development LifecycleREPOSITORY

PM SYSTEM

CI SYSTEM

DEVELOPER

LOOKUP

TASKS

SUBMIT

CODE

SCHEDULE BUILD

AUTOMATIC

BUILD

BUILD

RESULTS

BUILD

ARTEFACTS

CLOUDFORMATION,

PUPPET,

CHEF,

ANSIBLE.

CONTAINERS,

AMIs

EXE, MSI,

RPM, DEB,

ZIP, TAR

Delivery LifecycleREPOSITORY

PM SYSTEM

DEPLOYMENT

SYSTEM

DEVELOPER

LOOKUP

TASKS

SUBMIT

CODE

SCHEDULE BUILD

BUILD /

ARTEFACTS

BUILD

RESULTS

CI SYSTEM

ENVIRONMENTS

SYSTEST

PRE-PROD

PRODUCTIONDEPLOYMENT

RESULTS

DEPLOYMENT

CONFIG

TRIGGER A

PUSH / PULL

Delivery LifecycleREPOSITORY

PM SYSTEM

DEPLOYMENT

SYSTEM

DEVELOPER

LOOKUP

TASKS

SUBMIT

CODE

SCHEDULE BUILD

BUILD /

ARTEFACTS

BUILD

RESULTS

CI SYSTEM

ENVIRONMENTS

SYSTEST

PRE-PROD

PRODUCTIONDEPLOYMENT

RESULTS

DEPLOYMENT

CONFIG

ATOMIC UNIT OF DELIVERY

FUNCTIONAL CODE

UNIT TESTS

API

BUILD CONFIG

RUNTIME CONFIG

INFRASTRUCTURE CODE

DELIVERY PIPELINE

PUSH / PULL

PUSH / PULL

Delivery LifecycleREPOSITORY

PM SYSTEM

DEPLOYMENT

SYSTEM

DEVELOPER

LOOKUP

TASKS

SUBMIT

CODE

SCHEDULE BUILD

BUILD /

ARTEFACTS

BUILD

RESULTS

CI SYSTEM

ENVIRONMENTS

SYSTEST

PRE-PROD

PRODUCTIONDEPLOYMENT

RESULTS

DEPLOYMENT

CONFIG

ATOMIC UNIT OF

DEPLOYMENT

DEPLOYABLE ARTEFACT

API

TEST SCRIPTS

BUILD CONFIG

RUNTIME CONFIG

INFRASTRUCTURE CODE

DELIVERY PIPELINE

ENVIRONMENT CONFIG

SECURITY CONFIG

MONITORING CONFIG

BACKUP CONFIG

AVAILABILITY CONFIG

SLA CONFIG

Application Deployment Patterns

Arbitrary Snowflakes Periodic deployments Blue Green Deployments

Canary Deployment Dark Launch /

Feature ToggleEnvironment Promotion

Orchestrate Delivery with Pipelines

A pipeline models your release process as a series of stages that promote

changes along a set of environments into the hands of your customers.

A pipeline is a model of your standard procedure for deploying software.

Pipeline

Stage

Action

Pipeline

Run

Source change

• starts a run; and

• creates an artifact to be used by other actions.

Manual trigger

Stage transition

Parallel Actions

Pipeline Concepts – AWS CodePipeline

Characteristics of a Good Pipeline

Fast Feedback Validation IdempotentSecureDesired State

Consistency

Roll Forward API Driven Visualisation ExtensibleAs Code

Pipeline Design

Blockers

Simple Integral Security

Metrics Driven

Chained

Andon Cord Process Events

Loosely Coupled

Corollary to Conways Law :

Your pipelines design will be a copy of your organization's communication structure.

Pipeline Metrics

• Number of Builds

• Number of Deployments

• Average Time For Changes to Reach Production

• Average Time From First Pipeline Stage to Each Stage

• Number of Changes Reaching Production

• Average Build Time

Let us Deliver a Polyglot BeastPacker/Puppet/Chef scripts

Foundation SOE pipeline

Foundation SOE AMI/Container

Nginx SOE

pipeline

Java SOE

pipeline

Tomcat SOE

pipeline

Developer

SOE pipeline

Nginx SOE Java SOE Tomcat SOE Developer

Workstation

Nginx SOE Java SOE Tomcat SOE HAProxy SOE

Let us Deliver a Polyglot Beast

IIS SOE

Application 1

on EC2

Application 2

on ECS

Application 3

on Beanstalk

Introduction to Vend

SaaS Point-of-Sale, Ecommerce and

Reporting

18,000+ retail stores in 150+ countries

I’m part of the Platform team - we’re

responsible for internal dev platform

Pipeline Goals / Metrics

We try to release features as fast as possible, while limiting risk and retaining quality

Important metrics:

Developer Velocity

Release Quality

Developer Happiness

What Slows Developers Down?

Fear of breaking things

Application complexity and coupling

Constantly re-inventing the wheel

Vend Deployment Pipeline

Push to GitHub

Build container

Run unit tests

Run integration tests (against other containers)

Deploy to AWS ECS if master

Containerisation

Start shaping the unit of testing and deployment

Forces developers to think about interfaces and

bounded contexts

Makes it easier to create development and test

environments

Standardisation

Containers without a sprinkle of best

practices are a recipe for disaster

Developers have to learn “this is how we do

things in this service!”

Our early containerisation approach - great

for Dev, terrible for Ops

What we Standardised

Authentication

Logging

Configuration Injection

Request Routing

Monitoring

Request Routing

Our routing layer handles API requests from

the edge to port on a container

Authentication, Authorisation and Rate Limiting

all handled

Common libraries in a few languages to parse

authentication tokens

Container Configuration

Standardised config directory location

Bake development configuration into

the container

Container platform mounts volume over

the top of the config directory

Feature Management

Simple conditional around a “risky” piece of

code

Control the conditional by some external

process

Decouples deployment from feature

releases - less nervous developers!

if (hasFeature("new_thing")) {

// New code path

} else {

// Old path

}

Feature Management Rules

Feature true/false can be driven by a set of

rules, considering the context of the user

- Percentage of all customers

- Time (n customers per y time)

- Account Size / Value

- Market / Region

- Opt in attributes

Monitoring Service Health and Usage

Is my service up? Is it logging errors?

Statsd, Kibana, Redash

Are people using it in the way that I

expect?

We should check that our assumptions

about user behaviour are correct

We’re Still Improving

Docker Compose / Docker for Mac instead

of Vagrant

Automated service discovery

Dynamic configuration instead of static

Puppet-based ones

Lessons Learned

Start with a automated pipeline, optimise the slow

parts as you find them

Going down the container route? Create a “best

practices” document!

Decouple feature releases from deployment and

stage rollouts to reduce risk

Salutations to the Demo Gods

BuildKite

Application Delivery from Outer Space

Cost Aware Serverless

Shared Experience Observer PatternThrottles

Location Aware

Some Tools

AWS Codepipeline BuildKite

Commandments for Application Delivery

I. Acknowledge time. Version control everything

II. Be the master of your dependencies

III. Externalising configurations shall set you free

IV. Don’t be a prisoner of state

V. Loosely couple

VI. Audits that don’t kill you, make you stronger

VII. Everyone sees everything, all the time

VIII. Measure success

IX. Continuous practice

X. Own your Destiny, end to end

How Do I Start?

THINK BIG

START SMALL

ACT NOW

AWS Training & Certification

Intro Videos & Labs

Free videos and labs to

help you learn to work

with 30+ AWS services

– in minutes!

Training Classes

In-person and online

courses to build

technical skills –

taught by accredited

AWS instructors

Online Labs

Practice working with

AWS services in live

environment –

Learn how related

services work

together

AWS Certification

Validate technical

skills and expertise –

identify qualified IT

talent or show you

are AWS cloud ready

Learn more: aws.amazon.com/training

Your Training Next Steps:

Visit the AWS Training & Certification pod to discuss your

training plan & AWS Summit training offer

Register & attend AWS instructor led training

Get Certified

AWS Certified? Visit the AWS Summit Certification Lounge to pick up your swag

Learn more: aws.amazon.com/training

Thank You!