Upgrade to Pro — share decks privately, control downloads, hide ads and more …

An overview of Google Cloud serverless compute and orchestration

An overview of Google Cloud serverless compute and orchestration

After a brief introduction to the characteristics of serverless solutions, and a panorama of the existing serverless compute products of Google Cloud (with a focus on Cloud Run and Cloud Functions), we’ll have a closer look at serverless orchestration, thanks to Google Cloud Workflows. With Workflows, developers and architects can orchestrate existing APIs and microservices, crystallise and version the business process of the enterprise, and bring more coherence in the chaos of microservices.

137d3908243acfc30e126615d59d4e6d?s=128

Guillaume Laforge

June 23, 2022
Tweet

More Decks by Guillaume Laforge

Other Decks in Technology

Transcript

  1. Proprietary + Confidential An overview of serverless compute & orchestration

    on Google Cloud Guillaume Laforge Cloud Developer Advocate @glaforge
  2. Serverless Compute

  3. 3 Serverless Compute Develop, deploy and scale applications fast and

    securely in a fully managed environment Fully Managed Speed to Market Auto-scaling
  4. 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
  5. 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
  6. 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
  7. None
  8. 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
  9. Cloud Run Cloud Functions Serverless applications & containers Serverless functions

    https://cloud.run https://cloud.google.com/functions
  10. Focus: Cloud Functions

  11. 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
  12. Cloud Functions as Cloud Glue! Access Google services Cloud Storage

    Cloud Pub/Sub HTTPS Firebase Cloud Scheduler Cloud Tasks
  13. 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?
  14. Functions Framework Curated by Google Local Development Managed by you

    Function code & dependencies 7 Languages Functions Frameworks
  15. 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
  16. 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
  17. 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
  18. Focus: Cloud Run

  19. 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
  20. 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
  21. Containers Flexibility Serverless Velocity

  22. 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
  23. Container to production in seconds Natively Serverless One experience, where

    you want it Cloud Run Bringing serverless to containers
  24. Public • Website • API endpoint Private • Internal services

    • Async tasks • Mobile backend • Webhook HTTPS endpoint
  25. 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
  26. 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
  27. Pay per use CPU / Memory / Requests 100ms

  28. Billable time Instance Billable Time Request 1 Start Request 1

    End Request 2 Start Request 2 End Instance Time Billable Non-billable
  29. Concurrency: 1 to 1000! concurrency = 1 concurrency = 80

    (default) - 1000 (max)
  30. 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
  31. Beyond Compute

  32. 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
  33. None
  34. None
  35. None
  36. None
  37. None
  38. Focus: Workflows

  39. 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
  40. The Workflow definition Workflow sources specify the steps to take,

    and the state (variables) to save.
  41. The Workflow definition The syntax is in YAML or JSON,

    and is automatically visualized as a flow chart.
  42. Use cases • Service orchestration • Batch jobs • Business

    processes • Data and ML pipelines • Infrastructure automation
  43. Parallel steps! What’s new? Preview - <namedStep>: parallel: … for:

    value: <v> … steps: ... - <parallelStepName>: parallel: ... branches: - <branchName1>: steps: ... ... - <branchNameN>: steps: ...
  44. Let’s finish with a demo! pixxearch.appspot.com github.com/glaforge/pixxearch g.co/codelabs/serverless-workshop

  45. 󰚦 Thank you! 󰢨 Questions?