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
services/introspection: support to show introspection grpc service plugin #5455
Conversation
|
Hi @Iceber. 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 Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
|
Build succeeded.
|
d191f9d
to
0784f46
Compare
|
Build succeeded.
|
0784f46
to
350ad28
Compare
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
350ad28
to
c3fe456
Compare
|
Build succeeded.
|
|
@stevvooe @AkihiroSuda PTAL, Thanks |
|
/ok-to-test |
|
@containerd/committers Can someone take a look? |
| return false | ||
| } | ||
| for _, reg := range register.r { | ||
| byID, typeok := plugins.byTypeAndID[reg.Type] |
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 race detector does not complain about this?
| @@ -94,9 +91,16 @@ func (l *Local) Plugins(ctx context.Context, req *api.PluginsRequest, _ ...grpc. | |||
| } | |||
|
|
|||
| func (l *Local) getPlugins() []api.Plugin { | |||
| if !plugin.AreRegisteredPluginsInitialized(l.plugins) { | |||
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.
Instead of checking against registered, can you just check the size against what is already cached. If it changes, then update the cache.
|
Carried in #6432 |
|
@dmcgowan I'm sorry, I forgot to continue processing this pr |
ctr plugins lsdoes not display the introspection grpc service plugin# ctr plugins ls TYPE ID PLATFORMS STATUS io.containerd.content.v1 content - ok io.containerd.snapshotter.v1 aufs linux/amd64 error io.containerd.snapshotter.v1 btrfs linux/amd64 error io.containerd.snapshotter.v1 devmapper linux/amd64 error io.containerd.snapshotter.v1 native linux/amd64 ok io.containerd.snapshotter.v1 overlayfs linux/amd64 ok io.containerd.snapshotter.v1 zfs linux/amd64 error io.containerd.metadata.v1 bolt - ok io.containerd.differ.v1 walking linux/amd64 ok io.containerd.gc.v1 scheduler - ok io.containerd.service.v1 introspection-service - ok io.containerd.service.v1 containers-service - ok io.containerd.service.v1 content-service - ok io.containerd.service.v1 diff-service - ok io.containerd.service.v1 images-service - ok io.containerd.service.v1 leases-service - ok io.containerd.service.v1 namespaces-service - ok io.containerd.service.v1 snapshots-service - ok io.containerd.runtime.v1 linux linux/amd64 ok io.containerd.runtime.v2 task linux/amd64 ok io.containerd.monitor.v1 cgroups linux/amd64 ok io.containerd.service.v1 tasks-service - ok io.containerd.internal.v1 restart - ok io.containerd.grpc.v1 containers - ok io.containerd.grpc.v1 content - ok io.containerd.grpc.v1 diff - ok io.containerd.grpc.v1 events - ok io.containerd.grpc.v1 healthcheck - ok io.containerd.grpc.v1 images - ok io.containerd.grpc.v1 leases - ok io.containerd.grpc.v1 namespaces - ok io.containerd.internal.v1 opt - ok io.containerd.grpc.v1 snapshots - ok io.containerd.grpc.v1 tasks - ok io.containerd.grpc.v1 version - ok io.containerd.grpc.v1 cri linux/amd64 okanalysis
The
Pluginsmethod of the introspection grpc service does not show itself and the plugins initialised after it.When the introspection grpc service is initialised, it will get the list of currently registered plugins from the plugin context, which will not contain itself and plugins that have not yet been initialised.
Add to initialization list when initialization is complete:
containerd/services/server/server.go
Lines 168 to 173 in 1431679
When the introspection grpc service is initialised, it will get the list of currently registered plugins from the plugin context, which will not contain itself and plugins that have not yet been initialised.
containerd/services/introspection/service.go
Lines 53 to 64 in 1431679
Although the introspection grpc service requires itself to be initialized last(
Requires: []plugin.Type{"*"}), it still allowsRequestsfrom other plugins to also be*, and if these plugins are registered by callingplugin.Registerbefore the introspection grpc service, they will be initialized after the introspection grpc service when usingplugin.Graphsorting.output
# ctr plugin ls TYPE ID PLATFORMS STATUS io.containerd.content.v1 content - ok io.containerd.snapshotter.v1 aufs linux/amd64 error io.containerd.snapshotter.v1 btrfs linux/amd64 error io.containerd.snapshotter.v1 devmapper linux/amd64 error io.containerd.snapshotter.v1 native linux/amd64 ok io.containerd.snapshotter.v1 overlayfs linux/amd64 ok io.containerd.snapshotter.v1 zfs linux/amd64 error io.containerd.metadata.v1 bolt - ok io.containerd.differ.v1 walking linux/amd64 ok io.containerd.gc.v1 scheduler - ok io.containerd.service.v1 introspection-service - ok io.containerd.service.v1 containers-service - ok io.containerd.service.v1 content-service - ok io.containerd.service.v1 diff-service - ok io.containerd.service.v1 images-service - ok io.containerd.service.v1 leases-service - ok io.containerd.service.v1 namespaces-service - ok io.containerd.service.v1 snapshots-service - ok io.containerd.runtime.v1 linux linux/amd64 ok io.containerd.runtime.v2 task linux/amd64 ok io.containerd.monitor.v1 cgroups linux/amd64 ok io.containerd.service.v1 tasks-service - ok io.containerd.grpc.v1 introspection - ok io.containerd.internal.v1 restart - ok io.containerd.grpc.v1 containers - ok io.containerd.grpc.v1 content - ok io.containerd.grpc.v1 diff - ok io.containerd.grpc.v1 events - ok io.containerd.grpc.v1 healthcheck - ok io.containerd.grpc.v1 images - ok io.containerd.grpc.v1 leases - ok io.containerd.grpc.v1 namespaces - ok io.containerd.internal.v1 opt - ok io.containerd.grpc.v1 snapshots - ok io.containerd.grpc.v1 tasks - ok io.containerd.grpc.v1 version - ok io.containerd.grpc.v1 cri linux/amd64 ok