Google Cloud

Running One-Off/Admin Jobs for Cloud Run Services

Disclaimer: This is not officially supported by Google Cloud.

Cloud Run hosts services that handle HTTP requests but sometimes you need a way to run one-off / admin jobs with the same settings and container image. At this time the managed Cloud Run service doesn’t provide a way to run those kinds of processes and running them through HTTP handlers can result in short timeouts (5 minutes by default, max 60 minutes), the possibility to accidentally run them more than once, and potential security issues. Whether you need this for schema migrations, management tasks, or something else, I’ve made it easy for you. Click to launch a tool in Cloud Shell that will walk you through it:

One-Off Cloud Run

Want to see more about how it works? Watch this short demo:

Container-based Serverless Scheduled Jobs on Google Compute Engine

Most of my compute workloads today are on Cloud Run, a serverless for containers platform. But some workloads like scheduled jobs don’t fit the service-oriented model of Cloud Run. There are many places I can run those workloads but I’d like to keep the serverless “pay for what you use” model and still use containers as my packaging format. I could use Kubernetes for these and use Cloud Run for Anthos to run everything in one place but I wanted something more bare-bones. I created a way to hook up Cloud Scheduler so that it starts scheduled jobs from containers on Google Compute Engine. Here is a video walkthrough for how to set it up and use it: