What's new in "Serverless" on Google Cloud Platform

137d3908243acfc30e126615d59d4e6d?s=47 Guillaume Laforge
October 18, 2018
120

What's new in "Serverless" on Google Cloud Platform

New App Engine and Coud Functions runtimes with Python, Node or Go.
Ability to deploy containers in a "serverless" fashion as well.
Discover the Knative open source project to build serverless platforms.

In this presentation, learn about all the new things in the serverless realm on Google Cloud Platform.

137d3908243acfc30e126615d59d4e6d?s=128

Guillaume Laforge

October 18, 2018
Tweet

Transcript

  1. 4.

    @glaforge Machine Learning Cloud ML Platform Vision API Video Intelligence

    API Speech API Translate API NLP API Compute Compute Engine App Engine Kubernetes Engine Container Registry Cloud Functions Networking Cloud Virtual Network Cloud Load Balancing Cloud CDN Cloud Interconnect Cloud DNS Storage & Databases Cloud Storage Cloud Bigtable Cloud Datastore Cloud SQL Cloud Spanner Big Data BigQuery Cloud Dataflow Cloud Dataproc Cloud Dataprep Cloud Datalab Cloud Pub/Sub Genomics Management Stackdriver Overview Monitoring Logging Error Reporting Debugger Deployment Manager Developer Cloud SDK Deployment Manager Cloud Source Repositories Cloud Endpoints Cloud Tools for Android Studio Cloud Tools for IntelliJ Google Plugin for Eclipse Cloud Test Lab Cloud Container Builder Identity & Security Cloud IAM Cloud IAP Cloud KMS Cloud Resource Manager Cloud Security Scanner Cloud Platform Security Overview Panorama
  2. 6.

    @glaforge Serverless model(s) Operational model Fully managed security Pay only

    for usage No servers Event-driven Open Service-based Programming model
  3. 8.

    @glaforge Serverless operational spectrum Managed by your cloud Container orchestration

    (k8s) Not serverless for programming or ops Container focused Infra managed by you Hosted FaaS/compute Easiest dev experience Code focused Limited runtime options Managed by your team Serverless anywhere Knative / GKE serverless addon On prem or multi-cloud Code or containers Custom hardware (GPU, TPU, IoT, etc) Offline You manage infra Serverless containers Custom languages & runtimes Infra still cloud-managed
  4. 9.

    @glaforge Serverless “compute” on Cloud Platform App Engine Standard Highly

    scalable, serverless web applications. Deploy and scale Applications that react to Requests Cloud Functions Event-driven serverless compute platform. Deploy and scale Functions that react to Events
  5. 12.

    @glaforge Demo: Sharing pictures Event-driven logic Data storage User facing

    Frontend Web + API Admin app Picture files Picture metadata & most frequent tags Vision API annotations: Labels, color, filtering Via Pub/sub Compute most popular tags pic-a-daily.appspot.com
  6. 14.

    @glaforge App Engine: 2nd generation runtimes New! Pay for what

    you use, scale to zero Open-source, idiomatic experience Use any module, extension, or framework New supported runtimes: ◦ Node.js 8 ◦ Python 3.7 ◦ PHP 7.2 ◦ Go 1.11 Existing runtime: • Java 8
  7. 15.

    @glaforge New in Cloud Functions Generally Available (with SLA!) Python

    3.7, Node 8 Tokyo, Belgium, Iowa Environment Variables New! Ubuntu 18.04 with many packages (ffmpeg, imagemagick, headless Chrome) Security Controls: VPC, IAM Scaling Controls Cloud SQL Direct Connect
  8. 16.

    @glaforge Serverless operational spectrum Managed by your cloud Container orchestration

    (k8s) Not serverless for programming or ops Container focused Infra managed by you Hosted FaaS/compute Easiest dev experience Code focused Limited runtime options Managed by your team Serverless anywhere Knative / GKE serverless addon On prem or multi-cloud Code or containers Custom hardware (GPU, TPU, IoT, etc) Offline You manage infra Serverless containers Custom languages & runtimes Infra still cloud-managed New!
  9. 17.

    @glaforge Serverless operational spectrum Managed by your cloud Container orchestration

    (k8s) Not serverless for programming or ops Container focused Infra managed by you Hosted FaaS/compute Easiest dev experience Code focused Limited runtime options Managed by your team Serverless containers Custom languages & runtimes Infra still cloud-managed Serverless anywhere Knative / GKE serverless addon On prem or multi-cloud Code or containers Custom hardware (GPU, TPU, IoT, etc) Offline You manage infra New!
  10. 22.

    @glaforge Go 1.11 alpha, vendor & module friendly — goo.gl/ceDfGk

    package hello import ( "fmt" "net/http" ) func HelloWorld(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello, World!") } $ gcloud beta functions deploy hello --entry-point HelloWorld --runtime go111 --trigger-http
  11. 23.

    @glaforge Node 8 with async / await const PubSub =

    require('@google-cloud/pubsub'); exports.helloPubSub = async (data, context) => { let ps = new PubSub(); try { const topicName = context.resource.name; const topic = ps.topic(topicName); const data = await topic.getMetadata(); const metadata = data[0]; console.log(`Metadata: ${JSON.stringify(metadata)}`); } catch(err) { console.error(err); } };
  12. 24.

    @glaforge Environment variables $ gcloud beta functions deploy fnNAme --set-env-vars

    FOO=bar $ gcloud beta functions deploy fnNAme --env-vars-file .env.yaml --update-env-vars FOO=baz --remove-env-vars FOO --clear-env-vars
  13. 25.

    @glaforge Function scaling control Limit scaling on a per-function basis

    Prevents DoSing resources with different scalability $ gcloud functions deploy --max-instances=100
  14. 26.

    @glaforge Security controls Control access to function invocation using IAM

    • Developers • Other functions or GCP services • End-users using Google Sign-In Set IAM policies on individual functions Private by default
  15. 27.

    @glaforge Security controls $ gcloud functions add-iam-policy-binding fnOne \ --member='allUsers'

    \ --role='roles/cloudfunctions.invoker' $ gcloud functions add-iam-policy-binding fnTwo \ --member='fnOne@projectid.iam.gserviceaccount.com' \ --role='roles/cloudfunctions.invoker'
  16. 28.

    @glaforge Per function identities By default, all functions share the

    same identity Identity can be set on a per-function basis to provide least privilege access
  17. 29.

    @glaforge Per function identities $ gcloud iam service-accounts create fnOne

    $ gcloud iam service-accounts add-iam-policy-binding \ fnOne@projectid.gserviceaccount.com \ --member='serviceAccount:fnOne@projectid.gserviceaccount.com' \ --role='roles/cloudfunctions.invoker' $ gcloud functions deploy fnOne \ --service-account fnOne@projectid.gserviceaccount.com
  18. 30.

    @glaforge Per function identities $ gcloud iam service-accounts create fnTwo

    $ gcloud iam service-accounts add-iam-policy-binding \ fnTwo@projectid.gserviceaccount.com \ --member='serviceAccount:fnTwo@projectid.gserviceaccount.com' \ --role='roles/cloudsql.client' $ gcloud functions deploy fnTwo \ --service-account fnTwo@projectid.gserviceaccount.com
  19. 32.

    @glaforge Cloud Tasks • Manage distributed task queues • Decouple

    and scale microservices • Manage resource consumption • Handle releases gracefully Sign up: http://bit.ly/tasks-signup New!
  20. 33.

    @glaforge Cloud Scheduler • Enterprise grade cron job scheduler •

    Schedule batch, big data jobs, cloud infra ops... ◦ Invoke Cloud Functions over HTTPS or Pub/Sub ◦ Invoke App Engine on a relative url handler • Manage all your jobs from one place Sign up: http://bit.ly/sched-signup New!
  21. 35.

    @glaforge Everything at Google runs in containers: Gmail, Web Search,

    Maps, ... MapReduce, batch, ... GFS, Colossus, ... Even GCE itself: VMs in containers Google launches 4 billion containers per week.
  22. 36.

    @glaforge New: serverless containers on GCF (EAP) Serverless containers on

    Cloud Functions Provide arbitrary container images and run them "serverlessly" • Takes a pre-built Docker image • Use arbitrary system libraries • Use arbitrary language runtime • Same serverless execution environment ◦ Stateless, event-driven, auto-scaling ◦ No servers ◦ Pay only while code runs
  23. 37.

    @glaforge Serverless containers Fully managed BYO workloads Pay for use

    & stateless New: serverless containers on GCF (EAP) Sign up: g.co/serverlesscontainers
  24. 40.
  25. 42.

    @glaforge Knative isn't... • An open source FaaS developer-facing product

    • A product, It's primitives • The right solution for everyone ◦ The audience is more the ops building & running their own serverless platform for the developers
  26. 43.

    @glaforge GKE serverless add-on — Knative on GKE GKE serverless

    add-on Request early access today at g.co/serverlessaddon
  27. 45.

    @glaforge Q & A cloud.google.com/serverless Knative github.com/knative GKE serverless add-on

    (sign-up) g.co/serverlessaddon Containers on Cloud Functions (sign-up) g.co/serverlesscontainers
  28. 46.

    @glaforge Thank you! cloud.google.com/serverless Knative github.com/knative GKE serverless add-on (sign-up)

    g.co/serverlessaddon Containers on Cloud Functions (sign-up) g.co/serverlesscontainers