Summary
Merge packages/runtime-provider-docker and packages/runtime-provider-kata into a single packages/runtime-provider-container package. The two packages are nearly identical — both shell out to a Docker-compatible CLI (docker or nerdctl) with the same subcommands (run, exec, stop, rm). The only meaningful difference is the --runtime flag (runc vs io.containerd.kata.v2).
Motivation
- Code duplication:
DockerKataAdapter, NerdctlKataAdapter, DockerProvider, and DockerSession all build the same CLI args and handle the same lifecycle. The kata adapters are copy-paste of the docker provider with one extra flag.
- Conceptual overlap: Kata Containers is not a different container engine — it's an OCI runtime that plugs into Docker/containerd. The isolation level (namespace vs VM) is a runtime property, not a provider distinction.
- Simpler config: Users shouldn't need to choose between
provider: "docker" and provider: "kata" when the only real knob is which OCI runtime to use.
Proposed Design
Single provider with configurable runtime and CLI
export interface ContainerProviderOptions {
image: string;
/** CLI binary: 'docker' | 'nerdctl' (default: 'docker') */
cli?: 'docker' | 'nerdctl';
/** OCI runtime: 'runc' (default), 'io.containerd.kata.v2', etc. */
runtime?: string;
worktreePath?: string;
runner?: ContainerRunner;
hostEnv?: Record<string, string | undefined>;
}
Config schema
Migration path
- Keep
provider: "docker" and provider: "kata" as aliases in the provider-loader for backwards compatibility, mapping to container with the appropriate defaults.
- Deprecate the old provider names with a warning.
Work Items
- Create
packages/runtime-provider-container/ with merged source
- Unify
DockerSession + KataSession hardening (destroyed guard, exec options, timeout) into one ContainerSession
- Merge policy translation — Kata's
translatePolicy adds --runtime and capability checks; Docker's skips --runtime
- Single
healthCheck() implementation
- Update
provider-loader.ts to register container provider with aliases
- Update config schema — add
containerOptions, deprecate dockerOptions / kata
- Migrate all existing tests
- Remove
packages/runtime-provider-docker/ and packages/runtime-provider-kata/
- Update docs
Constraints
- Backwards-compatible config: existing
provider: "docker" and provider: "kata" must continue to work (with deprecation warning)
- No behavior changes — all existing unit tests should pass after migration
- E2E test gating unchanged (
CADRE_E2E_DOCKER, CADRE_E2E_KATA)
Summary
Merge
packages/runtime-provider-dockerandpackages/runtime-provider-katainto a singlepackages/runtime-provider-containerpackage. The two packages are nearly identical — both shell out to a Docker-compatible CLI (dockerornerdctl) with the same subcommands (run,exec,stop,rm). The only meaningful difference is the--runtimeflag (runcvsio.containerd.kata.v2).Motivation
DockerKataAdapter,NerdctlKataAdapter,DockerProvider, andDockerSessionall build the same CLI args and handle the same lifecycle. The kata adapters are copy-paste of the docker provider with one extra flag.provider: "docker"andprovider: "kata"when the only real knob is which OCI runtime to use.Proposed Design
Single provider with configurable runtime and CLI
Config schema
{ "isolation": { "provider": "container", "containerOptions": { "cli": "docker", // or "nerdctl" "runtime": "io.containerd.kata.v2", // optional, defaults to runc "image": "alpine:3" } } }Migration path
provider: "docker"andprovider: "kata"as aliases in the provider-loader for backwards compatibility, mapping tocontainerwith the appropriate defaults.Work Items
packages/runtime-provider-container/with merged sourceDockerSession+KataSessionhardening (destroyed guard, exec options, timeout) into oneContainerSessiontranslatePolicyadds--runtimeand capability checks; Docker's skips--runtimehealthCheck()implementationprovider-loader.tsto registercontainerprovider with aliasescontainerOptions, deprecatedockerOptions/katapackages/runtime-provider-docker/andpackages/runtime-provider-kata/Constraints
provider: "docker"andprovider: "kata"must continue to work (with deprecation warning)CADRE_E2E_DOCKER,CADRE_E2E_KATA)