diff --git a/sky/clouds/do.py b/sky/clouds/do.py index cb30200e775..565b4469d42 100644 --- a/sky/clouds/do.py +++ b/sky/clouds/do.py @@ -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 @@ -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]]: diff --git a/sky/provision/do/instance.py b/sky/provision/do/instance.py index 5c1fa1caa05..1293d93f172 100644 --- a/sky/provision/do/instance.py +++ b/sky/provision/do/instance.py @@ -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 @@ -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