Beispiel #1
0
    def test_cont_gateway(self):
        f1_args = set_gateway_parser().parse_args(['--allow-spawn'])
        f2_args = set_gateway_parser().parse_args([])
        with GatewayPod(f1_args):
            pass

        with GatewayPod(f2_args):
            pass
Beispiel #2
0
def test_remote_not_allowed():
    f_args = set_gateway_parser().parse_args([])
    p_args = set_pea_parser().parse_args(
        ['--host', 'localhost', '--port-expose',
         str(f_args.port_expose)])
    with GatewayPod(f_args):
        PeaSpawnHelper(p_args).start()
Beispiel #3
0
    def test_remote_pod_process(self):
        f_args = set_gateway_parser().parse_args(['--allow-spawn'])
        p_args = set_pod_parser().parse_args(
            ['--host', 'localhost', '--replicas', '3',
             '--port-grpc', str(f_args.port_grpc), '--runtime', 'process'])

        def start_spawn():
            PodSpawnHelper(p_args).start()

        with GatewayPod(f_args):
            t = Process(target=start_spawn)
            t.daemon = True
            t.start()

            time.sleep(5)
Beispiel #4
0
 def start_gateway():
     with GatewayPod(f_args):
         time.sleep(50)
Beispiel #5
0
        def _test_gateway_pod(runtime):
            args = set_gateway_parser().parse_args(['--runtime', runtime])
            with GatewayPod(args):
                pass

            GatewayPod(args).start().close()
Beispiel #6
0
def test_cont_gateway(args):
    parsed_args = set_gateway_parser().parse_args(args)
    with GatewayPod(parsed_args):
        pass
Beispiel #7
0
def gateway(args):
    """Start a Gateway Pod"""
    from jina.peapods.pod import GatewayPod
    with GatewayPod(args) as fs:
        fs.join()