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

Make it easier to deploy a mirror for uv-python command #10203

Open
MeitarR opened this issue Dec 27, 2024 · 1 comment
Open

Make it easier to deploy a mirror for uv-python command #10203

MeitarR opened this issue Dec 27, 2024 · 1 comment
Labels
wish Not on the immediate roadmap

Comments

@MeitarR
Copy link
Contributor

MeitarR commented Dec 27, 2024

The problem

Currently, in order to use the feature of uv to fetch Python versions (uv python install), in internal and air-gapped networks,
one needs to

  1. download all the needed binaries (using https://github.com/astral-sh/uv/blob/main/scripts/create-python-mirror.py )
  2. then get the resulting folder (14~ GB for a single uv version) to the target network - depending on the organization it may be a complicated stage, that is very hard (or even impossible) to automate
  3. and serve it to everyone else in the target network.

a process that may take hours.

The big issue is that the paths of the CPython binaries are hardcoded in the binary and change almost every release of uv. Thus, the one who maintains the mirror must go through that process frequently, or else the feature of uv python install will break when updating the uv version locally.

(see https://github.com/astral-sh/uv/commits/main/crates/uv-python/download-metadata.json for the frequency)

Suggested solution

instead of hardcoded URLs, fetch the json externally.

I think that one way of solving this issue is, instead of hardcoding the list of URLs in the binary, you can fetch the list (json) https://github.com/astral-sh/uv/blob/main/crates/uv-python/download-metadata.json from external URL (probably from the repo), letting you update the available python binaries versions without the need to update uv, and let the users change the URL the binary uses to fetch the JSON (https://github.com/astral-sh/uv/blob/main/crates/uv-python/download-metadata.json), so it will work for every version of uv, and if you update your list, we can download and update it in the target network later without consequences.

@charliermarsh charliermarsh added the wish Not on the immediate roadmap label Dec 28, 2024
@MeitarR
Copy link
Contributor Author

MeitarR commented Dec 31, 2024

@charliermarsh is this PR welcome? (And do you agree with the suggested solution?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wish Not on the immediate roadmap
Projects
None yet
Development

No branches or pull requests

2 participants