-
Notifications
You must be signed in to change notification settings - Fork 223
Proposal: Easier mechanism for repository updates #575
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
Comments
Adding to the cons of option 1, some registries are stateless, without a transaction log of changes per repository. Coordinating timestamps in a distributed ecosystem is also problematic (a client may have the wrong time and start requesting a very long history, and apps may not properly handle responses with timestamps in the future). As an alternative to option 1, I've thought it would be interesting to have a persistent connection to the registry, subscribed to a repository, and receiving updates as they are received. I imagine a few issues with that, including way too many open connections for major registries to support, and a thundering herd problem with the registry notifies all the listeners that a popular base image has been updated. I'd be a fan of option 2 just knowing how many additional issues an improved tag/manifest listing API would solve. Questions like "what tags point to this digest", "report the differences between two mirrors", and "identify every sigstore-style tag that doesn't have an associated manifest". One side note, watchtower seems to have been abandoned. So even if we improve the APIs, it's quite likely a large number of users will continue to use the existing APIs until a replacement is created. |
We have also thought a bit about an RSS feed, but there are issues with that as well. Option 2 would probably be the best way of solving multiple problems though. It does seem that watchtower is abandoned, but we've been in contact with many other tool creators and many are aware of the challenges involved and seem willing to work with registries to improve things. Obviously it would take a long while to get everyone to shift some workloads over, but ideally we can offer a big carrot by offering a better experience. |
@sozercan who might be interested in this for copacetic as well. |
As discussed on the call, it could be interesting to adopt what
This is already in the wild in a few registries and is backwards compatible. Assuming semver, clients could call |
Many tools exist these days to help users to upgrade their dependencies. A non-exhaustive list includes:
There is no existing API in the distribution spec to check for "new" tags (or manifests) - so if clients want a registry agnostic solution, they need to list all tags and try to find an update by using semvar rules. Since semvar is not universal, this is not an amazing experience. Additionally, this tag listing doesn't indicate if a tag has moved to a different digest, requiring a separate HEAD request to check that.
Because of this, several clients have also implemented registry specific API calls which do allow for querying tags by last updated. These APIs are not always well suited for this task though, and provide far more information and is actually necessary for this update check.
I'd like to start some discussion around ways we can make this easier for both the clients (more efficient checks, universally supported) and registries (lower burden from scrapers). It can also be used to make it easier to mirror repositories across multiple registries. A few initial ideas:
Option 1 - New update endpoint, in the style of catalog (not repo scoped):
/v2/updates?repository=foo/bar&repository=foo/baz&since=<time>
This would return a list of json objects in a format like:
Pro: A single endpoint to get updates to N repositories, though the response would then need sorted out.
Con: Stateless clients may not know a
since
value to add, which could require it to default to the last N updates per repo, or some default time value.Option 2 - Improved tag/manifest listing
There are some existing proposals/discussions to improve the tag/manifest listing endpoints to provide more usable data. If we could list tags/manifests using a sort, and the response data coming back included more metadata (timestamps, digests, mediatypes, etc), it could solve this need.
Pro: A more generic solution solving multiple needs
Pro: More options on checking for updates - Updates in , updates pushed since some digest, etc
Con: Need to check each repository individually.
At Docker, we'd like to start pushing hard on this and moving quickly on some implementation and start getting clients to move over, but want input on a preferred direction from other clients and distribution maintainers.
The text was updated successfully, but these errors were encountered: