Skip to content

Commit

Permalink
add open port debug message
Browse files Browse the repository at this point in the history
  • Loading branch information
asaiacai committed Sep 29, 2024
1 parent 0d71031 commit dd8c238
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
10 changes: 6 additions & 4 deletions sky/clouds/do.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ def make_deploy_resources_variables(
}

def _get_feasible_launchable_resources(
self, resources: 'resources_lib.Resources'
) -> resources_utils.FeasibleResources:
self, resources: 'resources_lib.Resources'
) -> resources_utils.FeasibleResources:
"""Returns a list of feasible resources for the given resources."""
if resources.use_spot:
# TODO: Add hints to all return values in this method to help
Expand Down Expand Up @@ -253,13 +253,15 @@ def check_credentials(cls) -> Tuple[bool, Optional[str]]:
# attempt to make a CURL request for listing instances
do_utils.client().droplets.list()
except do.exceptions().HttpResponseError as err:
return False, str(e)
return False, str(err)

return True, None

def get_credential_file_mounts(self) -> Dict[str, str]:
do_utils.client()
return {f'~/.config/doctl/{_CREDENTIAL_FILE}': do_utils.CREDENTIALS_PATH}
return {
f'~/.config/doctl/{_CREDENTIAL_FILE}': do_utils.CREDENTIALS_PATH
}

@classmethod
def get_current_user_identity(cls) -> Optional[List[str]]:
Expand Down
6 changes: 5 additions & 1 deletion sky/provision/do/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
logger = sky_logging.init_logger(__name__)


def _get_head_instance(instances: Dict[str, Dict[str, Any]]) -> Optional[Dict[str, Any]]:
def _get_head_instance(
instances: Dict[str, Dict[str, Any]]) -> Optional[Dict[str, Any]]:
for instance_name, instance_meta in instances.items():
if instance_name.endswith('-head'):
return instance_meta
Expand Down Expand Up @@ -290,6 +291,9 @@ def open_ports(
provider_config: Optional[Dict[str, Any]] = None,
) -> None:
"""See sky/provision/__init__.py"""
logger.debug(
f'Skip opening ports {ports} for DigitalOcean instances, as all '
'ports are open by default.')
del cluster_name_on_cloud, provider_config, ports


Expand Down

0 comments on commit dd8c238

Please sign in to comment.