def run_tests(self): """ Run all tests. @return: none """ if (self.terminated): return num_tests = len(self.tests) self.__log__("") self.__log__("Starting {} tests...".format(num_tests)) self.__log__("") # Do _one_ test at a time while len(self.tests_not_started) > 0: test = self.tests_not_started.pop(0) print "Beginning test " + test.test_name try: isEC2 = test.aws xmx = test.heap_bytes_per_node ip = test.ip base_port = test.port nodes_in_cloud = test.total_nodes hosts_in_cloud = test.hosts #this will be used to support multi-machine / aws #build h2os... regardless of aws.. just takes host configs and attempts to upload jar then launch if isEC2: raise Exception("Unimplemented: AWS support under construction...") cloud = H2OCloud(1, hosts_in_cloud, nodes_in_cloud, self.h2o_jar, base_port, self.output_dir, isEC2, test.remote_hosts) self.cloud.append(cloud) PerfUtils.start_cloud(self, test.remote_hosts) test.port = self.cloud[0].get_port() test.test_run = TableRow("test_run", self.perfdb) test.test_run.row.update(PerfUtils.__scrape_h2o_sys_info__(self)) contamination = test.do_test(self) test.test_run.row['start_epoch_ms'] = test.start_ms test.test_run.row['end_epoch_ms'] = test.end_ms test.test_run.row['test_name'] = test.test_name #contamination = PerfUtils.run_contaminated(self) print "DEBUG: " print contamination print "" print "" test.test_run.row["contaminated"] = contamination[0] test.test_run.row["contamination_message"] = contamination[1] test.test_run.update(True) PerfUtils.stop_cloud(self, test.remote_hosts) self.cloud.pop(0) except: print "Could not complete test + " test.test_name self.perfdb.this_test_run_id += 1
def run_tests(self): """ Run all tests. @return: none """ if (self.terminated): return num_tests = len(self.tests) self.__log__("") self.__log__("Starting {} tests...".format(num_tests)) self.__log__("") # Do _one_ test at a time while len(self.tests_not_started) > 0: test = self.tests_not_started.pop(0) print "Beginning test " + test.test_name self.isEC2 = test.aws self.xmx = test.heap_bytes_per_node self.ip = test.ip self.base_port = test.port self.nodes_in_cloud = test.total_nodes self.hosts_in_cloud = test.hosts #this will be used to support multi-machine / aws #build h2os... regardless of aws.. just takes host configs and attempts to upload jar then launch if self.isEC2: raise Exception( "Unimplemented: AWS support under construction...") cloud = H2OCloud(1, self.hosts_in_cloud, self.nodes_in_cloud, self.h2o_jar, self.base_port, self.output_dir, self.isEC2, test.remote_hosts) self.cloud.append(cloud) PerfUtils.start_cloud(self, test.remote_hosts) test.port = self.cloud[0].get_port() test.test_run = TableRow("test_run", self.perfdb) test.test_run.row.update(PerfUtils.__scrape_h2o_sys_info__(self)) test.do_test() test.test_run.row['start_epoch_ms'] = test.start_ms test.test_run.row['end_epoch_ms'] = test.end_ms test.test_run.row['test_name'] = test.test_name test.test_run.update(True) PerfUtils.stop_cloud(self, test.remote_hosts)
def run_tests(self): """ Run all tests. @return: none """ if (self.terminated): return num_tests = len(self.tests) self.__log__("") self.__log__("Starting {} tests...".format(num_tests)) self.__log__("") # Do _one_ test at a time while len(self.tests_not_started) > 0: test = self.tests_not_started.pop(0) self.use_aws = test.aws self.xmx = test.heap_bytes_per_node self.ip = test.ip self.base_port = test.port self.nodes_in_cloud = test.total_nodes self.hosts_in_cloud = test.hosts #this will be used to support multi-machine / aws #build h2os... regardless of aws.. just takes host configs and attempts to upload jar then launch if self.use_aws: raise Exception("Unimplemented: AWS support under construction...") cloud = H2OCloud(1, self.nodes_in_cloud, self.h2o_jar, self.base_port, self.xmx, self.output_dir) self.cloud.append(cloud) PerfUtils.start_cloud(self) test.port = self.cloud[0].get_port() test.test_run = TableRow("test_run", self.perfdb) test.test_run.row.update(PerfUtils.__scrape_h2o_sys_info__(self)) test.do_test() test.test_run.row['start_epoch_ms'] = test.start_ms test.test_run.row['end_epoch_ms'] = test.end_ms test.test_run.row['test_name'] = test.test_name test.test_run.update(True) PerfUtils.stop_cloud(self)
def start_remote(self): """ Start one node of H2O. (Stash away the self.child and self.pid internally here.) @return: none """ #upload flat_file #upload aws_creds #upload hdfs_config cmd = ["java", "-Xmx" + self.xmx, #"-ea", "-jar", self.uploaded[self.h2o_jar], "-name", self.cloud_name, "-baseport", str(self.my_base_port)] # Add S3N credentials to cmd if they exist. ec2_hdfs_config_file_name = os.path.expanduser("/home/spencer/.ec2/core-site.xml") if (os.path.exists(ec2_hdfs_config_file_name)): cmd.append("-hdfs_config") cmd.append(ec2_hdfs_config_file_name) self.output_file_name = "java_" + str(self.cloud_num) + "_" + str(self.node_num) self.error_file_name = "java_" + str(self.cloud_num) + "_" + str(self.node_num) cmd = ' '.join(cmd) self.channel = self.open_channel() self.stdouterr = "" #somehow cat outfile & errorfile? outfd, self.output_file_name = PerfUtils.tmp_file(prefix = "remoteH2O-" + self.output_file_name, suffix = ".out", directory = self.output_dir) errfd, self.error_file_name = PerfUtils.tmp_file(prefix = "remoteH2O-" + self.error_file_name, suffix = ".err", directory = self.output_dir) PerfUtils.drain(self.channel.makefile(), outfd) PerfUtils.drain(self.channel.makefile_stderr(), errfd) self.channel.exec_command(cmd) cmd_serve = ["python", "/home/0xdiag/serve_proc.py"] self.channelServe = self.open_channel() self.channelServe.exec_command(' '.join(cmd_serve)) @atexit.register def kill_process(): try: try: self.stop_remote() self.channel.exec_command('exit') self.ssh.close() except: pass try: self.stop_local() except: pass except OSError: pass print "+ CMD: " + cmd
def run_tests(self): """ Run all tests. @return: none """ if self.terminated: return print "DEBUG: TESTS TO BE RUN:" names = [test.test_name for test in self.tests] for n in names: print n num_tests = len(self.tests) self.__log__("") self.__log__("Starting {} tests...".format(num_tests)) self.__log__("") # Do _one_ test at a time while len(self.tests_not_started) > 0: test = self.tests_not_started.pop(0) print print "Beginning test " + test.test_name print isEC2 = test.aws # xmx = test.heap_bytes_per_node # ip = test.ip base_port = test.port nodes_in_cloud = test.total_nodes hosts_in_cloud = test.hosts # this will be used to support multi-machine / aws #build h2os... regardless of aws.. just takes host configs and attempts to upload jar then launch if isEC2: raise Exception("Unimplemented: AWS support coming soon.") cloud = H2OCloud(1, hosts_in_cloud, nodes_in_cloud, self.h2o_jar, base_port, self.output_dir, isEC2, test.remote_hosts) self.cloud.append(cloud) try: PerfUtils.start_cloud(self, test.remote_hosts) test.port = self.cloud[0].get_port() test.test_run = TableRow("test_run", self.perfdb) test.test_run.row.update(PerfUtils.__scrape_h2o_sys_info__(self)) p = self.begin_sys_profiling(test.test_name) contamination = test.do_test(self) test.test_run.row['start_epoch_ms'] = test.start_ms test.test_run.row['end_epoch_ms'] = test.end_ms test.test_run.row['test_name'] = test.test_name test.test_run.row["contaminated"] = contamination[0] test.test_run.row["contamination_message"] = contamination[1] test.test_run.update(True) p.terminate() print "Successfully stopped profiler..." PerfUtils.stop_cloud(self, test.remote_hosts) self.cloud.pop(0) self.perfdb.this_test_run_id += 1 except: print "Exception caught:" print '-' * 60 traceback.print_exc(file=sys.stdout) print '-' * 60 PerfUtils.stop_cloud(self, test.remote_hosts) self.cloud.pop(0) self.perfdb.this_test_run_id += 1
def start_remote(self): """ Start one node of H2O. (Stash away the self.child and self.pid internally here.) @return: none """ #upload flat_file #upload aws_creds #upload hdfs_config cmd = [ "java", "-Xmx" + self.xmx, #"-ea", "-jar", self.uploaded[self.h2o_jar], "-name", self.cloud_name, "-baseport", str(self.my_base_port) ] # Add S3N credentials to cmd if they exist. ec2_hdfs_config_file_name = os.path.expanduser( "/home/spencer/.ec2/core-site.xml") if os.path.exists(ec2_hdfs_config_file_name): cmd.append("-hdfs_config") cmd.append(ec2_hdfs_config_file_name) self.output_file_name = "java_" + str(self.cloud_num) + "_" + str( self.node_num) self.error_file_name = "java_" + str(self.cloud_num) + "_" + str( self.node_num) cmd = ' '.join(cmd) self.channel = self.open_channel() self.stdouterr = "" # somehow cat outfile & errorfile? outfd, self.output_file_name = PerfUtils.tmp_file( prefix="remoteH2O-" + self.output_file_name, suffix=".out", directory=self.output_dir) errfd, self.error_file_name = PerfUtils.tmp_file( prefix="remoteH2O-" + self.error_file_name, suffix=".err", directory=self.output_dir) PerfUtils.drain(self.channel.makefile(), outfd) PerfUtils.drain(self.channel.makefile_stderr(), errfd) self.channel.exec_command(cmd) cmd_serve = ["python", "/home/0xdiag/serve_proc.py"] self.channelServe = self.open_channel() self.channelServe.exec_command(' '.join(cmd_serve)) @atexit.register def kill_process(): try: try: self.stop_remote() self.channel.exec_command('exit') self.ssh.close() except: pass try: self.stop_local() except: pass except OSError: pass print "+ CMD: " + cmd
# corresponding node counts---each line is of # the form: nodeCount trcFile) # trcPtList (path to file containg the list of # trace points for which data is to # be plotted) # ############################################################################## # if len(sys.argv) < 8: print(sys.argv[0], "dbName description timeConv fileList "+\ "trcPtList minTimeStep outFileBase") sys.exit(-1) dbName = sys.argv[1] desc = sys.argv[2] timeConv = sys.argv[3] fileList = sys.argv[4] trcPtList = sys.argv[5] minTimeStep = sys.argv[6] outFileBase = sys.argv[7] traceSet = PerfUtils.makeFileList(fileList) labels = PerfUtils.makeLabelList(trcPtList) groupId = PerfUtils.traceGroup(dbName, desc, timeConv, traceSet) bracketName = 'TimeStep__0' outFileBase = 'stats' PerfUtils.traceGroupMultiStatsDb2(dbName, groupId, outFileBase, minTimeStep, bracketName) PerfUtils.scalability(dbName, groupId, outFileBase, labels)
def run_tests(self): """ Run all tests. @return: none """ if self.terminated: return print "DEBUG: TESTS TO BE RUN:" names = [test.test_name for test in self.tests] self.names = names for n in names: print n num_tests = len(self.tests) self.__log__("") self.__log__("Starting {} tests...".format(num_tests)) self.__log__("") # Do _one_ test at a time while len(self.tests_not_started) > 0: test = self.tests_not_started.pop(0) if "multinode" in test.test_name: print print "Skipping multinode test " + test.test_name print continue print print "Beginning test " + test.test_name print isEC2 = test.aws # xmx = test.heap_bytes_per_node # ip = test.ip base_port = test.port nodes_in_cloud = test.total_nodes hosts_in_cloud = test.hosts # this will be used to support multi-machine / aws #build h2os... regardless of aws.. just takes host configs and attempts to upload jar then launch if isEC2: raise Exception("Unimplemented: AWS support coming soon.") cloud = H2OCloud(1, hosts_in_cloud, nodes_in_cloud, self.h2o_jar, base_port, self.output_dir, isEC2, test.remote_hosts) self.cloud.append(cloud) try: PerfUtils.start_cloud(self, test.remote_hosts) test.port = self.cloud[0].get_port() test.test_run = TableRow("test_run", self.perfdb) test.test_run.row.update(PerfUtils.__scrape_h2o_sys_info__(self)) p = self.begin_sys_profiling(test.test_name) contamination = test.do_test(self) test.test_run.row['start_epoch_ms'] = test.start_ms test.test_run.row['end_epoch_ms'] = test.end_ms test.test_run.row['test_name'] = test.test_name test.test_run.row["contaminated"] = contamination[0] test.test_run.row["contamination_message"] = contamination[1] test.test_run.update(True) p.terminate() print "Successfully stopped profiler..." PerfUtils.stop_cloud(self, test.remote_hosts) self.cloud.pop(0) self.perfdb.this_test_run_id += 1 except: print "Exception caught:" print '-' * 60 traceback.print_exc(file=sys.stdout) print '-' * 60 PerfUtils.stop_cloud(self, test.remote_hosts) self.cloud.pop(0) self.perfdb.this_test_run_id += 1
# trcPtList (path to file containg the list of # trace points for which data is to # be plotted) # ############################################################################## def makeLabelList(trcPtList): labelList = [] tl = open(trcPtList, 'r') if not tl: print("Unable to open file", trcPtList) sys.exit(-1) ws = re.compile(r'\s+') for line in xreadlines(tl): rec = ws.split(str(line)) labelList.append(rec[0]) return labelList if len(sys.argv) < 5: print(sys.argv[0], "dbName groupId trcPtList outFileBase") sys.exit(-1) dbName = sys.argv[1] groupId = sys.argv[2] trcPtList = sys.argv[3] outFileBase = sys.argv[4] labels = makeLabelList(trcPtList) print(labels) PerfUtils.scalability(dbName, groupId, outFileBase, labels)