-
Notifications
You must be signed in to change notification settings - Fork 87
Add proposal for proxy cache referrer's API #270
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
base: main
Are you sure you want to change the base?
Conversation
a842058 to
44fac81
Compare
wy65701436
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
44fac81 to
92fda34
Compare
bupd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stonezdj added suggestions.
Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The proposal should be compliant with the OCI spec. The proposal should support OCI registries and not only proxying from Harbor.
|
@Vad1mo I'm not against the idea of proxying referrers from other upstream registries. I also believe the implementation supports other upstream registries that are OCI-compliant, but I don't think we have the bandwidth to test other registries. |
@Vad1mo For bandwith limitation, we only test/verify it on Harbor, it doesn't mean it is not comply with OCI spec. any registry follow the OCI spec should work this proxy cache feature. |
Vad1mo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find the proposal incomplete, and from what I understand, it is contradictory to OCI spec.
1. Missing: Referrers Tag Schema Fallback
OCI Spec Requirement:
"If the referrers API returns a 404, the client MUST fallback to pulling the referrers tag schema."
The tag schema format is <alg>-<ref> (e.g., sha256-aaaa... with first 64 chars of digest).
Proposal Gap: The proposal doesn't address this fallback mechanism. When proxying from an upstream registry that doesn't support the referrers API (returns 404), Harbor should:
- Attempt the referrers tag schema fallback on the upstream
- Return appropriate response to the client
Impact: OCI 1.0 registries and 1.1 registries without referrers API support won't work correctly. This includes many production registries (Docker Hub, older Harbor versions, ECR, GCR, etc.).
2. Missing: Pagination Support
OCI Spec Requirement:
"A
Linkheader MUST be included in the response when the descriptor list cannot be returned in a single manifest."
Proposal Gap: No mention of pagination handling. Questions:
- How will Harbor handle paginated responses from upstream?
- Will Harbor aggregate all pages before caching?
- Will Harbor pass through Link headers to clients?
Impact: Large referrer lists may be truncated or cause errors.
3. Missing: artifactType Filtering
OCI Spec Requirement:
"The registry SHOULD support filtering on
artifactType."Request:
GET /v2/<name>/referrers/<digest>?artifactType=<mediaType>
Response header:OCI-Filters-Applied: artifactType
Proposal Gap: The rawQuery parameter in the proposed interface hints at filter support, but no explicit handling is described:
ListReferrers(repository, ref string, rawQuery string) (*v1.Index, error)a101f0c to
cedba72
Compare
|
af77130 to
599faa2
Compare
These two statements contradict each other. - If the implementation will be truly OCI compliant, this should support at least two to three widely used OCI-compliant registries like ghcr/dockerhub/gitlab.
There are missing technical details on caching, such as Since this proposal is touching one of the core harbor features. This proposal should be clear on what it adds/solves |
|
I think we can defer this feature to v2.16 given that we are already closer to release date for v2.15. And unaddressed comments / need for potential testing across different registries for this feature. Thanks |
[Answer] Yes, cached in redis
[Answer] It is not a break change in current implementation, there is an check option "Proxy Referrer API", if the check option is enabled, It will proxy the request to the upstream registry, if the user don't want to proxy to the upstream registry, it will return the local generated referrers list. Merging the referrers can be considered in future enhancements. we have already change the table schema for future use. but we don't have bandwith to implement in v2.15.
[Answer] statement changed to: 1. Only Harbor will be verified as the upstream registry for proxy cache projects. verification for other registries can be considered in future enhancements.
[Answer] It is cached in redis, each success request to the upstream is write to redis.
[Answer] TTL is 1 week by default.
[Answer] check by json marshal
[Answer] the maximun cache size is depends on the memory of the redis.
[Answer] Return error and will return http 500 error. |
Signed-off-by: stonezdj <stonezdj@gmail.com>
599faa2 to
5bc5050
Compare
Okay then let's do it 2.16 Don't wanna have a half done feature in harbor
The answer doesn't actually makes sense Since the question specifically requested
I believe this is oci compliant so atleast one other registry should be verified. Thanks @stonezdj |
|
@stonezdj @wy65701436 Before merging that we should have agreement from all parties not only Broadcom maintainers. |
|
@OrlinVasilev @bupd @stonezdj |
No description provided.