简体   繁体   English

Pip 在谷歌云应用引擎中从私有 github repo 安装 package

[英]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.

相关问题 pip 从私有 github repo 安装 package 与部署密钥 Z05B6053C41A2130AFD6BDA3B - pip install package from private github repo with deploy key in docker Install a python package using pip from private GitHub repo when building Docker image? - Install a python package using pip from private GitHub repo when building Docker image? 来自私人 github repo 的 pip install wheel 版本 - pip install wheel version from private github repo 是否可以使用 pip 从私有 GitHub 存储库安装包? - Is it possible to use pip to install a package from a private GitHub repository? pip 从私有仓库安装一个包,但从代理后面的 PyPi 安装依赖 - pip install a package from a private repo but dependencies from PyPi behind a proxy pip安装私有包 - pip install private package Google Cloud Build:使用 Cloud KMS 作为 secretEnv 从 JFrog 私有存储库进行 pip 安装 - Google Cloud Build: pip install from JFrog private repository using Cloud KMS as secretEnv 我如何使用jenkins从私人github存储库安装python软件包? - How do I install python package from private github repo using jenkins? pip 从私人仓库安装,但来自 PyPi 的要求 - pip install from private repo but requirements from PyPi 从PIP安装软件包时,使用专用存储库/服务器 - While installing package from PIP it using private repo/server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM