示例#1
0
def main():
    init_database(args.logdir)

    py_filename = osp.join('jacmldash.py')
    if osp.isfile(py_filename):
        logger.critical('Loading JacMLDash config: {}.'.format(
            osp.abspath(py_filename)))
        config = load_source(py_filename)
        if hasattr(config, 'ui_methods'):
            register_ui_methods(config.ui_methods)
        if hasattr(config, 'run_methods'):
            register_run_methods(config.run_methods)
        if hasattr(config, 'custom_pages'):
            register_custom_pages(config.custom_pages)

    if args.cli:
        from IPython import embed
        embed()
        return

    app = make_app(
        [
            'mldash.web.app.index', 'mldash.web.app.experiment',
            'mldash.plugins.tensorboard.handler',
            'mldash.plugins.trashbin.handler', 'mldash.plugins.star.handler',
            'mldash.plugins.viewer.handler'
        ], {
            'gzip': True,
            'debug': args.debug,
            'xsrf_cookies': True,
            'static_path': get_static_path(),
            'template_path': get_template_path(),
            'ui_methods': get_ui_methods(),
            "cookie_secret": "20f42d0ae6548e88cf9788e725b298bd",
            "session_secret":
            "3cdcb1f00803b6e78ab50b466a40b9977db396840c28307f428b25e2277f1bcc",
            "frontend_secret":
            "asdjikfh98234uf9pidwja09f9adsjp9fd6840c28307f428b25e2277f1bcc",
            "cookie_prefix": 'jac_',
            'session_engine': 'off',
        })

    app.listen(args.port, xheaders=True)

    logger.critical('Mainloop started. Port: {}.'.format(args.port))
    loop = tornado.ioloop.IOLoop.current()
    loop.start()
示例#2
0
文件: main.py 项目: vacancy/JacMLDash
def main():
    init_database('.')

    ProjectMetainfo.set_all({
        'title': 'Test',
        'create_time': '2019-09-05 15:44:27',
        'update_time': '2019-09-05 15:44:27'
    })

    print(ProjectMetainfo.get_all())

    print('Create the desc')
    desc, _ = Desc.get_or_create(desc_name='desc_xxx')
    print('Create the expr')
    expr, _ = Experiment.get_or_create(expr_name='expr1', desc=desc)

    print('Create the runs')
    train_run = Run(expr=expr,
                    run_name='train1' + str(time.time()),
                    command='jac-run xxx',
                    args='{xxx}',
                    configs='{xxx}',
                    highlight_args='{yyy}',
                    highlight_configs='{yyy}')
    test_run = Run(expr=expr,
                   run_name='test1' + str(time.time()),
                   command='jac-run xxx',
                   args='{xxx}',
                   configs='{xxx}',
                   highlight_args='{yyy}',
                   highlight_configs='{yyy}',
                   refer=train_run)

    from IPython import embed
    embed()

    train_run.save()
    test_run.save()
示例#3
0
 def __init__(self, dump_dir):
     self.dump_dir = dump_dir
     init_database(self.dump_dir)
     self.desc = None
     self.expr = None
     self.run = None