From 495faaf3b82d6a5ce7e0635f664b9f2d27120932 Mon Sep 17 00:00:00 2001 From: Caroline Date: Thu, 6 Jun 2024 17:54:37 -0400 Subject: [PATCH 1/2] random small fixes --- runhouse/main.py | 2 +- runhouse/resources/packages/package.py | 1 + runhouse/rns/defaults.py | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/runhouse/main.py b/runhouse/main.py index a11bd670b..f5be1001f 100644 --- a/runhouse/main.py +++ b/runhouse/main.py @@ -604,7 +604,7 @@ def _start_server( flags.append(default_env_flag) conda_env_flag = f" --conda-env {conda_env}" if conda_env else "" - if default_env_flag: + if conda_env_flag: logger.info(f"Creating runtime env for conda env: {conda_env}") flags.append(conda_env_flag) diff --git a/runhouse/resources/packages/package.py b/runhouse/resources/packages/package.py index 9c9776046..da7d92b1a 100644 --- a/runhouse/resources/packages/package.py +++ b/runhouse/resources/packages/package.py @@ -162,6 +162,7 @@ def _install(self, env: Union[str, "Env"] = None, cluster: "Cluster" = None): path = self.install_target.path else: path = self.to(cluster).install_target.path + install_cmd = self._install_cmd(cluster=cluster) if not path: return diff --git a/runhouse/rns/defaults.py b/runhouse/rns/defaults.py index 49cfd4131..1c06be742 100644 --- a/runhouse/rns/defaults.py +++ b/runhouse/rns/defaults.py @@ -236,7 +236,9 @@ def set(self, key: str, value: Any, config_path: Optional[str] = None): def set_nested(self, key: str, value: Any, config_path: Optional[str] = None): """Set a config key that has multiple key/value pairs""" - self.defaults_cache.setdefault(key, {}).update(value) + if not self.defaults_cache.get(key): + self.defaults_cache.setdefault(key, {}) + self.defaults_cache[key].update(value) self.save_defaults(config_path=config_path) def set_many(self, key_value_pairs: Dict, config_path: Optional[str] = None): From edfa4fe5b1f48cfab605e072ac5afce8155f1e0c Mon Sep 17 00:00:00 2001 From: Caroline Date: Thu, 6 Jun 2024 17:55:34 -0400 Subject: [PATCH 2/2] update package .to --- runhouse/resources/packages/package.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/runhouse/resources/packages/package.py b/runhouse/resources/packages/package.py index da7d92b1a..58b77440b 100644 --- a/runhouse/resources/packages/package.py +++ b/runhouse/resources/packages/package.py @@ -336,8 +336,21 @@ def to( "`install_target` must be a Folder in order to copy the package to a system." ) + if ( + isinstance(self.install_target.system, str) + and not self.install_target.system == "file" + ): + self.install_target.system = _get_cluster_from(self.install_target.system) + + install_system_name = ( + self.install_target.system.name + if isinstance(self.install_target.system, Cluster) + else self.install_target.system + ) system = _get_cluster_from(system) - if self.install_target.system == system: + system_name = system.name if isinstance(system, Cluster) else system + + if system_name == install_system_name: return self if isinstance(system, Resource):