Skip to content

Commit

Permalink
disk_tier support
Browse files Browse the repository at this point in the history
  • Loading branch information
Cohen-J-Omer committed Apr 23, 2023
1 parent dcb8442 commit e6763b0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
13 changes: 11 additions & 2 deletions sky/clouds/ibm.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,11 @@ def get_accelerators_from_instance_type(
def get_default_instance_type(
cls,
cpus: Optional[str] = None,
memory: Optional[str] = None) -> Optional[str]:
memory: Optional[str] = None,
disk_tier: Optional[str] = None) -> Optional[str]:
return service_catalog.get_default_instance_type(cpus=cpus,
memory=memory,
disk_tier=disk_tier,
clouds='ibm')

def get_feasible_launchable_resources(self,
Expand Down Expand Up @@ -275,7 +277,9 @@ def _make(instance_list):
if accelerators is None:
# Return a default instance type with the given number of vCPUs.
default_instance_type = IBM.get_default_instance_type(
cpus=resources.cpus, memory=resources.memory)
cpus=resources.cpus,
memory=resources.memory,
disk_tier=resources.disk_tier)
if default_instance_type is None:
return ([], [])
else:
Expand Down Expand Up @@ -390,6 +394,11 @@ def check_credentials(cls) -> Tuple[bool, Optional[str]]:
except Exception as e:
return (False, f'{str(e)}' + help_str)

@classmethod
def check_disk_tier_enabled(cls, instance_type: str,
disk_tier: str) -> None:
del instance_type, disk_tier # unused

def get_credential_file_mounts(self) -> Dict[str, str]:
"""Returns a {remote:local} credential path mapping
written to the cluster's file_mounts segment
Expand Down
4 changes: 3 additions & 1 deletion sky/clouds/service_catalog/ibm_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ def list_accelerators(


def get_default_instance_type(cpus: Optional[str] = None,
memory: Optional[str] = None) -> Optional[str]:
memory: Optional[str] = None,
disk_tier: Optional[str] = None) -> Optional[str]:
del disk_tier # unused
if cpus is None and memory is None:
cpus = f'{_DEFAULT_NUM_VCPUS}+'

Expand Down

0 comments on commit e6763b0

Please sign in to comment.