Skip to content
This repository has been archived by the owner on Oct 27, 2023. It is now read-only.

Non-default nvidia-container-runtime-hook config file #47

Closed
kiendang opened this issue Feb 14, 2019 · 17 comments
Closed

Non-default nvidia-container-runtime-hook config file #47

kiendang opened this issue Feb 14, 2019 · 17 comments

Comments

@kiendang
Copy link

kiendang commented Feb 14, 2019

Hi I'm not sure if this is correct but it looks like the path to config.toml for nvidia-container-runtime-hook is hard-coded here

configPath = "/etc/nvidia-container-runtime/config.toml"

which means if I want to use a config file located somewhere else I need to edit the code and recompile?

Is it a good idea to make this path configurable via an arg to nvidia-container-runtime or an environment variable? I can submit a PR if that's the case.

@AkihiroSuda
Copy link

AkihiroSuda commented Feb 14, 2019

Aside from this issue, I also suggest adding $XDG_CONFIG_HOME/nvidia-container-runtime/config.toml
to the default path for supporting rootless containers
moby/moby#38729

@kiendang
Copy link
Author

Thanks @AkihiroSuda I encountered this issue exactly because I'm running rootless docker with nvidia runtime using your usernetes. Everything works, except have to set no-cgroups = true in /etc/nvidia-container-runtime/config.toml

@AkihiroSuda
Copy link

Coincidence 👍

@RenaudWasTaken
Copy link
Contributor

Hello!

This feature is already present, you can set the config flag to point to a different file:

configflag = flag.String("config", "", "configuration file")

@AkihiroSuda
Copy link

@RenaudWasTaken How the nvidia-container-runtime-hook flag can be configured?
Couldn't find any knob in https://github.com/NVIDIA/nvidia-container-runtime/blob/master/runtime/runc/96ec2177ae841256168fcf76954f7177af9446eb/0001-Add-prestart-hook-nvidia-container-runtime-hook-to-t.patch

Could you reopen the issue?

@kiendang
Copy link
Author

@RenaudWasTaken I don't run nvidia-container-runtime-hook directly but through nvidia-container-runtime and couldn't find a way to set it.

@RenaudWasTaken
Copy link
Contributor

An easy way for you to set it is to create a shell wrapper:

  • Move the nvidia-container-runtime-hook binary to nvidia-container-runtime-hook.real
  • Create a shell script called nvidia-container-runtime-hook which invokes nvidia-container-runtime-hook.real with the config flag

@kiendang
Copy link
Author

kiendang commented Feb 15, 2019

Thanks @RenaudWasTaken sorry didn't think of that, managed to run with alias nvidia-container-runtime-hook="nvidia-container-runtime-hook --config=..."

Thanks @RenaudWasTaken got it working by adding this file to PATH

#!/bin/sh

/usr/bin/nvidia-container-runtime-hook -config=... "$@"

@AkihiroSuda
Copy link

Move the nvidia-container-runtime-hook binary to nvidia-container-runtime-hook.real

This breaks DEB/RPM

@kiendang
Copy link
Author

@AkihiroSuda I got it working by leaving /usr/bin/nvidia-container-runtime-hook intact and creating this file and prepending it to PATH

#!/bin/sh

/usr/bin/nvidia-container-runtime-hook -config=... "$@"

But I agree it would be nicer if $XDG_CONFIG_HOME/nvidia-container-runtime/config.toml is added to the default config path.

@RenaudWasTaken
Copy link
Contributor

Ack, I'll keep this issue open
If I have time i'll look into adding this.

@AkihiroSuda
Copy link

PR: #50

@cdesiniotis
Copy link
Contributor

This enhancement is addressed in f6b61c4
@RenaudWasTaken this issue can be closed

@RenaudWasTaken
Copy link
Contributor

Not yet :D!
We still need to publish new packages!

@jjacobelli
Copy link
Contributor

jjacobelli commented Aug 14, 2019

This enhancement is addressed in f6b61c4
@RenaudWasTaken this issue can be closed

I think this change is only for the runtime and not for the hook no?

@cdesiniotis
Copy link
Contributor

@Ethyling Ah yes you are correct

@elezar
Copy link
Member

elezar commented Oct 20, 2023

I am closing this issue.

I know that we may not have completly added the requested feature, but given the changes in the architecture since this was opened, I would propose that a new issue is created with updated requirements if a need still exists.

@elezar elezar closed this as completed Oct 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants