[英]Pip install package from private github repo in google cloud appengine
I am using google cloud appengine and deploying with gcloud app deploy
and a standard app.yaml
file.我正在使用 google cloud appengine 并使用
gcloud app deploy
和标准app.yaml
文件进行部署。 My requirements.txt file has one private package that is fetched from github ( git+ssh://git@github.com/...git
).我的 requirements.txt 文件有一个从 github (
git+ssh://git@github.com/...git
) 获取的私有 package 。 This install works locally, but when I run the deploy I get此安装在本地工作,但是当我运行部署时,我得到
Host key verification failed.
fatal: Could not read from remote repository.
This suggests there is no ssh key when installing.这表明安装时没有 ssh 密钥。 Reading docs ( https://cloud.google.com/appengine/docs/standard/python3/specifying-dependencies ) it appears that this just isn't an option???
阅读文档( 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.
To me this seems severely not-optimal - the whole point of factoring out code into a package was to be able to avoid duplication in repos.对我来说,这似乎非常不理想 - 将代码分解为 package 的全部目的是能够避免回购中的重复。 Now, if I want to use appengine, you're telling me this not possible?
现在,如果我想使用 appengine,你是在告诉我这不可能吗?
Is there really no workaround?真的没有解决办法吗?
See:看:
https://cloud.google.com/appengine/docs/standard/python3/specifying-dependencies#private_dependencies https://cloud.google.com/appengine/docs/standard/python3/specifying-dependencies#private_dependencies
The App Engine service does not (and should not) have access to your private repo. App Engine 服务没有(也不应该)访问您的私人存储库。
One alternative (that you don't want) is to upload your public key to the App Engine service.一种替代方法(您不想要)是将您的公钥上传到 App Engine 服务。
The other -- as documented -- is that you must provide the content of your private repo to the service as part of your upload.另一个——如文件所述——是您必须在上传过程中向服务提供您的私有存储库的内容。
I'm going through the same issue, deploying on gcloud a python project that contains in its requirements.txt some private repositories.我遇到了同样的问题,在 gcloud 上部署了一个 python 项目,该项目在其 requirements.txt 中包含一些私有存储库。 As @DazWilkin wrote already, there's no way to deploy it like you do normally.
正如@DazWilkin 已经写的那样,没有办法像平常那样部署它。
One option would be to create a docker image of the whole project and its dependencies, save it into the gcloud docker registry and then pull it into the App Engine instance.一种选择是创建整个项目及其依赖项的 docker 映像,将其保存到 gcloud docker 注册表中,然后将其拉入 App Engine 实例。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.