From 6e5083293f0d9a9d069d51274c57f0e59e47e5ce Mon Sep 17 00:00:00 2001 From: Romil Bhardwaj Date: Thu, 5 Dec 2024 06:59:34 +0530 Subject: [PATCH] [k8s] Add resource limits only if they exist (#4440) Add limits only if they exist --- sky/templates/kubernetes-ray.yml.j2 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sky/templates/kubernetes-ray.yml.j2 b/sky/templates/kubernetes-ray.yml.j2 index 535e6f0b1ae..2087d9c6e9d 100644 --- a/sky/templates/kubernetes-ray.yml.j2 +++ b/sky/templates/kubernetes-ray.yml.j2 @@ -560,6 +560,7 @@ available_node_types: # https://gitlab.com/arm-research/smarter/smarter-device-manager smarter-devices/fuse: "1" {% endif %} + {% if k8s_resource_key is not none or k8s_fuse_device_required %} limits: # Limits need to be defined for GPU/TPU requests {% if k8s_resource_key is not none %} @@ -568,7 +569,8 @@ available_node_types: {% if k8s_fuse_device_required %} smarter-devices/fuse: "1" {% endif %} - + {% endif %} + setup_commands: # Disable `unattended-upgrades` to prevent apt-get from hanging. It should be called at the beginning before the process started to avoid being blocked. (This is a temporary fix.) # Create ~/.ssh/config file in case the file does not exist in the image.