Ejemplo n.º 1
0
from biothings.utils.hub import schedule, pending, done, _and, CommandDefinition, CommandDefinition


def trigger_merge(build_name):
    @asyncio.coroutine
    def do():
        build_manager.merge(build_name)

    return asyncio.ensure_future(do())


allspecies = partial(shell.launch,
                     partial(build_manager.merge, "mygene_allspecies"))
demo = partial(shell.launch, partial(build_manager.merge, "demo_allspecies"))
job_manager.submit(allspecies, "0 2 * * 7")
job_manager.submit(demo, "0 4 * * 7")

COMMANDS = OrderedDict()
# getting info
COMMANDS["source_info"] = CommandDefinition(command=smanager.get_source,
                                            tracked=False)
COMMANDS["status"] = CommandDefinition(command=shell.status, tracked=False)
# dump commands
COMMANDS["dump"] = dmanager.dump_src
COMMANDS["dump_all"] = dmanager.dump_all
# upload commands
COMMANDS["upload"] = upload_manager.upload_src
COMMANDS["upload_all"] = upload_manager.upload_all
# building/merging
COMMANDS["whatsnew"] = build_manager.whatsnew
Ejemplo n.º 2
0
index_manager = indexer.IndexerManager(job_manager=job_manager)
pindexer = partial(GeneIndexer,es_host=config.ES_HOST)
index_manager.configure([{"default" : pindexer}])

from biothings.utils.hub import schedule, pending, done, _and

def trigger_merge(build_name):
    @asyncio.coroutine
    def do():
        build_manager.merge(build_name)
    return asyncio.ensure_future(do())
mygene = partial(build_manager.merge,"mygene")
allspecies = partial(build_manager.merge,"mygene_allspecies")
demo = partial(build_manager.merge,"demo_allspecies")
job_manager.submit(partial(_and,mygene,allspecies,demo),"0 2 * * 7")


COMMANDS = OrderedDict()
# dump commands
COMMANDS["dump"] = dmanager.dump_src
COMMANDS["dump_all"] = dmanager.dump_all
# upload commands
COMMANDS["upload"] = upload_manager.upload_src
COMMANDS["upload_all"] = upload_manager.upload_all
# building/merging
COMMANDS["whatsnew"] = build_manager.whatsnew
COMMANDS["lsmerge"] = build_manager.list_merge
COMMANDS["merge"] = build_manager.merge
COMMANDS["es_sync_gene_test"] = partial(syncer_manager_test.sync,"es",target_backend=config.ES_TEST_GENE)
COMMANDS["es_sync_gene_allspecies_test"] = partial(syncer_manager_test.sync,"es",target_backend=config.ES_TEST_GENE_ALLSPECIES)