コード例 #1
0
ファイル: thrift.py プロジェクト: ralic/aurora
def create_container_config(container):
  if container is Empty:
    return Container(MesosContainer(), None)
  elif container.docker() is not Empty:
    params = list()
    if container.docker().parameters() is not Empty:
      for p in fully_interpolated(container.docker().parameters()):
        params.append(DockerParameter(p['name'], p['value']))
    return Container(None, DockerContainer(fully_interpolated(container.docker().image()), params))
  else:
    raise InvalidConfig('If a container is specified it must set one type.')
コード例 #2
0
def create_docker_container(container):
    params = list()
    if container.parameters() is not Empty:
        for p in fully_interpolated(container.parameters()):
            params.append(DockerParameter(p['name'], p['value']))
    return DockerContainer(fully_interpolated(container.image()), params)
コード例 #3
0
def test_sandbox_provider_docker_container():
    sandbox = DefaultSandboxProvider().from_assigned_task(
        AssignedTask(task=TaskConfig(container=Container(
            docker=DockerContainer()))))

    assert sandbox._user is None