本文整理匯總了Python中apache.aurora.config.AuroraConfig.job方法的典型用法代碼示例。如果您正苦於以下問題:Python AuroraConfig.job方法的具體用法?Python AuroraConfig.job怎麽用?Python AuroraConfig.job使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類apache.aurora.config.AuroraConfig
的用法示例。
在下文中一共展示了AuroraConfig.job方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_config_with_ports
# 需要導入模塊: from apache.aurora.config import AuroraConfig [as 別名]
# 或者: from apache.aurora.config.AuroraConfig import job [as 別名]
def test_config_with_ports():
hwc = HELLO_WORLD(
task=HELLO_WORLD.task()(
processes=[Process(name="hello_world", cmdline="echo {{thermos.ports[http]}} {{thermos.ports[admin]}}")]
)
)
config = AuroraConfig(hwc)
job = config.job()
assert job.taskConfig.requestedPorts == set(["http", "admin"])
示例2: test_config_with_ports
# 需要導入模塊: from apache.aurora.config import AuroraConfig [as 別名]
# 或者: from apache.aurora.config.AuroraConfig import job [as 別名]
def test_config_with_ports():
hwc = HELLO_WORLD(
task=HELLO_WORLD.task()(
processes=[
Process(name='hello_world',
cmdline='echo {{thermos.ports[http]}} {{thermos.ports[admin]}}')
]
)
)
config = AuroraConfig(hwc)
job = config.job()
assert Resource(namedPort='http') in list(job.taskConfig.resources)
assert Resource(namedPort='admin') in list(job.taskConfig.resources)
示例3: test_config_with_task_links
# 需要導入模塊: from apache.aurora.config import AuroraConfig [as 別名]
# 或者: from apache.aurora.config.AuroraConfig import job [as 別名]
def test_config_with_task_links():
tl = Map(String, String)
unresolved_tl = {
"foo": "http://%host%:{{thermos.ports[foo]}}",
"bar": "http://%host%:{{thermos.ports[bar]}}/{{mesos.instance}}",
}
resolved_tl = {"foo": "http://%host%:%port:foo%", "bar": "http://%host%:%port:bar%/%shard_id%"}
aurora_config = AuroraConfig(HELLO_WORLD(task_links=tl(unresolved_tl)))
assert aurora_config.task_links() == tl(resolved_tl)
assert aurora_config.job().taskConfig.taskLinks == frozendict(resolved_tl)
bad_tl = {"foo": "{{thermos.ports.bad}}"}
with pytest.raises(AuroraConfig.InvalidConfig):
AuroraConfig(HELLO_WORLD(task_links=tl(bad_tl))).job()