-
Notifications
You must be signed in to change notification settings - Fork 473
Take advantage of the Catalog API #199
Comments
Catalog API was already merged |
I just assigned myself to denote that I'm already doing some research on this. Sorry for the inconvenience @lsamayoa :) |
I've decided since PR #241 that this issue should also serve as a discussion about how we can implement this feature in the cleanest way. |
In my opinion, there are two strategies around this:
It might seem crazy at first, but I'd go for the second option. There are two main reason why I wouldn't go for the first option:
That being said, I can see why the crono gem can be appealing, but at first glance I don't like that it touches the database to persist the state of the running job. Moreover, we don't need to worry about using platform-dependent stuff. |
I don't think creating a standalone script would be a good idea doe, I With crono background jobs are proccesed in a diferent proccess, just like Sidenote: crono does not use platform dependent stuff. 2015-08-03 10:04 GMT-06:00 Miquel Sabaté Solà notifications@github.com:
|
Right now Portus builds its knowledge of the registry by processing the notifications messages sent by the registry. This works fine and has the advantage of being basically real time. However there are at least two big limitations:
This is where the catalog API can help us. Since I'm more interested in solving these issues I think a solution like cronos could be fine. We can still rely on the notification messages to have real time feedback and achieve data consistency running some "catalog-sync" code on a daily basis. Using cronos (or something similar) has the big advantage of keeping the deployment and maintenance work low because there's no new moving part like Redis to be involved. Going back to Redis, registry's master code has optional support for it. We should look more into that and understand if the in memory alternative is good enough for production usage. If using Redis is the recommended way for production usage, then we should not penalize solutions like sidekiq (after all everybody will already have to deal with Redis). Talking about sidekiq and similar. I think they could be useful to schedule background jobs as a response to some notifications sent by the registry. IMO Portus can keep creating new repositories/tags using the information attached to the notification message; at the same time it can schedule a background job that fetches and process more data about the new repository/tag. The first objective of Portus is to act as an authentication service for the Docker registry. Hence the push of a Docker image should be processed immediately to allow other users to access it. The details we can get by processing the image manifest have a lower priority, hence they can be extracted in the background even with a little delay. However, we should discuss about that here. |
Right now Portus' database is filled in using the data sent by distribution via the
webhook API
. Glitches inside of Portus could misalign the contents of its database in regards of what is actually inside of the registry.The next version of distribution (not yet released) is going to provide a search API that we can use to periodically sync our database with the real contents of the registry.
Portus will call the remote API exposed by the registry, parse the response and populate the database accordingly. We already have a client library that can be used to talk with registry. Note that registry's code is already in master.
The text was updated successfully, but these errors were encountered: