Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[devpi-server] Is there a way to fallback to a secondary mirror-url? #975

Closed
donateur opened this issue Jun 5, 2023 · 3 comments
Closed

Comments

@donateur
Copy link

donateur commented Jun 5, 2023

Hello, thanks so much for writing and maintaining devpi!

I've got an unusual situation. I need to cache pypi in an environment which may as well be disconnected from the internet. Further complicating things, I don't have a reliable pypi mirror to source from, but two different mirrors which each may be missing different packages.

Is there any way to use devpi-server such that if it is unable to find a module from one mirror_url it could retry with a different mirror_url?
(I've tried to use apache in front of devpi-server but can't rewrite on 404 as well as proxy to either server...it's a long story but it may not be a viable option)

Thanks again!

@fschulze
Copy link
Contributor

fschulze commented Jun 5, 2023

There is an experimental --offline-mode, but I'm not sure that is applicable here.

I would try to add both mirrors as separate mirror indexes and then create an index which has both as bases.

@donateur
Copy link
Author

donateur commented Jun 5, 2023

There is an experimental --offline-mode, but I'm not sure that is applicable here.

I would try to add both mirrors as separate mirror indexes and then create an index which has both as bases.

Thanks so much! I won't be able to test this for a few days but will get back to you.

@donateur
Copy link
Author

donateur commented Jun 8, 2023

Thanks for your help @fschulze.

It turns out that for policy reasons access between the server running devpi-server and the second pypi repo wasn't permitted. So we ended up using a pip.conf which uses an --extra-index-url with the second repo.
While pip randomly will use either repo, it doesn't really matter, clients will use the newer version of a package with the same name from whichever repo is more up to date. As far as I tested it seemed to find the packages we needed at either repo too.

Thanks again!

@donateur donateur closed this as completed Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants