[shimV2] implements task, shimdiag service and wires up pod/container controllers#2685
Open
rawahars wants to merge 1 commit intomicrosoft:mainfrom
Open
[shimV2] implements task, shimdiag service and wires up pod/container controllers#2685rawahars wants to merge 1 commit intomicrosoft:mainfrom
rawahars wants to merge 1 commit intomicrosoft:mainfrom
Conversation
… controllers Implements the full TaskService and ShimDiag service methods for the LCOW containerd shim (containerd-shim-lcow-v2), replacing the previous `ErrNotImplemented` stubs with working lifecycle management. Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
jterry75
approved these changes
Apr 15, 2026
|
|
||
| sandboxsvc "github.com/containerd/containerd/api/runtime/sandbox/v1" | ||
| tasksvc "github.com/containerd/containerd/api/runtime/task/v3" | ||
| tasksvc "github.com/containerd/containerd/api/runtime/task/v2" |
Contributor
There was a problem hiding this comment.
Does it matter what version?
| // the provided server so that containerd can call into the shim over TTRPC. | ||
| func (s *Service) RegisterTTRPC(server *ttrpc.Server) error { | ||
| tasksvc.RegisterTTRPCTaskService(server, s) | ||
| tasksvc.RegisterTaskService(server, s) |
Contributor
There was a problem hiding this comment.
Uh? Doesnt this have to be ttrpc for contained?
| return nil, err | ||
| } | ||
|
|
||
| ec, err := s.vmController.ExecIntoHost(ctx, request) |
Contributor
There was a problem hiding this comment.
Does it seem like the vmController ExecIntoHost should just handle the is_running? This would ensure its locked for the check and call versus it could change between these calls?
| s.mu.RLock() | ||
| defer s.mu.RUnlock() | ||
|
|
||
| ctrl, ok := s.podControllers[podID] |
Contributor
There was a problem hiding this comment.
Why is it an error for containers but not here?
| } | ||
|
|
||
| // Retrieve the process controller for the target exec (or init) process. | ||
| proc, err := ctrCtrl.GetProcess(request.ExecID) |
Contributor
There was a problem hiding this comment.
Should this be a notfound by contract as well?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR replaces all
ErrNotImplementedstubs in the LCOW containerd shim (containerd-shim-lcow-v2) with fullTaskServiceandShimDiagimplementations. These updates successfully delegate tasks to the pod, container, and process controllers introduced in the previous commit.File Changes & Implementations
service_task_internal.go: Implements every task lifecycle RPC (Create,Start,Delete,Kill,Exec,Wait,State,Pids,Stats,Update,CloseIO,ResizePty,Shutdown).Create: Distinguishes sandbox vs. workload containers via OCI annotations and manages pod/container controller mappings.Delete: Handles both individual container and full pod teardown, including network cleanup.Kill: Supports fan-out to all workload containers when theAllflag is set on a sandbox.Shutdown: Operates as a no-op since teardown is deferred toSandboxService.ShutdownSandbox.service_shimdiag_internal.go:DiagTasks(lists all containers and their exec processes across every pod).DiagShare(shares a host path into the guest VM via the plan9 controller).DiagStacks(collects goroutine stacks from both the host shim and the guest VM).service.go:podControllersandcontainerPodMappingmaps to track active pods and their containers.sync.Mutextosync.RWMutex.ensureVMRunning()precondition guard.send()for task event publishing.main.go: Adds a minimum Windows build version check (≥ 26100 / V25H1Server) at startup and updates the build tag towindows && lcow.plugin/plugin.go: Updates ETW provider ID and uses thelogfields.SandboxIDconstant for structured logging.//go:build windows && lcowbuild constraint.Signed-off-by: Harsh Rawat harshrawat@microsoft.com