"g": globals(), "sch": partial(schedule, loop), "top": partial(top, process_queue, thread_queue), "pending": pending, "done": done, } passwords = { 'guest': '', # guest account with no password } from biothings.utils.hub import start_server server = start_server(loop, "MyVariant hub", passwords=passwords, port=config.SSH_HUB_PORT, commands=COMMANDS) try: loop.run_until_complete(server) except (OSError, asyncssh.Error) as exc: sys.exit('Error starting server: ' + str(exc)) loop.run_forever()
# indexing commands "im" : index_manager, "index" : index_manager.index, "snapshot" : index_manager.snapshot, ## admin/advanced #"loop" : loop, #"pqueue" : process_queue, #"tqueue" : thread_queue, "g": globals(), "sch" : partial(schedule,loop), "top" : partial(top,process_queue,thread_queue), "pending" : pending, "done" : done, } passwords = { 'guest': '', # guest account with no password } from biothings.utils.hub import start_server server = start_server(loop, "Species hub",passwords=passwords,port=7022,commands=COMMANDS) try: loop.run_until_complete(server) except (OSError, asyncssh.Error) as exc: sys.exit('Error starting server: ' + str(exc)) loop.run_forever()
## admin/advanced #"loop" : loop, "q": jmanager.process_queue, "t": jmanager.thread_queue, "g": globals(), "l": loop, "j": jmanager, "sch": partial(schedule, loop), "top": jmanager.top, "pending": pending, "done": done, } passwords = config.HUB_PASSWD from biothings.utils.hub import start_server ssh_server = start_server(loop, "Species hub", passwords=passwords, port=config.HUB_SSH_PORT, commands=COMMANDS, extra_ns=EXTRA_NS) try: loop.run_until_complete(asyncio.wait([ssh_server])) except (OSError, asyncssh.Error) as exc: sys.exit('Error starting SSH server: ' + str(exc)) loop.run_forever()
import biothings.hub.api.handlers.ws as ws import sockjs.tornado from biothings.utils.hub_db import ChangeWatcher listener = ws.HubDBListener() ChangeWatcher.add(listener) ChangeWatcher.publish() ws_router = sockjs.tornado.SockJSRouter( partial(ws.WebSocketConnection, listener=listener), '/ws') routes.extend(ws_router.urls) app = tornado.web.Application(routes, settings=settings) EXTRA_NS["app"] = app # register app into current event loop app_server = tornado.httpserver.HTTPServer(app) app_server.listen(config.HUB_API_PORT) app_server.start() server = start_server(loop, "MyGene hub", passwords=config.HUB_PASSWD, port=config.HUB_SSH_PORT, shell=shell) try: loop.run_until_complete(server) except (OSError, asyncssh.Error) as exc: sys.exit('Error starting server: ' + str(exc)) loop.run_forever()
# indexing commands "im" : index_manager, "index" : index_manager.index, "snapshot" : index_manager.snapshot, # admin/advanced "loop" : loop, "pqueue" : process_queue, "tqueue" : thread_queue, "g": globals(), "sch" : partial(schedule,loop), "top" : partial(top,process_queue,thread_queue), "pending" : pending, "done" : done, } passwords = { 'guest': '', # guest account with no password } from biothings.utils.hub import start_server server = start_server(loop,"MyVariant hub",passwords=passwords,port=config.SSH_HUB_PORT,commands=COMMANDS) try: loop.run_until_complete(server) except (OSError, asyncssh.Error) as exc: sys.exit('Error starting server: ' + str(exc)) loop.run_forever()
"dim": differ_manager, "im": index_manager, "jm": job_manager, ## admin/advanced #"loop" : loop, "q": job_manager.process_queue, "t": job_manager.thread_queue, "g": globals(), "l": loop, "j": job_manager, "sch": partial(schedule, loop), "top": job_manager.top, "pending": pending, "done": done, } shell.set_commands(COMMANDS, EXTRA_NS) server = start_server(loop, "MyChem.info hub", passwords=config.HUB_PASSWD, port=config.SSH_HUB_PORT, shell=shell) try: loop.run_until_complete(server) except (OSError, asyncssh.Error) as exc: sys.exit('Error starting server: ' + str(exc)) loop.run_forever()
"dim" : differ_manager, "smt" : syncer_manager_test, "smp" : syncer_manager_prod, "im" : index_manager, "jm" : job_manager, "mongo_sync" : partial(syncer_manager_test.sync,"mongo"), "es_sync_test" : partial(syncer_manager_test.sync,"es"), "es_sync_prod" : partial(syncer_manager_prod.sync,"es"), "loop" : loop, "pqueue" : process_queue, "tqueue" : thread_queue, "g": globals(), "sch" : partial(schedule,loop), "top" : job_manager.top, "pending" : pending, "done" : done, } from biothings.utils.hub import start_server server = start_server(loop,"MyGene hub",passwords=config.HUB_PASSWD, port=config.HUB_SSH_PORT,commands=COMMANDS,extra_ns=EXTRA_NS) try: loop.run_until_complete(server) except (OSError, asyncssh.Error) as exc: sys.exit('Error starting server: ' + str(exc)) loop.run_forever()
"um": umanager, "upload": umanager.upload_src, "upload_all": umanager.upload_all, # admin/advanced "loop": loop, "executor": executor, "g": globals(), "sch": partial(schedule, loop), } passwords = { 'guest': '', # guest account with no password } from biothings.utils.hub import start_server cwd = os.path.dirname(os.path.realpath(__file__)) server = start_server(loop, "wikidata hub", passwords=passwords, port=8022, commands=COMMANDS, keys=[os.path.join(cwd, 'ssh_host_key')]) try: loop.run_until_complete(server) except (OSError, asyncssh.Error) as exc: sys.exit('Error starting server: ' + str(exc)) loop.run_forever()
"upload_all": umanager.upload_all, # admin/advanced "loop": loop, "pqueue": process_queue, "tqueue": thread_queue, "g": globals(), "sch": partial(schedule, loop), "top": partial(top, process_queue, thread_queue), "pending": pending, "done": done, } passwords = { 'guest': '', # guest account with no password } from biothings.utils.hub import start_server server = start_server(loop, "wikidata hub", passwords=passwords, port=8022, commands=COMMANDS) try: loop.run_until_complete(server) except (OSError, asyncssh.Error) as exc: sys.exit('Error starting server: ' + str(exc)) loop.run_forever()