Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to host a private python package manager in Azure or AWS

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.

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:

  • hosted in the cloud (possibly Azure but AWS is fine)
  • up and running 24/7
  • secure. Users must authenticate in order to see the package manager and the packages.
  • not hosted in a operative system but something higher level (e.g. docker container or Azure function app?) since it would be much easier to maintain, geo-replicate etc

Question: How to get a secure and private server (python package manager) always up and running in the cloud?

like image 441
MLguy Avatar asked Sep 14 '17 17:09

MLguy


People also ask

What is the preferred package manager that you will use with Python?

Pip is python's package manager. It has come built-in to Python for quite a while now, so if you have Python, you likely have pip installed already. Pip installs packages like tensorflow and numpy, pandas and jupyter, and many more, along with their dependencies.

What is PYPI server?

What is a pypi server? Those that use python on a regular basis will know that pypi is basically the server that hosts all the public python packages that we all use and love — for example, packages like pandas and requests. These packages can then be installed using pip.


1 Answers

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

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).

For the authentication part, htaccess file with basic authentication is supported by pip. This allow to do something like extra-index-url = https://login:[email protected]/simple/. I don't have a prefered tutorial, but google/bing something like "pip private repository" you will have no issue to find answers.

(full disclosure, I work at MS in the Azure Python SDK team)

like image 176
Laurent Mazuel Avatar answered Sep 23 '22 00:09

Laurent Mazuel