Giter VIP home page Giter VIP logo

Comments (9)

hinshun avatar hinshun commented on August 29, 2024

You should use the gRPC plugin interface, so the compatibility is happening at a protobuf API level not a go plugin level. https://github.com/containerd/containerd/blob/main/docs/PLUGINS.md#proxy-plugins

from ipcs.

nealef avatar nealef commented on August 29, 2024

I had created a content store based on the snapshotter plugin. However, it’s unclear how to connect my store implementation with the RPC service. For snapshotter we:

        // Convert the snapshotter to a gRPC service,
        snsvc := snapshotservice.FromSnapshotter(rs)

        // Register the service with the gRPC server
        snapshotsapi.RegisterSnapshotsServer(rpc, snsvc)

With that in place my snapshotter works fine.

However, for the content store I am a little lost. For content there's a RegisterContentServer() but that's something tha's implemented in content/contentserver/contentserver.go that uses a content store. So I am now sure how to make the association so my Info(), Status() functions are invoked.

from ipcs.

hinshun avatar hinshun commented on August 29, 2024

You need to disable the built in one. See the containerd config here as a reference: https://github.com/hinshun/ipcs/blob/master/cmd/containerd/config.toml#L4

from ipcs.

nealef avatar nealef commented on August 29, 2024

It's done. When I try to do a pull I get an "unimplemented" error. I was wondering if the IPCS implementation chose to use the .so plugin method because they were having the same type of trouble. With the proxy method I am unclear how to let the grpc mechanism know we can handle those content store requests.

from ipcs.

hinshun avatar hinshun commented on August 29, 2024

I'm not sure I understand. Why not just use these:

cssvc := contentserver.New(cs)
cssvc.Register(rpc)

IPCS should be using the proxy mechanism, its been a few years so it's unclear why it chose the .so plugin method first. Probably to facilitate easier debugging / stacktraces when it was under heavy development.

from ipcs.

nealef avatar nealef commented on August 29, 2024

With my gRPC implementation I had:

sv := contentserver.New(cs)
api.RegisterContentServer(rpc, sv)

Because using:

sv.Register(cs)

Resulted in:

sv.Register undefined (type "github.com/containerd/containerd/api/services/content/v1".ContentServer has no field or method Register)

As contentserver.New(cs) returns api.ContentServer not service for:

func (s *service) Register(server *grpc.Server)

The registration provides no feedback so it's not clear if things are set. I see a connection come in:

146069 accept4(7, {sa_family=AF_UNIX}, [112 => 2], SOCK_CLOEXEC|SOCK_NONBLOCK) = 8

But no traffic flows and when I do a pull:

# ctr image pull docker.io/library/httpd:latest
ERRO[0000] active check failed                           error="unknown service containerd.services.content.v1.Content: not implemented"
ERRO[0000] active check failed                           error="unknown service containerd.services.content.v1.Content: not implemented"

Which seems to tell me I really haven't registered properly.

from ipcs.

nealef avatar nealef commented on August 29, 2024

Got it - i had incorrectly named the type content.store in the function that creates a content store. As a result the registration got garbage in and I go garbage out. I am now getting the gRPC messages. I am able to handle Delete/Walk/ListStatuses. Pull is proving less co-coperative where I am still getting "Not Implemented" messages but this should be easier to track down.

Thanks for the suggestions, they helped enormously.

from ipcs.

nealef avatar nealef commented on August 29, 2024

I think the registration is still (a/the) problem. The value returned by sv := contentserver.New(cs) is:

fmt.Printf("sv - %q type: %s\n",sv,reflect.TypeOf(sv));
sv - &{%!q(*content.store=&{/var/lib/containerd/io.containerd.content.v1.content /var/lib/containerd-mssnap-grpc/cache 0xc0001351e0})} type: *contentserver.service

The significant part is that the type is *content.service, therefore it should be possible to invoke:

sv.Register(rpc)

So why does it tell me:

sv.Register undefined (type "github.com/containerd/containerd/api/services/content/v1".ContentServer has no field or method Register)

from ipcs.

nealef avatar nealef commented on August 29, 2024

I have created a discussion on containerd to pursue this further. containerd/containerd#8611

from ipcs.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.