Skip to content

Commit

Permalink
Change to check provision_timeout is none
Browse files Browse the repository at this point in the history
  • Loading branch information
Michaelvll committed Aug 16, 2024
1 parent 7e034f3 commit b205166
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 3 additions & 4 deletions sky/provision/gcp/instance_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1081,17 +1081,16 @@ def create_instances(
run_duration=managed_instance_group_config['run_duration'])
cls.wait_for_operation(operation, project_id, zone=zone)

provision_timeout = managed_instance_group_config.get('provision_timeout')
if provision_timeout is None:
provision_timeout = constants.DEFAULT_MANAGED_INSTANCE_GROUP_PROVISION_TIMEOUT
# This will block the provisioning until the nodes are ready, which
# makes the failover not effective. We rely on the request timeout set
# by user to trigger failover.
mig_utils.wait_for_managed_group_to_be_stable(
project_id,
zone,
managed_instance_group_name,
timeout=provision_timeout)
timeout=managed_instance_group_config.get(
'provision_timeout',
constants.DEFAULT_MANAGED_INSTANCE_GROUP_PROVISION_TIMEOUT))

pending_running_instance_names = cls._add_labels_and_find_head(
cluster_name, project_id, zone, labels, potential_head_instances)
Expand Down
2 changes: 2 additions & 0 deletions sky/templates/gcp-ray.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ available_node_types:
{%- if gcp_use_managed_instance_group %}
managed-instance-group:
run_duration: {{ run_duration }}
{%- if provision_timeout is defined and provision_timeout is not none %}
provision_timeout: {{ provision_timeout }}
{%- endif %}
{%- endif %}
{%- if specific_reservations %}
reservationAffinity:
Expand Down

0 comments on commit b205166

Please sign in to comment.