为什么我的 GCP Vertex 管道 api_endpoint 不对?

Why is my GCP Vertex pipeline api_endpoint not right?

我的 API_ENDPOINT 设置为 europe-west1-aiplatform.googleapis.com

我定义了一个管道:

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

当我运行它时:

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

它始终在 USandA 中创建:

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

如何进入欧洲?

google.cloud.aiplatform.init中设置location = API_ENDPOINT

aip.PipelineJob()class中的location参数可用于指定管道将部署在哪个区域。有关 PipelineJob() 方法的更多信息,请参阅此 documentation

REGION = "europe-west1"

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

job.run()

以上代码将在 europe-west1 区域部署管道。代码returns输出如下。作业现已部署到指定区域。

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