【发布时间】:2021-04-10 04:11:30
【问题描述】:
我实际上对 App Engine 柔性环境部署感到恼火。我正在使用 Cloud Build 从 GitHub 存储库部署我的代码,但手动部署也会出现此问题。
我想创建一个具有灵活环境的简单 Flask 应用程序来为 Web 应用程序“分析”部分加载 Tensorflow 模型(这不是更好的方法,存在 GCP ML 但我想使用 App引擎)。
这是我的analysis.yaml 文件:
service: analysis
env: flex
runtime: custom
runtime_config:
python_version: 3
resources:
memory_gb: 2.4
(我也试过没有入口点)
将我的服务部署为 Cloud Build 会出现如下警告:
WARNING: Unable to verify that the Appengine Flexible API is enabled for project [XXX]. You may not have permission to list enabled services on this project. If it is not enabled, this may cause problems in running your deployment. Please ask the project owner to ensure that the Appengine Flexible API has been enabled and that this account has permission to list enabled APIs.
在提出这个问题后,我关注了这篇帖子:How can I grant the account permission to list enabled APIs?,以启用 App Engine API 并向我的服务帐户授予正确的角色。
使用 gcloud SDK,我启用并检查了带有 gcloud services enable appengineflex.googleapis.com 和 gcloud services list 的 App Engine Flexible API
然后,我将以下角色授予 Cloud Build 服务帐号:
还有那些用于我的 App Engine 服务帐户的:
我真的不明白为什么我的部署失败了。我想它是由错误的权限角色分配触发的,但我不知道。
期待您的帮助,并在此先感谢您。
【问题讨论】:
-
您能分享一下您遇到的错误吗?将角色授予 Cloud Build 服务帐户后,您是否收到与以前相同的警告错误?
-
是的。奇怪的是没有发生错误。这只是一个警告,但云构建中的部署循环,我有义务中断它。
-
请注意,App Engine Flexible 需要时间来部署,大约需要 5 分钟。
-
是的,我知道,但感谢您的建议。实际上,我正在尝试重新制作我所有的 AppEngine 实例。我清理了所有 AppEngine 存储桶并删除了所有服务。但目前,部署已完成,但 UPDATE('更新服务 [...](这可能需要几分钟)需要很长时间,而且似乎没有结束。
-
我更新了我的
analysis.yaml文件,您可以在原帖中看到它。
标签: python google-app-engine google-cloud-build google-iam google-flexible