feat: Add extra_args variables to nvidia_gpu_exporter to support the new per process stats features - #848
feat: Add extra_args variables to nvidia_gpu_exporter to support the new per process stats features#848Emalios wants to merge 5 commits into
Conversation
gardar
left a comment
There was a problem hiding this comment.
Thanks for the PR.
We generally try to avoid adding generic extra_args / extra_opts variables to the roles, since we want the supported options to be explicit and tested. Otherwise, it becomes difficult to know which configurations the role actually supports, and the role starts providing less value compared to users passing all command-line arguments themselves.
That said, I have no issue with supporting this specific option. Please add a dedicated variable for --collect.compute-apps instead. Since the feature is only available from version 1.9.0, we should probably guard it with a version check as well.
Please also make sure to add the new option to the role's argument specs, and sign the commits so the DCO check passes.
Docs Build 📝Thank you for contributing!✨ The docs for this PR have been published here: You can compare to the docs for the The docsite for this PR is also available for download as an artifact from this run: File changes: Click to see the diff comparison.NOTE: only file modifications are shown here. New and deleted files are excluded. diff --git a/home/runner/work/ansible/ansible/docsbuild/base/nvidia_gpu_exporter_role.html b/home/runner/work/ansible/ansible/docsbuild/head/nvidia_gpu_exporter_role.html
index 6f6d715..9c62a51 100644
--- a/home/runner/work/ansible/ansible/docsbuild/base/nvidia_gpu_exporter_role.html
+++ b/home/runner/work/ansible/ansible/docsbuild/head/nvidia_gpu_exporter_role.html
@@ -203,6 +203,18 @@ To check whether it is installed, run <code class="code docutils literal notrans
</div></td>
</tr>
<tr class="row-odd"><td><div class="ansible-option-cell">
+<div class="ansibleOptionAnchor" id="parameter-main--nvidia_gpu_exporter_collect_compute_apps"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-nvidia-gpu-exporter-role-parameter-main-nvidia-gpu-exporter-collect-compute-apps"><strong>nvidia_gpu_exporter_collect_compute_apps</strong></p>
+<a class="ansibleOptionLink" href="#parameter-main--nvidia_gpu_exporter_collect_compute_apps" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
+</div></td>
+<td><div class="ansible-option-cell"><p>Enable the --collect.compute-apps flag on the exporter. Requires nvidia_gpu_exporter_version >= 1.9.0.</p>
+<p class="ansible-option-line"><strong class="ansible-option-choices">Choices:</strong></p>
+<ul class="simple">
+<li><p><code class="ansible-option-default-bold docutils literal notranslate"><strong><span class="pre">false</span></strong></code> <span class="ansible-option-choices-default-mark">← (default)</span></p></li>
+<li><p><code class="ansible-option-choices-entry docutils literal notranslate"><span class="pre">true</span></code></p></li>
+</ul>
+</div></td>
+</tr>
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-main--nvidia_gpu_exporter_config_dir"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-nvidia-gpu-exporter-role-parameter-main-nvidia-gpu-exporter-config-dir"><strong>nvidia_gpu_exporter_config_dir</strong></p>
<a class="ansibleOptionLink" href="#parameter-main--nvidia_gpu_exporter_config_dir" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
@@ -210,7 +222,7 @@ To check whether it is installed, run <code class="code docutils literal notrans
<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">"/etc/nvidia_gpu_exporter"</span></code></p>
</div></td>
</tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-main--nvidia_gpu_exporter_local_cache_path"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-nvidia-gpu-exporter-role-parameter-main-nvidia-gpu-exporter-local-cache-path"><strong>nvidia_gpu_exporter_local_cache_path</strong></p>
<a class="ansibleOptionLink" href="#parameter-main--nvidia_gpu_exporter_local_cache_path" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
@@ -218,7 +230,7 @@ To check whether it is installed, run <code class="code docutils literal notrans
<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">"/tmp/nvidia_gpu_exporter-{{</span> <span class="pre">ansible_facts['system']</span> <span class="pre">|</span> <span class="pre">lower</span> <span class="pre">}}-{{</span> <span class="pre">_nvidia_gpu_exporter_go_ansible_arch</span> <span class="pre">}}/{{</span> <span class="pre">nvidia_gpu_exporter_version</span> <span class="pre">}}"</span></code></p>
</div></td>
</tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-main--nvidia_gpu_exporter_system_group"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-nvidia-gpu-exporter-role-parameter-main-nvidia-gpu-exporter-system-group"><strong>nvidia_gpu_exporter_system_group</strong></p>
<a class="ansibleOptionLink" href="#parameter-main--nvidia_gpu_exporter_system_group" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
@@ -227,7 +239,7 @@ To check whether it is installed, run <code class="code docutils literal notrans
<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">"nvidia-gpu-exp"</span></code></p>
</div></td>
</tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-main--nvidia_gpu_exporter_system_user"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-nvidia-gpu-exporter-role-parameter-main-nvidia-gpu-exporter-system-user"><strong>nvidia_gpu_exporter_system_user</strong></p>
<a class="ansibleOptionLink" href="#parameter-main--nvidia_gpu_exporter_system_user" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
@@ -236,7 +248,7 @@ To check whether it is installed, run <code class="code docutils literal notrans
<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">"nvidia-gpu-exp"</span></code></p>
</div></td>
</tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-main--nvidia_gpu_exporter_version"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-nvidia-gpu-exporter-role-parameter-main-nvidia-gpu-exporter-version"><strong>nvidia_gpu_exporter_version</strong></p>
<a class="ansibleOptionLink" href="#parameter-main--nvidia_gpu_exporter_version" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
@@ -244,7 +256,7 @@ To check whether it is installed, run <code class="code docutils literal notrans
<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">"1.10.0"</span></code></p>
</div></td>
</tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-main--nvidia_gpu_exporter_web_listen_address"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-nvidia-gpu-exporter-role-parameter-main-nvidia-gpu-exporter-web-listen-address"><strong>nvidia_gpu_exporter_web_listen_address</strong></p>
<a class="ansibleOptionLink" href="#parameter-main--nvidia_gpu_exporter_web_listen_address" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
@@ -252,7 +264,7 @@ To check whether it is installed, run <code class="code docutils literal notrans
<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">"0.0.0.0:9835"</span></code></p>
</div></td>
</tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-main--nvidia_gpu_exporter_web_telemetry_path"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-nvidia-gpu-exporter-role-parameter-main-nvidia-gpu-exporter-web-telemetry-path"><strong>nvidia_gpu_exporter_web_telemetry_path</strong></p>
<a class="ansibleOptionLink" href="#parameter-main--nvidia_gpu_exporter_web_telemetry_path" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
|
|
I changed the extra_args var to an unique boolean which enable the option for the exporter. |
That's fine. The other way to do the version check would have been in the template directly but that wouldn't warn users which attempt to use the option on a unsupported version and it would just be ignored silently, so this is actually the preferred way. Can you please rebase the branch? |
…f nvidia_gpu_exporter. Especially to enable the per process gpu vram consuption as detailed [here](utkuozdemir/nvidia_gpu_exporter@43dedb0) Signed-off-by: Hugo Bergerat <hugo.bergerat@inria.fr>
…nvidia_gpu_exporter as per process gpu stats is only available since version 1.9.0 Signed-off-by: Hugo Bergerat <hugo.bergerat@inria.fr>
…lowing the per process gpu stats Signed-off-by: Hugo Bergerat <hugo.bergerat@inria.fr>
…ard in main.yml Signed-off-by: Hugo Bergerat <hugo.bergerat@inria.fr>
Signed-off-by: Hugo Bergerat <hugo.bergerat@inria.fr>
|
Hello, the branch is rebased |
Since version 1.9.0, Nvidia Gpu Exporter allow users to have per process statistics of vram usage.
In order to allow this feature you need to add the argument
--collect.compute-appsto the launch command of nvidia_gpu_exporter, so I propose to add a variableextra_argswhich we can use to activate this option.I runned the 3 molecules tests, default, latest and alternative. The alternative one needed to up the nvidia_gpu_exporter version cause the feature is only available since 1.9.0
Please do not hesitate to tell me if I did something wrong or if I forgot to do something.