FluentDocker icon indicating copy to clipboard operation
FluentDocker copied to clipboard

Missing Create Parameters? / Allow custom arguments

Open apazureck opened this issue 2 years ago • 5 comments

Hi,

I try to create a container with GPU support with fluent docker, as specified in the Docker Documentation.

I figured out, that fluent docker does not have support for the GPU flag. I expected sth. like this:

containerBuilder.UseGpu("all");

I also did not find any way to work around. I expected it being something like this:

containerBuilder.WithCustomArgument("gpus", "all");

// or

containerBuilder.WithCustomArgument("--gpus all");

Am I missing something? The latter one would be some kind of fallback for everybody who needs features you did not provide with the builder.

If you like I would gladly offer to contribute these changes.

Cheers!

apazureck avatar Jul 18 '22 19:07 apazureck

Hi @apazureck thanks for your issue! I haven't looked into --gpus switch. How does it relate to --runtime switch?

Currently it is possible to set the --runtime=nvidia to enable NVIDIA GPU via ContainerBuilder UseRuntime(ContainerRuntime runtime)

Should the --gpus have any relation to this or? It was implemented using NVIDIA ref page

Second containerBuilder.WithCustomArgument(arg, params...) is really a great idea - I'll add that to the TODO list.

Cheers, Mario :)

mariotoffia avatar Jul 19 '22 19:07 mariotoffia

As I understood so far it was nvidia exclusive for some time, but they now made it more generic. I'll check out the runtime switch, thanks for that hint, but I think I read somewhere that this is deprecated now (in favor of the GPU switch).

I'll talk to my customer, if they agree that we contribute this to your library, if it is OK for you.

apazureck avatar Jul 20 '22 08:07 apazureck

@apazureck I would be delighted if you contribute! :)

mariotoffia avatar Jul 20 '22 08:07 mariotoffia

I've been thinking - if --runtime has been deprectated and replaced with more advanced --gpus (saw that you could have several arguments there). It would be nice if we'd keep the runtime options (and nvidia for backards compatability and just add optiona all) and it will render --gpus switch instead of --runtime and the added capability as optional arguments. So existing FluentAPI uses will autiomatically use the newver options.

What do you think?

Cheers, Mario :)

mariotoffia avatar Jul 20 '22 11:07 mariotoffia

Sure, I would not touch anything breaking the old logic. I already asked my customer and it would be OK to them, if I put some effort. I will try to fit it in the next weeks.

apazureck avatar Jul 21 '22 19:07 apazureck