Thursday, November 7, 2024

Cloud Functions To Cloud Run Functions: Smooth Transition

- Advertisement -

Now known as Cloud Run functions, Cloud Functions and its well-known event-driven programming approach are included, along with the scalability and fine-grained control that developers like about the serverless platform. You don’t have to pick between the two because we’ve developed a single serverless platform with Cloud Run features for all of your workloads.

This goes beyond just changing the name. Since Google Cloud combined the Cloud Functions infrastructure with Cloud Run, developers of Cloud Functions (2nd gen) now have immediate access to all new Cloud Run features, including NVIDIA GPUs.

- Advertisement -

You will have total control over the underlying service settings when Cloud Functions transform into Cloud Run functions and you may build and deploy functions directly with Cloud Run:

gcloud beta run deploy hello-function \
–source . \
–function hello_get \
–base-image nodejs20

A new deployment option for Cloud Run: the function

Additionally, all functions developed using Google Cloud Functions (2nd gen) can utilize all of Cloud Run’s features, such as:

  • Functions with multi-event trigger management
  • Exceptional Direct VPC egress performance
  • Mounting volumes from Cloud Storage
  • Language runtimes controlled by Google, with base image security updates applied automatically
  • Separating traffic and managing revisions
  • controlled support for Prometheus and OpenTelemetry using sidecar containers
  • Functions of inference with NVIDIA GPUs

Maintenance of current gcloud commands, terraform modules, and APIs

Cloud Run functions will be automatically transformed from Cloud Functions 2nd gen functions. We are dedicated to maintaining compatibility for the current functions APIs, gcloud commands, and Terraform modules (Gen 2) with Cloud Run functions. This allows you to use Run features on your function without requiring your deployment automation to be redesigned.

- Advertisement -

First-generation functions will remain accessible as Cloud Run functions. Before you can fully utilize the underlying Cloud Run functionality, 1st gen functions must be upgraded to Cloud Run functions. Terraform modules (Gen 1), gcloud commands, and Cloud Run functions (1st gen) APIs will all remain maintained.

Linking functions to your platform

Connecting your platform is made easy with Cloud Run functions; you just need to worry about the code; Google Cloud take care of the rest. Without needing to bundle up the code, any member of your team who knows how to code can come up with a solution. Also, you have a choice of seven widely used languages. Even with insufficient knowledge of infrastructure, data scientists, for example, can get a Python script running in the cloud.

Because each Cloud Run function is its own independent component and is not immediately impacted by other workloads, it maintains high productivity and low operations. It is improbable that upgrades and modifications to one function will affect another.

Responding when an object is added to a Cloud Storage bucket is a typical use case for functions. The method could create thumbnails for images or analyze text files for emotion. However, there are a plethora of additional instances where clients opt for Cloud Functions:

  • Data transformation and BigQuery loading
  • Establishing a webhook that is called by a third party (GitHub, for example)
  • Evaluating data added to a database or storage bucket using machine learning APIs

Start using the features of Cloud Run

Building and managing event-driven apps is now simpler than ever thanks to Cloud Run features, regardless of your level of experience with serverless computing.

Version comparison for Cloud Run functions

The Cloud Run functions come in two versions:

  • Formerly known as Cloud Functions (2nd gen), Cloud Run functions enable you to activate your functions using Eventarc and Pub/Sub by deploying them as services on Cloud Run.
  • First-generation Cloud Run functions, originally called Cloud Functions (1st gen), are the original function version with constrained event triggers and configurable options.

Whenever feasible, Google advise you to select Cloud Run functions for new features. Google Cloud do, however, intend to keep supporting Cloud Run features (1st gen).

This article compares the two product versions and explains the capabilities that have been added to Cloud Run functions.

Cloud Run Functions

Google Cloud’s next-generation Functions-as-a-Service is called Cloud Run functions. Cloud Run functions, which are based on Cloud Run and Eventarc, provide improved infrastructure and wider event coverage to Cloud Run functions. These include:

  • Built on Cloud Run: Cloud Build is used to create functions, which are then made available as Cloud Run services. This allows you to personalize your function just like you would with a Cloud Run service. To learn more about setting your service, including memory restrictions and environment variables, check out the Cloud Run guide.
  • Extended request processing durations: Execute workloads with lengthier requests, including handling massive data streams from BigQuery or Cloud Storage.
  • Greater instance sizes: Execute workloads that are more computationally demanding, in-memory, and parallel.
  • Enhanced concurrency: Reduce cold starts and increase delay by managing several concurrent requests with a single function instance.
  • Traffic management options include rolling a function back to an earlier version or dividing traffic among several function revisions.
  • Eventarc integration: Cloud Run functions now support all 90+ event sources that are offered by Eventarc thanks to native support for Eventarc triggers.
  • More widespread support for CloudEvents: All language runtimes support the industry-standard CloudEvents, offering a unified developer experience.

Details can be found in the comparison table

Cloud Run functions share resource quotas and constraints with Cloud Run because they are deployed as services on Cloud Run.

Comparison table

FeatureCloud Run functions (1st gen)Cloud Run functions
Image registryContainer Registry or Artifact RegistryArtifact Registry only
Request timeoutUp to 9 minutesUp to 60 minutes for HTTP-triggered functionsUp to 9 minutes for event-triggered functions
Instance sizeUp to 8GB RAM with 2 vCPUUp to 16GiB RAM with 4 vCPU
Concurrency1 concurrent request per function instanceUp to 1000 concurrent requests per function instance
Traffic splittingNot supportedSupported
Event typesDirect support for events from 7 sourcesSupport for any event type supported by Eventarc, including 90+ event sources via Cloud Audit Logs
CloudEventsSupported only in Ruby, .NET, and PHP runtimesSupported in all language runtimes
- Advertisement -
Thota nithya
Thota nithya
Thota Nithya has been writing Cloud Computing articles for govindhtech from APR 2023. She was a science graduate. She was an enthusiast of cloud computing.
RELATED ARTICLES

Recent Posts

Popular Post

Govindhtech.com Would you like to receive notifications on latest updates? No Yes