Skip to content

Commit

Permalink
Save a few needless RNS lookups. Bump version for release. Style.
Browse files Browse the repository at this point in the history
  • Loading branch information
dongreenberg committed Jul 11, 2023
1 parent d7c3ab8 commit c789468
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 20 deletions.
2 changes: 1 addition & 1 deletion runhouse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
# Syntactic sugar
fn = function

__version__ = "0.0.7"
__version__ = "0.0.8"
14 changes: 2 additions & 12 deletions runhouse/rns/folders/folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,18 +149,8 @@ def from_config(config: dict, dryrun=False, _resolve_children=True):
def _check_for_child_configs(cls, config):
"""Overload by child resources to load any resources they hold internally."""
system = config["system"]
if (
isinstance(system, str)
and system not in RESERVED_SYSTEM_NAMES
and rns_client.exists(system)
):
# if the system is set to a cluster
cluster_config: dict = rns_client.load_config(name=system)
if not cluster_config:
raise Exception(f"No cluster config saved for {system}")

# set the cluster config as the system
config["system"] = cluster_config
if isinstance(system, str) and system not in RESERVED_SYSTEM_NAMES:
config["system"] = rns_client.load_config(name=system) or system
return config

@property
Expand Down
8 changes: 3 additions & 5 deletions runhouse/rns/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,12 @@ def from_config(config: dict, dryrun: bool = False):
def _check_for_child_configs(cls, config):
"""Overload by child resources to load any resources they hold internally."""
system = config["system"]
if isinstance(system, str) and rh_config.rns_client.exists(system):
if isinstance(system, str):
config["system"] = rh_config.rns_client.load_config(name=system)
# if the system is set to a cluster
cluster_config: dict = rh_config.rns_client.load_config(name=system)
if not cluster_config:
if not config["system"]:
raise Exception(f"No cluster config saved for {system}")

# set the cluster config as the system
config["system"] = cluster_config
config["env"] = _get_env_from(config["env"])
return config

Expand Down
2 changes: 1 addition & 1 deletion runhouse/rns/hardware/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ def restart_server(
ray_start_cmd = "ray start --head --port 6379 --autoscaling-config=~/ray_bootstrap_config.yaml"
# We need to use this instead of ray stop to make sure we don't stop the SkyPilot ray server,
# which runs on other ports but is required to preserve autostop and correct cluster status.
kill_ray_cmd = f'pkill -f ".*ray.*6379.*"'
kill_ray_cmd = 'pkill -f ".*ray.*6379.*"'
if self.ips and len(self.ips) > 1:
raise NotImplementedError(
"Starting Ray on a cluster with multiple nodes is not yet supported."
Expand Down
4 changes: 3 additions & 1 deletion runhouse/rns/packages/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,9 @@ def to(
@staticmethod
def from_config(config: dict, dryrun=False):
if isinstance(config.get("install_target"), dict):
config["install_target"] = Folder.from_config(config["install_target"], dryrun=dryrun)
config["install_target"] = Folder.from_config(
config["install_target"], dryrun=dryrun
)
if config.get("resource_subtype") == "GitPackage":
from runhouse import GitPackage

Expand Down

0 comments on commit c789468

Please sign in to comment.