mirror of
https://github.com/wassname/ray.git
synced 2026-08-17 11:25:34 +08:00
[autoscaler] Fix redirects, fix submit (#4085)
This commit is contained in:
@@ -206,12 +206,9 @@ 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)),
|
||||
redirect=open("/dev/null", "w"),
|
||||
)
|
||||
self.rsync_up(
|
||||
local_path, remote_path, redirect=open("/dev/null", "w"))
|
||||
self.ssh_cmd("mkdir -p {}".format(
|
||||
os.path.dirname(remote_path)))
|
||||
self.rsync_up(local_path, remote_path)
|
||||
|
||||
# Run init commands
|
||||
self.provider.set_node_tags(self.node_id,
|
||||
@@ -220,15 +217,19 @@ 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, redirect=open("/dev/null", "w"))
|
||||
self.ssh_cmd(cmd)
|
||||
|
||||
m = "{}: Setup commands completed".format(self.node_id)
|
||||
with LogTimer("NodeUpdater: {}".format(m)):
|
||||
for cmd in self.setup_commands:
|
||||
self.ssh_cmd(cmd, redirect=open("/dev/null", "w"))
|
||||
self.ssh_cmd(cmd)
|
||||
|
||||
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",
|
||||
@@ -242,6 +243,11 @@ 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",
|
||||
@@ -264,6 +270,10 @@ 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"]
|
||||
|
||||
Reference in New Issue
Block a user