schoon
schoon

Reputation: 3324

Why is my GCP Vertex pipeline api_endpoint not right?

My API_ENDPOINT is set to europe-west1-aiplatform.googleapis.com.

I define a pipeline:

def pipeline(project: str = PROJECT_ID, region: str = REGION, api_endpoint: str = API_ENDPOINT):

when I run it:

job = aip.PipelineJob(
display_name=DISPLAY_NAME,
template_path="image classification_pipeline.json".replace(" ", "_"),)
job.run()

it is always created in USandA:

INFO:google.cloud.aiplatform.pipeline_jobs:PipelineJob created. 
Resource name: projects/my_proj_id/locations/us-central1/pipelineJobs/automl-image-training-v2-anumber

How do I get it into Europe?

Upvotes: 2

Views: 257

Answers (2)

Kabilan Mohanraj
Kabilan Mohanraj

Reputation: 1906

The location parameter in the aip.PipelineJob() class can be used to specify in which region the pipeline will be deployed. Refer to this documentation for more information about the PipelineJob() method.

REGION = "europe-west1"

job = aip.PipelineJob(
          display_name=DISPLAY_NAME,
          template_path="image classification_pipeline.json".replace(" ", "_"),
          location=REGION)

job.run()

The above code will deploy a pipeline in the europe-west1 region. The code returns the following output. The job is now deployed in the specified region.

INFO:google.cloud.aiplatform.pipeline_jobs:Creating PipelineJob
INFO:google.cloud.aiplatform.pipeline_jobs:PipelineJob created. Resource name: projects/<project-id>/locations/europe-west1/pipelineJobs/hello-world-pipeline

Upvotes: 1

schoon
schoon

Reputation: 3324

Set location = API_ENDPOINT in google.cloud.aiplatform.init.

Upvotes: 1

Related Questions