Example #1
0
def setup(submit_dir, config_properties):
    """
	Setup the populate module
	@submit_dir submit directory path of the workflow run
	@config_properties path to the propery file
	"""
    # global reference
    global global_base_submit_dir
    global global_braindb_submit_dir
    global global_db_url
    global global_top_wf_uuid
    global_base_submit_dir = submit_dir
    #Getting values from braindump file
    config = utils.slurp_braindb(submit_dir)
    if (config.has_key('submit_dir') or config.has_key('run')):
        if config.has_key('submit_dir'):
            global_braindb_submit_dir = os.path.abspath(config['submit_dir'])
        else:
            global_braindb_submit_dir = os.path.abspath(config['run'])
    else:
        logger.error(
            "Submit directory cannot be found in the braindump.txt . ")
        sys.exit(1)

    # Create the sqllite db url
    global_db_url, global_top_wf_uuid = db_utils.get_db_url_wf_uuid(
        submit_dir, config_properties)
    if global_db_url is None:
        sys.exit(1)
Example #2
0
def setup(submit_dir , config_properties):
	"""
	Setup the populate module
	@submit_dir submit directory path of the workflow run
	@config_properties path to the propery file
	"""
	# global reference
	global global_base_submit_dir
	global global_braindb_submit_dir
	global global_db_url
	global global_top_wf_uuid
	global_base_submit_dir = submit_dir
	#Getting values from braindump file
	config = utils.slurp_braindb(submit_dir)
	if (config.has_key('submit_dir') or config.has_key('run')):
		if config.has_key('submit_dir'):
			global_braindb_submit_dir =  os.path.abspath(config['submit_dir'])
		else:
			global_braindb_submit_dir =  os.path.abspath(config['run'])
	else:
		logger.error("Submit directory cannot be found in the braindump.txt . ")
		sys.exit(1)
	
	# Create the sqllite db url
	global_db_url, global_top_wf_uuid = db_utils.get_db_url_wf_uuid(submit_dir, config_properties)
	if global_db_url is None:
		sys.exit(1)
Example #3
0
    def __init__(self, submit_dir):
        ''' initialize - connect to the database. '''
        logger.debug ("event-scanner:<init> submit_dir: %s", submit_dir)
        properties = os.path.join (submit_dir, "grayson.stampede.properties")
        properties = None
	self.db_url, self.wf_uuid = db_utils.get_db_url_wf_uuid (submit_dir, properties)
        logger.debug ("dburl=(%s) wf_uuid=(%s)", self.db_url, self.wf_uuid)

        self.database = StampedeStatistics (self.db_url, True)
        self.database.initialize (self.wf_uuid)
        self.totalMessages = 0