Skip to content

Remove dependency on github.com/opencontainers/runtime-tools - #13519

Merged
fuweid merged 1 commit into
containerd:mainfrom
tianon-sso:runtime-tools
Aug 7, 2026
Merged

fuweid merged 1 commit into
containerd:mainfrom
tianon-sso:runtime-tools

Conversation

@tianon-sso

@tianon-sso tianon-sso commented Jun 2, 2026 •

Copy link
Copy Markdown
Contributor

The direct use was two lines in internal/cri/nri/nri_api_linux.go -- constructing a generate.Generator{Config: spec} solely to satisfy the nrigen.UnderlyingGenerator interface defined in containerd/nri. Since that interface already exists, we just need an implementation. Add spec_generator.go in the same package, implementing UnderlyingGenerator directly on *rspec.Spec with no external dependencies beyond runtime-spec.

The transitive dependency via tags.cncf.io/container-device-interface is addressed by the temporary replace directive pointing at cncf-tags/container-device-interface@7a214f2 (cncf-tags/container-device-interface#317), which removes that project's own use of runtime-tools. The replace will be dropped once that change is released.

Assisted-By: "claude my eyes right out"

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR removes the dependency on github.com/opencontainers/runtime-tools/generate by introducing an internal OCI spec generator implementation, and updates Go module/vendoring metadata accordingly (including a temporary CDI module replacement).

Changes:

  • Added internal/cri/nri/spec_generator.go implementing the generator functionality directly on *specs-go.Spec.
  • Updated NRI API wiring to use the new internal generator instead of runtime-tools/generate.
  • Updated go.mod, go.sum, and vendor/modules.txt to drop runtime-tools and apply a temporary container-device-interface module replacement.

Reviewed changes

Copilot reviewed 3 out of 31 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
internal/cri/nri/spec_generator.go New internal generator implementation to avoid importing runtime-tools/generate.
internal/cri/nri/nri_api_linux.go Switches to the internal generator (newSpecGen) in the NRI adjust path.
go.mod Removes runtime-tools and adds a temporary replace for CDI.
go.sum Removes checksums for dropped deps and adds checksums for the replaced CDI fork module.
vendor/modules.txt Reflects module removals and the CDI replacement in vendoring metadata.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread go.mod Outdated

replace github.com/containerd/containerd/api => ./api

replace tags.cncf.io/container-device-interface => github.com/tianon-sso/cncf-cdi v0.0.0-20260602195946-5a781dda2ce0 // TODO https://github.com/cncf-tags/container-device-interface/pull/316

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is valid, and why the PR is still a draft -- I wouldn't suggest merging this with the replace rule in-place -- that just makes the full change visible (with the full removal of runtime-tools).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 32 changed files in this pull request and generated 1 comment.

Comment thread go.mod Outdated

replace github.com/containerd/containerd/api => ./api

replace tags.cncf.io/container-device-interface => tags.cncf.io/container-device-interface v1.1.1-0.20260625135320-7a214f294075 // TODO https://github.com/cncf-tags/container-device-interface/pull/317

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

womp womp womp

Comment thread go.mod Outdated

replace github.com/containerd/containerd/api => ./api

replace tags.cncf.io/container-device-interface => tags.cncf.io/container-device-interface v1.1.1-0.20260625135320-7a214f294075 // TODO https://github.com/cncf-tags/container-device-interface/pull/317

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.1.1-xxx is now higher than 1.1.0 so you can remove the replace and just update the version to a (not yet tagged) version @tianon

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I thought about it, but decided to leave it as replace because it felt wrong to put an untagged version above and I wanted it obvious that this is a bad state and we shouldn't leave it like this -- but I'm happy to update if that's the preference

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like there's releases done nowadays with untagged dependency versions. so 🤷‍♂️😆

@dmcgowan dmcgowan moved this from Needs Triage to Work In Progress in Pull Request Review Aug 5, 2026
@dmcgowan dmcgowan added this to the 2.4 milestone Aug 5, 2026
The direct use was two lines in `internal/cri/nri/nri_api_linux.go` -- constructing a `generate.Generator{Config: spec}` solely to satisfy the `nrigen.UnderlyingGenerator` interface defined in `containerd/nri`. Since that interface already exists, we just need an implementation. Add `spec_generator.go` in the same package, implementing `UnderlyingGenerator` directly on `*rspec.Spec` with no external dependencies beyond `runtime-spec`.

Assisted-By: "claude my eyes right out"
Signed-off-by: Tianon Gravi <[email protected]>
Copilot AI review requested due to automatic review settings August 5, 2026 23:59
@tianon-sso
tianon-sso marked this pull request as ready for review August 5, 2026 23:59
@dmcgowan dmcgowan moved this from Work In Progress to Review In Progress in Pull Request Review Aug 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 33 changed files in this pull request and generated no new comments.

Suppressed comments (1)

go.mod:93

  • PR description mentions a temporary replace directive pointing at cncf-tags/container-device-interface@7a214f... to remove CDI's runtime-tools dependency, but go.mod currently has no replace section and instead pins tags.cncf.io/container-device-interface directly to a pseudo-version. Please update the PR description to match the actual approach (or add the intended replace if the pseudo-version is not sufficient).
	k8s.io/klog/v2 v2.140.0
	k8s.io/streaming v0.36.3
	k8s.io/utils v0.0.0-20260319190234-28399d86e0b5
	tags.cncf.io/container-device-interface v1.1.1-0.20260720132747-49ac08dcf160
)

@fuweid
fuweid added this pull request to the merge queue Aug 6, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Aug 6, 2026

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

(started reviewing, then forgot to LGTM 😂)

@thaJeztah

Copy link
Copy Markdown
Member

Looks like the merge queue was cancelled because of GitHub's outage Yesterday; can someone kick it again?

@fuweid
fuweid added this pull request to the merge queue Aug 7, 2026
Merged via the queue into containerd:main with commit e125e77 Aug 7, 2026
51 checks passed
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in Pull Request Review Aug 7, 2026
@tianon-sso
tianon-sso deleted the runtime-tools branch August 10, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

7 participants