本文整理汇总了Python中codalabtools.deploy.DeploymentConfig.getWebHostnames方法的典型用法代码示例。如果您正苦于以下问题:Python DeploymentConfig.getWebHostnames方法的具体用法?Python DeploymentConfig.getWebHostnames怎么用?Python DeploymentConfig.getWebHostnames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类codalabtools.deploy.DeploymentConfig
的用法示例。
在下文中一共展示了DeploymentConfig.getWebHostnames方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: config
# 需要导入模块: from codalabtools.deploy import DeploymentConfig [as 别名]
# 或者: from codalabtools.deploy.DeploymentConfig import getWebHostnames [as 别名]
def config(label):
"""
Reads deployment parameters for the given setup.
label: Label identifying the desired setup (e.g., prod, test, etc.)
"""
env.cfg_label = label
print "Deployment label is:", env.cfg_label
filename = ".codalabconfig"
print "Loading configuration from:", env.cfg_path
configuration = DeploymentConfig(label, env.cfg_path)
print "Configuring logger..."
logging.config.dictConfig(configuration.getLoggerDictConfig())
logger.info("Loaded configuration from file: %s", configuration.getFilename())
env.roledefs = {'web' : configuration.getWebHostnames()}
# Credentials
env.user = configuration.getVirtualMachineLogonUsername()
env.password = configuration.getVirtualMachineLogonPassword()
env.key_filename = configuration.getServiceCertificateKeyFilename()
# Repository
env.git_codalab_tag = configuration.getGitTag()
env.git_codalab_cli_tag = configuration.getBundleServiceGitTag()
env.deploy_codalab_dir = 'codalab'
env.deploy_codalab_cli_dir = 'codalab-cli'
env.django_settings_module = 'codalab.settings'
env.django_configuration = configuration.getDjangoConfiguration() # Prod or Dev
env.config_http_port = '80'
env.config_server_name = "{0}.cloudapp.net".format(configuration.getServiceName())
env.configuration = True
env.SHELL_ENV = {}
示例2: config
# 需要导入模块: from codalabtools.deploy import DeploymentConfig [as 别名]
# 或者: from codalabtools.deploy.DeploymentConfig import getWebHostnames [as 别名]
def config(label=None):
"""
Reads deployment parameters for the given setup.
label: Label identifying the desired setup.
"""
env.cfg_label = label
print "Deployment label is: ", env.cfg_label
if 'cfg_path' not in env:
env.cfg_path = os.path.join(os.environ['HOME'], '.codalabconfig')
print "Loading configuration from: ", env.cfg_path
configuration = DeploymentConfig(label, env.cfg_path)
print "Configuring logger..."
logging.config.dictConfig(configuration.getLoggerDictConfig())
logger.info("Loaded configuration from file: %s", configuration.getFilename())
env.user = configuration.getVirtualMachineLogonUsername()
env.password = configuration.getVirtualMachineLogonPassword()
env.key_filename = configuration.getServiceCertificateKeyFilename()
env.roledefs = { 'build' : [ configuration.getBuildHostname() ] }
if label is not None:
env.roledefs.update({ 'web' : configuration.getWebHostnames() })
env.git_user = configuration.getGitUser()
env.git_repo = configuration.getGitRepo()
env.git_tag = configuration.getGitTag()
env.git_repo_url = 'https://github.com/{0}/{1}.git'.format(env.git_user, env.git_repo)
env.deploy_dir = 'deploy'
env.build_archive = '{0}.tar.gz'.format(env.git_tag)
env.django_settings_module = 'codalab.settings'
env.django_configuration = configuration.getDjangoConfiguration()
env.config_http_port = '80'
env.config_server_name = "{0}.cloudapp.net".format(configuration.getServiceName())
env.configuration = True
示例3: config
# 需要导入模块: from codalabtools.deploy import DeploymentConfig [as 别名]
# 或者: from codalabtools.deploy.DeploymentConfig import getWebHostnames [as 别名]
def config(label=None):
"""
Reads deployment parameters for the given setup.
label: Label identifying the desired setup.
"""
env.cfg_label = label
print "Deployment label is: ", env.cfg_label
filename = ".codalabconfig"
if "cfg_path" not in env:
env.cfg_path = os.path.join(os.getcwd(), filename)
if os.path.exists(env.cfg_path) == False:
env.cfg_path = os.path.join(os.path.expanduser("~"), filename)
print "Loading configuration from: ", env.cfg_path
configuration = DeploymentConfig(label, env.cfg_path)
print "Configuring logger..."
logging.config.dictConfig(configuration.getLoggerDictConfig())
logger.info("Loaded configuration from file: %s", configuration.getFilename())
env.user = configuration.getVirtualMachineLogonUsername()
env.password = configuration.getVirtualMachineLogonPassword()
env.key_filename = configuration.getServiceCertificateKeyFilename()
env.roledefs = {"build": [configuration.getBuildHostname()]}
if label is not None:
env.roledefs.update({"web": configuration.getWebHostnames()})
# Information about main CodaLab repo
env.git_user = configuration.getGitUser()
env.git_repo = configuration.getGitRepo()
env.git_tag = configuration.getGitTag()
env.git_repo_url = "https://github.com/{0}/{1}.git".format(env.git_user, env.git_repo)
# Information about Bundles repo
env.git_bundles_user = configuration.getBundleServiceGitUser()
env.git_bundles_repo = configuration.getBundleServiceGitRepo()
env.git_bundles_tag = configuration.getBundleServiceGitTag()
if len(configuration.getBundleServiceUrl()) > 0:
env.git_bundles_repo_url = "https://github.com/{0}/{1}.git".format(
env.git_bundles_user, env.git_bundles_repo
)
else:
env.git_bundles_repo_url = ""
env.deploy_dir = "deploy"
env.build_archive = "{0}.tar.gz".format(env.git_tag)
env.django_settings_module = "codalab.settings"
env.django_configuration = configuration.getDjangoConfiguration()
env.config_http_port = "80"
env.config_server_name = "{0}.cloudapp.net".format(configuration.getServiceName())
env.configuration = True