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

Convenience method to attach artifact #164

Closed
jonesbusy opened this issue Feb 26, 2025 · 3 comments · Fixed by #169
Closed

Convenience method to attach artifact #164

jonesbusy opened this issue Feb 26, 2025 · 3 comments · Fixed by #169
Labels
enhancement New feature or request

Comments

@jonesbusy
Copy link
Collaborator

Description of the bug

Right now to attach an artifact to an other one we need to do the following

(pseudo code)

ContainerRef containerRef = ContainerRef.parse("localhost:5000/artifact-maven");
Manifest manifest = registry.pushArtifact(containerRef, "artifactType", localPath);
Layer layer = registry.pushBlobStream(containerRef, is, size);
Manifest attachedManifest= Manifest.empty().withSubject(manifest.getDescriptor().toSubject()).withAnnotations(Map.of(Const.ANNOTATION_CREATED, Const.currentTimestamp())).withLayers(List.of(layer)).withArtifactType("maven");
registry.pushManifest(containerRef.withDigest(SupportedAlgorithm.SHA256.digest(attachedManifest.toJson().getBytes(StandardCharsets.UTF_8))), attachedManifest);

Creating a method on Registry to perform such operation is a must

@jonesbusy jonesbusy added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Feb 26, 2025
@sparsh3007
Copy link

Hi @jonesbusy,

Would you say this is a good first issue or a good start point to contribute here? If not, can you suggest one?

@jonesbusy
Copy link
Collaborator Author

Well I've started already this one. But referers on the test registry doesn't full implement the spec

This flow need to be implemented first: https://github.com/opencontainers/distribution-spec/blob/main/spec.md#pushing-manifests-with-subject

So not really a good first issue

Perhaps this one #13 ? Also need to double check if the current blob upload follow the spec or not. I'm not planning to work on it any time soon

@jonesbusy
Copy link
Collaborator Author

While switching from registry to zot it looks the pushStream doesn't fully work and a 400 is received.

I think I will remove this method until correct chunk upload are implemented.

I think it's overly complex to push a stream on the monolitic push (that should be reserved for small blob)

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

Successfully merging a pull request may close this issue.

2 participants