where should i run my code?app engine standard 2nd generation runtimes open-source, idiomatic...

58
@glasnt Where should I run my code? Katie McLaughlin Developer Advocate, Google Cloud

Upload: others

Post on 05-Oct-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

Where should I run my code?

Katie McLaughlinDeveloper Advocate, Google Cloud

Page 2: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

Where should I run my code?

Page 3: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

It depends.

Page 4: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

Thank you!@glasnt

Page 5: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

Okay, fine.

Page 6: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

It depends.

Page 7: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

I'm a sysadmin.I'm not your sysadmin.

Page 8: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

? ?

Page 9: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

What is the "right choice"?

Page 10: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

The right choiceis what is right for you.

Page 11: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

Cloud Functions

App Engine

CloudRun

ComputeEngine

Page 12: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

01Cloud Functions

Managed code execution

Page 13: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

What is Cloud Functions?

A serverless environment to build and connect cloud services

Event driven - connect Cloud services● via Cloud Pub/Sub, Cloud Storage, HTTP requests & more

Serverless ● Fully managed execution environment● Pay only for what you use● Autoscales with usage

Page 14: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

What do you have to worry about?

What is managed for you?

Everything else.

EventsFunction Definitions

Page 15: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

Good fit? Constraints?

Good fit

Serverless

Using Cloud Pub/Sub, Cloud Storage

Don't want to think about runtime environment

Data transformations (ETL)

HTTP glue

Constraints

Function level granularity

Must interact via events

Specific language runtimes:

Node.js, Python, Go.

Page 16: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

Why Cloud Functions?

Don't have to even think about servers

Pay only for what you use

Simple developer experience (deploy functions not apps)

Page 17: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

02App Engine

Managed Runtimes

Page 18: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

What is App Engine?

App Engine goal: let developers focus on app code

No servers to manage, scale up fast, scale down to zero

No patches/updates

Versioning

Traffic splitting

“Serverless” before it was cool ;)

Page 19: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

App Engine Standard 2nd Generation Runtimes

Open-source, idiomatic experience

Use any extension, binary, or framework

Supported Runtimes

Python, Java, Node.js, PHP, Ruby, Go

Use Google Cloud APIs directly

Page 20: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

What do you have to worry about?

What is managed for you?

Everything else.

Code

HTTP Requests

Versions

Page 21: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

Good fit? Constraints?

Good fit

HTTP/S request-response

Stateless serving applications

Scaling to high traffic

Constraints

Standard● Runtimes for Python, Java, Node, PHP, Ruby, Go● HTTP/S only

Flexible runtimes● Inherit Docker constraints● Not best for very low traffic sites

Page 22: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

Why App Engine?

Developers focus on code

Optimized for web serving workloads

Especially great for variable load

App Engine currently serves more than 100B requests per day

Page 23: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

03Cloud Run

Managed containers

Page 24: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

What is Cloud Run?

Input: container image with code listening on $PORT for HTTP

SSL terminationHTTP requests to running containers 1-80 concurrent requests, configurableScale to zeroPay only for actual CPU & memory used

out of beta 2 days ago!

Available in europe-west1

Page 25: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

What do you have to worry about?

What is managed for you?

Everything else.

* https://cloud.google.com/run/docs/reference/container-contract

Code in a container imageBuilding the imageListening on a $PORT *

Page 26: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

Good fit? Constraints?

Good fit

Stateless

HTTP request-response workloads

Scale: way up, down to zero, bursty

Specific runtime requirements

Constraints

Must use containers

Decide on build process (Cloud Build, etc)

Page 27: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

Why Cloud Run?

Serverless developer experience

Decide on operations model at deployment time

Change with a re-deploy

Runs anything that can run in a container and listens to HTTP.

Open: run same containers on your machines

Page 28: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

04Compute Engine

Virtual Machines

Page 29: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

What is Compute Engine?

Virtual machines and networking

Per Virtual Machine:● up to 160 vCPUs● up to 3,844 GB RAM● up to 64 TB of disk● optional GPUs, TPUs

Each specification independently configurable

Page 30: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

What is Compute Engine?

Virtual machines and networking

Start quickly, ~20 seconds to user code running

Pre-built images, or create your own● Debian, CentOS, CoreOS, Ubuntu, RHEL, SUSE● also Windows Server Datacenter!

Page 31: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

What do you have to worry about?

What is managed for you?

Everything else.

Your softwareOperating system / disk imagesCPU, RAM, DiskNetworking - Firewall, Load balancers, VPNs

Page 32: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

Good fit? Constraints?

Good fit

Existing systems (lift and shift)

1:1 container:VM mapping

Specific OS / kernel required

License requirements

Running databases

Constraints

Scaling speed floor

~20s per VM, 1000s in ~60s

Decide how to handle software updates

Page 33: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

Why Compute Engine?

Consistency - ask for 10 VMs, you get 10 good VMs

Custom VMs - choose RAM and CPU, GPUs

Live disk resize - also any size disk on any machine

Billing - Sustained use discounts, preemptible VMs, per minute billing

Live migrations - your VMs stay up longer

Architecture - good fit for most existing systems

Page 34: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

Why Compute Engine?

Google Cloud services run on it, too:

Cloud SQL

GKE

Cloud Dataflow

Cloud Dataproc

Cloud Build

and more...

Page 35: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

! ! But hold on there, Katie

Page 36: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

??Why haven't you mentioned Kubernetes yet?

Page 37: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

Oh, but I have.

Page 38: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

Knativeopen source building blocks for serverless on Kubernetes

Page 39: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

Knative directly powers Cloud Run

Page 40: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

Found a good fit already?

Page 41: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

Page 42: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

What choice do I have?

Page 43: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

Packages

Language

Operating System

Hardware

What choice do I have?

Any .

None .

Any .

Any .

Any .

Any .

Any .

Any .

Some .

Any .

None .

None .

Some .

None .

None .

Some .

Page 44: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

Alternatively:

Page 45: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

What do I haveto worry about?

Page 46: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

Packages

Language

Operating System

Hardware

What do I have to worry about?

Worry .

Managed .

Worry .

Worry .

Worry .

Worry .

Worry .

Managed .

.

Managed .

Worry .

Managed .

Managed .

Managed .

Managed .

Managed .

Worry .

Page 47: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

The right choiceis what is right for you.

Page 48: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

Do one thing

Do many things

Do anything

Do everything

https://twitter.com/steren/status/1126310362494787584

Page 49: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

The right choicemight be

more than one.

Page 50: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

Use them together!

Page 51: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

Most systems use multiple services together

Page 52: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

CloudDatastore

CloudSQL

CloudSpanner

CloudBigtable

BigQuery

TranslationAPI

NaturalLanguage API

SpeechAPI

VisionAPI

AppEngine

ComputeEngine

KubernetesEngine

CloudFunctions

CloudRun

CloudStorage

CloudPub/Sub

CloudTasks

CloudScheduler

Complex systems could use many more component!

Page 53: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

…or move up or down abstraction levels

Page 54: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

Page 55: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

The right choiceis what is right for you.

Page 56: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

Thank you!@glasnt

Page 57: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

??Questions

Page 58: Where should I run my code?App Engine Standard 2nd Generation Runtimes Open-source, idiomatic experience Use any extension, binary, or framework Supported Runtimes Python, Java, Node.js,

@glasnt

Thank you!@glasnt