abandon all hardware intro to serverless · intro to serverless abandon all hardware. about me ......

18
INTRO TO SERVERLESS ABANDON ALL HARDWARE

Upload: others

Post on 04-Jun-2020

11 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ABANDON ALL HARDWARE INTRO TO SERVERLESS · INTRO TO SERVERLESS ABANDON ALL HARDWARE. ABOUT ME ... SERVERLESS THE FRAMEWORK. GOALS DEMO In the next 15 mins, using a skeleton project

INTRO TO SERVERLESS

ABANDON ALL HARDWARE

Page 2: ABANDON ALL HARDWARE INTRO TO SERVERLESS · INTRO TO SERVERLESS ABANDON ALL HARDWARE. ABOUT ME ... SERVERLESS THE FRAMEWORK. GOALS DEMO In the next 15 mins, using a skeleton project

ABOUT ME

• Rhys Campbell

• Solution Architect @

• Interest in Web & Cloud

• No vested interest in products and services mentioned today

Page 3: ABANDON ALL HARDWARE INTRO TO SERVERLESS · INTRO TO SERVERLESS ABANDON ALL HARDWARE. ABOUT ME ... SERVERLESS THE FRAMEWORK. GOALS DEMO In the next 15 mins, using a skeleton project

WHERE ARE WE GOING?

WHATS THE PROBLEM?

• Snow flake servers

• Shared VMs/ISOs

• Scripted VMs

• Scripted Containers

• … why?

Page 4: ABANDON ALL HARDWARE INTRO TO SERVERLESS · INTRO TO SERVERLESS ABANDON ALL HARDWARE. ABOUT ME ... SERVERLESS THE FRAMEWORK. GOALS DEMO In the next 15 mins, using a skeleton project

Consistency leads to predictable results

Page 5: ABANDON ALL HARDWARE INTRO TO SERVERLESS · INTRO TO SERVERLESS ABANDON ALL HARDWARE. ABOUT ME ... SERVERLESS THE FRAMEWORK. GOALS DEMO In the next 15 mins, using a skeleton project

ISSUES• Not our core business

• Not our competitive advantage • How much time are you spending on your ISO, Ansible, chef, puppet, docker ...stuff?

• How many lines of code are dedicated to this?

• Are we at least getting value add?

• Is your infrastructure allowing you 5 nines?

• Can you scale immediately?

• Do you pay for infrastructure when no customer are using it? Ie geographically focused

• Don't get me started on build servers.....

Page 6: ABANDON ALL HARDWARE INTRO TO SERVERLESS · INTRO TO SERVERLESS ABANDON ALL HARDWARE. ABOUT ME ... SERVERLESS THE FRAMEWORK. GOALS DEMO In the next 15 mins, using a skeleton project

SOLUTION?

Page 7: ABANDON ALL HARDWARE INTRO TO SERVERLESS · INTRO TO SERVERLESS ABANDON ALL HARDWARE. ABOUT ME ... SERVERLESS THE FRAMEWORK. GOALS DEMO In the next 15 mins, using a skeleton project

FUNCTIONS AS A SERVICE

FAAS

• IaaS => PaaS => SaaS

• Now FaaS

• Multiple providers

• Multiple languages

• Small blocks of code

• Event driven

• Pay per execution & resource utilisation

Page 8: ABANDON ALL HARDWARE INTRO TO SERVERLESS · INTRO TO SERVERLESS ABANDON ALL HARDWARE. ABOUT ME ... SERVERLESS THE FRAMEWORK. GOALS DEMO In the next 15 mins, using a skeleton project

HOW TO CODEZ IN THE CLOUDZ?

Page 9: ABANDON ALL HARDWARE INTRO TO SERVERLESS · INTRO TO SERVERLESS ABANDON ALL HARDWARE. ABOUT ME ... SERVERLESS THE FRAMEWORK. GOALS DEMO In the next 15 mins, using a skeleton project

WHAT IS REQUIRED

• A cohesive way of defining services

• Which resources constitute the service

• A simple manner of managing these in source control

• A means to effectively deploy the complete service

Page 10: ABANDON ALL HARDWARE INTRO TO SERVERLESS · INTRO TO SERVERLESS ABANDON ALL HARDWARE. ABOUT ME ... SERVERLESS THE FRAMEWORK. GOALS DEMO In the next 15 mins, using a skeleton project

SERVERLESSTHE FRAMEWORK

Page 11: ABANDON ALL HARDWARE INTRO TO SERVERLESS · INTRO TO SERVERLESS ABANDON ALL HARDWARE. ABOUT ME ... SERVERLESS THE FRAMEWORK. GOALS DEMO In the next 15 mins, using a skeleton project

GOALS

DEMO

In the next 15 mins, using a skeleton project from github we will:

• Create a new serverless service

• Deploy it

• Test it

• Have a serverless CI tool let us know that it is invalid

• Redeploy the fixed version and assert the changes are valid

Page 12: ABANDON ALL HARDWARE INTRO TO SERVERLESS · INTRO TO SERVERLESS ABANDON ALL HARDWARE. ABOUT ME ... SERVERLESS THE FRAMEWORK. GOALS DEMO In the next 15 mins, using a skeleton project

CODE

Page 13: ABANDON ALL HARDWARE INTRO TO SERVERLESS · INTRO TO SERVERLESS ABANDON ALL HARDWARE. ABOUT ME ... SERVERLESS THE FRAMEWORK. GOALS DEMO In the next 15 mins, using a skeleton project

HELLO WORLDS… SUCK

Code is not intended to show rich features

Highlighting iteration 0 is short, not that it is feature complete

Where the hell did Lamb CI come from?

• Just a cloud formation template

• Github (and Slack) tokens are required

Page 14: ABANDON ALL HARDWARE INTRO TO SERVERLESS · INTRO TO SERVERLESS ABANDON ALL HARDWARE. ABOUT ME ... SERVERLESS THE FRAMEWORK. GOALS DEMO In the next 15 mins, using a skeleton project

NON FUNCTIONAL FEATURES

Crosscutting concerns can not be ignored

• Security - VPC bound resources

• Auth - AWS Cognito and Auth0

• Logging and Monitoring

• AWS Cloudwatch

• Preferably NewRelic

Page 15: ABANDON ALL HARDWARE INTRO TO SERVERLESS · INTRO TO SERVERLESS ABANDON ALL HARDWARE. ABOUT ME ... SERVERLESS THE FRAMEWORK. GOALS DEMO In the next 15 mins, using a skeleton project

TESTING

• Seperate out your business code from the event handler

• Unit test the business code

• LocalStack to end to end test locally https://bitbucket.org/atlassian/localstack

• Just deploy your stack, test and tear it down!

Page 16: ABANDON ALL HARDWARE INTRO TO SERVERLESS · INTRO TO SERVERLESS ABANDON ALL HARDWARE. ABOUT ME ... SERVERLESS THE FRAMEWORK. GOALS DEMO In the next 15 mins, using a skeleton project

HATE THE CLOUD?

• Checkout iron.io

• Picasso: a FaaS that can run on OpenStack

• Iron Functions

Page 17: ABANDON ALL HARDWARE INTRO TO SERVERLESS · INTRO TO SERVERLESS ABANDON ALL HARDWARE. ABOUT ME ... SERVERLESS THE FRAMEWORK. GOALS DEMO In the next 15 mins, using a skeleton project

NOT READY?

• FaaS can be added to exiting applications to add seams, e.g.

• Replace a worker with a schedule FaaS

• Service proxies

• Non business critical backends

• Notifications systems

Page 18: ABANDON ALL HARDWARE INTRO TO SERVERLESS · INTRO TO SERVERLESS ABANDON ALL HARDWARE. ABOUT ME ... SERVERLESS THE FRAMEWORK. GOALS DEMO In the next 15 mins, using a skeleton project

LINKS• https://github.com/lambci

• iron.io

• serverless.com

• https://newrelic.com/infrastructure

• auth0.com