Skip to content

Comments

add and patch containerd/pkg/shim to be used with new Windows shims#2601

Open
rawahars wants to merge 1 commit intomicrosoft:mainfrom
rawahars:feat/shim-pkg
Open

add and patch containerd/pkg/shim to be used with new Windows shims#2601
rawahars wants to merge 1 commit intomicrosoft:mainfrom
rawahars:feat/shim-pkg

Conversation

@rawahars
Copy link
Contributor

@rawahars rawahars commented Feb 17, 2026

This PR introduces a vendored and modified version of the upstream containerd/pkg/shim package. This transition will benefit the newer Windows shims, allowing for a more modular and reusable shim management logic. Moreover, By aligning with the upstream pkg/shim structure, we enable better interoperability with containerd v2 while maintaining the specific hooks necessary for Windows.

Key changes

Testing

Created a new shim and tested it with this logic.

@helsaawy
Copy link
Contributor

theres already containerd/pkg/shim that implements a lot of the management and parsing needed, can we leverage that?

@rawahars
Copy link
Contributor Author

@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?

@helsaawy
Copy link
Contributor

Even without the Run logic to start and manage a shim server, integrating with it now would allow moving to the BootstrapParams containerd is now expecting (instead of the "address" file)
especially for utilities like ReadRuntimeOptions and the event publisher plugin

@rawahars
Copy link
Contributor Author

@helsaawy While I totally agree, the upstream shim implementation has stubbed out even newServer method which is used for creating the TTRPC server. Without that we cannot integrate at all.

@rawahars rawahars changed the title add reusable package for managing windows shims add and patch containerd/pkg/shim to be used with new Windows shims Feb 21, 2026
@rawahars rawahars force-pushed the feat/shim-pkg branch 2 times, most recently from f4d1226 to 03bafb4 Compare February 21, 2026 22:42
The existing runhcs shim management logic is tightly coupled, making it difficult to reuse for new shim implementations. Additionally, aligning with upstream's move toward BootstrapParams requires additional effort in existing logic.

To maintain compatibility and reduce technical debt, this commit vendors the containerd/pkg/shim implementation. Since Windows requires specific
considerations not yet present upstream, we are applying local patches while those changes are prepared for upstream contribution.

Source: https://github.com/containerd/containerd/tree/main/pkg/shim
Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants