Тёмный

Cloud Run Jobs overrides 

Google Cloud Tech
Подписаться 1,2 млн
Просмотров 3,1 тыс.
50% 1

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
Watch more episodes of Serverless Expeditions → goo.gle/ServerlessExpeditions
Subscribe to Google Cloud Tech → goo.gle/GoogleCloudTech
#ServerlessExpeditions

Наука

Опубликовано:

 

8 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 36   
@googlecloudtech
@googlecloudtech 3 месяца назад
Leave your comments and questions for Martin and Karolína down below!
@oscarrivera4037
@oscarrivera4037 3 месяца назад
Cloud Run Rules! Martin, please make a firebase blocking functions video. Thanks a lot!
@TheMomander
@TheMomander Месяц назад
Thank you for the suggestion!
@santosharakere
@santosharakere 29 дней назад
Awesome, thanks.
@Mendez_84
@Mendez_84 3 месяца назад
Cloud run jobs are awesome!
@techwithitchris
@techwithitchris Месяц назад
Really useful thank you!
@techwithitchris
@techwithitchris Месяц назад
I am using cloud run jobs to run AI pipelines
@TheMomander
@TheMomander Месяц назад
@@techwithitchris Happy to hear you're finding Cloud Run Jobs useful! AI pipelines sounds like a great use case for this technology.
@VadimMarchenko
@VadimMarchenko 3 месяца назад
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?
@TheMomander
@TheMomander 2 месяца назад
You set the timeout of your Cloud Run Job when you create it. You can set it to anything up to 24 hours.
@jsdegard3010
@jsdegard3010 Месяц назад
Thanks! Would cloud run jobs be appropriate for event-based triggers as well?
@TheMomander
@TheMomander Месяц назад
If you need to trigger code from events, a Cloud Run *service* (instead of job) is the way to go. If you search for "cloud run trigger with events" you will find the documentation for setting up triggers which will invoke Cloud Run services.
@CTOServefast
@CTOServefast Месяц назад
You should give a link to the code used also you should give working examples in all supported languages
@TheMomander
@TheMomander Месяц назад
Good point! I will do that for future videos. In the meantime, you can find working examples and how to deploy Cloud Run Jobs if you do a web search for "Quickstart: Create and execute a job in Cloud Run". Best of luck with your project!
@sumeetilalwani5548
@sumeetilalwani5548 2 месяца назад
Is it possible to change the entrypoint of my job from the default index.js? I'm using the node library
@TheMomander
@TheMomander 2 месяца назад
Yes, in your package.json file, point the "start" script to another file than index.js. For example: "start": "node my_file.js"
@rwp8033
@rwp8033 3 месяца назад
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
@TheMomander
@TheMomander 3 месяца назад
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.
@IvanPopov
@IvanPopov Месяц назад
That really looks awesome - quick and configurable. There's only one thing I wonder - how does this feature compare to the other available execution runtimes? For instance, can't the same be achieved with Cloud Functions? And if it can, what does this new approach give us more?
@jbellero
@jbellero 29 дней назад
You can use Cloud Functions but this specific use case utilized containerized units of code. Whereas Cloud Functions provides an HTTP server wrapper to your userland function in the languages available (currently only Java, Python, Go, & Node). It's a matter of choice based on requirements. Do you use one of those languages and want to use HTTP as your transport? Then Cloud Functions is probably all you need. But if you want to run (or already have existing) code not in that language set, say Rust for example, you could package it into a container (or rely on Buildpacks to do it) and deploy the code to Cloud Run Jobs.
@IvanPopov
@IvanPopov 29 дней назад
@@jbellero Yep, that's the kind of perspective I was missing in the video. Thanks!
@swethabathula-r2r
@swethabathula-r2r Месяц назад
How to override arguments and command using for execution of a cloud run job in java code. We are using JobsClient class to execute the job. Could you please help us with a code example which needs to show clear steps how to send new arguments to the job for execution please
@TheMomander
@TheMomander Месяц назад
I believe it's done like this: try (JobsClient jobsClient = JobsClient.create()) { RunJobRequest request = RunJobRequest.newBuilder() .setName(JobName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) .setValidateOnly(true) .setEtag("etag3123477") .setOverrides(RunJobRequest.Overrides.newBuilder().build()) .build(); Execution response = jobsClient.runJobAsync(request).get(); } You'd set your overrides with the setOverrides() call above. I found this code snippet by searching for "google cloud run java jobsclient". You will find more documentation of these classes there. Best of luck with your project!
@rohitkumar-dk5sy
@rohitkumar-dk5sy 3 месяца назад
Can we override the memory and CPU of the cloud run job ,if so how do we do it using the client libraries
@TheMomander
@TheMomander 2 месяца назад
I don't believe that's possible.
@panigrahiswastik
@panigrahiswastik 3 месяца назад
Cloud Run Jobs via Worflow, run same job in parallel with overriding parameters.
@TheMomander
@TheMomander Месяц назад
Thank you for the suggestion!
@Ar001-hb6qn
@Ar001-hb6qn Месяц назад
How to pass the parameter externally from the cloud run job?
@TheMomander
@TheMomander Месяц назад
Are you asking about returning a value from a Cloud Run to the caller? That is not possible. If you want to return a value from your Cloud Run code, there are two possibilities: 1. Either your Cloud Run Job writes any return values in a database, to Cloud Storage, or sends a Pub/Sub message. 2. Or you put your code in a Cloud Run *service* (instead of a Job). Cloud Run services are triggered by HTTP calls, so they can return values when they respond to such a call.
@palamurukan
@palamurukan 3 месяца назад
Okey
@NaveenTogalur
@NaveenTogalur 18 дней назад
How can i give my own execution_id while calling cloud run job?
@TheMomander
@TheMomander 10 дней назад
I don't believe you can. Could you share what you are trying to accomplish? There may another way to implement what you need.
@palamurukan
@palamurukan 3 месяца назад
Ok
@guillekoala
@guillekoala Месяц назад
Google AI is amazing, look they are making videos already.
@palamurukan
@palamurukan 3 месяца назад
Understand me money all go problem
Далее
Cloud Run volume mounts
9:57
Просмотров 4,4 тыс.
Has Generative AI Already Peaked? - Computerphile
12:48
Kubernetes networking on Google Cloud
7:20
Просмотров 14 тыс.
A Day in Life as a Google Data Scientist (Analytics)
6:43
Cloud Run deployments with YAML
11:26
Просмотров 9 тыс.
Introducing Cloud Run Jobs
6:44
Просмотров 15 тыс.
DBT Core on Cloud Run Job
39:26
Просмотров 1,5 тыс.
КРАХ WINDOWS 19 ИЮЛЯ 2024 | ОБЪЯСНЯЕМ
10:04