mirror of
https://github.com/wassname/ray.git
synced 2026-08-02 13:01:01 +08:00
[docker] Fix rsyncs & filesync for docker (#9920)
This commit is contained in:
@@ -481,14 +481,28 @@ class DockerCommandRunner(SSHCommandRunner):
|
||||
ssh_options_override=ssh_options_override)
|
||||
|
||||
def run_rsync_up(self, source, target):
|
||||
protected_path = ""
|
||||
if target.find("/root") == 0:
|
||||
protected_path = target
|
||||
target = target.replace("/root", "/tmp/root")
|
||||
self.ssh_command_runner.run(
|
||||
f"mkdir -p {os.path.dirname(target)}", run_env="host")
|
||||
self.ssh_command_runner.run_rsync_up(source, target)
|
||||
if self._check_container_status():
|
||||
self.ssh_command_runner.run("docker cp {} {}:{}".format(
|
||||
target, self.docker_name, self._docker_expand_user(target)))
|
||||
target, self.docker_name,
|
||||
self._docker_expand_user(protected_path)))
|
||||
|
||||
def run_rsync_down(self, source, target):
|
||||
protected_path = ""
|
||||
if source.find("/root") == 0:
|
||||
protected_path = source
|
||||
source = source.replace("/root", "/tmp/root")
|
||||
self.ssh_command_runner.run(
|
||||
f"mkdir -p {os.path.dirname(source)}", run_env="host")
|
||||
self.ssh_command_runner.run("docker cp {}:{} {}".format(
|
||||
self.docker_name, self._docker_expand_user(source), source))
|
||||
self.docker_name, self._docker_expand_user(protected_path),
|
||||
source))
|
||||
self.ssh_command_runner.run_rsync_down(source, target)
|
||||
|
||||
def remote_shell_command_str(self):
|
||||
|
||||
Reference in New Issue
Block a user