Add nvidia-smi sidecar when requesting gpus
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
1832e97a56
commit
86d8098646
22
base.tf.j2
22
base.tf.j2
@ -484,6 +484,28 @@ resource "kubernetes_deployment" "main" {
|
|||||||
}
|
}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block kubernetes_pod_nvidia_sidecar %}
|
||||||
|
dynamic "container" {
|
||||||
|
for_each = data.coder_parameter.gpu.value == 0 ? [] : [1]
|
||||||
|
|
||||||
|
{
|
||||||
|
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 %}
|
{% block kubernetes_pod_main_volume %}
|
||||||
volume {
|
volume {
|
||||||
name = "home"
|
name = "home"
|
||||||
|
|||||||
@ -69,7 +69,6 @@ resource "coder_script" "splunk_ansible" {
|
|||||||
script = <<EOT
|
script = <<EOT
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
sudo microdnf install --assumeyes glibc-langpack-en
|
|
||||||
sudo -E -u ansible /sbin/entrypoint.sh start-and-exit
|
sudo -E -u ansible /sbin/entrypoint.sh start-and-exit
|
||||||
EOT
|
EOT
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user