예제 #1
0
 def setUp(self):
     logging.info("Creating test sqlite database")
     copy2(dirpath + "/test_pipeline.db.template",
           dirpath + "/test_pipeline.db")
     logging.info("Connecting to hive test sqlite database " + dirpath +
                  "/test_pipeline.db")
     self.hive = HiveInstance("sqlite:///" + dirpath + "/test_pipeline.db")
예제 #2
0
def get_hive(process):
    if process not in hives.keys():
        if process not in process_lookup.keys():
            raise ProcessNotFoundError("Process " + str(process) +
                                       " not known")
        hives[process] = HiveInstance(process_lookup[process]['hive_uri'])
    return hives[process]
예제 #3
0
def get_hive(process):
    if process not in hives:
        if process not in process_lookup:
            raise ProcessNotFoundError('Process %s not known' % process)
        hives[process] = HiveInstance(process_lookup[process]['hive_uri'])
    return hives[process]
예제 #4
0
from ensembl_prodinf.exceptions import HTTPRequestError
from ensembl_prodinf.config import load_config_json


app = Flask(__name__, instance_relative_config=True)
app.config.from_object('db_config')
app.analysis = app.config["HIVE_ANALYSIS"]
app.blacklisted_status_hosts = set(app.config['BLACKLISTED_STATUS_HOSTS'])
app.config['SWAGGER'] = {
    'title': 'Database copy REST endpoints',
    'uiversion': 2
}


swagger = Swagger(app)
app.hive = HiveInstance(app.config["HIVE_URI"])
app.logger.addHandler(app_logging.file_handler(__name__))
app.logger.addHandler(app_logging.default_handler())

app.logger.info(app.config)

app.servers = load_config_json(app.config['SERVER_URIS_FILE'])


def is_running(pid):
    try:
        os.kill(pid, 0)
    except OSError as err:
        return False
    return True
예제 #5
0
def get_hive():
    global hive
    if hive is None:
        hive = HiveInstance(app.config["HIVE_URI"])
    return hive