Skip to content

Configure CDI registry only on start#7419

Merged
fuweid merged 4 commits intocontainerd:mainfrom
bart0sh:PR005-configure-CDI-registry-on-start
Oct 22, 2022
Merged

Configure CDI registry only on start#7419
fuweid merged 4 commits intocontainerd:mainfrom
bart0sh:PR005-configure-CDI-registry-on-start

Conversation

@bart0sh
Copy link
Copy Markdown
Contributor

@bart0sh bart0sh commented Sep 22, 2022

Currently CDI registry is reconfigured on every WithCDI call, which is a relatively heavy operation.

This happens because cdi.GetRegistry(cdi.WithSpecDirs(cdiSpecDirs...)) unconditionally reconfigures the registry (clears fs notify watch, sets up new watch, rescans directories).

Moving configuration to the criService.initPlatform should result in performing registry configuration only once on the service start.

@k8s-ci-robot
Copy link
Copy Markdown

Hi @bart0sh. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@bart0sh bart0sh force-pushed the PR005-configure-CDI-registry-on-start branch 2 times, most recently from f1c6cca to 3e6a272 Compare September 22, 2022 11:44
@bart0sh bart0sh changed the title Configure cdi registry only on start Configure CDI registry only on start Sep 22, 2022
@bart0sh bart0sh marked this pull request as draft September 22, 2022 20:46
@bart0sh bart0sh force-pushed the PR005-configure-CDI-registry-on-start branch from 3e6a272 to 15eae63 Compare September 22, 2022 21:25
@bart0sh bart0sh marked this pull request as ready for review September 22, 2022 21:39
@bart0sh
Copy link
Copy Markdown
Contributor Author

bart0sh commented Sep 23, 2022

/cc @mikebrow

@bart0sh
Copy link
Copy Markdown
Contributor Author

bart0sh commented Sep 23, 2022

/cc @kzys @MikeZappa87

@bart0sh
Copy link
Copy Markdown
Contributor Author

bart0sh commented Oct 4, 2022

/cc @AkihiroSuda @fuweid

Comment thread pkg/cri/server/service_linux.go
Comment thread oci/spec_opts_linux.go
As WithCDI is CRI-only API it makes sense to move it
out of oci module.

This move can also fix possible issues with this API when
CRI plugin is disabled.

Signed-off-by: Ed Bartosh <[email protected]>
Currently CDI registry is reconfigured on every
WithCDI call, which is a relatively heavy operation.

This happens because cdi.GetRegistry(cdi.WithSpecDirs(cdiSpecDirs...))
unconditionally reconfigures the registry (clears fs notify watch,
sets up new watch, rescans directories).

Moving configuration to the criService.initPlatform should result
in performing registry configuration only once on the service start.

Signed-off-by: Ed Bartosh <[email protected]>
Added logging of found CDI devices.
Fixed test failures caused by the change.

Signed-off-by: Ed Bartosh <[email protected]>
@bart0sh bart0sh force-pushed the PR005-configure-CDI-registry-on-start branch from 15eae63 to 643dc16 Compare October 12, 2022 10:46
Signed-off-by: Ed Bartosh <[email protected]>
@bart0sh bart0sh force-pushed the PR005-configure-CDI-registry-on-start branch from def093a to 347397c Compare October 12, 2022 11:01
@bart0sh
Copy link
Copy Markdown
Contributor Author

bart0sh commented Oct 13, 2022

@fuweid @mikebrow There are 3 failing tests, but I'm not sure they're caused by my changes. Please let me know if you think it's not the case.

@bart0sh
Copy link
Copy Markdown
Contributor Author

bart0sh commented Oct 21, 2022

@fuweid @mikebrow gentle ping for review.

Comment thread pkg/cri/server/container_create_linux_test.go
@fuweid fuweid merged commit 9b54eee into containerd:main Oct 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants