Slide 1

Slide 1 text

@maltzj Taking Python Serverless: Using Zappa to Deploy Webapps Without Infrastructure Jonathan Maltz @maltzj 11-13-19 AUTHOR DATE

Slide 2

Slide 2 text

@maltzj @maltzj I just wrote my python webapp!

Slide 3

Slide 3 text

@maltzj @maltzj

Slide 4

Slide 4 text

@maltzj @maltzj Build a .whl file

Slide 5

Slide 5 text

@maltzj @maltzj Build a .whl file Deploy to an EC2 instance

Slide 6

Slide 6 text

@maltzj @maltzj Build a .whl file Deploy to an EC2 instance Gunicorn

Slide 7

Slide 7 text

@maltzj @maltzj Build a .whl file Deploy to an EC2 instance Gunicorn nginx

Slide 8

Slide 8 text

@maltzj @maltzj

Slide 9

Slide 9 text

@maltzj @maltzj Add your python code Gunicorn nginx

Slide 10

Slide 10 text

@maltzj @maltzj nginx

Slide 11

Slide 11 text

@maltzj @maltzj

Slide 12

Slide 12 text

@maltzj @maltzj

Slide 13

Slide 13 text

@maltzj @maltzj Lambda's Promise: Give me a zip file within some constraints, and I'll just run that code for you

Slide 14

Slide 14 text

@maltzj @maltzj How can it talk to the world?

Slide 15

Slide 15 text

@maltzj @maltzj

Slide 16

Slide 16 text

@maltzj @maltzj API Gateway's Promise: I'll manage all your RESTful APIs in front of AWS services

Slide 17

Slide 17 text

@maltzj @maltzj

Slide 18

Slide 18 text

@maltzj @maltzj

Slide 19

Slide 19 text

@maltzj @maltzj Serverless Frameworks!

Slide 20

Slide 20 text

@maltzj @maltzj Serverless Frameworks: Tools that let you stitch together your serverless code and provision the necessary cloud resources.

Slide 21

Slide 21 text

@maltzj ● Zappa Serverless Frameworks

Slide 22

Slide 22 text

@maltzj ● Zappa ● Serverless Serverless Frameworks

Slide 23

Slide 23 text

@maltzj ● Zappa ● Serverless ● AWS SAM Serverless Frameworks

Slide 24

Slide 24 text

@maltzj ● Zappa ● Serverless ● AWS SAM ● Chalice Serverless Frameworks

Slide 25

Slide 25 text

@maltzj ● Zappa ● Serverless ● AWS SAM ● Chalice Serverless Frameworks

Slide 26

Slide 26 text

@maltzj @maltzj

Slide 27

Slide 27 text

@maltzj @maltzj WSGI

Slide 28

Slide 28 text

@maltzj @maltzj Application Server

Slide 29

Slide 29 text

@maltzj @maltzj Application Server (Things that deal with raw HTTP)

Slide 30

Slide 30 text

@maltzj @maltzj Application (Frameworks that use parsed HTTP) Server (Things that deal with raw HTTP)

Slide 31

Slide 31 text

@maltzj @maltzj Application (Frameworks that use parsed HTTP) Server (Things that deal with raw HTTP) callable(environ, start_response)

Slide 32

Slide 32 text

@maltzj @maltzj Application (Frameworks that use parsed HTTP) Server (Things that deal with raw HTTP) callable(environ, start_response)

Slide 33

Slide 33 text

@maltzj @maltzj Application (Frameworks that use parsed HTTP) Server (Things that deal with raw HTTP) callable(environ, start_response)

Slide 34

Slide 34 text

@maltzj @maltzj So what?

Slide 35

Slide 35 text

@maltzj @maltzj Zappa Handler (Speaks WSGI) Your WSGI App

Slide 36

Slide 36 text

@maltzj @maltzj Zappa Handler (Speaks WSGI) Your WSGI App Zappa CLI

Slide 37

Slide 37 text

@maltzj @maltzj Zappa Handler (Speaks WSGI) Your WSGI App Zappa CLI Lambda-ready Zip

Slide 38

Slide 38 text

@maltzj @maltzj Zappa Handler (Speaks WSGI) Your WSGI App Zappa CLI Lambda-ready Zip AWS

Slide 39

Slide 39 text

@maltzj @maltzj Zappa Handler (Speaks WSGI) Your WSGI App Zappa CLI Lambda-ready Zip AWS Opinionated cloud provisioning (via Boto)

Slide 40

Slide 40 text

@maltzj @maltzj

Slide 41

Slide 41 text

@maltzj @maltzj

Slide 42

Slide 42 text

@maltzj ● No servers == rethinking lots of assumptions ○ How do I get to my DB? ○ Where are my logs? ○ Lean on cloud services to mitigate ● Some constraint on what you can build ○ Lambda size limits, application response sizes ○ Many can be worked around Some things to be aware of

Slide 43

Slide 43 text

@maltzj How's Zappa Overall? ● Very quick if you will play within its box ○ WSGI webapps, only python ● Maintenance story is not great ● Would suggest evaluating alongside serverless + plugins

Slide 44

Slide 44 text

@maltzj @maltzj

Slide 45

Slide 45 text

@maltzj ● Zappa: https://github.com/Miserlou/Zappa ● Serverless: https://serverless.com/ ● AWS SAM: https://aws.amazon.com/serverless/sam/ ● Chalice - https://github.com/aws/chalice ● PEP 333 - https://www.python.org/dev/peps/pep-0333/ ● AWS Lambda Limitations - https://docs.aws.amazon.com/lambda/latest/dg/limits.html ● Serverless Conf NYC: https://acloud.guru/series/serverlessconf-nyc-2019 ● Google Cloud Run: https://cloud.google.com/run/ ● AWS Fargate: https://aws.amazon.com/fargate/ Resources

Slide 46

Slide 46 text

@maltzj @maltzj https://boards.greenhouse.io/nuna/