From 09c33602aa191dfc24cbc19519d21642b3b339db Mon Sep 17 00:00:00 2001 From: Steve McMaster Date: Mon, 22 Jul 2024 01:39:03 -0400 Subject: [PATCH] mount models for gpu workspaces --- base.tf.j2 | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/base.tf.j2 b/base.tf.j2 index 4e7c58e..f599179 100644 --- a/base.tf.j2 +++ b/base.tf.j2 @@ -481,6 +481,16 @@ resource "kubernetes_deployment" "main" { read_only = false } {% endblock %} + + dynamic "volume_mount" { + for_each = data.coder_parameter.gpu.value == "0" ? [] : [1] + + content { + mount_path = "/models" + name = "models" + read_only = false + } + } } {% endblock %} @@ -524,6 +534,18 @@ resource "kubernetes_deployment" "main" { } } {% endblock %} + + dynamic "volume" { + for_each = data.coder_parameter.gpu.value == "0" ? [] : [1] + + content { + name = "models" + hostPath { + path = "/ai/models" + type = "Directory" + } + } + } } } }