pypi / warehouse

The Python Package Index
https://pypi.org
Apache License 2.0
3.54k stars 955 forks source link

Internal Mirroring #3359

Closed ewdurbin closed 6 years ago

ewdurbin commented 6 years ago

Our VCL should fallback to an internal mirror for ^/simple and ^/pypi/.*/json$

This will allow us to serve the bulk of traffic during maintenance and downtime.

dstufft commented 6 years ago

Thinking about this, one thing that will make this harder is that Warehouse no longer uses relative URLs for the /simple/ but instead uses files.pythonhosted.org. We'll need add a feature to bandersnatch that allows us to point the files to a different domain name.

brainwane commented 6 years ago

@ewdurbin Go ahead and put this in a milestone, please.

ewdurbin commented 6 years ago

Feature PRs in bandersnatch:

ewdurbin commented 6 years ago

Setting up a new internal mirror running from my fork via an hg+https:// install to test.

ewdurbin commented 6 years ago

new mirror is loading up at https://mirror.dub1.pypi.io/

ewdurbin commented 6 years ago

Internal mirror is up, but talking to pypi.org it is failing to stay up to date due to purging issues.

di commented 6 years ago

@ewdurbin Is this resolved now that #3396 is merged?

ewdurbin commented 6 years ago

great question! we need to validate that bandersnatch continues to be able to mirror from pypi.org over the course of the next few days, and then update our VCL use this as an internal failover for /simple, /pypi/.*/json$, and under extreme circumstances /packages.

ewdurbin commented 6 years ago

our new internal mirror has been holding strong! next step is VCL to do fallback at the edge for /simple, /packages, and /pypi/*/json$

brainwane commented 6 years ago

For those reading this who, like me, didn't know, VCL means "Varnish Configuration Language".

brainwane commented 6 years ago

Ernest is planning on finishing this on Monday.

dstufft commented 6 years ago

I went ahead and got the VCL sorted out to do this in https://github.com/python/pypi-infra/pull/12 and https://github.com/python/pypi-infra/pull/14.