Reputation: 38
I started a batch prediction job in AutoML (now VertexAI) for a small csv in one of my buckets, using a classification model, then I noticed the csv had an error but was unable to find a way to cancel the job using the web GUI, it just says "running" but I see no "stop" or "cancel" button.
Fortunately, it was done after 20 minutes, but I need to know how to stop a job since I will require predictions for way bigger files and can't risk having to wait until the job ends by itself. It was kind of desperating being able to watch the log throwing error after error and not being able to stop the job. I tried to delete the job but it said it can't be deleted while its running.
I found a related question, but it was not answered, the job just finished itself after a couple of days. I can't risk that. How do I force "batch prediction" to stop?
I will greatly appreciate any help.
Upvotes: 0
Views: 1628
Reputation: 7287
Unfortunately the cancel/stop feature is not yet available in the Vertex AI UI. As per How do I force "batch prediction" to stop?, the OP sent a feedback. You can ask if there was a public issue tracker created for this so you can monitor the progress of the feature request there.
But there is a workaround for this, just send a request projects.locations.batchPredictionJobs.cancel via REST.
To do this you can send a request via curl. In this example the model and endpoint are located in us-central1
thus the location defined in the request.
Just supply your project-id
and the batch-prediction-id
on the request. To get the batch-prediction-id
you can get it via UI:
Get batch-prediction-id
via UI:
To cancel the job send a cancel request via curl. If requests is successful, the response body is empty.
curl -X POST -H "Content-Type: application/json" \
-H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \
https://us-central1-aiplatform.googleapis.com/v1/projects/your-project-id/locations/us-central1/batchPredictionJobs/batch-prediction-job-id:cancel
Check in Vertex AI UI if the job was canceled.
Upvotes: 2