将 VPC Service Controls 与 AI Platform Training 搭配使用

VPC Service Controls 可帮助您降低 AI Platform Training 作业中发生数据渗漏的风险。当您从服务边界内的项目运行训练作业时,VPC Service Controls 可确保您的数据不会离开此边界。这包括作业访问的训练数据以及作业创建的工件。

创建服务边界

请按照 VPC Service Controls 指南创建服务边界。指定要限制的服务时,请务必添加以下所有服务:

  • AI Platform Training and Prediction API (ml.googleapis.com)
  • Pub/Sub API (pubsub.googleapis.com)
  • Cloud Storage API (storage.googleapis.com)
  • Google Kubernetes Engine API (container.googleapis.com)
  • Container Registry API (containerregistry.googleapis.com)
  • Cloud Logging API (logging.googleapis.com)

要使 AI Platform Training 和 AI Platform Prediction 与 VPC Service Controls 正常配合使用,您的服务边界必须限制所有这些服务。

限制

创建完服务边界并将 Google Cloud 项目添加到该边界内后,您可以运行训练作业,而无需进行其他任何配置。但是,需遵守以下限制:

  • 如果您在创建服务边界后的最初几分钟内提交训练作业,则作业可能会失败。请等待大约 15 分钟,以便 VPC Service Controls 限制传播到所有相关的 Google Cloud 服务,然后再重试。
  • 您无法使用 TPU 执行训练
  • ml.googleapis.com 受到保护时,您的训练作业将无法访问边界外的资源。您的训练代码可以访问属于边界内项目的 Cloud Storage 以及 VPC Service Controls 所支持其他 Google Cloud 服务中的数据,但如果您的代码向边界外的服务发送请求,则这些请求将失败。
  • 如果不进行其他配置,您就无法使用 Google Cloud Console 管理服务边界内项目的训练作业或查看日志。了解如何在 Google Cloud 控制台中访问受服务边界保护的资源

AI Platform Prediction 和 AI Platform Vizier

当您创建保护 AI Platform Training and Prediction API 的服务边界时,VPC Service Controls 会保护 AI Platform Training 和 AI Platform Prediction 的在线预测功能。了解如何将 VPC Service Controls 与 AI Platform Prediction 搭配使用

但是,VPC Service Controls 不支持批量预测。当 AI Platform Training and Prediction API 受服务边界的保护时,AI Platform 会禁止创建批量预测作业,以防止数据渗漏。

AI Platform Vizier 也使用 AI Platform Training and Prediction API,它目前不完全支持 VPC Service Controls。但是,当您配置服务边界以保护 AI Platform Training and Prediction API 时,AI Platform Vizier 将保持启用状态。

后续步骤