Cloud Run Jobs overrides
HTML-код
- Опубликовано: 1 июн 2024
- We often need to run Cloud Run Jobs with different parameters. For example, a job may need to look for files in different Cloud Storage buckets every time it runs. See how Karolína Netolická shows Martin Omander how to run jobs with default parameters or override them for specific executions.
Chapters:
0:00 - Intro
0:18 - Running unattended jobs on Cloud Run
1:14 - Deploying code as a Cloud Run job
2:18 - Executing a Cloud Run job
3:04 - Overriding job parameters
4:44 - Starting Cloud Run jobs outside of the production environment
5:30 - Overriding the number of tasks & task timeouts
6:13 - Wrap up
Checkout more episodes of Serverless Expeditions → goo.gle/ServerlessExpeditions
Subscribe to Google Cloud Tech → goo.gle/GoogleCloudTech
#ServerlessExpeditions - Наука
Leave your comments and questions for Martin and Karolína down below!
Cloud Run Rules! Martin, please make a firebase blocking functions video. Thanks a lot!
Cloud run jobs are awesome!
Can you edit the env variable using the code in the job? Let's say I have an env variable that keeps track of the last processed ID, so when the job starts it uses that variable to know where the last job finished, and right before the job ends, it updates that variable. The idea here would be triggering the job on a schedule. Thank you
Good question! Environment variables are useful for read-only settings. In the case of an ID that needs to be updated and then persisted between executions, I would use a database. If you want to keep it simple you could use Firestore. It requires no connection strings or other settings, and reading or writing a value only requires a single line of code.
Is it possible to change the entrypoint of my job from the default index.js? I'm using the node library
Yes, in your package.json file, point the "start" script to another file than index.js. For example:
"start": "node my_file.js"
I remember when we were evaluating Cloud Run. We rejected It because there was a hard timeout on Cloud Run execution time. Is that now removed? We have jobs that may run for 5 hours. Can we use Cloud Run for them?
You set the timeout of your Cloud Run Job when you create it. You can set it to anything up to 24 hours.
Can we override the memory and CPU of the cloud run job ,if so how do we do it using the client libraries
I don't believe that's possible.
Cloud Run Jobs via Worflow, run same job in parallel with overriding parameters.
Okey
Ok
Understand me money all go problem