How to run Python script in Cron in GCP?

Viewed 67

I would like to get a help from you. I am trying to deploy my python script to google cloud and execute it as cron. I am unable to deploy it to google cloud as i am unable to it work. Can anyone help me with this? Thanks in advance.

2 Answers

In your use case, you have to deploy your python somewhere.

In both case, I recommend you to use container to package your code.

Then you have to schedule that runtime.

  • Call the Cloud Run Job execution API directly with Cloud Scheduler (Be careful, for now, you can't send parameters to your jobs, only trigger a run)
  • Call the Batch API directly with Cloud Scheduler and with the config in the body

Cloud Scheduler is a fully managed enterprise-grade cron job scheduler. It allows you to schedule virtually any job, including batch, big data jobs, cloud infrastructure operations, and more. You can automate everything, including retries in case of failure to reduce manual toil and intervention. Cloud Scheduler even acts as a single pane of glass, allowing you to manage all your automation tasks from one place.

https://cloud.google.com/scheduler

Related