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

Containers image registry implementation with opt-in caching #1626

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

joelanford
Copy link
Member

@joelanford joelanford commented Mar 25, 2025

Description of the change:
This change adds a new containers/image-based registry client and updates various (non-deprecated) commands to use it. Specifically render (and other commands that use action.Render) and alpha bundle validate. Deprecated sqlite based commands are not updated.

The intent of the PR is to keep essentially full compatibility with the containerd implementation, and to additionally gain the features of containers/image-based clients.

This PR also includes the ability to opt into caching (and reusing) downloaded blobs (when OLM_CACHE_DIR is set). The behavior around the cache is essentially --pull-policy=Always, where existing layers do not need to be redownloaded. While this PR does garbage collect unused blobs in the cache after each image pull, specifically cleaning up the cache is (for now at least) left as an exercise for the user.

Motivation for the change:
Improves alignment of opm with the ecosystem of tools it is often used with. The main benefit here is that opm calls that use this client will now honor user's existing containers/image-based configuration, including registries.conf CAs and image mappings.

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Docs updated or added to /docs
  • Commit messages sensible and descriptive

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 25, 2025
Copy link
Contributor

openshift-ci bot commented Mar 25, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

Copy link
Contributor

openshift-ci bot commented Mar 25, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: joelanford

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 25, 2025
Copy link

codecov bot commented Mar 25, 2025

Codecov Report

Attention: Patch coverage is 52.28426% with 94 lines in your changes missing coverage. Please review.

Project coverage is 55.14%. Comparing base (e6d2c99) to head (caec04f).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
pkg/image/containersimageregistry/registry.go 50.52% 71 Missing and 23 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1626      +/-   ##
==========================================
+ Coverage   46.77%   55.14%   +8.36%     
==========================================
  Files         135      136       +1     
  Lines       15883    15911      +28     
==========================================
+ Hits         7430     8774    +1344     
+ Misses       7412     5984    -1428     
- Partials     1041     1153     +112     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@joelanford joelanford marked this pull request as ready for review March 25, 2025 18:27
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 25, 2025
@openshift-ci openshift-ci bot requested review from awgreene and dinhxuanvu March 25, 2025 18:28
@joelanford joelanford changed the title Containers image and cache Containers image registry implementation with opt-in caching Mar 25, 2025
@joelanford joelanford force-pushed the containers-image-and-cache branch 6 times, most recently from a0e5296 to a88e1e3 Compare March 26, 2025 12:07
@joelanford joelanford force-pushed the containers-image-and-cache branch from a88e1e3 to 07676d6 Compare March 26, 2025 12:48
@joelanford joelanford force-pushed the containers-image-and-cache branch from 07676d6 to caec04f Compare March 27, 2025 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants