NVIDIA / nvidia-container-toolkit

Build and run containers leveraging NVIDIA GPUs
Apache License 2.0
1.88k stars 214 forks source link

Reduce logging verbosity in NVIDIA Container Runtime #560

Open elezar opened 1 week ago

elezar commented 1 week ago

These changes reduce the verbosity of the logging of the NVIDIA Container Runtime -- especially for the case where no modifications are required.

See:

Testing

  1. Build the executable:
    make cmd-nvidia-container-runtime
  2. Create a dummy config file:
    mkdir -p .config/nvidia-container-runtime
    cat <<EOF > .config/nvidia-container-runtime/config.toml 
    [nvidia-container-runtime]
    log-level = "info"
    runtimes = ["undefined", "missing", "runtime"]
    EOF
  3. Create a dummy runtime:
    cat <<EOF > runtime
    #!/bin/bash
    echo "runtime args \$@"
    EOF
    chmod +x runtime
  4. Run the NVIDIA runtime with the create command:
    PATH=$(pwd):${PATH} XDG_CONFIG_HOME=$(pwd)/.config \
    ./nvidia-container-runtime --log=$(pwd)/runtime.log create foo
  5. Check the generated log:
    cat runtime.log

We can change the following: