2

I used this code, straight from the Javadocs, to delete a VertexAI Training Pipeline

try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
  TrainingPipelineName name =
      TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]");
  pipelineServiceClient.deleteTrainingPipelineAsync(name).get();
}

I get this error. From what I can see, this means that this API, though officially documented, is simply unimplemented. How do we delete Training Pipelines using Java?

Error in deleting //aiplatform.googleapis.com/projects/746859988231/locations/us-central1/trainingPipelines/186468439399187392: 
java.util.concurrent.ExecutionException: 
com.google.api.gax.rpc.UnimplementedException: io.grpc.StatusRuntimeException:
UNIMPLEMENTED: HTTP status code 404
...
<!DOCTYPE html>
<html lang=en>
....
  <p>The requested URL <code>/google.cloud.aiplatform.v1.PipelineService
/DeleteTrainingPipeline</code> was not found on this server.  
<ins>That’s all we know.</ins>
Joshua Fox
  • 18,704
  • 23
  • 87
  • 147

1 Answers1

3

According to the official documentation, https://cloud.google.com/vertex-ai/docs/reference/rest , the supported service URLs for this service are:

https://us-central1-aiplatform.googleapis.com
https://us-east1-aiplatform.googleapis.com
https://us-east4-aiplatform.googleapis.com
https://us-west1-aiplatform.googleapis.com
https://northamerica-northeast1-aiplatform.googleapis.com
https://europe-west1-aiplatform.googleapis.com
https://europe-west2-aiplatform.googleapis.com
https://europe-west4-aiplatform.googleapis.com
https://asia-east1-aiplatform.googleapis.com
https://asia-northeast1-aiplatform.googleapis.com
https://asia-northeast3-aiplatform.googleapis.com
https://asia-southeast1-aiplatform.googleapis.com
https://australia-southeast1-aiplatform.googleapis.com

  PipelineServiceSettings pipelineServiceSettings =
        PipelineServiceSettings.newBuilder()
            .setEndpoint("us-central1-aiplatform.googleapis.com:443")
            .build();

 try (PipelineServiceClient pipelineServiceClient =
      PipelineServiceClient.create(pipelineServiceSettings)) {

  String location = "us-central1";
  TrainingPipelineName trainingPipelineName =
      TrainingPipelineName.of(project, location, trainingPipelineId);

  OperationFuture<Empty, DeleteOperationMetadata> operationFuture =
      pipelineServiceClient.deleteTrainingPipelineAsync(trainingPipelineName);

  System.out.format("Operation name: %s\n", operationFuture.getInitialFuture().get().getName());
  System.out.println("Waiting for operation to finish...");
  operationFuture.get(300, TimeUnit.SECONDS);

  System.out.format("Deleted Training Pipeline.");
}
JCompetence
  • 6,997
  • 3
  • 19
  • 26
  • 1
    That does it! What's the difference? Just that non-standard endpoint? Do you know if this is a bug that Google should be asked to fix, or just standard behavior that I don't quite understand? – Joshua Fox Sep 17 '21 at 12:05
  • Kindly see the edit @JoshuaFox The service is supported by specific endpoints – JCompetence Sep 17 '21 at 14:14
  • 1
    Thank you. I submitted a bug request to fix the docs: I asked them to add that `setEndpoint()` call – Joshua Fox Sep 19 '21 at 06:51