Skip to content

Commit

Permalink
Allow opening ports for cudo
Browse files Browse the repository at this point in the history
  • Loading branch information
Michaelvll committed Jul 3, 2024
1 parent ad5966d commit a85f194
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
3 changes: 2 additions & 1 deletion sky/provision/cudo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from sky.provision.cudo.config import bootstrap_instances
from sky.provision.cudo.instance import cleanup_ports
from sky.provision.cudo.instance import get_cluster_info
from sky.provision.cudo.instance import open_ports
from sky.provision.cudo.instance import query_instances
from sky.provision.cudo.instance import run_instances
from sky.provision.cudo.instance import stop_instances
Expand All @@ -11,4 +12,4 @@

__all__ = ('bootstrap_instances', 'run_instances', 'stop_instances',
'terminate_instances', 'wait_instances', 'get_cluster_info',
'cleanup_ports', 'query_instances')
'cleanup_ports', 'query_instances', 'open_ports')
10 changes: 10 additions & 0 deletions sky/provision/cudo/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,16 @@ def query_instances(
return statuses


def open_ports(
cluster_name_on_cloud: str,
ports: List[str],
provider_config: Optional[Dict[str, Any]] = None,
) -> None:
del cluster_name_on_cloud, ports, provider_config
# Cudo has all ports open by default. Nothing to do here.
return


def cleanup_ports(
cluster_name_on_cloud: str,
ports: List[str],
Expand Down
11 changes: 5 additions & 6 deletions sky/utils/controller_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,11 @@ def _get_cloud_dependencies_installation_commands(
'/bin/linux/amd64/kubectl" && '
'sudo install -o root -g root -m 0755 '
'kubectl /usr/local/bin/kubectl))')
elif isinstance(cloud, clouds.Cudo):
commands.append(
f'echo -en "\\r{prefix_str}Cudo{empty_str}" && '
'pip list | grep cudo-compute > /dev/null 2>&1 || '
'pip install "cudo-compute>=0.1.10" > /dev/null 2>&1')
if controller == Controllers.JOBS_CONTROLLER:
if isinstance(cloud, clouds.IBM):
commands.append(
Expand All @@ -263,12 +268,6 @@ def _get_cloud_dependencies_installation_commands(
f'echo -en "\\r{prefix_str}RunPod{empty_str}" && '
'pip list | grep runpod > /dev/null 2>&1 || '
'pip install "runpod>=1.5.1" > /dev/null 2>&1')
elif isinstance(cloud, clouds.Cudo):
# cudo doesn't support open port
commands.append(
f'echo -en "\\r{prefix_str}Cudo{empty_str}" && '
'pip list | grep cudo-compute > /dev/null 2>&1 || '
'pip install "cudo-compute>=0.1.8" > /dev/null 2>&1')
if (cloudflare.NAME
in storage_lib.get_cached_enabled_storage_clouds_or_refresh()):
commands.append(f'echo -en "\\r{prefix_str}Cloudflare{empty_str}" && ' +
Expand Down

0 comments on commit a85f194

Please sign in to comment.