Skip to content

Keep frequently used packages up to date in the background #632

Open

Description

@simonchrz

mirror.schedules keeps container image tags current, but for packages the cache only learns about a new release when a client asks for it. On a home or CI proxy that is often offline-first, the first install after a release then waits on the upstream, or fails while it is down.

Idea: an opt-in background job that refreshes what is used most.

mirror:
  refresh:
    interval: 24h
    top: 50          # most downloaded packages per ecosystem, by recent hits
    since: 14d

Each run, for each of those packages:

  • revalidate the metadata (packument, Composer p2 file, PyPI simple page, maven-metadata.xml, …)
  • if there is a newer version on a major line already cached, mirror it, with the newest version cooldown allows rather than the newest published
  • for images, re-mirror the cached tags the way schedules do

Open questions:

  • Which files: npm, Composer, Cargo and gems have one archive per version. PyPI and conda have many; mirroring only the variants clients fetched before (same wheel tags, same subdir) seems right.
  • Major lines: newest per cached major line, or only the overall latest (Add --latest to mirror only the newest version #631 adds --latest for the latter)?
  • Storage: new versions add up; max_size and retention evict old ones, but a cap on files or bytes per run may be needed.
  • Debian/Alpine/RPM are index-driven and probably out of scope at first.
  • With several instances on one database, run it once per interval like schedules (job_runs).

Happy to work on it if this fits the project.

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions