Skip to content

client/updater design: mirror config redesign #1143

Closed

Description

@jku

This is a future wishlist item for client API (#1135), based on working on pip integration. I'm not sure what exactly should happen here, just documenting the issues

Warehouse may be an unusal setup but here's how it works (using server names of the pypi instance as examples):

Issues encountered while implementing a client for this:

  • There's no way in the client mirror config to say "this server has no metadata: don't request from here" (Updater: mirrors configuration tweaks #1079)
  • confined_target_dirs seems useless: it is not possible to use e.g. "packages/" or "simple/" as a confining directory in the above target file example because only files directly under those directories would then be accepted

This could be fixed in TUF... but reality is that pip does not really need a mirror config: it always knows which server it wants to use for a particular download. With current API this means I will end up storing two mirror configurations and choosing the correct one every time before a download happens.

Activity

  1. added a commit that references this issue on Sep 14, 2020
  2. added
    client
    on Sep 21, 2020
  3. added this to the Client Refactor milestone on Sep 21, 2020
  4. added a commit that references this issue on Oct 2, 2020
  5. jku commented on Oct 2, 2020

    @jku
    MemberAuthor

    This could be fixed in TUF

    After further meditation: this particular issue cannot be fixed in TUF client. Even if confined_target_dirs allowed subdirectory matching, pip could not use them to separate index files and distribution files: The directory names "simple" and "packages" are just implementation details of pypi.org, not part of the Warehouse API. Some other instance might use the same directory name on both servers.

    This is essentially a result of not namespacing the target names of index files and distribution files in the Warehouse TUF implementation: it is impossible to tell the two targets apart without some heuristics.

  6. added a commit that references this issue on Oct 21, 2020
  7. jku commented on May 19, 2021

    @jku
    MemberAuthor

    Mirrors have been annihilated in new client:

    • Metadata is only downloaded from one host
    • For targets, caller can give Updater a default download url prefix, and can override it case-by-case when calling download_target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    client

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions