예제 #1
0
 def run(self):
     install.run(self)
     from biomaj.schema_version import SchemaVersion
     SchemaVersion.migrate_pendings()
     SchemaVersion.add_property(prop='desc', cfg='db.fullname')
     SchemaVersion.set_version()
예제 #2
0
파일: setup.py 프로젝트: genouest/biomaj
 def run(self):
     install.run(self)
     from biomaj.schema_version import SchemaVersion
     SchemaVersion.migrate_pendings()
     SchemaVersion.add_property(prop='desc', cfg='db.fullname')
     SchemaVersion.set_version()
예제 #3
0
파일: setup.py 프로젝트: hexylena/biomaj
 def run(self):
     install.run(self)
     from biomaj.schema_version import SchemaVersion
     SchemaVersion.migrate_pendings()
예제 #4
0
                    action="store",
                    dest="cfg",
                    default=None,
                    help="Bank configuration key to retrieve prop value")
parser.add_argument('-p',
                    '--property',
                    action="store",
                    dest="prop",
                    required=True,
                    help="Property name")
parser.add_argument('-v',
                    '--value',
                    action="store",
                    dest="value",
                    help="Property value")
args = parser.parse_args()
if sys.argv == 1:
    parser.print_help()
    sys.exit(0)
if args.value and args.cfg:
    logging.error("-v and -c are not compatible")
    sys.exit(1)
logging.warn(
    "Needs global.properties in local directory or env variable BIOMAJ_CONF")
SchemaVersion.add_property(bank=args.bank,
                           prop=args.prop,
                           value=args.value,
                           cfg=args.cfg)
logging.info("Insertion done")
sys.exit(0)
예제 #5
0
from biomaj.schema_version import SchemaVersion
import logging

logging.warn('Migrate BioMAJ database...')
logging.warn('Needs global.properties in local directory or env variable BIOMAJ_CONF')
SchemaVersion.migrate_pendings()
logging.warn('Migration done')
예제 #6
0
if not os.path.exists(process_dir):
    os.makedirs(process_dir)
cache_dir = BiomajConfig.global_config.get('GENERAL', 'cache.dir')
if not os.path.exists(cache_dir):
    os.makedirs(cache_dir)
lock_dir = BiomajConfig.global_config.get('GENERAL', 'lock.dir')
if not os.path.exists(lock_dir):
    os.makedirs(lock_dir)

redis_client = redis.StrictRedis(host=config['redis']['host'],
                                 port=config['redis']['port'],
                                 db=config['redis']['db'],
                                 decode_responses=True)

logging.info("Check database schema and upgrade if necessary")
SchemaVersion.migrate_pendings()
SchemaVersion.set_version()

app = Flask(__name__)
CORS(app)

biomaj_metric = Counter("biomaj_daemon_total", "Bank total update execution.",
                        ['bank', 'action', 'updated'])
biomaj_error_metric = Counter("biomaj_daemon_errors",
                              "Bank total update errors.", ['bank', 'action'])
biomaj_time_metric = Gauge("biomaj_daemon_time",
                           "Bank update execution time in seconds.",
                           ['bank', 'action', 'updated'],
                           multiprocess_mode='all')