我正在使用 google cloud appengine 并使用 gcloud app deploy
和标准的 app.yaml
文件进行部署。我的 requirements.txt 文件有一个从 github (git+ssh://git@github.com/...git
) 获取的私有(private)包。此安装在本地运行,但是当我运行部署时,我得到了
Host key verification failed.
fatal: Could not read from remote repository.
这表明安装时没有 ssh key 。阅读文档(https://cloud.google.com/appengine/docs/standard/python3/specifying-dependencies)似乎这不是一个选择???
Dependencies are installed in a Cloud Build environment that does not provide access to SSH keys. Packages hosted on repositories that require SSH-based authentication must be copied into your project directory and uploaded alongside your project's code using the pip package manager.
对我来说,这似乎不是最佳选择——将代码分解到一个包中的全部意义在于能够避免 repo 中的重复。现在,如果我想使用 appengine,你是说这不可能吗?
真的没有解决办法吗?
最佳答案
参见:
App Engine 服务没有(也不应该)访问您的私有(private) 存储库。
一种替代方法(您不想要)是将您的公钥上传到 App Engine 服务。
另一个 - 如文档所述 - 是您必须将您的私有(private)存储库的内容作为上传的一部分提供给服务。
关于python - 从谷歌云应用引擎中的私有(private) github repo pip 安装包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58211194/