Esempio n. 1
0
def host(clean_context, test_svc_bundle, enable_microbatch, with_docker):
    if with_docker:
        image = clean_context.enter_context(
            build_api_server_docker_image(test_svc_bundle, "example_service"))
        with run_api_server_docker_container(image, enable_microbatch) as host:
            yield host
    else:
        with run_api_server(test_svc_bundle, enable_microbatch) as host:
            yield host
Esempio n. 2
0
def host(pytestconfig, clean_context, enable_microbatch):
    test_svc_bundle = pytestconfig.getoption("bento_dist") or os.path.join(
        sys.argv[1], "build", "dist")

    if pytestconfig.getoption("docker"):
        image = clean_context.enter_context(
            build_api_server_docker_image(test_svc_bundle, "example_service"))
        with run_api_server_docker_container(image, enable_microbatch) as host:
            yield host
    else:
        with run_api_server(test_svc_bundle, enable_microbatch) as host:
            yield host
Esempio n. 3
0
def host(pytestconfig, clean_context):
    """
    Launch host from a
    """
    test_svc_bundle = pytestconfig.getoption("bento_dist") or os.path.join(
        sys.argv[2], "build", "dist")

    config_file = pytestconfig.getoption("config_file") or os.path.join(
        sys.argv[2], "bentoml_config.yml")
    if not os.path.exists(config_file):
        if pytestconfig.getoption("config_file"):
            raise Exception(f"config file not found: {config_file}")
        else:
            config_file = None

    if pytestconfig.getoption("docker"):
        image = clean_context.enter_context(
            build_api_server_docker_image(test_svc_bundle, "example_service"))
        with run_api_server_docker_container(
                image,
                config_file=config_file,
        ) as host:
            yield host
    elif pytestconfig.getoption("dev_server"):
        with run_api_server(
                test_svc_bundle,
                config_file=config_file,
                dev_server=True,
        ) as host:
            yield host
    else:
        with run_api_server(
                test_svc_bundle,
                config_file=config_file,
        ) as host:
            yield host
def h2o_docker_host(h2o_image):
    with run_api_server_docker_container(h2o_image, timeout=500) as host:
        yield host
def host(image, enable_microbatch):
    with run_api_server_docker_container(
        image, enable_microbatch=enable_microbatch, timeout=500
    ) as host:
        yield host
def xgboost_docker_host(xgboost_image):
    with run_api_server_docker_container(xgboost_image, timeout=60) as host:
        yield host
Esempio n. 7
0
def xgboost_docker_host(xgboost_image):
    with run_api_server_docker_container(xgboost_image,
                                         enable_microbatch=False,
                                         timeout=60) as host:
        yield host
Esempio n. 8
0
def transformers_host(transformers_image):
    with run_api_server_docker_container(transformers_image,
                                         timeout=500) as host:
        yield host