def setup(submit_dir, out_dir, env, log_level): """ Setup the pegasus host over time module @param submit_dir submit directory path @out_dir the output directory path @env the environment variables @log_level logging level """ global output_dir output_dir = out_dir if log_level == None: log_level = "info" setup_logger(log_level) utils.create_directory(output_dir) src_js_path = env['pegasus_javascript_dir'] src_img_path = os.path.join(env['pegasus_share_dir'], "plots/images/protovis/") dest_js_path = os.path.join(output_dir, "js") dest_img_path = os.path.join(output_dir, "images/") utils.create_directory(dest_js_path) utils.create_directory(dest_img_path) plot_utils.copy_files(src_js_path, dest_js_path) plot_utils.copy_files(src_img_path, dest_img_path) # copy images from common src_img_path = os.path.join(env['pegasus_share_dir'], "plots/images/common/") plot_utils.copy_files(src_img_path, dest_img_path) create_action_script(output_dir)
def setup(submit_dir, out_dir, env, log_level): """ Setup the pegasus host over time module @param submit_dir submit directory path @out_dir the output directory path @env the environment variables @log_level logging level """ global output_dir output_dir = out_dir if log_level == None: log_level = "info" setup_logger(log_level) utils.create_directory(output_dir) src_js_path = env["pegasus_javascript_dir"] src_img_path = os.path.join(env["pegasus_share_dir"], "plots/images/protovis/") dest_js_path = os.path.join(output_dir, "js") dest_img_path = os.path.join(output_dir, "images/") utils.create_directory(dest_js_path) utils.create_directory(dest_img_path) plot_utils.copy_files(src_js_path, dest_js_path) plot_utils.copy_files(src_img_path, dest_img_path) # copy images from common src_img_path = os.path.join(env["pegasus_share_dir"], "plots/images/common/") plot_utils.copy_files(src_img_path, dest_img_path) create_action_script(output_dir)
def setup(submit_dir, out_dir, env): """ Setup the pegasus breakdown module @param submit_dir submit directory path @out_dir the output directory path @env the environment variables """ # global reference global output_dir output_dir = out_dir utils.create_directory(output_dir) src_js_path = env['pegasus_javascript_dir'] src_img_path = os.path.join(env['pegasus_share_dir'], "plots/images/protovis/") dest_js_path = os.path.join(output_dir, "js") dest_img_path = os.path.join(output_dir, "images/") utils.create_directory(dest_js_path) utils.create_directory(dest_img_path) plot_utils.copy_files(src_js_path, dest_js_path) plot_utils.copy_files(src_img_path, dest_img_path) # copy images from common src_img_path = os.path.join(env['pegasus_share_dir'], "plots/images/common/") plot_utils.copy_files(src_img_path, dest_img_path) create_action_script(output_dir)
def setup(submit_dir,out_dir,env): """ Setup the pegasus host over time module @param submit_dir submit directory path @out_dir the output directory path @env the environment variables """ global output_dir output_dir = out_dir utils.create_directory(output_dir) src_js_path = env['pegasus_javascript_dir'] src_img_path = os.path.join(env['pegasus_share_dir'] , "plots/images/protovis/") dest_js_path = os.path.join(output_dir, "js") dest_img_path = os.path.join(output_dir, "images/") utils.create_directory(dest_js_path) utils.create_directory(dest_img_path) plot_utils.copy_files(src_js_path , dest_js_path) plot_utils.copy_files(src_img_path, dest_img_path) # copy images from common src_img_path = os.path.join(env['pegasus_share_dir'] , "plots/images/common/") plot_utils.copy_files(src_img_path, dest_img_path) create_action_script(output_dir)
def main(): # Configure command line option parser prog_usage = prog_base +" [options] SUBMIT DIRECTORY" parser = optparse.OptionParser(usage=prog_usage) parser.add_option("-o", "--output", action = "store", dest = "output_dir", help = "writes the output to given directory.") parser.add_option("-c", "--conf", action = "store", type = "string", dest = "config_properties", help = "specifies the properties file to use. This option overrides all other property files.") parser.add_option("-m", "--max-graph-nodes", action = "store", type = "int", dest = "max_graph_nodes", help = "Maximum limit on the number of tasks/jobs in the dax/dag upto which the graph should be generated; Default value is 100") parser.add_option("-p", "--plotting-level", action = "store", dest = "plotting_level", choices=['all', 'all_charts', 'all_graphs', 'dax_graph', 'dag_graph', 'gantt_chart', 'host_chart', 'time_chart', 'breakdown_chart'], help = "specifies the chart and graphs to generate. Valid levels are: all, all_charts, all_graphs, dax_graph,\ dag_graph, gantt_chart, host_chart, time_chart, breakdown_chart; Default is all_charts.") parser.add_option("-i", "--ignore-db-inconsistency", action = "store_const", const = 0, dest = "ignore_db_inconsistency", help = "turn off the check for db consistency") parser.add_option("-v", "--verbose", action="count", default=0, dest="verbose", help="Increase verbosity, repeatable") parser.add_option("-q", "--quiet", action="count", default=0, dest="quiet", help="Decrease verbosity, repeatable") parser.add_option("-f", "--files", action="store_true", dest="files", default=False, help="Include files. This option is only valid for DAX files. [default: false]") # Parse command line options (options, args) = parser.parse_args() if len(args) > 1: parser.error("Invalid argument") sys.exit(1) if len(args) < 1: submit_dir = os.getcwd() else: submit_dir = os.path.abspath(args[0]) # Copy options from the command line parser log_level = 1 log_level_str = "info" log_level += (options.verbose - options.quiet) if log_level <= 0: log_level_str = "error" elif log_level == 1: log_level_str = "warning" elif log_level == 2: log_level_str = "info" elif log_level >= 3: log_level_str = "debug" setup_logger(log_level_str) logger.info(prog_base + " : initializing...") if options.ignore_db_inconsistency is None: if not utils.loading_completed(submit_dir): if utils.monitoring_running(submit_dir): logger.warning("pegasus-monitord still running. Please wait for it to complete. ") else: logger.warning("Please run pegasus monitord in replay mode. ") sys.exit(1) else: logger.warning("The tool is meant to be run after the completion of workflow run.") if options.plotting_level is not None: plotting_level = options.plotting_level else: plotting_level = 'all_charts' set_plotting_level(plotting_level) if options.output_dir is not None: output_dir = options.output_dir else : output_dir = os.path.join(submit_dir, DEFAULT_OUTPUT_DIR) utils.create_directory(output_dir, True) if options.max_graph_nodes is not None: global max_graph_nodes max_graph_nodes = options.max_graph_nodes try: create_charts(submit_dir, output_dir, options.config_properties, options.files) except SystemExit: sys.exit(1) except: logger.warning(traceback.format_exc()) sys.exit(1) sys.exit(0)