From 3bcf1b18e91bd712ca2bd1d1e84696ca3a293d98 Mon Sep 17 00:00:00 2001 From: puchazhong Date: Fri, 19 Nov 2021 14:16:00 +0800 Subject: [PATCH] distribute tmp_run --- OneFlow/tools/group_test.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/OneFlow/tools/group_test.py b/OneFlow/tools/group_test.py index 4d88e1e0..6d36c82d 100644 --- a/OneFlow/tools/group_test.py +++ b/OneFlow/tools/group_test.py @@ -118,7 +118,14 @@ def exec_cmd(num_nodes, cmd, host_ips, password): with open('tmp_run.sh', 'w') as f: f.write(cmd) - + + distribute_tmp_run_cmd = ['ansible all --inventory=inventory -m copy', + '--ssh-extra-args "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"', + f'-a "src={os.getcwd()}/tmp_run.sh dest={os.getcwd()}"',] + distribute_cmd = ' '.join(distribute_tmp_run_cmd) + print(distribute_cmd) + os.system(distribute_cmd) + time.sleep(10) # generate ansible command ansible_cmd = ['ansible all --inventory=inventory -m shell', '--ssh-extra-args "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"',