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

DRAFT: Send oci-layout formatted tars to the daemon #242

Closed
wants to merge 4 commits into from

Conversation

natalieparellano
Copy link
Member

No description provided.

Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
@@ -1137,20 +1137,20 @@ func testImage(t *testing.T, when spec.G, it spec.S) {

it.Before(func() {
// new base image
newBase = "pack-newbase-test-" + h.RandString(10)
newBase = newTestImageName()
// TODO: this test consistently fails when the below line is commented in
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really don't know what to say about this

return err
}
layers, err := image.Layers()
if err != nil {
if err = layoutPath.AppendImage(image, layout.WithAnnotations(map[string]string{"io.containerd.image.name": withName})); err != nil {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be more efficient to add content to the tar as it's being streamed, but that requires more work

diffID v1.Hash
optionalLayerPath string
diffID v1.Hash
optionalUnderlyingLayer v1.Layer
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allows us to return the correct digest and compressed bits

return err
}

func Annotate(image v1.Image, key, val string) (v1.Image, error) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated refactor

if l.optionalUnderlyingLayer != nil {
return l.optionalUnderlyingLayer.Digest()
}
return v1.NewHash("sha256:90e01955edcd85dac7985b72a8374545eac617ccdddcc992b732e43cd42534af")
Copy link
Member Author

@natalieparellano natalieparellano Jan 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(hard coded from busybox, used by tests as the "base")

This and Size() below is the big bummer - we can't construct a valid manifest without it. But, we can't know it without pulling all the layers from the daemon. Many sighs

Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
@natalieparellano
Copy link
Member Author

I'm going to close this PR for now. Until we have some way of getting the digest & compressed size of layers that already exist in the daemon (see moby/moby#44369), we won't be able to construct a valid manifest for the image we're trying to load. However if we do get this information, we should be able to send an OCI layout tar that simply omits existing layer data in the blobs directory to avoid re-uploading the layers.

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

Successfully merging this pull request may close these issues.

1 participant