google.cloud.aiplatform: Model.batch_predict with sync=False does not submit batch prediction asynchronously - google-cloud-vertex-ai

I am creating a batch prediction from a pipeline. According to the documentation sync=False argument for Model.batch_predict would submit a batch prediction asyncronously, meaning (in my understanding) that the pipeline won't wait till the batch prediction completes. Instead it is pinging the batch prediciton status and completed only after the batch prediction completes.
Sample code:
model.batch_predict(
gcs_source=gcs_source,
gcs_destination_prefix=gcs_destination,
machine_type='n1-standard-4',
instances_format='csv',
sync=False
)
Pipeline logs:

According to the answer on python-aiplatform Github, asynchronous submission of batch prediction does not mean that the pipeline will not wait for its completion. It means that we can execute some more code after we have submitted the batch prediction. But the pipeline will still wait for the completion of batch prediction.
https://github.com/googleapis/python-aiplatform/issues/1793

Related

Save Actual Response time for a Process from Start to Complete in summary report(jtl) in jmeter

I have jmeter test plan in which I create a workflow which transitions statuses like Not Started to In Progress to Completed.
The problem I am having is how I can measure how long it took for workflow status from the time of creation to it get completed? Since we are logging the response time of api calls only.
Is there a way we can extract this info and also add it to the summary (jtl reports?) I was thinking if I could do it from beanshell post processor where I have the wait time calculated and also checking the status of workflow and I could write to the summary result (jtl). How can I do this?
I have the test plan set up something like this:
Thread Group
- Create Workflow API call
- WhileLoop(checking on a flag set by beanshell post processor)
- Wait for 5seconds
- Check for timeout using JSR223 sampler(java)(don't want test to run inevitably if something goes wrong so want to break the loop after a fixed amount of time)
- Get Workflow status API call
- Beanshell post processor to check the response from above call to see if status is Completed or wait time has exceeded. In either of these cases I set the while loop flag false if not repeat the loop wait for 5 seconds and so on.
For the test itself it works as expected.
Use transaction controller to measure the time taken. Please check the reference;-
The Transaction Controller generates an additional sample which
measures the overall time taken to perform the nested test elements.
Hope this helps.

Mapping in informatica

I have a job in GECS scheduler which will trigger a informatica workflow, if the job is late for 10 min then we need to create a mapping such a way that it will fail the workflow and trigger a mail to outlook saying the workflow is failed
You can branch off your main workflow line to a timer task which starts as soon as the workflow starts. Set the timer to wait for the specified number of minutes then route to an email task on condition that the last task of the workflow has not succeeded. One caveat to this approach is that the workflow will always run for no less than the timer task is set for even when the rest of it has completed early. For this reason it is pragmatic to replace the timer task with a command task to a script which checks every few seconds for the final task completion and exits when this is true or after the set time interval

Batch transfer rate upper bound in a channel - batch creation start trigger

From this stackoverflow question i understand a batch is sent out one at a time (without bother pipeline in this discussion), meaning, a second batch won't be sent until the first one is delivered.
My follow up question is, what condition starts a batch creation process. If i understand correctly (i could obviously be wrong....), a batch is created/cut, or let's call it a batch creation process is completed, if BATCHSZ reached, or BATCHLIM reached, or BATCHINT (=/=0) reached, or XMIT-Q is empty, but what starts a batch creation process. Is the batch creation process synchronous or asynchronous to batch transfer? Does batch creation process start only after the previous batch is delivered (synchronous), or it's totally decoupled from the previous batch (eg. while the previous batch is still in transfer)?
This is a sibling/follow up question to 1. The intention is to estimate our QRepl-MQ-transfer upper limit. As documented in entry "[added on Dec.20]" in the first (self-)answer in 1, our observation seems support the batch creation process starts synchronously AFTER the previous batch transfer is complete, but i couldn't find ibm references documenting the details......
Thanks for your help.
our observation seems support the batch creation process starts
synchronously AFTER the previous batch transfer is complete, but i
couldn't find ibm references documenting the details.
Yes that is how it works. If a 2nd batch started before the 1st batch finished then you would have newer messages jumping in front of older messages, which could cause all kinds of issues.
Yes, I know, applications are not suppose to rely on messages coming in a logical order (i.e. 1,2,3,etc.) but they do.
Think of MCA (Message Channel Agent) which is the process getting messages from the XMIT the same as a security guard at a store on Black Friday. He lets in 50 people form the line (batch). After many people leave the store, he lets in another 50 people into the store. Would you want ASYNC batching of the line at the store - absolutely not. The security guard wants order not chaos.
The same is true for MQ's MCA. It creates a batch of "n" messages, sends them, acknowledges them, then goes onto the next batch.

Spring Batch - I have multiple jobs to be executed sequentially and pass results of first job to second

Spring Batch jobs I have multiple jobs to be executed sequentially.
I need to pass results of job1 to job2 where it will be processed and then pass the data of job2 to job3. and so on. and may use results of job1 till job5(last job) and write output.
Job1 - is reading from db and and storing results in Hashmap
Job2 read from file and use the job1 hashmap for procesing results.
So please can anyone suggest the best solution for this. I am able to pass data between steps using ExecutionContext & JobPromotionListener, but not sure how to do same between multiple jobs
Instead of having 5 jobs for your batch processing you should have 5 steps of the same job. It is the best way to perform what you are trying to achieve.
Spring Batch framework keeps the state of every step execution so in case one of your steps fails you can relaunch your job that will only process remaining steps. Of course there are customisation options to control how and when a step can be considered failing or relaunchable.
Spring batch does not provide out of box support for the same.Seems like all you need is to configure some steps that can be executed sequentially.you can also divide the steps using the readers ,processor and writers

Oozie stuck in PREP state

I have a problem with running oozie coordinator jobs. Below is my job properties and xml file codes. While submitting the job there was no errors, but the job is always in 'PREP' state. I have to manually kill the job after some extent of waiting. When executing the workflow job separately, it was completed successfully.
Can you please let me know what could be wrong in my co-ord job?
Here is my coordinator.xml
Here is my coordinatorjob.properties
Thanks,
Kalai
Coordinator is in status PREP when it's start time is in the future. Start time in your config is 2014-02-25 11:31 UTC, so if you submitted in at the time of posting the question (2014-02-25 06:45 UTC) it still had about 5 hours to wait in PREP status before creating the first materialization and switching to RUNNING. See documentation about status transitions.
Synchronous jobs (individual jobs, not coordinator jobs, etc.) do the actual work while being in PREP state. It's the case of the SSH Action for example (even though there it is a little more complicated because the java code happens synchronously but the remote shell script is executed asynchronously).
In your case, I think Dmitry's answer is the more helpful one, but it's good to keep in mind that there can be other reasons for being in the PREP state too.

Resources