diff --git a/runhouse/resources/hardware/on_demand_cluster.py b/runhouse/resources/hardware/on_demand_cluster.py index 86afa0da6..c7ad0b28f 100644 --- a/runhouse/resources/hardware/on_demand_cluster.py +++ b/runhouse/resources/hardware/on_demand_cluster.py @@ -522,6 +522,9 @@ def _populate_connection_from_status_dict(self, cluster_dict: Dict[str, Any]): _, current_context = kubernetes.config.list_kube_config_contexts() self.compute_properties["kube_context"] = current_context["name"] + self._kube_namespace = self.compute_properties.get("kube_namespace") + self._kube_context = self.compute_properties.get("kube_context") + def _update_from_sky_status(self, dryrun: bool = False): # Try to get the cluster status from SkyDB if self.is_shared: diff --git a/tests/fixtures/on_demand_cluster_fixtures.py b/tests/fixtures/on_demand_cluster_fixtures.py index ab2ce41aa..9e4a24560 100644 --- a/tests/fixtures/on_demand_cluster_fixtures.py +++ b/tests/fixtures/on_demand_cluster_fixtures.py @@ -186,7 +186,7 @@ def ondemand_k8s_cluster(request, test_rns_folder): # Note: Cannot specify both `instance_type` and any of `memory`, `disk_size`, `num_cpus`, or `accelerators` args = { - "name": "k8s-cpu", + "name": f"{test_rns_folder}-k8s-cpu", "provider": "kubernetes", "instance_type": "CPU:1", } diff --git a/tests/test_resources/test_clusters/test_cluster.py b/tests/test_resources/test_clusters/test_cluster.py index 253712148..8343b829b 100644 --- a/tests/test_resources/test_clusters/test_cluster.py +++ b/tests/test_resources/test_clusters/test_cluster.py @@ -308,6 +308,14 @@ def test_condensed_config_for_cluster(self, cluster): ] on_cluster_config = remove_config_keys(on_cluster_config, keys_to_skip) local_cluster_config = remove_config_keys(local_cluster_config, keys_to_skip) + if local_cluster_config.get("ssh_properties") and local_cluster_config.get( + "ssh_properties" + ).get("ssh_proxy_command"): + local_cluster_config["ssh_properties"]["ssh_proxy_command"] = ( + local_cluster_config.get("ssh_properties") + .get("ssh_proxy_command") + .replace("'", "") + ) assert on_cluster_config == local_cluster_config