Example #1
0
    def serve(
        port,
        bento,
        enable_microbatch,
        mb_max_batch_size,
        mb_max_latency,
        run_with_ngrok,
        yatai_url,
        enable_swagger,
        config,
    ):
        saved_bundle_path = resolve_bundle_path(
            bento, pip_installed_bundle_path, yatai_url
        )

        container = BentoMLContainer()
        config = BentoMLConfiguration(override_config_file=config)
        config.override(["api_server", "port"], port)
        config.override(["api_server", "enable_microbatch"], enable_microbatch)
        config.override(["api_server", "run_with_ngrok"], run_with_ngrok)
        config.override(["api_server", "enable_swagger"], enable_swagger)
        config.override(["marshal_server", "max_batch_size"], mb_max_batch_size)
        config.override(["marshal_server", "max_latency"], mb_max_latency)
        container.config.from_dict(config.as_dict())

        from bentoml import marshal, server

        container.wire(packages=[marshal, server])

        start_dev_server(saved_bundle_path)
Example #2
0
    def serve(
        port,
        bento,
        enable_microbatch,
        mb_max_batch_size,
        mb_max_latency,
        run_with_ngrok,
        yatai_url,
        enable_swagger,
        config,
    ):
        saved_bundle_path = resolve_bundle_path(bento,
                                                pip_installed_bundle_path,
                                                yatai_url)

        start_dev_server(
            saved_bundle_path,
            port=port,
            enable_microbatch=enable_microbatch,
            mb_max_batch_size=mb_max_batch_size,
            mb_max_latency=mb_max_latency,
            run_with_ngrok=run_with_ngrok,
            enable_swagger=enable_swagger,
            config_file=config,
        )
Example #3
0
    def serve(
        port,
        bento,
        enable_microbatch,
        mb_max_batch_size,
        mb_max_latency,
        run_with_ngrok,
        yatai_url,
        enable_swagger,
    ):

        if enable_microbatch is not None:
            logger.warning(
                "Option --enable-microbatch/--disable-microbatch has been "
                "deprecated in the current release. The micro-batching option "
                "has become the default. Consider using --mb-max-batching=1 "
                "to simulate the effect of --disable-microbatch")

        saved_bundle_path = resolve_bundle_path(bento,
                                                pip_installed_bundle_path,
                                                yatai_url)

        start_dev_server(
            saved_bundle_path,
            port=port,
            mb_max_batch_size=mb_max_batch_size,
            mb_max_latency=mb_max_latency,
            run_with_ngrok=run_with_ngrok,
            enable_swagger=enable_swagger,
        )
Example #4
0
 def serve(port,
           bento=None,
           enable_microbatch=False,
           run_with_ngrok=False,
           yatai_url=None):
     saved_bundle_path = resolve_bundle_path(bento,
                                             pip_installed_bundle_path,
                                             yatai_url)
     start_dev_server(saved_bundle_path, port, enable_microbatch,
                      run_with_ngrok)
Example #5
0
 def serve(
     port,
     bento=None,
     enable_microbatch=False,
     mb_max_batch_size=None,
     mb_max_latency=None,
     run_with_ngrok=False,
     yatai_url=None,
     enable_swagger=True,
 ):
     saved_bundle_path = resolve_bundle_path(bento,
                                             pip_installed_bundle_path,
                                             yatai_url)
     start_dev_server(
         saved_bundle_path,
         port,
         enable_microbatch,
         mb_max_batch_size,
         mb_max_latency,
         run_with_ngrok,
         enable_swagger,
     )
Example #6
0
 def serve(port, bento=None, enable_microbatch=False):
     saved_bundle_path = resolve_bundle_path(bento,
                                             pip_installed_bundle_path)
     start_dev_server(saved_bundle_path, port, enable_microbatch)