From 60dbc771a233906a8eda7801e23bb2ee949e65a4 Mon Sep 17 00:00:00 2001 From: Eric Liang Date: Mon, 25 Feb 2019 17:00:59 -0800 Subject: [PATCH] Revert "[autoscaler] Fix redirects, fix submit (#4085)" (#4158) This reverts commit acf4d53b55779822873a438bf696aaa59537a1c0. --- python/ray/autoscaler/updater.py | 26 ++++++++------------------ python/ray/rllib/setup-rllib-dev.py | 1 - python/ray/scripts/scripts.py | 11 +++-------- 3 files changed, 11 insertions(+), 27 deletions(-) diff --git a/python/ray/autoscaler/updater.py b/python/ray/autoscaler/updater.py index ef8f34394..e3697adba 100644 --- a/python/ray/autoscaler/updater.py +++ b/python/ray/autoscaler/updater.py @@ -206,9 +206,12 @@ class NodeUpdater(object): m = "{}: Synced {} to {}".format(self.node_id, local_path, remote_path) with LogTimer("NodeUpdater {}".format(m)): - self.ssh_cmd("mkdir -p {}".format( - os.path.dirname(remote_path))) - self.rsync_up(local_path, remote_path) + self.ssh_cmd( + "mkdir -p {}".format(os.path.dirname(remote_path)), + redirect=open("/dev/null", "w"), + ) + self.rsync_up( + local_path, remote_path, redirect=open("/dev/null", "w")) # Run init commands self.provider.set_node_tags(self.node_id, @@ -217,19 +220,15 @@ class NodeUpdater(object): m = "{}: Initialization commands completed".format(self.node_id) with LogTimer("NodeUpdater: {}".format(m)): for cmd in self.initialization_commands: - self.ssh_cmd(cmd) + self.ssh_cmd(cmd, redirect=open("/dev/null", "w")) m = "{}: Setup commands completed".format(self.node_id) with LogTimer("NodeUpdater: {}".format(m)): for cmd in self.setup_commands: - self.ssh_cmd(cmd) + self.ssh_cmd(cmd, redirect=open("/dev/null", "w")) def rsync_up(self, source, target, redirect=None, check_error=True): self.set_ssh_ip_if_required() - if redirect is None: - if logger.getEffectiveLevel() > logging.DEBUG: - redirect = open("/dev/null", "w") - self.get_caller(check_error)( [ "rsync", "-e", @@ -243,11 +242,6 @@ class NodeUpdater(object): def rsync_down(self, source, target, redirect=None, check_error=True): self.set_ssh_ip_if_required() - - if redirect is None: - if logger.getEffectiveLevel() > logging.DEBUG: - redirect = open("/dev/null", "w") - self.get_caller(check_error)( [ "rsync", "-e", @@ -270,10 +264,6 @@ class NodeUpdater(object): self.set_ssh_ip_if_required() - if redirect is None: - if logger.getEffectiveLevel() > logging.DEBUG: - redirect = open("/dev/null", "w") - logger.info("NodeUpdater: Running {} on {}...".format( cmd, self.ssh_ip)) ssh = ["ssh"] diff --git a/python/ray/rllib/setup-rllib-dev.py b/python/ray/rllib/setup-rllib-dev.py index f50bdffbe..d85f048d5 100755 --- a/python/ray/rllib/setup-rllib-dev.py +++ b/python/ray/rllib/setup-rllib-dev.py @@ -38,7 +38,6 @@ if __name__ == "__main__": do_link("rllib") do_link("tune") do_link("autoscaler") - do_link("scripts") print("Created links.\n\nIf you run into issues initializing Ray, please " "ensure that your local repo and the installed Ray are in sync " "(pip install -U the latest wheels at " diff --git a/python/ray/scripts/scripts.py b/python/ray/scripts/scripts.py index b4d853cb2..352c41426 100644 --- a/python/ray/scripts/scripts.py +++ b/python/ray/scripts/scripts.py @@ -610,11 +610,6 @@ def rsync_up(cluster_config_file, source, target, cluster_name): @cli.command() @click.argument("cluster_config_file", required=True, type=str) -@click.option( - "--docker", - is_flag=True, - default=False, - help="Runs command in the docker container specified in cluster_config.") @click.option( "--stop", is_flag=True, @@ -642,8 +637,8 @@ def rsync_up(cluster_config_file, source, target, cluster_name): "--port-forward", required=False, type=int, help="Port to forward.") @click.argument("script", required=True, type=str) @click.argument("script_args", required=False, type=str, nargs=-1) -def submit(cluster_config_file, docker, screen, tmux, stop, start, - cluster_name, port_forward, script, script_args): +def submit(cluster_config_file, screen, tmux, stop, start, cluster_name, + port_forward, script, script_args): """Uploads and runs a script on the specified cluster. The script is automatically synced to the following location: @@ -660,7 +655,7 @@ def submit(cluster_config_file, docker, screen, tmux, stop, start, rsync(cluster_config_file, script, target, cluster_name, down=False) cmd = " ".join(["python", target] + list(script_args)) - exec_cluster(cluster_config_file, cmd, docker, screen, tmux, stop, False, + exec_cluster(cluster_config_file, cmd, screen, tmux, stop, False, cluster_name, port_forward)