Skip to content

Fix absolute links in pytorch repository and allow it to be proxied #101798

@stephanbertl

Description

@stephanbertl

🐛 Describe the bug

The pip repositories like https://download.pytorch.org/whl/cu118 do not follow common standards like PEP503.

While for itself pip this is not an issue, we are having trouble proxying the repository using Sonatype Nexus.

When looking at the actual location of the wheels, https://download.pytorch.org/whl/torch/ the links to the wheel files use absolute paths like that:

<a href="/whl/cu117/torch-2.0.1%2Bcu117-cp310-cp310-linux_x86_64.whl">torch-2.0.1+cu117-cp310-cp310-linux_x86_64.whl</a>

So far so good.

Now I am proxying the pytorch repo to make use of caching and faster downloads in our corporate network. Additionally direct internet access is not allowed. We are using a so-called "raw repository" inside Sonatype Nexus. We cannot use their "PyPI" repository feature, because the pytorch repository does not follow PEP503 standard. But that is a separate issue.

Our cached repository ends up at https://nexus.corporate.info/repository/pytorch-raw/ with the wheels ending up at https://nexus.corporate.info/repository/pytorch-raw/whl/torch/. The page shows links the same way as the original repo.

<a href="/whl/cu117/torch-2.0.1%2Bcu117-cp310-cp310-linux_x86_64.whl">torch-2.0.1+cu117-cp310-cp310-linux_x86_64.whl</a>

But a link like /whl/cu117/torch-2.0.1%2Bcu117-cp310-cp310-linux_x86_64.whl ends up being resolved to https://nexus.corporate.info/whl/cu117/torch-2.0.1%2Bcu117-cp310-cp310-linux_x86_64.whl

The correct URL should be https://nexus.corporate.info/repository/pytorch-raw/whl/cu117/torch-2.0.1%2Bcu117-cp310-cp310-linux_x86_64.whl

Could you please fix the absolute links and use relative ones if possible?

Alternatively, can you implement a PEP503 simple repository? What is the issue with that?

Versions

2.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    oncall: relengIn support of CI and Release EngineeringtriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    Status

    Cold Storage

    Status

    Followup Required

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions