add reusable package for managing windows shims#2601
add reusable package for managing windows shims#2601rawahars wants to merge 1 commit intomicrosoft:mainfrom
Conversation
785f197 to
61fe5f1
Compare
|
theres already containerd/pkg/shim that implements a lot of the management and parsing needed, can we leverage that? |
61fe5f1 to
61e79b5
Compare
|
@helsaawy Using the upstream shim pkg would have been the absolute right way to go. However, Windows implementation is not yet robust upstream. Reference- https://github.com/containerd/containerd/blob/main/pkg/shim/shim_windows.go Also, we have custom logic related to setting up ETW provider among other things. In my opinion, as a follow-up to the new shim, we can work to ensure that containerd's shim pkg has robust Windows implementation and then move our new shim to the upstream package once it is released. What are your thoughts? |
Existing `containerd-shim-runhcs-v1` was tightly coupled with the code used for managing the shim lifecycle and other boilerplate code. Since we are adding new shims for Windows, the newly added `shim` package will be used for the boilerplate management code. This commit adds the same. Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
61e79b5 to
0623f40
Compare
|
Even without the |
|
@helsaawy While I totally agree, the upstream shim implementation has stubbed out even |
This pull request introduces a new reusable Windows containerd shim bootstrap package. The main goal is to provide a generic, shareable shim entrypoint and eventing logic to avoid code duplication across Windows shim binaries.
Key changes:
Shim Bootstrap Implementation:
pkg/shimpackage, which provides a reusable shim entrypoint for Windows containerd shims, handling CLI commands (start,serve,delete), ttrpc server setup, event publishing, and logging. Includes a detailedREADME.mdwith usage instructions and responsibilities.Core Logic:
servecommand to set up ttrpc server, handle log redirection, event publishing, and clean shutdowns.deletecommand to clean up container resources, handle panic logs, and ensure protocol-compliant responses.shim.go, including ETW logging and OpenCensus tracing.Event Publishing Infrastructure:
Publisherinterface andeventPublisherimplementation for sending task events back to containerd, including OpenCensus tracing integration.Testing:
Documentation:
README.mdfor the new shim package, describing its purpose, usage, and integration points for consumers.