skypilot-nightly 1.0.0.dev20240928__py3-none-any.whl → 1.0.0.dev20240929__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sky/__init__.py +2 -2
- sky/authentication.py +5 -0
- sky/clouds/kubernetes.py +35 -7
- sky/provision/kubernetes/config.py +5 -4
- sky/provision/kubernetes/instance.py +8 -5
- sky/provision/kubernetes/network_utils.py +8 -7
- sky/provision/kubernetes/utils.py +51 -18
- sky/utils/command_runner.py +1 -1
- sky/utils/command_runner.pyi +1 -1
- sky/utils/controller_utils.py +8 -0
- {skypilot_nightly-1.0.0.dev20240928.dist-info → skypilot_nightly-1.0.0.dev20240929.dist-info}/METADATA +1 -1
- {skypilot_nightly-1.0.0.dev20240928.dist-info → skypilot_nightly-1.0.0.dev20240929.dist-info}/RECORD +16 -16
- {skypilot_nightly-1.0.0.dev20240928.dist-info → skypilot_nightly-1.0.0.dev20240929.dist-info}/LICENSE +0 -0
- {skypilot_nightly-1.0.0.dev20240928.dist-info → skypilot_nightly-1.0.0.dev20240929.dist-info}/WHEEL +0 -0
- {skypilot_nightly-1.0.0.dev20240928.dist-info → skypilot_nightly-1.0.0.dev20240929.dist-info}/entry_points.txt +0 -0
- {skypilot_nightly-1.0.0.dev20240928.dist-info → skypilot_nightly-1.0.0.dev20240929.dist-info}/top_level.txt +0 -0
sky/__init__.py
CHANGED
@@ -5,7 +5,7 @@ from typing import Optional
|
|
5
5
|
import urllib.request
|
6
6
|
|
7
7
|
# Replaced with the current commit when building the wheels.
|
8
|
-
_SKYPILOT_COMMIT_SHA = '
|
8
|
+
_SKYPILOT_COMMIT_SHA = 'e6a3b830fb2a12871815773af6171d42e0416e89'
|
9
9
|
|
10
10
|
|
11
11
|
def _get_git_commit():
|
@@ -35,7 +35,7 @@ def _get_git_commit():
|
|
35
35
|
|
36
36
|
|
37
37
|
__commit__ = _get_git_commit()
|
38
|
-
__version__ = '1.0.0.
|
38
|
+
__version__ = '1.0.0.dev20240929'
|
39
39
|
__root_dir__ = os.path.dirname(os.path.abspath(__file__))
|
40
40
|
|
41
41
|
|
sky/authentication.py
CHANGED
@@ -380,6 +380,11 @@ def setup_kubernetes_authentication(config: Dict[str, Any]) -> Dict[str, Any]:
|
|
380
380
|
secret_field_name = clouds.Kubernetes().ssh_key_secret_field_name
|
381
381
|
context = config['provider'].get(
|
382
382
|
'context', kubernetes_utils.get_current_kube_config_context_name())
|
383
|
+
if context == kubernetes_utils.IN_CLUSTER_REGION:
|
384
|
+
# If the context is set to IN_CLUSTER_REGION, we are running in a pod
|
385
|
+
# with in-cluster configuration. We need to set the context to None
|
386
|
+
# to use the mounted service account.
|
387
|
+
context = None
|
383
388
|
namespace = config['provider'].get(
|
384
389
|
'namespace',
|
385
390
|
kubernetes_utils.get_kube_config_context_namespace(context))
|
sky/clouds/kubernetes.py
CHANGED
@@ -129,11 +129,24 @@ class Kubernetes(clouds.Cloud):
|
|
129
129
|
'Ignoring these contexts.')
|
130
130
|
|
131
131
|
@classmethod
|
132
|
-
def _existing_allowed_contexts(cls) -> List[str]:
|
133
|
-
"""Get existing allowed contexts.
|
132
|
+
def _existing_allowed_contexts(cls) -> List[Optional[str]]:
|
133
|
+
"""Get existing allowed contexts.
|
134
|
+
|
135
|
+
If None is returned in the list, it means that we are running in a pod
|
136
|
+
with in-cluster auth. In this case, we specify None context, which will
|
137
|
+
use the service account mounted in the pod.
|
138
|
+
"""
|
134
139
|
all_contexts = kubernetes_utils.get_all_kube_config_context_names()
|
135
|
-
if all_contexts
|
140
|
+
if len(all_contexts) == 0:
|
136
141
|
return []
|
142
|
+
if all_contexts == [None]:
|
143
|
+
# If only one context is found and it is None, we are running in a
|
144
|
+
# pod with in-cluster auth. In this case, we allow it to be used
|
145
|
+
# without checking against allowed_contexts.
|
146
|
+
# TODO(romilb): We may want check in-cluster auth against
|
147
|
+
# allowed_contexts in the future by adding a special context name
|
148
|
+
# for in-cluster auth.
|
149
|
+
return [None]
|
137
150
|
all_contexts = set(all_contexts)
|
138
151
|
|
139
152
|
allowed_contexts = skypilot_config.get_nested(
|
@@ -164,7 +177,15 @@ class Kubernetes(clouds.Cloud):
|
|
164
177
|
del accelerators, zone, use_spot # unused
|
165
178
|
existing_contexts = cls._existing_allowed_contexts()
|
166
179
|
|
167
|
-
regions = [
|
180
|
+
regions = []
|
181
|
+
for context in existing_contexts:
|
182
|
+
if context is None:
|
183
|
+
# If running in-cluster, we allow the region to be set to the
|
184
|
+
# singleton region since there is no context name available.
|
185
|
+
regions.append(clouds.Region(
|
186
|
+
kubernetes_utils.IN_CLUSTER_REGION))
|
187
|
+
else:
|
188
|
+
regions.append(clouds.Region(context))
|
168
189
|
|
169
190
|
if region is not None:
|
170
191
|
regions = [r for r in regions if r.name == region]
|
@@ -541,13 +562,20 @@ class Kubernetes(clouds.Cloud):
|
|
541
562
|
def validate_region_zone(self, region: Optional[str], zone: Optional[str]):
|
542
563
|
if region == self._LEGACY_SINGLETON_REGION:
|
543
564
|
# For backward compatibility, we allow the region to be set to the
|
544
|
-
# legacy
|
565
|
+
# legacy singleton region.
|
545
566
|
# TODO: Remove this after 0.9.0.
|
546
567
|
return region, zone
|
547
568
|
|
569
|
+
if region == kubernetes_utils.IN_CLUSTER_REGION:
|
570
|
+
# If running incluster, we set region to IN_CLUSTER_REGION
|
571
|
+
# since there is no context name available.
|
572
|
+
return region, zone
|
573
|
+
|
548
574
|
all_contexts = kubernetes_utils.get_all_kube_config_context_names()
|
549
|
-
if all_contexts
|
550
|
-
|
575
|
+
if all_contexts == [None]:
|
576
|
+
# If [None] context is returned, use the singleton region since we
|
577
|
+
# are running in a pod with in-cluster auth.
|
578
|
+
all_contexts = [kubernetes_utils.IN_CLUSTER_REGION]
|
551
579
|
if region not in all_contexts:
|
552
580
|
raise ValueError(
|
553
581
|
f'Context {region} not found in kubeconfig. Kubernetes only '
|
@@ -247,7 +247,8 @@ def _get_resource(container_resources: Dict[str, Any], resource_name: str,
|
|
247
247
|
|
248
248
|
|
249
249
|
def _configure_autoscaler_service_account(
|
250
|
-
namespace: str, context:
|
250
|
+
namespace: str, context: Optional[str],
|
251
|
+
provider_config: Dict[str, Any]) -> None:
|
251
252
|
account_field = 'autoscaler_service_account'
|
252
253
|
if account_field not in provider_config:
|
253
254
|
logger.info('_configure_autoscaler_service_account: '
|
@@ -281,7 +282,7 @@ def _configure_autoscaler_service_account(
|
|
281
282
|
f'{created_msg(account_field, name)}')
|
282
283
|
|
283
284
|
|
284
|
-
def _configure_autoscaler_role(namespace: str, context: str,
|
285
|
+
def _configure_autoscaler_role(namespace: str, context: Optional[str],
|
285
286
|
provider_config: Dict[str, Any],
|
286
287
|
role_field: str) -> None:
|
287
288
|
""" Reads the role from the provider config, creates if it does not exist.
|
@@ -330,7 +331,7 @@ def _configure_autoscaler_role(namespace: str, context: str,
|
|
330
331
|
|
331
332
|
def _configure_autoscaler_role_binding(
|
332
333
|
namespace: str,
|
333
|
-
context: str,
|
334
|
+
context: Optional[str],
|
334
335
|
provider_config: Dict[str, Any],
|
335
336
|
binding_field: str,
|
336
337
|
override_name: Optional[str] = None,
|
@@ -620,7 +621,7 @@ def _configure_fuse_mounting(provider_config: Dict[str, Any]) -> None:
|
|
620
621
|
f'in namespace {fuse_device_manager_namespace!r}')
|
621
622
|
|
622
623
|
|
623
|
-
def _configure_services(namespace: str, context: str,
|
624
|
+
def _configure_services(namespace: str, context: Optional[str],
|
624
625
|
provider_config: Dict[str, Any]) -> None:
|
625
626
|
service_field = 'services'
|
626
627
|
if service_field not in provider_config:
|
@@ -302,7 +302,8 @@ def _wait_for_pods_to_run(namespace, context, new_nodes):
|
|
302
302
|
time.sleep(1)
|
303
303
|
|
304
304
|
|
305
|
-
def _set_env_vars_in_pods(namespace: str, context: str,
|
305
|
+
def _set_env_vars_in_pods(namespace: str, context: Optional[str],
|
306
|
+
new_pods: List):
|
306
307
|
"""Setting environment variables in pods.
|
307
308
|
|
308
309
|
Once all containers are ready, we can exec into them and set env vars.
|
@@ -330,7 +331,7 @@ def _set_env_vars_in_pods(namespace: str, context: str, new_pods: List):
|
|
330
331
|
new_pod.metadata.name, rc, stdout)
|
331
332
|
|
332
333
|
|
333
|
-
def _check_user_privilege(namespace: str, context: str,
|
334
|
+
def _check_user_privilege(namespace: str, context: Optional[str],
|
334
335
|
new_nodes: List) -> None:
|
335
336
|
# Checks if the default user has sufficient privilege to set up
|
336
337
|
# the kubernetes instance pod.
|
@@ -366,7 +367,8 @@ def _check_user_privilege(namespace: str, context: str,
|
|
366
367
|
'from the image.')
|
367
368
|
|
368
369
|
|
369
|
-
def _setup_ssh_in_pods(namespace: str, context: str,
|
370
|
+
def _setup_ssh_in_pods(namespace: str, context: Optional[str],
|
371
|
+
new_nodes: List) -> None:
|
370
372
|
# Setting up ssh for the pod instance. This is already setup for
|
371
373
|
# the jump pod so it does not need to be run for it.
|
372
374
|
set_k8s_ssh_cmd = (
|
@@ -410,7 +412,7 @@ def _setup_ssh_in_pods(namespace: str, context: str, new_nodes: List) -> None:
|
|
410
412
|
logger.info(f'{"-"*20}End: Set up SSH in pod {pod_name!r} {"-"*20}')
|
411
413
|
|
412
414
|
|
413
|
-
def _label_pod(namespace: str, context: str, pod_name: str,
|
415
|
+
def _label_pod(namespace: str, context: Optional[str], pod_name: str,
|
414
416
|
label: Dict[str, str]) -> None:
|
415
417
|
"""Label a pod."""
|
416
418
|
kubernetes.core_api(context).patch_namespaced_pod(
|
@@ -647,7 +649,8 @@ def stop_instances(
|
|
647
649
|
raise NotImplementedError()
|
648
650
|
|
649
651
|
|
650
|
-
def _terminate_node(namespace: str, context: str,
|
652
|
+
def _terminate_node(namespace: str, context: Optional[str],
|
653
|
+
pod_name: str) -> None:
|
651
654
|
"""Terminate a pod."""
|
652
655
|
logger.debug('terminate_instances: calling delete_namespaced_pod')
|
653
656
|
try:
|
@@ -132,7 +132,7 @@ def fill_ingress_template(namespace: str, service_details: List[Tuple[str, int,
|
|
132
132
|
|
133
133
|
|
134
134
|
def create_or_replace_namespaced_ingress(
|
135
|
-
namespace: str, context: str, ingress_name: str,
|
135
|
+
namespace: str, context: Optional[str], ingress_name: str,
|
136
136
|
ingress_spec: Dict[str, Union[str, int]]) -> None:
|
137
137
|
"""Creates an ingress resource for the specified service."""
|
138
138
|
networking_api = kubernetes.networking_api(context)
|
@@ -156,7 +156,7 @@ def create_or_replace_namespaced_ingress(
|
|
156
156
|
_request_timeout=kubernetes.API_TIMEOUT)
|
157
157
|
|
158
158
|
|
159
|
-
def delete_namespaced_ingress(namespace: str, context: str,
|
159
|
+
def delete_namespaced_ingress(namespace: str, context: Optional[str],
|
160
160
|
ingress_name: str) -> None:
|
161
161
|
"""Deletes an ingress resource."""
|
162
162
|
networking_api = kubernetes.networking_api(context)
|
@@ -171,7 +171,7 @@ def delete_namespaced_ingress(namespace: str, context: str,
|
|
171
171
|
|
172
172
|
|
173
173
|
def create_or_replace_namespaced_service(
|
174
|
-
namespace: str, context: str, service_name: str,
|
174
|
+
namespace: str, context: Optional[str], service_name: str,
|
175
175
|
service_spec: Dict[str, Union[str, int]]) -> None:
|
176
176
|
"""Creates a service resource for the specified service."""
|
177
177
|
core_api = kubernetes.core_api(context)
|
@@ -208,7 +208,7 @@ def delete_namespaced_service(namespace: str, service_name: str) -> None:
|
|
208
208
|
raise e
|
209
209
|
|
210
210
|
|
211
|
-
def ingress_controller_exists(context: str,
|
211
|
+
def ingress_controller_exists(context: Optional[str],
|
212
212
|
ingress_class_name: str = 'nginx') -> bool:
|
213
213
|
"""Checks if an ingress controller exists in the cluster."""
|
214
214
|
networking_api = kubernetes.networking_api(context)
|
@@ -220,7 +220,7 @@ def ingress_controller_exists(context: str,
|
|
220
220
|
|
221
221
|
|
222
222
|
def get_ingress_external_ip_and_ports(
|
223
|
-
context: str,
|
223
|
+
context: Optional[str],
|
224
224
|
namespace: str = 'ingress-nginx'
|
225
225
|
) -> Tuple[Optional[str], Optional[Tuple[int, int]]]:
|
226
226
|
"""Returns external ip and ports for the ingress controller."""
|
@@ -258,7 +258,7 @@ def get_ingress_external_ip_and_ports(
|
|
258
258
|
return external_ip, None
|
259
259
|
|
260
260
|
|
261
|
-
def get_loadbalancer_ip(context: str,
|
261
|
+
def get_loadbalancer_ip(context: Optional[str],
|
262
262
|
namespace: str,
|
263
263
|
service_name: str,
|
264
264
|
timeout: int = 0) -> Optional[str]:
|
@@ -284,7 +284,8 @@ def get_loadbalancer_ip(context: str,
|
|
284
284
|
return ip
|
285
285
|
|
286
286
|
|
287
|
-
def get_pod_ip(context: str, namespace: str,
|
287
|
+
def get_pod_ip(context: Optional[str], namespace: str,
|
288
|
+
pod_name: str) -> Optional[str]:
|
288
289
|
"""Returns the IP address of the pod."""
|
289
290
|
core_api = kubernetes.core_api(context)
|
290
291
|
pod = core_api.read_namespaced_pod(pod_name,
|
@@ -33,6 +33,7 @@ if typing.TYPE_CHECKING:
|
|
33
33
|
|
34
34
|
# TODO(romilb): Move constants to constants.py
|
35
35
|
DEFAULT_NAMESPACE = 'default'
|
36
|
+
IN_CLUSTER_REGION = 'in-cluster'
|
36
37
|
|
37
38
|
DEFAULT_SERVICE_ACCOUNT_NAME = 'skypilot-service-account'
|
38
39
|
|
@@ -310,7 +311,7 @@ AUTOSCALER_TO_LABEL_FORMATTER = {
|
|
310
311
|
|
311
312
|
@functools.lru_cache()
|
312
313
|
def detect_gpu_label_formatter(
|
313
|
-
context: str
|
314
|
+
context: Optional[str]
|
314
315
|
) -> Tuple[Optional[GPULabelFormatter], Dict[str, List[Tuple[str, str]]]]:
|
315
316
|
"""Detects the GPU label formatter for the Kubernetes cluster
|
316
317
|
|
@@ -342,7 +343,7 @@ def detect_gpu_label_formatter(
|
|
342
343
|
|
343
344
|
|
344
345
|
@functools.lru_cache(maxsize=10)
|
345
|
-
def detect_gpu_resource(context: str) -> Tuple[bool, Set[str]]:
|
346
|
+
def detect_gpu_resource(context: Optional[str]) -> Tuple[bool, Set[str]]:
|
346
347
|
"""Checks if the Kubernetes cluster has nvidia.com/gpu resource.
|
347
348
|
|
348
349
|
If nvidia.com/gpu resource is missing, that typically means that the
|
@@ -402,7 +403,7 @@ def get_all_pods_in_kubernetes_cluster(
|
|
402
403
|
return pods
|
403
404
|
|
404
405
|
|
405
|
-
def check_instance_fits(context: str,
|
406
|
+
def check_instance_fits(context: Optional[str],
|
406
407
|
instance: str) -> Tuple[bool, Optional[str]]:
|
407
408
|
"""Checks if the instance fits on the Kubernetes cluster.
|
408
409
|
|
@@ -488,7 +489,7 @@ def check_instance_fits(context: str,
|
|
488
489
|
return fits, reason
|
489
490
|
|
490
491
|
|
491
|
-
def get_gpu_label_key_value(context: str,
|
492
|
+
def get_gpu_label_key_value(context: Optional[str],
|
492
493
|
acc_type: str,
|
493
494
|
check_mode=False) -> Tuple[str, str]:
|
494
495
|
"""Returns the label key and value for the given GPU type.
|
@@ -651,11 +652,14 @@ def get_external_ip(network_mode: Optional[
|
|
651
652
|
return parsed_url.hostname
|
652
653
|
|
653
654
|
|
654
|
-
def check_credentials(context: str,
|
655
|
+
def check_credentials(context: Optional[str],
|
656
|
+
timeout: int = kubernetes.API_TIMEOUT) -> \
|
655
657
|
Tuple[bool, Optional[str]]:
|
656
658
|
"""Check if the credentials in kubeconfig file are valid
|
657
659
|
|
658
660
|
Args:
|
661
|
+
context (Optional[str]): The Kubernetes context to use. If none, uses
|
662
|
+
in-cluster auth to check credentials, if available.
|
659
663
|
timeout (int): Timeout in seconds for the test API call
|
660
664
|
|
661
665
|
Returns:
|
@@ -817,22 +821,42 @@ def get_current_kube_config_context_name() -> Optional[str]:
|
|
817
821
|
return None
|
818
822
|
|
819
823
|
|
820
|
-
def
|
824
|
+
def is_incluster_config_available() -> bool:
|
825
|
+
"""Check if in-cluster auth is available.
|
826
|
+
|
827
|
+
Note: We cannot use load_incluster_config() to check if in-cluster config
|
828
|
+
is available because it will load the in-cluster config (if available)
|
829
|
+
and modify the current global kubernetes config. We simply check if the
|
830
|
+
service account token file exists to determine if in-cluster config may
|
831
|
+
be available.
|
832
|
+
"""
|
833
|
+
return os.path.exists('/var/run/secrets/kubernetes.io/serviceaccount/token')
|
834
|
+
|
835
|
+
|
836
|
+
def get_all_kube_config_context_names() -> List[Optional[str]]:
|
821
837
|
"""Get all kubernetes context names from the kubeconfig file.
|
822
838
|
|
839
|
+
If running in-cluster, returns [None] to indicate in-cluster config.
|
840
|
+
|
823
841
|
We should not cache the result of this function as the admin policy may
|
824
842
|
update the contexts.
|
825
843
|
|
826
844
|
Returns:
|
827
|
-
List[str]
|
828
|
-
|
845
|
+
List[Optional[str]]: The list of kubernetes context names if
|
846
|
+
available, an empty list otherwise. If running in-cluster,
|
847
|
+
returns [None] to indicate in-cluster config.
|
829
848
|
"""
|
830
849
|
k8s = kubernetes.kubernetes
|
831
850
|
try:
|
832
851
|
all_contexts, _ = k8s.config.list_kube_config_contexts()
|
852
|
+
# all_contexts will always have at least one context. If kubeconfig
|
853
|
+
# does not have any contexts defined, it will raise ConfigException.
|
833
854
|
return [context['name'] for context in all_contexts]
|
834
855
|
except k8s.config.config_exception.ConfigException:
|
835
|
-
return None
|
856
|
+
# If running in cluster, return [None] to indicate in-cluster config
|
857
|
+
if is_incluster_config_available():
|
858
|
+
return [None]
|
859
|
+
return []
|
836
860
|
|
837
861
|
|
838
862
|
@functools.lru_cache()
|
@@ -1046,7 +1070,7 @@ def get_ssh_proxy_command(
|
|
1046
1070
|
k8s_ssh_target: str,
|
1047
1071
|
network_mode: kubernetes_enums.KubernetesNetworkingMode,
|
1048
1072
|
private_key_path: str,
|
1049
|
-
context: str,
|
1073
|
+
context: Optional[str],
|
1050
1074
|
namespace: str,
|
1051
1075
|
) -> str:
|
1052
1076
|
"""Generates the SSH proxy command to connect to the pod.
|
@@ -1144,7 +1168,8 @@ def create_proxy_command_script() -> str:
|
|
1144
1168
|
return port_fwd_proxy_cmd_path
|
1145
1169
|
|
1146
1170
|
|
1147
|
-
def setup_ssh_jump_svc(ssh_jump_name: str, namespace: str,
|
1171
|
+
def setup_ssh_jump_svc(ssh_jump_name: str, namespace: str,
|
1172
|
+
context: Optional[str],
|
1148
1173
|
service_type: kubernetes_enums.KubernetesServiceType):
|
1149
1174
|
"""Sets up Kubernetes service resource to access for SSH jump pod.
|
1150
1175
|
|
@@ -1216,7 +1241,8 @@ def setup_ssh_jump_svc(ssh_jump_name: str, namespace: str, context: str,
|
|
1216
1241
|
|
1217
1242
|
|
1218
1243
|
def setup_ssh_jump_pod(ssh_jump_name: str, ssh_jump_image: str,
|
1219
|
-
ssh_key_secret: str, namespace: str,
|
1244
|
+
ssh_key_secret: str, namespace: str,
|
1245
|
+
context: Optional[str]):
|
1220
1246
|
"""Sets up Kubernetes RBAC and pod for SSH jump host.
|
1221
1247
|
|
1222
1248
|
Our Kubernetes implementation uses a SSH jump pod to reach SkyPilot clusters
|
@@ -1296,7 +1322,8 @@ def setup_ssh_jump_pod(ssh_jump_name: str, ssh_jump_image: str,
|
|
1296
1322
|
logger.info(f'Created SSH Jump Host {ssh_jump_name}.')
|
1297
1323
|
|
1298
1324
|
|
1299
|
-
def clean_zombie_ssh_jump_pod(namespace: str, context: str,
|
1325
|
+
def clean_zombie_ssh_jump_pod(namespace: str, context: Optional[str],
|
1326
|
+
node_id: str):
|
1300
1327
|
"""Analyzes SSH jump pod and removes if it is in a bad state
|
1301
1328
|
|
1302
1329
|
Prevents the existence of a dangling SSH jump pod. This could happen
|
@@ -1618,7 +1645,8 @@ def check_nvidia_runtime_class(context: Optional[str] = None) -> bool:
|
|
1618
1645
|
return nvidia_exists
|
1619
1646
|
|
1620
1647
|
|
1621
|
-
def check_secret_exists(secret_name: str, namespace: str,
|
1648
|
+
def check_secret_exists(secret_name: str, namespace: str,
|
1649
|
+
context: Optional[str]) -> bool:
|
1622
1650
|
"""Checks if a secret exists in a namespace
|
1623
1651
|
|
1624
1652
|
Args:
|
@@ -1836,7 +1864,7 @@ def get_namespace_from_config(provider_config: Dict[str, Any]) -> str:
|
|
1836
1864
|
|
1837
1865
|
|
1838
1866
|
def filter_pods(namespace: str,
|
1839
|
-
context: str,
|
1867
|
+
context: Optional[str],
|
1840
1868
|
tag_filters: Dict[str, str],
|
1841
1869
|
status_filters: Optional[List[str]] = None) -> Dict[str, Any]:
|
1842
1870
|
"""Filters pods by tags and status."""
|
@@ -1962,6 +1990,11 @@ def set_autodown_annotations(handle: 'backends.CloudVmRayResourceHandle',
|
|
1962
1990
|
context=context)
|
1963
1991
|
|
1964
1992
|
|
1965
|
-
def get_context_from_config(provider_config: Dict[str, Any]) -> str:
|
1966
|
-
|
1967
|
-
|
1993
|
+
def get_context_from_config(provider_config: Dict[str, Any]) -> Optional[str]:
|
1994
|
+
context = provider_config.get('context',
|
1995
|
+
get_current_kube_config_context_name())
|
1996
|
+
if context == IN_CLUSTER_REGION:
|
1997
|
+
# If the context (also used as the region) is set to IN_CLUSTER_REGION
|
1998
|
+
# we need to use in-cluster auth.
|
1999
|
+
context = None
|
2000
|
+
return context
|
sky/utils/command_runner.py
CHANGED
sky/utils/command_runner.pyi
CHANGED
sky/utils/controller_utils.py
CHANGED
@@ -363,6 +363,14 @@ def shared_controller_vars_to_fill(
|
|
363
363
|
# again on the controller. This is required since admin_policy is not
|
364
364
|
# installed on the controller.
|
365
365
|
local_user_config.pop('admin_policy', None)
|
366
|
+
# Remove allowed_contexts from local_user_config since the controller
|
367
|
+
# may be running in a Kubernetes cluster with in-cluster auth and may
|
368
|
+
# not have kubeconfig available to it. This is the typical case since
|
369
|
+
# remote_identity default for Kubernetes is SERVICE_ACCOUNT.
|
370
|
+
# TODO(romilb): We should check the cloud the controller is running on
|
371
|
+
# before popping allowed_contexts. If it is not on Kubernetes,
|
372
|
+
# we may be able to use allowed_contexts.
|
373
|
+
local_user_config.pop('allowed_contexts', None)
|
366
374
|
with tempfile.NamedTemporaryFile(
|
367
375
|
delete=False,
|
368
376
|
suffix=_LOCAL_SKYPILOT_CONFIG_PATH_SUFFIX) as temp_file:
|
{skypilot_nightly-1.0.0.dev20240928.dist-info → skypilot_nightly-1.0.0.dev20240929.dist-info}/RECORD
RENAMED
@@ -1,6 +1,6 @@
|
|
1
|
-
sky/__init__.py,sha256=
|
1
|
+
sky/__init__.py,sha256=8FioKRx3X_BHtQt6BCrINW2IHHhrCWkiT7cb8NcaRjY,5854
|
2
2
|
sky/admin_policy.py,sha256=hPo02f_A32gCqhUueF0QYy1fMSSKqRwYEg_9FxScN_s,3248
|
3
|
-
sky/authentication.py,sha256=
|
3
|
+
sky/authentication.py,sha256=TfKkVnmRIetATSEVQFp-rOOIRGqVig2i8faSQQt_ixA,20974
|
4
4
|
sky/check.py,sha256=jLMIIJrseaZj1_o5WkbaD9XdyXIlCaT6pyAaIFdhdmA,9079
|
5
5
|
sky/cli.py,sha256=9h4yO8p962960qUjvQ-xSusrtdh8TXNNQ1sfV0OqgZc,206262
|
6
6
|
sky/cloud_stores.py,sha256=RjFgmRhUh1Kk__f6g3KxzLp9s7dA0pFK4W1AukEuUaw,21153
|
@@ -48,7 +48,7 @@ sky/clouds/cudo.py,sha256=H4VyMo5wWGAv2MXZ3xsbWjlZA_cZYnt4ecNlTOOao8Y,13147
|
|
48
48
|
sky/clouds/fluidstack.py,sha256=iOmoOx52yTrHKMzwBDaxFJCfNo79M61d5tj-Np24Lyc,12436
|
49
49
|
sky/clouds/gcp.py,sha256=CrSsaSXd83tM78foKH9viBfW1cQsjve3aUQbshsqvDg,54033
|
50
50
|
sky/clouds/ibm.py,sha256=M8QdjeSFlwssfoY2aOodxG4q5R3eT9K-4lTPDHYvEYI,21476
|
51
|
-
sky/clouds/kubernetes.py,sha256=
|
51
|
+
sky/clouds/kubernetes.py,sha256=aWoXWR-S4puZHzuUHroLKxLdTpkqU7j75dQlXECnsmE,28679
|
52
52
|
sky/clouds/lambda_cloud.py,sha256=2Al3qCSl-I4iTi7pPPNXcbaLyVfCUgTl__vYBunLB6k,12439
|
53
53
|
sky/clouds/oci.py,sha256=ozVEa-9IkfI-RxyXDs_aLG5G0toLBRdtwUtaU-y7bH4,26382
|
54
54
|
sky/clouds/paperspace.py,sha256=lmUZPYAblaqiBmGQwCunccMiTF_dVA1o3vqY9Q_Nc28,10921
|
@@ -137,11 +137,11 @@ sky/provision/gcp/instance.py,sha256=l2-1nHj4pUoHqOu8HMN1hT1bwd4Q96X8MXgOPsNJUN8
|
|
137
137
|
sky/provision/gcp/instance_utils.py,sha256=veRBr6Oziv0KaUdC4acuWeaOremNV0gMYCCHaSvY7c8,70943
|
138
138
|
sky/provision/gcp/mig_utils.py,sha256=oFpcFZoapHMILSE4iIm8V5bxP1RhbMHRF7cciqq8qAk,7883
|
139
139
|
sky/provision/kubernetes/__init__.py,sha256=y6yVfii81WYG3ROxv4hiIj-ydinS5-xGxLvXnARVQoI,719
|
140
|
-
sky/provision/kubernetes/config.py,sha256=
|
141
|
-
sky/provision/kubernetes/instance.py,sha256=
|
140
|
+
sky/provision/kubernetes/config.py,sha256=WEKcFXXhe89bLGAvoMiBvTDxdxkpTIA6ezrj2vmzldc,29072
|
141
|
+
sky/provision/kubernetes/instance.py,sha256=MdgyGcMUbhsSRdaTRV3IgHmiAj5goCDVhzDZ2PDVs_Y,38323
|
142
142
|
sky/provision/kubernetes/network.py,sha256=EpNjRQ131CXepqbdkoRKFu4szVrm0oKEpv1l8EgOkjU,12364
|
143
|
-
sky/provision/kubernetes/network_utils.py,sha256=
|
144
|
-
sky/provision/kubernetes/utils.py,sha256=
|
143
|
+
sky/provision/kubernetes/network_utils.py,sha256=t1FS3K400fetH7cBuRgQJZl5_jEeMshsvsYmnMUcq8k,11399
|
144
|
+
sky/provision/kubernetes/utils.py,sha256=iULhot4naFOsyzp53x4Q4qpsHXvz5-DMOIFFTR8ap9s,83609
|
145
145
|
sky/provision/kubernetes/manifests/smarter-device-manager-configmap.yaml,sha256=AMzYzlY0JIlfBWj5eX054Rc1XDW2thUcLSOGMJVhIdA,229
|
146
146
|
sky/provision/kubernetes/manifests/smarter-device-manager-daemonset.yaml,sha256=RtTq4F1QUmR2Uunb6zuuRaPhV7hpesz4saHjn3Ncsb4,2010
|
147
147
|
sky/provision/paperspace/__init__.py,sha256=1nbUPWio7UA5gCQkO_rfEDfgXT17u5OtuByxQx4Ez6g,598
|
@@ -244,10 +244,10 @@ sky/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
244
244
|
sky/utils/accelerator_registry.py,sha256=BO4iYH5bV80Xyp4EPfO0n1D3LL0FvESCy7xm59Je3_o,3798
|
245
245
|
sky/utils/admin_policy_utils.py,sha256=zFCu1OFIrZRfQNY0JFRO1502WFfdqZhwAU_QgM4fO9U,5943
|
246
246
|
sky/utils/cluster_yaml_utils.py,sha256=1wRRYqI1kI-eFs1pMW4r_FFjHJ0zamq6v2RRI-Gtx5E,849
|
247
|
-
sky/utils/command_runner.py,sha256=
|
248
|
-
sky/utils/command_runner.pyi,sha256=
|
247
|
+
sky/utils/command_runner.py,sha256=NpBe7VHlzxGxuWJeDbRWwy2p64qefqz8c6Bar7KaRnc,33860
|
248
|
+
sky/utils/command_runner.pyi,sha256=G6DHTQ9DhjYmGf_hDoyeWdWuktXqkQyJ7U-wAJTcLiw,7720
|
249
249
|
sky/utils/common_utils.py,sha256=O6PlZTCNhbuXOzjuV2DKw43niWE_qPfYZNGhnMtZzQg,24028
|
250
|
-
sky/utils/controller_utils.py,sha256=
|
250
|
+
sky/utils/controller_utils.py,sha256=32pVORm2cd42tg0srxGvmYV0kYTl67IFsw2EdXbdoR8,38042
|
251
251
|
sky/utils/dag_utils.py,sha256=gjGZiJj4_GYsraXX67e6ElvbmOByJcyjSfvVgYZiXvs,5588
|
252
252
|
sky/utils/db_utils.py,sha256=AOvMmBEN9cF4I7CoXihPCtus4mU2VDGjBQSVMMgzKlA,2786
|
253
253
|
sky/utils/env_options.py,sha256=1VXyd3bhiUgGfCpmmTqM9PagRo1ILBH4-pzIxmIeE6E,861
|
@@ -273,9 +273,9 @@ sky/utils/kubernetes/k8s_gpu_labeler_job.yaml,sha256=KPqp23B-zQ2SZK03jdHeF9fLTog
|
|
273
273
|
sky/utils/kubernetes/k8s_gpu_labeler_setup.yaml,sha256=VLKT2KKimZu1GDg_4AIlIt488oMQvhRZWwsj9vBbPUg,3812
|
274
274
|
sky/utils/kubernetes/rsync_helper.sh,sha256=Ma-N9a271fTfdgP5-8XIQL7KPf8IPUo-uY004PCdUFo,747
|
275
275
|
sky/utils/kubernetes/ssh_jump_lifecycle_manager.py,sha256=RFLJ3k7MR5UN4SKHykQ0lV9SgXumoULpKYIAt1vh-HU,6560
|
276
|
-
skypilot_nightly-1.0.0.
|
277
|
-
skypilot_nightly-1.0.0.
|
278
|
-
skypilot_nightly-1.0.0.
|
279
|
-
skypilot_nightly-1.0.0.
|
280
|
-
skypilot_nightly-1.0.0.
|
281
|
-
skypilot_nightly-1.0.0.
|
276
|
+
skypilot_nightly-1.0.0.dev20240929.dist-info/LICENSE,sha256=emRJAvE7ngL6x0RhQvlns5wJzGI3NEQ_WMjNmd9TZc4,12170
|
277
|
+
skypilot_nightly-1.0.0.dev20240929.dist-info/METADATA,sha256=WfIgFJj_CNWtVZ39aN4Bx7l35R3rE4vdr6tJR9w9m-A,18948
|
278
|
+
skypilot_nightly-1.0.0.dev20240929.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
279
|
+
skypilot_nightly-1.0.0.dev20240929.dist-info/entry_points.txt,sha256=StA6HYpuHj-Y61L2Ze-hK2IcLWgLZcML5gJu8cs6nU4,36
|
280
|
+
skypilot_nightly-1.0.0.dev20240929.dist-info/top_level.txt,sha256=qA8QuiNNb6Y1OF-pCUtPEr6sLEwy2xJX06Bd_CrtrHY,4
|
281
|
+
skypilot_nightly-1.0.0.dev20240929.dist-info/RECORD,,
|
File without changes
|
{skypilot_nightly-1.0.0.dev20240928.dist-info → skypilot_nightly-1.0.0.dev20240929.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|
File without changes
|