Skip to content

Commit

Permalink
fix format issue
Browse files Browse the repository at this point in the history
Signed-off-by: nkwangleiGIT <[email protected]>
  • Loading branch information
nkwangleiGIT committed Dec 15, 2024
1 parent f40bcf8 commit 014e00a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 6 additions & 3 deletions sky/provision/kubernetes/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ def _raise_pod_scheduling_errors(namespace, context, new_nodes):
# case we will need to update this logic.
# TODO(Doyoung): Update the error message raised
# with the multi-host TPU support.
gpu_resource_key = kubernetes_utils.get_gpu_resource_key()
gpu_resource_key = kubernetes_utils.get_gpu_resource_key(
)
if 'Insufficient google.com/tpu' in event_message:
extra_msg = (
f'Verify if '
Expand All @@ -199,8 +200,10 @@ def _raise_pod_scheduling_errors(namespace, context, new_nodes):
in event_message)):
extra_msg = (
f'Verify if any node matching label '
f'{pod.spec.node_selector[label_key]} and sufficient '
f'resource {gpu_resource_key} is available in the cluster.')
f'{pod.spec.node_selector[label_key]} and '
f'sufficient resource {gpu_resource_key} is '
f'available in the cluster.'
)
raise config_lib.KubernetesError(
_lack_resource_msg('GPU',
pod,
Expand Down
5 changes: 3 additions & 2 deletions sky/provision/kubernetes/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2427,6 +2427,7 @@ def get_gpu_resource_key():
Returns:
str: The selected GPU resource name.
"""
# Retrieve GPU resource name from environment variable, if set. Else use default.
# Retrieve GPU resource name from environment variable, if set.
# Else use default.
# E.g., can be nvidia.com/gpu-h100, amd.com/gpu etc.
return os.getenv('CUSTOM_GPU_RESOURCE_KEY', default = GPU_RESOURCE_KEY)
return os.getenv('CUSTOM_GPU_RESOURCE_KEY', default=GPU_RESOURCE_KEY)

0 comments on commit 014e00a

Please sign in to comment.