当前位置: 首页>>代码示例>>Python>>正文


Python DeploymentConfig.get_compute_worker_logs_password方法代码示例

本文整理汇总了Python中codalabtools.deploy.DeploymentConfig.get_compute_worker_logs_password方法的典型用法代码示例。如果您正苦于以下问题:Python DeploymentConfig.get_compute_worker_logs_password方法的具体用法?Python DeploymentConfig.get_compute_worker_logs_password怎么用?Python DeploymentConfig.get_compute_worker_logs_password使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在codalabtools.deploy.DeploymentConfig的用法示例。


在下文中一共展示了DeploymentConfig.get_compute_worker_logs_password方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: deploy_compute_worker

# 需要导入模块: from codalabtools.deploy import DeploymentConfig [as 别名]
# 或者: from codalabtools.deploy.DeploymentConfig import get_compute_worker_logs_password [as 别名]
def deploy_compute_worker(label):
    '''
    Deploy/update compute workers.
    For monitoring make sure the azure instance has the port 8000 forwarded

    :param label: Either test or prod
    '''
    env.deploy_codalab_dir = 'codalab-competitions'
    # Create .codalabconfig within home directory
    env.label = label
    cfg = DeploymentConfig(env.label, env.cfg_path if hasattr(env, 'cfg_path') else '.codalabconfig')
    dep = Deployment(cfg)
    buf = StringIO()
    buf.write(dep.get_compute_workers_file_content())
    settings_file = os.path.join('~', '.codalabconfig')
    put(buf, settings_file)
    env.git_codalab_tag = cfg.getGitTag()
    env.logs_password = cfg.get_compute_worker_logs_password()

    # Initial setup
    with cd(env.deploy_codalab_dir):
        run('git checkout %s' % env.git_codalab_tag)
        run('git pull')
        run('source /home/azureuser/codalab-competitions/venv/bin/activate && pip install -r /home/azureuser/codalab-competitions/codalab/requirements/dev_azure.txt')
        # run('./dev_setup.sh')

    # run("source /home/azureuser/codalab-competitions/venv/bin/activate && pip install bottle==0.12.8")

    current_directory = os.path.dirname(os.path.realpath(__file__))

    put(
        local_path='{}/configs/upstart/codalab-compute-worker.conf'.format(current_directory),
        remote_path='/etc/init/codalab-compute-worker.conf',
        use_sudo=True
    )
    put(
        local_path='{}/configs/upstart/codalab-monitor.conf'.format(current_directory),
        remote_path='/etc/init/codalab-monitor.conf',
        use_sudo=True
    )
    # run("echo %s > /home/azureuser/codalab-competitions/codalab/codalabtools/compute/password.txt" % env.logs_password)

    with settings(warn_only=True):
        sudo("stop codalab-compute-worker")
        sudo("stop codalab-monitor")
        sudo("start codalab-compute-worker")
        sudo("start codalab-monitor")
开发者ID:xbaro,项目名称:codalab,代码行数:49,代码来源:fabfile.py


注:本文中的codalabtools.deploy.DeploymentConfig.get_compute_worker_logs_password方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。