google-cloud-platform - 如何在 Vertex AI 中访问 AIP_STORAGE_URI?
问题描述
我上传了一个模型
gcloud beta ai models upload --artifact-uri
在我访问的 docker 中AIP_STORAGE_URI
。我看到这AIP_STORAGE_URI
是另一个 Google 存储位置,所以我尝试使用下载文件,storage.Client()
但它说我无权访问:
google.api_core.exceptions.Forbidden: 403 GET https://storage.googleapis.com/storage/v1/b/caip-tenant-***-***-*-*-***?projection=noAcl&prettyPrint=false: custom-online-prediction@**.iam.gserviceaccount.com does not have storage.buckets.get access to the Google Cloud Storage bucket
我正在使用默认服务帐户运行此端点。
https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#artifacts
根据上面的链接:
The service account that your container uses by default has permission to read from this URI.
我究竟做错了什么?
解决方案
错误背后的原因是,Vertex AI 使用的默认服务帐户具有“<a href="https://cloud.google.com/storage/docs/access-control/iam-roles#standard-roles" rel ="nofollow noreferrer">存储对象查看者”角色,排除storage.buckets.get
权限。同时,该storage.Client()
部分代码storage.buckets.get
向默认服务账户无权访问的 Vertex AI 托管存储桶发出请求。
要解决此问题,我建议您按照以下步骤操作 -
推荐阅读
- .net - 调试本地存储的自己的 NuGet 包
- javascript - 使用 Javascript 从 Excel 文件中提取某些数据行
- http - Angular 7 中的 Http 帖子返回无效响应
- python - 根据字典中的值更新熊猫数据框
- ubuntu - Ubuntu 在 18.04 中限制运行 curl 命令
- typescript - 打字稿:如何根据对象键/值类型在 ES6 映射中创建条目
- html - 如何判断一个按钮是否被点击
- php - 如何在没有任何外部数据库的情况下将 mysql 与 laravel 一起使用
- javascript - 禁用AngularJS下拉多选
- android - 如何为当前活动设置动画(不是过渡)?