passing container arguments to Cloud Run Job (not service)

2,082 views
Skip to first unread message

Dokook Choe

unread,
Aug 19, 2022, 5:32:55 PM8/19/22
to Google Cloud Developers
Hi,

I have a simple container that I'd like to run with different parameters. Using Cloud Run Job, I can execute a job with predefined parameters but I am wondering if there is a way to pass arguments to it.

I have asked the same question on stackoverflow and one answer tells me to update parameters before every execution but it doesn't sound like Cloud Run is designed to be used like that.
stackoverflow post: https://stackoverflow.com/questions/73394733/passing-container-arguments-to-cloud-run-job-not-service

If there is no good way to pass arguments, am I supposed to use Cloud Run Job only if it runs with the same parameters? That doesn't sound right to me either. Can someone tell me how to pass container arguments to Cloud Run Job?

Thanks,
DK

Rogelio Monter

unread,
Aug 31, 2022, 2:05:30 PM8/31/22
to Google Cloud Developers

As stated in the official documentation:

    Unlike a Cloud Run service, which listens for and serves requests, a Cloud Run job only runs its tasks and exits when finished. A job does not listen for or serve requests, and cannot accept arbitrary parameters at execution.

Therefore, there is no way for a Cloud Run job to receive parameters at execution time.

An approach could be as stated in the Stack Overflow answer:

    To update the parameters as stated in Configure container entrypoint command and arguments, then execute the job.
Reply all
Reply to author
Forward
0 new messages