Add nvidia-smi sidecar when requesting gpus
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Steve McMaster 2024-07-21 23:40:05 -04:00
parent 1832e97a56
commit 2766919e52
2 changed files with 22 additions and 1 deletions

View File

@ -484,6 +484,28 @@ resource "kubernetes_deployment" "main" {
}
{% endblock %}
{% block kubernetes_pod_nvidia_sidecar %}
dynamic "container" {
for_each = data.coder_parameter.gpu.value == 0 ? [] : [1]
content {
name = "nvidia-smi"
image = "nvidia/cuda:12.5.1-cudnn-devel-ubuntu22.04"
command = ["bash", "-c", "watch -n1 nvidia-smi"]
image_pull_policy = "{{ image_pull_policy }}"
resources {
limits = {
"cpu" = "250m"
"memory" = "512Mi"
"nvidia.com/gpu" = 0
}
}
}
}
{% endblock %}
{% block kubernetes_pod_main_volume %}
volume {
name = "home"

View File

@ -69,7 +69,6 @@ resource "coder_script" "splunk_ansible" {
script = <<EOT
#!/bin/bash
sudo microdnf install --assumeyes glibc-langpack-en
sudo -E -u ansible /sbin/entrypoint.sh start-and-exit
EOT
}