是否有可能从 gcp 顶点作业命中同一项目中另一个 gcp pod 中的 http 端点?

Is it possible from a gcp vertex job to hit an http endpoint in another gcp pod in the same project?

我有一个自定义容器顶点端点,它作为输入传递 url,以便作业可以调用它来获取作业所需的特定数据帧。 (gcs:// buckets 确实有效)但我想专门对同一个 gcp 项目中的服务器使用 http 请求。

我尝试使用端点上的 --networks 参数将端点设置为私有,但随后收到消息:

{
  "error": {
    "code": 400,
    "message": "Making request from public OnePlatform API is not allowed on a private Endpoint peered with network (projects/11111111111/global/networks/some-dev-project-vpc).",
    "status": "FAILED_PRECONDITION"
  }
}

当我尝试击中那个私有顶点端点时。我试过从同一个项目的 运行 pod 中 curling 它,但这也没有用。

有办法吗? 谢谢

错误指出您的请求是 public API,这可能是因为您使用 public url 模式进行预测。顶点端点的结构在私有端点和 public 之间有所不同,因此请仔细检查您是否正在为您的请求使用私有端点 url。

Public

https://{REGION}-aiplatform.googleapis.com/v1/projects/{PROJECT}/locations/{REGION}/endpoints/{ENDPOINT_ID}:predict

私人

http://{ENDPOINT_ID}.aiplatform.googleapis.com/v1/models/{DEPLOYED_MODEL_ID}:predict

您可以使用以下 gcloud 命令生成专用端点 url:

gcloud beta ai endpoints describe {ENDPOINT_ID} \
  --region=us-central1 \
  --format="value(deployedModels.privateEndpoints.predictHttpUri)"

可以找到有关专用端点的更多文档here