In containerd 2.3 we've introduced a new way to launch shims - Shim Bootstrap Protocol.
TLDR: Starting with containerd 2.3, the start command receives all configuration from containerd via a single protobuf-serialized BootstrapParams message on stdin. This replaces the previous scattered mechanisms (CLI flags, environment variables, stdin protobuf options) with a single, versioned, extensible protocol.
However, the new path is currently disabled for shim-runhcs-v1. hcsshim hard-codes the assumption that stdin is a marshalled with runhcsopts.Options (which we now pass as an extension) and hard fails.
The call chain:
-
|
shimOpts := &runhcsopts.Options{ |
It'd be great to have hcsshim's readOptions (serve.go) to first attempt to decode the input as BootstrapParams and extract the Options from its extension (AddExtension/GetExtension), falling back to the legacy Any decode for older containerd.
Relevant runc v2 example:
func (manager) Start(ctx context.Context, opts *bootapi.BootstrapParams) (_ *bootapi.BootstrapResult, retErr error) {
...
var runcOpts options.Options
if found, err := opts.FindExtension(&runcOpts); err != nil {
return nil, fmt.Errorf("failed to fetch runc options: %w", err)
} else if found {
if shimCgroup := runcOpts.GetShimCgroup(); shimCgroup != "" {
... // join the shim cgroup
}
}
In containerd 2.3 we've introduced a new way to launch shims - Shim Bootstrap Protocol.
However, the new path is currently disabled for
shim-runhcs-v1.hcsshimhard-codes the assumption that stdin is a marshalled withrunhcsopts.Options(which we now pass as an extension) and hard fails.The call chain:
hcsshim/cmd/containerd-shim-runhcs-v1/start.go
Line 149 in 06fce47
hcsshim/cmd/containerd-shim-runhcs-v1/serve.go
Line 75 in 06fce47
It'd be great to have
hcsshim'sreadOptions(serve.go) to first attempt to decode the input asBootstrapParamsand extract theOptionsfrom its extension (AddExtension/GetExtension), falling back to the legacy Any decode for older containerd.Relevant runc v2 example: