Jump to Content

Serverless for all your needs: Cloud Run jobs and second-generation execution environment now GA

April 25, 2023
Karolina Netolicka

Group Product Manager

Bex Heart

Product Marketing Manager

Google Cloud Next

Registration is open for our flagship event August 29-31.


For the past 15 years, organizations have been using Google Cloud serverless products to connect the world, secure cloud banking, provide free education to anyone, revolutionize the cosmetic industry, re-architect the freight industry, redefine the retail industry, and more.

And today, with the general availability of Cloud Run jobs and the Cloud Run second-generation execution environment, the sky’s the limit for what you can build on our serverless platforms.

Cloud Run was initially designed around the needs of websites or APIs serving, allowing users to run “services” that responded to HTTP requests or events. Services were a good match for workloads that needed to serve requests or automatically scale to meet traffic demands.

But the same organizations that used Cloud Run to innovate and change entire industries wished there were a way to use serverless environments to run other workloads that didn’t quite fit into the HTTP request paradigm. For example: internal administrative jobs, scripts, orchestration workloads, lightweight data transformation tasks, workloads that ran on a schedule instead of responding to an event, and more importantly, that exited when done.

With a few workarounds, this was possible using a few Cloud Run services — for example, by bundling a web server into a container and having an incoming request start the job itself, or by breaking a single job into smaller, shorter tasks to avoid timeouts. But these workarounds required changing the code, which made it harder to move existing workloads to a serverless environment. 

Well, with Cloud Run’s latest features, you could say:

  • Batch data transformations just went serverless.

  • Database migrations just went serverless.

  • Nightly reports just went serverless.

  • Run-to-completion jobs just went serverless.

  • Even accessing network file systems just went serverless!

Let’s take a deeper look.

Cloud Run jobs 

With Cloud Run jobs, what used to be time-consuming manual processes can now be simplified to scheduled jobs or reduced to a simple command-line operation. Introduced in Preview at Google I/O, Cloud Run jobs enable developers to execute long, run-to-completion scripts that do not respond to HTTP requests — all on a serverless platform. Enterprise developers looking to modernize legacy scripts and port them into a serverless environment can do so without having to re-architect the code into an event-driven model.

"We have plenty of data processing tasks running on the cloud. Some of those are long running and require a large number of compute resources. However, managing virtual machines for that purpose is time-consuming and spreads the focus from high-value activities. With Cloud Run jobs we now can leverage the full capabilities of serverless services, including faster time to deployment, improved ideation cycles, and out-of-the box automation. Furthermore, this service eliminates the need to constantly maintain compute resources and such saving costs." – Christian Gorke, Head of Cyber Center of Excellence, Commerzbank AG


Cloud Run second generation execution environment

Cloud Run’s new execution environment provides increased CPU and network performance and lets you mount network file systems. It allows you to move existing applications that use network file systems to Cloud Run without rewriting their storage layer. Cloud Run can access your network file system, regardless of whether you're using Cloud Filestore, running your own NFS server, or want to access your Cloud Storage files via Cloud Storage FUSE. Additionally, the second-generation execution environment is fully compatible with all Linux features, making it easier to move existing containers to Cloud Run. This means that software that previously didn’t run in Cloud Run due to unimplemented system call issues can now run in Cloud Run’s second-generation execution environment.

"When we migrated to Cloud Run, we were impressed with its scalability, resilience, and ease of use. Then we switched to the second-generation execution environment and it sped up our boot time by 4x! This has allowed us to easily move lots of microbatch jobs from an on-prem old-fashioned application server to a fully managed serverless integration platform based on Apache Camel running on Cloud Run second generation execution environment." — Alessandra Franca Grendele, CIO, Carrefour

We were able to achieve these improvements because the second generation execution environment is based on a micro VM. This means that unlike the first generation execution environment, which uses gVisor, a container running in the second generation execution environment has access to a full Linux kernel. 

Our vision for serverless is to support the broadest possible array of workloads and use cases in a powerful, deeply integrated and easy-to-use environment. If you've been holding off from migrating your applications to Cloud Run because you thought they weren’t a good fit for serverless, take another look. 

Get started with second-generation environment and Cloud Run jobs.

Posted in