Cloud Run Jobs overrides

  Рет қаралды 3,062

Google Cloud Tech

Google Cloud Tech

Күн бұрын

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

Пікірлер: 36
@googlecloudtech
@googlecloudtech 2 ай бұрын
Leave your comments and questions for Martin and Karolína down below!
@oscarrivera4037
@oscarrivera4037 2 ай бұрын
Cloud Run Rules! Martin, please make a firebase blocking functions video. Thanks a lot!
@TheMomander
@TheMomander Ай бұрын
Thank you for the suggestion!
@santosharakere
@santosharakere 26 күн бұрын
Awesome, thanks.
@Mendez_84
@Mendez_84 2 ай бұрын
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 28 күн бұрын
@@techwithitchris Happy to hear you're finding Cloud Run Jobs useful! AI pipelines sounds like a great use case for this technology.
@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"
@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!
@CTOServefast
@CTOServefast 28 күн бұрын
You should give a link to the code used also you should give working examples in all supported languages
@TheMomander
@TheMomander 28 күн бұрын
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!
@VadimMarchenko
@VadimMarchenko 2 ай бұрын
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.
@rwp8033
@rwp8033 2 ай бұрын
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 2 ай бұрын
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.
@jsdegard3010
@jsdegard3010 27 күн бұрын
Thanks! Would cloud run jobs be appropriate for event-based triggers as well?
@TheMomander
@TheMomander 27 күн бұрын
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.
@Ar001-hb6qn
@Ar001-hb6qn Ай бұрын
How to pass the parameter externally from the cloud run job?
@TheMomander
@TheMomander 28 күн бұрын
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.
@NaveenTogalur
@NaveenTogalur 14 күн бұрын
How can i give my own execution_id while calling cloud run job?
@TheMomander
@TheMomander 7 күн бұрын
I don't believe you can. Could you share what you are trying to accomplish? There may another way to implement what you need.
@panigrahiswastik
@panigrahiswastik 2 ай бұрын
Cloud Run Jobs via Worflow, run same job in parallel with overriding parameters.
@TheMomander
@TheMomander Ай бұрын
Thank you for the suggestion!
@rohitkumar-dk5sy
@rohitkumar-dk5sy 2 ай бұрын
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.
@IvanPopov
@IvanPopov 26 күн бұрын
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 26 күн бұрын
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 25 күн бұрын
@@jbellero Yep, that's the kind of perspective I was missing in the video. Thanks!
@palamurukan
@palamurukan 2 ай бұрын
Okey
@guillekoala
@guillekoala Ай бұрын
Google AI is amazing, look they are making videos already.
@palamurukan
@palamurukan 2 ай бұрын
Ok
@palamurukan
@palamurukan 2 ай бұрын
Understand me money all go problem
Cloud Run volume mounts
9:57
Google Cloud Tech
Рет қаралды 4,4 М.
Practice 5,6 Aug 2024
4:25
Adisak Suasaming
Рет қаралды 35
A little girl was shy at her first ballet lesson #shorts
00:35
Fabiosa Animated
Рет қаралды 16 МЛН
Они так быстро убрались!
01:00
Аришнев
Рет қаралды 2,2 МЛН
路飞太过分了,自己游泳。#海贼王#路飞
00:28
路飞与唐舞桐
Рет қаралды 38 МЛН
Ouch.. 🤕
00:30
Celine & Michiel
Рет қаралды 25 МЛН
6 VSTs INSTRUMENTOS VIRTUALES GRATUITOS (2024)
10:23
Nico Astegiano
Рет қаралды 3,1 М.
Simplify Kuberay with Ray Operator on GKE
3:48
Container Bytes
Рет қаралды 51
What is Retrieval-Augmented Generation (RAG)?
6:36
IBM Technology
Рет қаралды 640 М.
Unity Beginner Tutorial 2024: How to Pick Up Items & Weapons
11:40
A Day in Life as a Google Data Scientist (Analytics)
6:43
Sundas Khalid
Рет қаралды 326 М.
Manually Deploy to Cloud Run - Updated for Artifact Registry
11:04
ScriptBytes
Рет қаралды 4,5 М.
Ускоряем ваш TV🚀
0:44
ARTEM_CHIBA
Рет қаралды 148 М.
iPhone 15 Pro в реальной жизни
24:07
HUDAKOV
Рет қаралды 494 М.