如何在Azure或AWS中托管私有python包管理器 [英] How to host a private python package manager in Azure or AWS
问题描述
我在一个由Python开发人员组成的小团队中工作,我们的目标是创建一个私有软件包管理器来存储我们的软件包.我穿过 pypicloud 并跟随其
I work in a small team of Python developers and we aim to create a private package manager to store our packages. I came cross pypicloud and following its tutorial I've successfully been able to upload and install packages stored in AWS-S3. That's fantastic.
但是,私有软件包管理器是在终端中启动并在本地键入pserve server.ini
托管的.然后,可以在http://0.0.0.0:6543/#/
上访问软件包管理器.理想情况下,我希望该服务器为:
However, the private package manager is launched and hosted locally typing pserve server.ini
in the terminal. The package manager is then accessible at http://0.0.0.0:6543/#/
. Ideally, I want this server to be:
- 托管在云中(可能是Azure,但AWS可以)
- 启动并运行24/7
- 安全.用户必须进行身份验证才能查看软件包管理器和软件包.
- 不是托管在操作系统中,而是更高级别的托管(例如docker容器或Azure函数应用程序?),因为它更易于维护,地理复制等
问题:如何始终在云中启动并运行安全的私有服务器(python软件包管理器)?
Question: How to get a secure and private server (python package manager) always up and running in the cloud?
推荐答案
我将使用Linux上的Azure WebApp:
I would go to Azure WebApp on Linux:
- https://docs. microsoft.com/en-us/azure/app-service/containers/app-service-linux-intro
- https://docs. microsoft.com/en-us/azure/app-service/containers/quickstart-custom-docker-image
- https://docs.microsoft.com/en-us/azure/app-service/containers/app-service-linux-intro
- https://docs.microsoft.com/en-us/azure/app-service/containers/quickstart-custom-docker-image
这大致上是在没有Kubernetes负担的情况下部署容器的一种简单方法.如果您确实想要专用的容器解决方案(有,请 ACS 可能是最好的是几个协调器.
This is roughly just a simple way to deploy a container without the burden of Kubernetes. ACS might be best if you really want a dedicated container solution (there is several orchestrators).
对于身份验证部分,pip支持具有基本身份验证的htaccess文件.这允许执行类似extra-index-url = https://login:password@pypi.myserver.com/simple/
的操作.我没有首选的教程,但是google/bing之类的"pip private repository"之类的问题都没有找到问题的答案.
For the authentication part, htaccess file with basic authentication is supported by pip. This allow to do something like extra-index-url = https://login:password@pypi.myserver.com/simple/
. I don't have a prefered tutorial, but google/bing something like "pip private repository" you will have no issue to find answers.
(全面披露,我在Azure Python SDK团队的MS部门工作)
(full disclosure, I work at MS in the Azure Python SDK team)
这篇关于如何在Azure或AWS中托管私有python包管理器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!