diff --git a/sky/clouds/gcp.py b/sky/clouds/gcp.py index 7e7dacc539f..94add7fce7d 100644 --- a/sky/clouds/gcp.py +++ b/sky/clouds/gcp.py @@ -509,6 +509,10 @@ def make_deploy_resources_variables( ('gcp', 'managed_instance_group'), None) use_mig = managed_instance_group_config is not None resources_vars['gcp_use_managed_instance_group'] = use_mig + # Convert boolean to 0 or 1 in string, as GCP does not support boolean + # value in labels for TPU VM APIs. + resources_vars['gcp_use_managed_instance_group_value'] = str( + int(use_mig)) if use_mig: resources_vars.update(managed_instance_group_config) return resources_vars diff --git a/sky/templates/gcp-ray.yml.j2 b/sky/templates/gcp-ray.yml.j2 index 51a7b332a72..f4ec10a697d 100644 --- a/sky/templates/gcp-ray.yml.j2 +++ b/sky/templates/gcp-ray.yml.j2 @@ -80,7 +80,7 @@ available_node_types: {%- for label_key, label_value in labels.items() %} {{ label_key }}: {{ label_value|tojson }} {%- endfor %} - managed-instance-group: {{ gcp_use_managed_instance_group }} + use-managed-instance-group: {{ gcp_use_managed_instance_group_value|tojson }} {%- if gcp_use_managed_instance_group %} managed-instance-group: run_duration: {{ run_duration }}