Beispiel #1
0
def test_pod_factory_pod():
    args_no_replicas = set_pod_parser().parse_args(['--shards', '1'])
    assert isinstance(PodFactory.build_pod(args_no_replicas), Pod)

    args_replicas = set_pod_parser().parse_args(['--shards', '2'])
    assert isinstance(PodFactory.build_pod(args_replicas), CompoundPod)

    args_no_replicas = set_pod_parser().parse_args(['--replicas', '2'])
    assert isinstance(PodFactory.build_pod(args_no_replicas), Pod)
Beispiel #2
0
def test_pod_factory_k8s():
    args_replicas = set_pod_parser().parse_args([])
    assert isinstance(
        PodFactory.build_pod(args_replicas,
                             infrastructure=InfrastructureType.K8S),
        K8sPod,
    )
Beispiel #3
0
def pod(args: 'Namespace'):
    """
    Start a Pod

    :param args: arguments coming from the CLI.
    """
    from jina.peapods.pods.factory import PodFactory

    try:
        with PodFactory.build_pod(args) as p:
            p.join()
    except KeyboardInterrupt:
        pass
def external_pod(external_pod_args):
    return PodFactory.build_pod(external_pod_args)
def external_pod_pre_parallel(external_pod_pre_parallel_args):
    return PodFactory.build_pod(external_pod_pre_parallel_args)
Beispiel #6
0
def external_pod_pre_shards(external_pod_pre_shards_args):
    return PodFactory.build_pod(external_pod_pre_shards_args)
Beispiel #7
0
def external_pod_parallel_2(external_pod_parallel_2_args):
    return PodFactory.build_pod(
        external_pod_parallel_2_args,
    )