Skip to content

Commit

Permalink
[Core] Add HOST_CONTROLLERS check for clouds (#3407)
Browse files Browse the repository at this point in the history
* host_controllers

* host_controllers

* host_controllers
  • Loading branch information
romilbhardwaj authored Apr 2, 2024
1 parent 1c442e4 commit dd17f98
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions sky/clouds/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class CloudImplementationFeatures(enum.Enum):
CUSTOM_DISK_TIER = 'custom_disk_tier'
OPEN_PORTS = 'open_ports'
STORAGE_MOUNTING = 'storage_mounting'
HOST_CONTROLLERS = 'host_controllers' # Can run spot/serve controllers


class Region(collections.namedtuple('Region', ['name'])):
Expand Down
7 changes: 7 additions & 0 deletions sky/clouds/kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ class Kubernetes(clouds.Cloud):
'tiers are not '
'supported in '
'Kubernetes.',
# Kubernetes may be using exec-based auth, which may not work by
# directly copying the kubeconfig file to the controller.
# Support for service accounts for auth will be added in #3377, which
# will allow us to support hosting controllers.
clouds.CloudImplementationFeatures.HOST_CONTROLLERS: 'Kubernetes can '
'not host '
'controllers.',
}

IMAGE_CPU = 'skypilot:cpu-ubuntu-2004'
Expand Down
4 changes: 4 additions & 0 deletions sky/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ def _execute(
# Requested features that some clouds support and others don't.
requested_features = set()

if controller_utils.Controllers.from_name(cluster_name) is not None:
requested_features.add(
clouds.CloudImplementationFeatures.HOST_CONTROLLERS)

# Add requested features from the task
requested_features |= task.get_required_cloud_features()

Expand Down

0 comments on commit dd17f98

Please sign in to comment.