GCP的Vertex AI(AI平台)PipeLineserviceClient给出了不完美的错误

发布于 2025-01-29 05:46:02 字数 577 浏览 6 评论 0 原文

尝试使用 pipelineserviceclient list_pipeline_jobs 方法给定here, I get the following error:

_InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNIMPLEMENTED
details = "Received http2 header with status: 404"
...

How is the API unimplemented, how do I resolve this?

When trying to list pipelines with PipelineServiceClient list_pipeline_jobs method as given here, I get the following error:

_InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNIMPLEMENTED
details = "Received http2 header with status: 404"
...

How is the API unimplemented, how do I resolve this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

日久见人心 2025-02-05 05:46:02

我们这里缺少两件事:

  1. 我们需要使用具有正确端点的客户端选项初始化Pipelineserviceclient。端点列表在这里。另外,它应该是端点的格式:端口
  2. 我们需要将正确的请求提供给 list_pipeline_jobs

示例:对于 Asia-South1 区域,我们将写一个这样的呼叫:

import google.cloud.aiplatform as aip
from google.api_core.client_options import ClientOptions

aip.init(project='<PROJECT_NAME>',
         staging_bucket='PROJECT_BUCKET',
         location='asia-south1')

options = ClientOptions(
    api_endpoint="asia-south1-aiplatform.googleapis.com:443")

cli = aip.gapic.PipelineServiceClient(client_options=options)

parent = cli.common_location_path(project='<PROJECT_NAME>', location='asia-south1')
request = aip.gapic.ListPipelineJobsRequest(
    request=request
)

pipeline_jobs_pager = cli.list_pipeline_jobs(parent=parent) # returns a pager object

for page in pipeline_jobs_pager.pages:
  for pipeline_job in page.pipeline_jobs:
    print(pipeline_job.name)

注意: gapic 可以用 v1 v1beta1 调用。

There are two things we are missing here:

  1. We need to initialize PipelineServiceClient with client options with the correct endpoint. List of endpoints are given here. Also it should be in the format of endpoint:port
  2. We need to give the correct request to the list_pipeline_jobs.

Example: for asia-south1 region, we would write a call like this:

import google.cloud.aiplatform as aip
from google.api_core.client_options import ClientOptions

aip.init(project='<PROJECT_NAME>',
         staging_bucket='PROJECT_BUCKET',
         location='asia-south1')

options = ClientOptions(
    api_endpoint="asia-south1-aiplatform.googleapis.com:443")

cli = aip.gapic.PipelineServiceClient(client_options=options)

parent = cli.common_location_path(project='<PROJECT_NAME>', location='asia-south1')
request = aip.gapic.ListPipelineJobsRequest(
    request=request
)

pipeline_jobs_pager = cli.list_pipeline_jobs(parent=parent) # returns a pager object

for page in pipeline_jobs_pager.pages:
  for pipeline_job in page.pipeline_jobs:
    print(pipeline_job.name)

Note: gapic can be replaced with v1 or v1beta1 calls.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文