python/ray/serve/api.py
def build(target: Union[ClassNode, FunctionNode]) -> Application:
    """Builds a Serve application into a static application.

    Takes in a ClassNode or FunctionNode and converts it to a
    Serve application consisting of one or more deployments. This is intended
    to be used for production scenarios and deployed via the Serve REST API or
    CLI, so there are some restrictions placed on the deployments:
        1) All of the deployments must be importable. That is, they cannot be
           defined in __main__ or inline defined. The deployments will be
           imported in production using the same import path they were here.
        2) All arguments bound to the deployment must be JSON-serializable.

    The returned Application object can be exported to a dictionary or YAML
    config.
    """
    # TODO (jiaodong): Resolve circular reference in pipeline codebase and serve
    from ray.serve.pipeline.api import build as pipeline_build

    if in_interactive_shell():
        raise RuntimeError(
            "build cannot be called from an interactive shell like "
            "IPython or Jupyter because it requires all deployments to be "
            "importable to run the app after building."
        )

    # TODO(edoakes): this should accept host and port, but we don't
    # currently support them in the REST API.
    return Application(pipeline_build(target))
Builds a Serve application into a static application.

    Takes in a ClassNode or FunctionNode and converts it to a
    Serve application consisting of one or more deployments. This is intended
    to be used for production scenarios and deployed via the Serve REST API or
    CLI, so there are some restrictions placed on the deployments:
        1) All of the deployments must be importable. That is, they cannot be
           defined in __main__ or inline defined. The deployments will be
           imported in production using the same import path they were here.
        2) All arguments bound to the deployment must be JSON-serializable.

    The returned Application object can be exported to a dictionary or YAML
    config.
    
Builds a Serve application into a static application.
Takes in a ClassNode or FunctionNode and converts it to a
Serve application consisting of one or more deployments. This is intended
to be used for production scenarios and deployed via the Serve REST API or
CLI, so there are some restrictions placed on the deployments:
1) All of the deployments must be importable. That is, they cannot be
defined in __main__ or inline defined. The deployments will be
imported in production using the same import path they were here.
2) All arguments bound to the deployment must be JSON-serializable.

The returned Application object can be exported to a dictionary or YAML
config.
Builds a Serve application into a static application . Takes in a ClassNode or FunctionNode and converts it to a Serve application consisting of one or more deployments . This is intended to be used for production scenarios and deployed via the Serve REST API or CLI so there are some restrictions placed on the deployments : 1 ) All of the deployments must be importable . That is they cannot be defined in __main__ or inline defined . The deployments will be imported in production using the same import path they were here . 2 ) All arguments bound to the deployment must be JSON - serializable . The returned Application object can be exported to a dictionary or YAML config .
def build(target: Union[ClassNode, FunctionNode]) -> Application:
    from ray.serve.pipeline.api import build as pipeline_build
    if in_interactive_shell():
        raise RuntimeError(
            "build cannot be called from an interactive shell like "
            "IPython or Jupyter because it requires all deployments to be "
            "importable to run the app after building."
        )
    return Application(pipeline_build(target))
def build ( target : Union [ ClassNode , FunctionNode ] ) -> Application : from ray . serve . pipeline . api import build as pipeline_build if in_interactive_shell ( ) : raise RuntimeError ( "build cannot be called from an interactive shell like " "IPython or Jupyter because it requires all deployments to be " "importable to run the app after building." ) return Application ( pipeline_build ( target ) )
Builds a Serve application into a static application.
Builds a Serve application into a static application .
"""Builds a Serve application into a static application.

    Takes in a ClassNode or FunctionNode and converts it to a
    Serve application consisting of one or more deployments. This is intended
    to be used for production scenarios and deployed via the Serve REST API or
    CLI, so there are some restrictions placed on the deployments:
        1) All of the deployments must be importable. That is, they cannot be
           defined in __main__ or inline defined. The deployments will be
           imported in production using the same import path they were here.
        2) All arguments bound to the deployment must be JSON-serializable.

    The returned Application object can be exported to a dictionary or YAML
    config.
    """ # TODO (jiaodong): Resolve circular reference in pipeline codebase and serve # TODO(edoakes): this should accept host and port, but we don't # currently support them in the REST API.
target
Union[ClassNode, FunctionNode]