Skip to content

v0.5.0

Latest

Choose a tag to compare

@github-actions github-actions released this 20 Nov 19:14

Mirrors that keep themselves up to date. This closes #1, the first feature request the project received.

Before you upgrade: this release changes the metadata database (schema version 4). The upgrade runs by itself at start and a v0.4.1 data directory needs nothing done to it, but v0.4.1 cannot open the database afterwards. Take a backup first if you might go back: modelctl backup now.

Keeping mirrors up to date

Until now a mirror was a snapshot: picking up a newer upstream revision meant running modelctl mirror again.

modelctl mirror openai-community/gpt2 --follow     # mirror it, and keep it up to date
modelctl serve --sync-interval 1h                  # check followed repositories every hour
modelctl sync openai-community/gpt2                # or check one now, for example from CI
modelctl follow list                               # what is followed, and when each last synced
  • When a followed branch moves upstream, the registry mirrors the new revision and moves the branch. Earlier revisions stay, so anything pinned to a revision id keeps getting exactly the same files. Only files that changed are downloaded.
  • A sync never removes anything. A branch or tag deleted upstream stays in the registry and is reported.
  • Only repositories that were mirrored or cached from upstream can be followed. One you pushed yourself is refused.
  • An upstream that keeps failing is retried less often, up to once a day, without holding up other repositories. A revision that fails verification is not recorded and the branch does not move.
  • --sync-interval (REGISTRY_SYNC_INTERVAL) is off unless set; the minimum is five minutes. POST /api/v1/repos/{repo}/sync is the call for a CI job or a webhook receiver.
  • Works for datasets with --repo-type dataset.

The operations guide has the details, including how this interacts with pull-through caching.

Mirror every branch and tag

modelctl mirror openai-community/gpt2 --all-refs

Copies every branch and tag the upstream reports, in one command, storing shared files once. Each ref's outcome is printed; refs that succeeded are kept if another fails. Add --follow to keep all of them up to date.

Tags stay tags

Mirroring an upstream tag by name used to record it as a local branch. It is now recorded as a tag, by modelctl mirror and by pull-through. A tag never moves in the registry: if the upstream has moved one since it was mirrored, the local tag stays where it is and the difference is reported.

Also new

  • Metrics for sync: checks, changes and failures by cause, repositories followed, and the age of the oldest successful check, with an alert for a followed repository that has stopped syncing.
  • A repository's page in the web UI shows whether it is followed, when it last synced, and the last error.
  • GET /api/v1/follows, and "all_refs": true on POST /api/v1/mirror.

Upgrade notes

  • The database upgrade is described at the top. A backup taken by v0.4.1 restores and is upgraded on start.
  • Databases written by earlier versions may hold branches that are tags upstream, from the behaviour fixed above. A sync reports such a name as a conflict and leaves it as it is; delete and re-mirror the repository if you want it corrected.
  • Mirroring or caching a repository by branch or tag name now makes one more small request to the upstream, to learn whether the name is a branch or a tag.

Full Changelog: v0.4.1...v0.5.0