Skip to content

Conversation

@ethan-lowman-dd
Copy link
Contributor

@ethan-lowman-dd ethan-lowman-dd commented Mar 15, 2023

#8062 and #8193 seem to have broken image pulling using ctr image pull --local=false. This PR attempts to address that.

The first issue is that the new OCIRegistry transfer types are not registered due to the missing import _ "github.com/containerd/containerd/pkg/transfer/registry". This results in the error

ctr: rpc error: code = Unimplemented desc = method Transfer not implemented for containerd.types.transfer.OCIRegistry to containerd.types.transfer.ImageStore

Once that's fixed, the next issue encountered on image pull is:

ctr: rpc error: code = Unknown desc = unable to initialize unpacker: snapshotter must be provided to unpack

This appears to be because the unpack.Platforms constructed in plugins/transfer/plugin.go do not have the Snapshotter or Applier fields set.

I don't think this PR is a complete fix (e.g. there appears to be no way to configure the SnapshotterOpts and ApplyOpts for the transfer service) and I'm not sure if it's correct (should we use the plugin.DiffPlugin or the DiffService plugin.ServicePlugin?). I primarily put this PR together so I could test pulling via the Transfer service in #8269

@k8s-ci-robot
Copy link

Hi @ethan-lowman-dd. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@fangn2
Copy link
Contributor

fangn2 commented Mar 15, 2023

Thanks for the PR, I can take a look.

@ethan-lowman-dd ethan-lowman-dd force-pushed the ethan.lowman/fix-ctr-transfer-pull branch from 87d65d0 to 3e87f05 Compare March 15, 2023 20:10
return nil, fmt.Errorf("%s: platform configuration %v invalid", plugin.TransferPlugin, uc.platform)
}

s, err := ic.GetByID(plugin.SnapshotPlugin, uc.snapshotter)
Copy link
Member

Choose a reason for hiding this comment

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

Looks good to me. I think we can ensure the snapshot supports the platform since
the plugin exports supported platforms https://github.com/containerd/containerd/blob/main/plugin/context.go#L76.
But current plugin package api is not friendly to do that right now. It can be a follow-up enhancement.

Copy link
Contributor

Choose a reason for hiding this comment

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

@dims
Copy link
Member

dims commented Mar 29, 2023

/ok-to-test

@k8s-ci-robot
Copy link

@dims: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Details

In response to this:

/ok-to-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@estesp estesp added cherry-pick/1.7.x Change to be cherry picked to release/1.7 branch and removed needs-ok-to-test labels Apr 3, 2023
@samuelkarp
Copy link
Member

/ok-to-test

// Load packages with type registrations
_ "github.com/containerd/containerd/pkg/transfer/archive"
_ "github.com/containerd/containerd/pkg/transfer/image"
_ "github.com/containerd/containerd/pkg/transfer/registry"
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for being late for the party.
I did forget to load the newly created registry package when I moved registry related stuffs from image package to it.
Thanks for fixing this!

Copy link
Member

@dmcgowan dmcgowan left a comment

Choose a reason for hiding this comment

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

LGTM

I have a follow up for this one, let's get this one in first

@dmcgowan dmcgowan merged commit 800ec30 into containerd:main Apr 20, 2023
@dmcgowan dmcgowan added cherry-picked/1.7.x PR commits are cherry-picked into release/1.7 branch and removed cherry-pick/1.7.x Change to be cherry picked to release/1.7 branch labels May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-picked/1.7.x PR commits are cherry-picked into release/1.7 branch ok-to-test

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

9 participants