【问题标题】:Is it possible to request a Vertex AI endpoint from another GCP project?是否可以从另一个 GCP 项目请求 Vertex AI 端点?
【发布时间】:2022-01-25 11:35:51
【问题描述】:

我在 GCP Vertex AI 上训练了一个模型,并将其部署在一个端点上。

我可以使用这个 python 代码 https://cloud.google.com/vertex-ai/docs/predictions/online-predictions-automl#aiplatform_predict_image_classification_sample-python 执行从样本到我的模型的预测

它适用于我的 GCP 项目。

我的问题是,是否可以从另一个 GCP 项目请求此端点?如果我在两个项目中都设置了服务帐号并设置了 IAM 角色?

【问题讨论】:

    标签: python-3.x google-cloud-platform google-cloud-vertex-ai


    【解决方案1】:

    是的,这是可能的。例如,您有项目 A 和项目 B,假设项目 A 托管模型。

    • 在项目 A 中添加项目 B 的服务帐户,并至少提供 roles/aiplatform.user 预定义角色。请参阅 predefined roles 并查找 roles/aiplatform.user 以查看其中包含的完整角色。

    • 此角色包含 aiplatform.endpoints.* 和 aiplatform.batchPredictionJobs.*,因为这些是运行预测所需的角色。

      IAM permissions for Vertex AI

      Resource Operation Permissions needed
      batchPredictionJobs Create a batchPredictionJob aiplatform.batchPredictionJobs.create (permission needed on the parent resource)
      endpoints Predict an endpoint aiplatform.endpoints.predict (permission needed on the endpoint resource)

    通过此设置,项目 B 将能够使用项目 A 中的模型来运行预测。

    注意:只要确保项目 B 的脚本指向项目 A 中的资源,例如 project_idendpoint_id

    【讨论】:

    • 谢谢,已解决
    猜你喜欢
    • 2021-11-06
    • 2021-12-02
    • 2023-02-17
    • 2023-04-04
    • 2021-12-09
    • 2022-09-27
    • 2021-10-09
    • 2021-11-12
    • 2020-06-12
    相关资源
    最近更新 更多