Skip to content
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

Image repository monitoring libary #653

Open
alexmt opened this issue Dec 13, 2023 · 6 comments
Open

Image repository monitoring libary #653

alexmt opened this issue Dec 13, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@alexmt
Copy link

alexmt commented Dec 13, 2023

Is your feature request related to a problem? Please describe.

The image registry monitoring is a generic functionality required in multiple projects. I propose extracting this functionality into a separate Git repository and making it available as a library.

Describe the solution you'd like

The library should provide the following features:

  • Finding a tag of a given image that meets criteria such as pattern match constraints, semver constraints, time constraints (newest), etc. The existing functionality already covers all these requirements, and no semantic changes are required.

  • Ability to extract the image digest along with the tag that is found.

  • Caching of extracted image information. I propose considering two different strategies:

    • A cache where entries are keyed by tag. (current strategy)
    • Optionally, pull the digest along with the selected tag and use it for caching. This supports the edge case where the tag is mutable.
  • Support for different registries: the ability to interact with various registries, including those that do not fully comply with the Docker Registry HTTP API V2.

The library's source code should be hosted under the argoproj-labs organization. Alternatively, we might consider argoproj. The following repository names are proposed: container-registry-scanner, oci-scanner, oci-utils, oci-go-sdk, registry-scanner. Please vote in the comments!

As a summary we need functionality of packages below. Minimal changes are required - just one request to support caching using digests in addition to tags. Packages (list may be incomplete - listing packages here just to explain the idea) :

  • pkg/image
  • pkg/registry
  • pkg/tag
  • pkg/version

Describe alternatives you've considered

Import the Image Updater itself as a library. This is not ideal since it also introduces all transitive dependencies. Another issue is introducing changes: the Image Updater is a product that provides end-to-end functionality for a specific use case, so it has its own release cycle, which makes it difficult to release changes specific to image registry monitoring functionality.

Additional context

The first customer of the library would be https://github.com/akuity/kargo!

@alexmt alexmt added the enhancement New feature or request label Dec 13, 2023
@alexmt
Copy link
Author

alexmt commented Dec 13, 2023

For additional context, here is @jessesuen 's opinion (I personally 100% agree ) about how Kargo & Image Updater are related: #645 (comment)

TLDR: projects are not competing and targeting different use cases. Extracting shared functionality into the library would help both Kargo & Image Updater.

@christianh814
Copy link

+1 for registry-scanner

@krancour
Copy link
Contributor

Proposing image-selector since this selects a single image from a repository based on specified criteria.

@jaideepr97
Copy link
Collaborator

+1 for registry-scanner as well

@jannfis
Copy link
Contributor

jannfis commented Dec 20, 2023

How about oci-toolkit?

@krancour
Copy link
Contributor

@jannfis wouldn't we want the library to continue working with registry v1 and v2? (Ok... maybe v1 can go.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants