MCPcopy Create free account
hub / github.com/ProjectMitosisOS/mitosis-core / trigger_bootstrap

Function trigger_bootstrap

exp_scripts/evaluation_runner.py:45–75  ·  view source on GitHub ↗
(dictory)

Source from the content-addressed store, hash-verified

43 time.sleep(0.1)
44
45def trigger_bootstrap(dictory):
46 data = []
47 for root, dirs, files in os.walk(dictory):
48 for f in sorted(files):
49 pattern = re.compile(r"^run.*?toml$")
50 # pattern = re.compile(r"^run48.toml$")
51 if pattern.match(f) is not None:
52 log_path = "{}/{}.txt".format(dictory, f)
53 cmd = "python bootstrap.py -f {} {} > {}".format(
54 os.path.join(root, f), str(arguments), log_path)
55 sys_command_outstatuserr(cmd, timeout=600)
56
57 if len(filter) > 0:
58 trace = ""
59 try:
60 trace = int(f.split("-")[1].split(".")[0])
61 except:
62 trace = str(f.split("-")[1].split(".")[0])
63 print("trace {}".format(trace))
64
65 print_process = Popen(("cat {}".format(os.path.join(root,f + ".txt")).split()), stdout=subprocess.PIPE)
66 grep_process = Popen(["grep", "-i", filter], stdin=print_process.stdout, stdout=PIPE)
67 print_process.stdout.close() # Allow ps_process to receive a SIGPIPE if grep_process exits.
68 output = grep_process.communicate()[0]
69
70 print(output.decode('utf-8'))
71 data.append([trace,output.decode('utf-8') ])
72
73 print('finish\n-------\n', f)
74
75 print(tabulate(sorted(data), headers=["trace","data"]))
76
77if __name__ == '__main__':
78 trigger_bootstrap(input_dir)

Callers 1

Calls 6

walkMethod · 0.80
joinMethod · 0.80
decodeMethod · 0.80
sys_command_outstatuserrFunction · 0.70
closeMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected