• No results found

Achieving Continuous Delivery with AWS Lambda and Codeship

N/A
N/A
Protected

Academic year: 2021

Share "Achieving Continuous Delivery with AWS Lambda and Codeship"

Copied!
95
0
0

Loading.... (view fulltext now)

Full text

(1)

Achieving Continuous

Delivery with AWS

(2)

Timeline

• Ajay Nair from AWS

Introduction to AWS Lambda

• Florian Motlik from Codeship

Introduction to Codeship and Deploying

to AWS Lambda

• Martin Tajur

How Pipedrive uses Codeship and AWS Lambda

• Q&A

(3)

FAQ

• We’re recording

and will share the recording

soon after

• Tweet with #awslambdawebinar

(4)

Introduction to

Lambda

(5)
(6)

AWS Lambda

COMPUTE SERVICE

EVENT DRIVEN

Run code without thinking about

servers

Code only runs when it needs to run

(7)

AWS Lambda: Benefits

EVENT-DRIVEN SCALE

(8)

AWS Lambda: Capabilities

BRING YOUR OWN CODE COMPUTE “POWER LEVELS”

(9)

AWS Lambda: Putting it to work

… and the list will

continue to grow!

Amazon Echo skills File processing with Amazon S3 Amazon Dynamo DB triggers Amazon Kinesis processors Microservices with API Gateway AWS CloudFormation custom resources Customized notifications with Amazon SNS Amazon Cognito triggers

Mobile and Web backends

(10)

AWS Lambda: How it works

AUTHOR CONFIGURE

(11)

Codeship and Lambda

(12)

Build - Release Cycle

Build

Test

Release

(13)

!

„ The top lesson that Cockcroft

learned at Netflix is that speed wins

in the marketplace. If you ask any

developer whether a slower

development process is better, no

one ever says yes.“

(14)
(15)

AWS Lambda on

Codeship

(16)

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "lambda:UpdateFunctionCode", "lambda:UpdateFunctionConfiguration", "lambda:InvokeFunction", "lambda:GetFunction" ], "Resource": [ "arn:aws:lambda:YOUR_AWS_REGION:YOUR_AWS_AC COUNT_ID:function:YOUR_FUNCTION_NAME" ] } ] }

(17)
(18)
(19)
(20)

Support any Software

?

?

?

? ?

?

?

?

?

?

?

(21)
(22)

Parity between

(23)
(24)
(25)
(26)
(27)

How we use AWS Lambda to process incoming emails

Martin Tajur

(28)
(29)

● Web-based CRM for small teams with big ambitions. ● Founded in 2010.

(30)

● Web-based CRM for small teams with big ambitions. ● Founded in 2010.

(31)

● Web-based CRM for small teams with big ambitions. ● Founded in 2010.

● Used by well over 10,000 businesses worldwide.

(32)

● Web-based CRM for small teams with big ambitions. ● Founded in 2010.

● Used by well over 10,000 businesses worldwide.

● 100+ employees, venture funded (BVP, Series A in 2015) ● Very end user focused, helping the actual sales person do

(33)
(34)
(35)
(36)
(37)

What we do with Lambda

TL;DR: We process incoming emails in Lambda.

(38)
(39)

What we do with Lambda Gmail

(40)

What we do with Lambda

(41)

What we do with Lambda

(42)

What we do with Lambda

(43)

What we do with Lambda

Gmail Receive Process Store

We process incoming emails in Lambda.

(44)
(45)

Pipedrive Gmail integration

(46)

Pipedrive Gmail integration

● Work with your deals and contacts straight in the CRM ● Send and receive emails within the CRM

(47)

Pipedrive Gmail integration

● Work with your deals and contacts straight in the CRM ● Send and receive emails within the CRM

(48)

Pipedrive Gmail integration

● Work with your deals and contacts straight in the CRM ● Send and receive emails within the CRM

● Contact history stored

(49)

Pipedrive Gmail integration

● Work with your deals and contacts straight in the CRM ● Send and receive emails within the CRM

● Contact history stored

● No juggling between apps ● Keep your focus

(50)

Pipedrive Gmail integration

● Work with your deals and contacts straight in the CRM ● Send and receive emails within the CRM

● Contact history stored

● No juggling between apps ● Keep your focus

(51)

Pipedrive Gmail integration

● Work with your deals and contacts straight in the CRM ● Send and receive emails within the CRM

● Contact history stored

● No juggling between apps ● Keep your focus

● Close more deals ● $$$

(52)
(53)

Our Lambda function

(54)

Our Lambda function

● Called mail-message-parser

(55)

Our Lambda function

● Called mail-message-parser

● Node.js, Javascript based application

(56)

Our Lambda function

● Called mail-message-parser

● Node.js, Javascript based application

● Takes in regular HTML, returns nicer HTML ● Covered with 105 unit tests

(57)

Our Lambda function

● Called mail-message-parser

● Node.js, Javascript based application

● Takes in regular HTML, returns nicer HTML ● Covered with 105 unit tests

(58)

What we do with Lambda

(59)

What we do with Lambda

● Fix broken HTML emails

● Filter out unwanted parts of HTML (<script>, attached event handlers, etc)

(60)

What we do with Lambda

● Fix broken HTML emails

● Filter out unwanted parts of HTML (<script>, attached event handlers, etc)

(61)

300,000 emails

per day on average We process

(62)

300,000 emails

of the

per day on average We process

4,000 users

(63)
(64)

Processing incoming emails is... ● Highly fluctuating in volume

(65)

Processing incoming emails is... ● Highly fluctuating in volume

● High peak hours (20k+ emails per hour), lower on

(66)

Processing incoming emails is... ● Highly fluctuating in volume

● High peak hours (20k+ emails per hour), lower on

weekends (2k per hour), bursts up to 200 emails/sec. ● CPU intensive

(67)

Without Lambda,

(68)
(69)

Without Lambda, we would either...

...provision as much as instances as needed to serve the peak hours

Bad. Waste of resources during less busy hours. Est. cost around

(70)

Without Lambda, we would either...

...provision as much as instances as needed to serve the peak hours

Bad. Waste of resources during less busy hours. Est. cost around

$150/mo.

...set up instances as autoscale group

Bad. Complexity. Lots of moving parts to manage. Complex deployments. Est. cost up to $100/mo.

(71)

Without Lambda, it would cost us $100-$150/month.

(72)
(73)

Our monthly spend on Lambda?

(74)
(75)

Without Lambda at scale?

(76)

Without Lambda at scale?

4K users, 300K emails/day = $150/month

(77)
(78)

With Lambda at scale?

(79)

With Lambda at scale?

4K users, 300K emails/day = $8/month

(80)

Without Lambda, it would take

(81)

Lambda production deployment setup through Codeship took us

(82)

Lambda production deployment setup through Codeship took us

(83)

Time spent on “scaling it” down the road —

(84)
(85)

How we deploy to Lambda

● GitHub based workflow

(86)

How we deploy to Lambda

● GitHub based workflow

branch out › write code › pull request › merge › repeat ● Unit tests executed on each pull and commit on Codeship.

(87)

How we deploy to Lambda

● GitHub based workflow

branch out › write code › pull request › merge › repeat

● Unit tests executed on each pull and commit on Codeship.

(88)
(89)

Works perfectly for us

● 0 hours spent on provisioning VMs, worrying about setting up autoscaling or other fine-tuning.

(90)

Works perfectly for us

● 0 hours spent on provisioning VMs, worrying about setting up autoscaling or other fine-tuning.

(91)

Works perfectly for us

● 0 hours spent on provisioning VMs, worrying about setting up autoscaling or other fine-tuning.

● 0 hours spent on configuration management.

(92)

Works perfectly for us

● 0 hours spent on provisioning VMs, worrying about setting up autoscaling or other fine-tuning.

● 0 hours spent on configuration management.

● $$$ saved on having the resources be provisioned 24/7. ● 20 minutes spent on setting up continuous delivery.

(93)

Works perfectly for us

● 0 hours spent on provisioning VMs, worrying about setting

up autoscaling or other fine-tuning.

● 0 hours spent on configuration management.

● $$$ saved on having the resources be provisioned 24/7.

● 20 minutes spent on setting up continuous delivery.

● Developers can focus on the parser, not the deployment or supporting tools.

(94)

Thank you. Martin Tajur

@tajur on Twitter

With this promo code

CODESHIPROCKS

2 months free

(95)

Q&A

• Ajay Nair - @ajaynairthinks

• Florian Motlik - @flomotlik

• Martin Tajur - @tajur

n up at http://beta.codeship.com

References

Related documents