Slide 1

Slide 1 text

Proprietary + Confidential An overview of serverless compute & orchestration on Google Cloud Guillaume Laforge Cloud Developer Advocate @glaforge

Slide 2

Slide 2 text

Serverless Compute

Slide 3

Slide 3 text

3 Serverless Compute Develop, deploy and scale applications fast and securely in a fully managed environment Fully Managed Speed to Market Auto-scaling

Slide 4

Slide 4 text

Proprietary + Confidential What is the benefit of Serverless? Cloud Physical Servers Network Hardware Physical Security Internet Connectivity On Prem Application Development Performance Monitoring Serverless Scaling VM Provisioning Ops & Security Management

Slide 5

Slide 5 text

5 Proprietary + Confidential Are you looking for a custom house or move-in ready? Custom House = On-Prem Control and selection of ● Site plan ● Floorplan ● Appliance and Fixture locations ● Appliances, fixtures, finishes ● Furniture and Small appliances ● What to cook for dinner and watch on TV Fully Furnished = Serverless Control and selection of: ● Site plan ● Floorplan ● Appliance and Fixture locations ● Appliances, fixtures, finishes ● Furniture and Small appliances ● What to cook for dinner and watch on TV

Slide 6

Slide 6 text

Fully Managed Infrastructure Rapid Auto-scaling Fault-tolerant (N+1) Self-healing Built-in services (APM, identity & security) Pre-provisioned Abstraction (Dev. Experience) Connectivity HTTPS / gRPC Events VPC App 2008 Function 2017 Container 2019 Serverless Compute

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

Proprietary + Confidential Serverless Use Cases App Engine Cloud Run Cloud Functions Build a web or mobile app — HTTP web app ✅ ✅ Developing APIs — Web & mobile backends ✅ ✅ — Internal APIs and services ✅ ✅ Data Processing ✅ Automation — Event driven reactive automation ✅ ✅ Application Integration Services ✅ ✅ Common use cases for Serverless compute products

Slide 9

Slide 9 text

Cloud Run Cloud Functions Serverless applications & containers Serverless functions https://cloud.run https://cloud.google.com/functions

Slide 10

Slide 10 text

Focus: Cloud Functions

Slide 11

Slide 11 text

Proprietary + Confidential Why choose... Cloud Functions Connect and extend GCP services Single-purpose, reusable code Triggered by an event Retries Node.js, Python, Go, Java, PHP, Ruby, .NET

Slide 12

Slide 12 text

Cloud Functions as Cloud Glue! Access Google services Cloud Storage Cloud Pub/Sub HTTPS Firebase Cloud Scheduler Cloud Tasks

Slide 13

Slide 13 text

Container Managed by Google Serverless container infrastructure Managed by you Function code & dependencies Functions Framework Runtime (Node.js) Operating System (Ubuntu) index.js exports.helloWorld = (req, res) => { res.send("Hello, Cloud Next!"); } package.json ... Manages your function's lifecycle What is a Function?

Slide 14

Slide 14 text

Functions Framework Curated by Google Local Development Managed by you Function code & dependencies 7 Languages Functions Frameworks

Slide 15

Slide 15 text

Languages and versions supported ● Node.js — 10, 12, 14, 16 ● Python — 3.7, 3.8, 3.9 ● Go — 1.13, 1.16 ● Java — 11, 17 preview ● .NET Core — 3.1 ● PHP — 7.4, 8.1 preview ● Ruby — 2.6, 2.7, 3.0

Slide 16

Slide 16 text

What’s new? Developer Experience ● Develop and run locally Expand supported workloads ● Minimum instances ● Private pools Security ● Secret Manager integration ● Customer Managed Encryption Keys Networking ● VPC connectors: Shared VPC support ● VPC-SC New

Slide 17

Slide 17 text

Developer Experience ● Develop and run locally Security ● Secret Manager integration ● Customer Managed Encryption Keys ● Binary Authorization Networking ● VPC connectors: Shared VPC support ● VPC-SC Cloud Functions 2nd generation Expand supported workloads ● Larger instances ● Concurrency > 1 ● BigQuery remote functions ● Traffic splitting ● Longer processing time ● 90+ event sources via Eventarc New

Slide 18

Slide 18 text

Focus: Cloud Run

Slide 19

Slide 19 text

Proprietary + Confidential Why choose... Cloud Run Run your code and deploy in seconds to a container Automatic HTTPS/SSL, Custom domains Any language, any library Portability No cluster management

Slide 20

Slide 20 text

Any language Any library Any binary Ecosystem of base images .js .rb .go .py .sh … 0 1 0 1 0 0 1 1 1 Containers

Slide 21

Slide 21 text

Containers Flexibility Serverless Velocity

Slide 22

Slide 22 text

Cloud Run Fully managed, deploy your workloads and don’t see the cluster. Cloud Run on Anthos Deploy into Anthos, run serverless side-by-side with your existing workloads. Knative Everywhere Use the same APIs and tooling anywhere you run Kubernetes with Knative. Serverless Containers with Knative and Anthos

Slide 23

Slide 23 text

Container to production in seconds Natively Serverless One experience, where you want it Cloud Run Bringing serverless to containers

Slide 24

Slide 24 text

Public • Website • API endpoint Private • Internal services • Async tasks • Mobile backend • Webhook HTTPS endpoint

Slide 25

Slide 25 text

Listen on 0.0.0.0 on port $PORT (default 8080) HTTP server must start < 4 min (timeout → 504) Request time < 60 min (default → 5 min) Stateless (in-memory file system, doesn’t persist) Computation only within request (No background activity) Container contract

Slide 26

Slide 26 text

1 vCPU per container instance (configurable to 8 vCPU) 512 MiB of memory up to a max of 8 GiB (256MB-32GB preview) 80 concurrent requests per container (configurable 1-1000) 100 max containers by default (configurable 1-1000) Sandboxed by gVisor Container resources

Slide 27

Slide 27 text

Pay per use CPU / Memory / Requests 100ms

Slide 28

Slide 28 text

Billable time Instance Billable Time Request 1 Start Request 1 End Request 2 Start Request 2 End Instance Time Billable Non-billable

Slide 29

Slide 29 text

Concurrency: 1 to 1000! concurrency = 1 concurrency = 80 (default) - 1000 (max)

Slide 30

Slide 30 text

What’s new? Developer Experience ● Develop and run locally ● Deploy from local source (no Dockerfile needed) Expand supported workloads ● CPU allocation (always allocated) ● Better performance and file system support ● gRPC streaming, WebSockets, HTTP/2 ● 60min request timeout Security ● Secret Manager integration ● Customer Managed Encryption Keys ● Binary Authorization Networking ● VPC connectors: Shared VPC support ● VPC-SC Committed use discounts New

Slide 31

Slide 31 text

Beyond Compute

Slide 32

Slide 32 text

Cloud Workflows Declarative service orchestration Cloud Tasks Asynchronous task execution Eventarc Asynchronous event delivery Cloud Build Serverless CI/CD Cloud Pub/Sub Serverless messaging Cloud Scheduler Cron in the cloud API Gateway Declarative API management VPC Access Serverless networking Build and persist Orchestrate Connect Cloud Firestore Serverless NoSQL database AI Platform Serverless data science and ML BigQuery Serverless data warehouse Portfolio of Serverless capabilities on Google Cloud

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

Focus: Workflows

Slide 39

Slide 39 text

Workflows at a glance ● Easiest way to connect ● Zero maintenance ● Durable and reliable ● Observable ● Self documenting ● Event & scheduled triggers ● Long-running operations ● Callbacks ● Connectors ● Low-latency, fast deploys ● Scale from 0 → ∞ Compute External API’s Cloud Services etc... SaaS API’s Private API’s Other Clouds Triggers Workflows - orchestrate & integrate

Slide 40

Slide 40 text

The Workflow definition Workflow sources specify the steps to take, and the state (variables) to save.

Slide 41

Slide 41 text

The Workflow definition The syntax is in YAML or JSON, and is automatically visualized as a flow chart.

Slide 42

Slide 42 text

Use cases ● Service orchestration ● Batch jobs ● Business processes ● Data and ML pipelines ● Infrastructure automation

Slide 43

Slide 43 text

Parallel steps! What’s new? Preview - : parallel: … for: value: … steps: ... - : parallel: ... branches: - : steps: ... ... - : steps: ...

Slide 44

Slide 44 text

Let’s finish with a demo! pixxearch.appspot.com github.com/glaforge/pixxearch g.co/codelabs/serverless-workshop

Slide 45

Slide 45 text

󰚦 Thank you! 󰢨 Questions?