8000 CDI: follow-up refactors · Issue #49993 · moby/moby · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

CDI: follow-up refactors #49993

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
thaJeztah opened this issue May 15, 2025 · 0 comments
Open

CDI: follow-up refactors #49993

thaJeztah opened this issue May 15, 2025 · 0 comments
Labels
kind/refactor PR's that refactor, or clean-up code

Comments

@thaJeztah
Copy link
Member

Description

Some follow-up work identified in #49990

Change looks good to me; we should probably look at rolling this into daemon.NewDaemon, as there's some validation and setup steps being performed in that function as well (and possibly adjusting of config options), so possibly this should go after that;

moby/daemon/daemon.go

Lines 763 to 783 in b87aecc

func NewDaemon(ctx context.Context, config *config.Config, pluginStore *plugin.Store, authzMiddleware *authorization.Middleware) (_ *Daemon, retErr error) {
// Verify platform-specific requirements.
// TODO(thaJeztah): this should be called before we try to create the daemon; perhaps together with the config validation.
if err := checkSystem(); err != nil {
return nil, err
}
registryService, err := registry.NewService(config.ServiceOptions)
if err != nil {
return nil, err
}
// Ensure that we have a correct root key limit for launching containers.
if err := modifyRootKeyLimit(); err != nil {
log.G(ctx).Warnf("unable to modify root key limit, number of containers could be limited by this quota: %v", err)
}
// Ensure we have compatible and valid configuration options
if err := verifyDaemonSettings(config); err != nil {
return nil, err
}

and

For a follow up -- perhaps we should consider a centralized function to register all available device drivers. Currently it's a bit inconsistent because the nvidia driver initializes itself via func init and the CDI is registered manually (because it needs a feature flag check).

@thaJeztah thaJeztah added the kind/refactor PR's that refactor, or clean-up code label May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/refactor PR's that refactor, or clean-up code
Projects
None yet
Development

No branches or pull requests

1 participant
0