containers and serverless technologies in aws · • cheap processing (spot instances) • not real...

29
Containers and serverless technologies in AWS Károly Sepsy – Head of Engineering @ TC2 09.10.2019.

Upload: others

Post on 01-Aug-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Containers and serverless technologies in AWS · • Cheap processing (spot instances) • Not real time execution y Mixed use cases Step functions • Workflow needs • Can integrate

Containers and serverless technologies in AWS

Károly Sepsy – Head of Engineering @ TC2

0 9 . 1 0 . 2 0 1 9 .

Page 2: Containers and serverless technologies in AWS · • Cheap processing (spot instances) • Not real time execution y Mixed use cases Step functions • Workflow needs • Can integrate

Intr

od

uct

ion

Src: codetee.com

Page 3: Containers and serverless technologies in AWS · • Cheap processing (spot instances) • Not real time execution y Mixed use cases Step functions • Workflow needs • Can integrate

Intr

od

uct

ion

Page 4: Containers and serverless technologies in AWS · • Cheap processing (spot instances) • Not real time execution y Mixed use cases Step functions • Workflow needs • Can integrate

AWS portfolio

Page 5: Containers and serverless technologies in AWS · • Cheap processing (spot instances) • Not real time execution y Mixed use cases Step functions • Workflow needs • Can integrate

AWS portfolio for serverless and containersIn

tro

du

ctio

n

Page 6: Containers and serverless technologies in AWS · • Cheap processing (spot instances) • Not real time execution y Mixed use cases Step functions • Workflow needs • Can integrate

Serverless

Page 7: Containers and serverless technologies in AWS · • Cheap processing (spot instances) • Not real time execution y Mixed use cases Step functions • Workflow needs • Can integrate

Lambda

• Function as a Service

• Event driven

• Asynchronous

• Scale by process

• Billed by 100 miliseconds

• Platform integrations

• Limits

Serv

erl

ess

Page 8: Containers and serverless technologies in AWS · • Cheap processing (spot instances) • Not real time execution y Mixed use cases Step functions • Workflow needs • Can integrate

Operating functions

• Cloudwatch metrics

• Error-success rate

• Throttles

• Invocations

• Cloudwatch logs

• Function outputs, errors logged

• Monitor log patterns

• Dead letter queue

Serv

erl

ess

Lambda event sources

Page 9: Containers and serverless technologies in AWS · • Cheap processing (spot instances) • Not real time execution y Mixed use cases Step functions • Workflow needs • Can integrate

Developing Lambda

• AWS Console editor

• Cloud9 IDE

• Development in local environment

• Debugging

• Test events

• Dependency management

• Layers

• Serverless application repository

• Deploying a release

• Versions, aliases

• Serverless application model

Serv

erl

ess

Page 10: Containers and serverless technologies in AWS · • Cheap processing (spot instances) • Not real time execution y Mixed use cases Step functions • Workflow needs • Can integrate

Lambda billing

Function execution

• Duration: 2074.97 ms

• Billed duration 2100 ms

• Memory size: 128 MB

Billing unit (besides free tier)

• $0.0000166667/GB-second

• $0.0000002/request

Cost: $0.0000002+$0.0000166667/8*2.1=$0,00000457500875

Serv

erl

ess

Page 11: Containers and serverless technologies in AWS · • Cheap processing (spot instances) • Not real time execution y Mixed use cases Step functions • Workflow needs • Can integrate

Operating functions

• Cloudwatch metrics

• Error-success rate

• Throttles

• Invocations

• Cloudwatch logs

• Function outputs, errors logged

• Monitor log patterns

• Dead letter queue

Serv

erl

ess

Building workflows of function

Page 12: Containers and serverless technologies in AWS · • Cheap processing (spot instances) • Not real time execution y Mixed use cases Step functions • Workflow needs • Can integrate

Building workflows of functions

• Visual workflow

• JSON defined template

• State machine

• Sync and async calls (wait for callback)

• Supported services for steps:

• Lambda

• Container execution (ECS)

• ETL (Glue)

• Machine learning (Sagemaker)

Serv

erl

ess

Page 13: Containers and serverless technologies in AWS · • Cheap processing (spot instances) • Not real time execution y Mixed use cases Step functions • Workflow needs • Can integrate

Containers

Page 14: Containers and serverless technologies in AWS · • Cheap processing (spot instances) • Not real time execution y Mixed use cases Step functions • Workflow needs • Can integrate

Containers on AWS

• ECR: Container repository

• ECS: Container orchestration service developed by AWS

• Fargate: Serverless Container runtime for ECS

• EKS: Container orchestration service, based on open source

Kubernetes, managed by AWS

• Batch: batch processing service using containers

Co

nta

iners

Page 15: Containers and serverless technologies in AWS · • Cheap processing (spot instances) • Not real time execution y Mixed use cases Step functions • Workflow needs • Can integrate

Serverless containers: Fargate

• Option for Elastic Container Service

• Specify CPU and RAM needs for containers

• No need to manage servers

• Billed after used container capacity

• Storage limits

Co

nta

iners

Page 16: Containers and serverless technologies in AWS · • Cheap processing (spot instances) • Not real time execution y Mixed use cases Step functions • Workflow needs • Can integrate

Firecracker

• Technology behind Lambda and Fargate

• MicroVMs

• Linux support (kernel version >= 4.14)

• VM like isolation and security

• Container like startup time

• KVM based

• Containerd support

• Written in Rust-lang

• Similar to KATA containers

• RESTful control API

Co

nta

iners

Page 17: Containers and serverless technologies in AWS · • Cheap processing (spot instances) • Not real time execution y Mixed use cases Step functions • Workflow needs • Can integrate

Elastic Kubernetes Service

• Standard K8s technology

• Managed Kubernetes

• Integrated IAM security

• Versions 1.11-1.14

• Cloudformation support for cluster deployment

Co

nta

iners

Page 18: Containers and serverless technologies in AWS · • Cheap processing (spot instances) • Not real time execution y Mixed use cases Step functions • Workflow needs • Can integrate

source

Page 19: Containers and serverless technologies in AWS · • Cheap processing (spot instances) • Not real time execution y Mixed use cases Step functions • Workflow needs • Can integrate

AWS Batch

• Container support

• Queue based processing

• Priority levels

• Dynamic resource provisioning (event driven)

• Autoscaling

• Spot instances

• Multi-node parallel jobs for tightly-coupled HPC workloads

Co

nta

iners

Page 20: Containers and serverless technologies in AWS · • Cheap processing (spot instances) • Not real time execution y Mixed use cases Step functions • Workflow needs • Can integrate

Batch

Co

nta

iners

Page 21: Containers and serverless technologies in AWS · • Cheap processing (spot instances) • Not real time execution y Mixed use cases Step functions • Workflow needs • Can integrate

Managing containers

Co

nta

iners

Monitoring

Alerting

Logging

Page 22: Containers and serverless technologies in AWS · • Cheap processing (spot instances) • Not real time execution y Mixed use cases Step functions • Workflow needs • Can integrate

Operating functions

• Cloudwatch metrics

• Error-success rate

• Throttles

• Invocations

• Cloudwatch logs

• Function outputs, errors logged

• Monitor log patterns

• Dead letter queue

Serv

erl

ess

Src: aws.amazon.com

Page 23: Containers and serverless technologies in AWS · • Cheap processing (spot instances) • Not real time execution y Mixed use cases Step functions • Workflow needs • Can integrate

Operating functions

• Cloudwatch metrics

• Error-success rate

• Throttles

• Invocations

• Cloudwatch logs

• Function outputs, errors logged

• Monitor log patterns

• Dead letter queue

Serv

erl

ess

Src: aws.amazon.com

Page 24: Containers and serverless technologies in AWS · • Cheap processing (spot instances) • Not real time execution y Mixed use cases Step functions • Workflow needs • Can integrate

Summary

Page 25: Containers and serverless technologies in AWS · • Cheap processing (spot instances) • Not real time execution y Mixed use cases Step functions • Workflow needs • Can integrate

Serverless use cases

Lambda

• Asynchronous

• Lightweight (no or little local data processing)

• Quick execution (<15minutes)

• Usage varies from zero to large spikes

ECS with Fargate

• General workloads (local data processing below 10GB)

• Usage varies from zero to large spikes

Su

mm

ary

Page 26: Containers and serverless technologies in AWS · • Cheap processing (spot instances) • Not real time execution y Mixed use cases Step functions • Workflow needs • Can integrate

Container use cases

ECS & EKS

• Any container workload

• Standard Kubernetes (exit plan)

• Fixed minimum usage possibly with spikes or steady workloads

Batch

• Cheap processing (spot instances)

• Not real time execution

Su

mm

ary

Page 27: Containers and serverless technologies in AWS · • Cheap processing (spot instances) • Not real time execution y Mixed use cases Step functions • Workflow needs • Can integrate

Mixed use cases

Step functions

• Workflow needs

• Can integrate with Lambda, ECS and Batch and other services

• Combine purpose built services for their most efficient use cases

Su

mm

ary

Page 28: Containers and serverless technologies in AWS · • Cheap processing (spot instances) • Not real time execution y Mixed use cases Step functions • Workflow needs • Can integrate

Wrap up

• Know your workloads

• Use managed services

• Design the architecture with the right

tools&technologies

Su

mm

ary

Page 29: Containers and serverless technologies in AWS · • Cheap processing (spot instances) • Not real time execution y Mixed use cases Step functions • Workflow needs • Can integrate

THANK YOU FORYOUR ATTENTION!

KÁROLY SEPSYHead of Engineering

[email protected]+36 30 246 9120