python/ray/serve/pipeline/generate.py
def process_ingress_deployment_in_serve_dag(
    deployments: List[Deployment],
) -> List[Deployment]:
    """Mark the last fetched deployment in a serve dag as exposed with default
    prefix.
    """
    if len(deployments) == 0:
        return deployments

    # Last element of the list is the root deployment if it's applicable type
    # that wraps an deployment, given Ray DAG traversal is done bottom-up.
    ingress_deployment = deployments[-1]
    if ingress_deployment.route_prefix in [None, f"/{ingress_deployment.name}"]:
        # Override default prefix to "/" on the ingress deployment, if user
        # didn't provide anything in particular.
        new_ingress_deployment = ingress_deployment.options(route_prefix="/")
        deployments[-1] = new_ingress_deployment

    # Erase all non ingress deployment route prefix
    for i, deployment in enumerate(deployments[:-1]):
        if (
            deployment.route_prefix is not None
            and deployment.route_prefix != f"/{deployment.name}"
        ):
            raise ValueError(
                "Route prefix is only configurable on the ingress deployment. "
                "Please do not set non-default route prefix: "
                f"{deployment.route_prefix} on non-ingress deployment of the "
                "serve DAG. "
            )
        else:
            # Earse all default prefix to None for non-ingress deployments to
            # disable HTTP
            deployments[i] = deployment.options(route_prefix=None)

    return deployments
Mark the last fetched deployment in a serve dag as exposed with default
    prefix.
    
Mark the last fetched deployment in a serve dag as exposed with default
prefix.
Mark the last fetched deployment in a serve dag as exposed with default prefix .
def process_ingress_deployment_in_serve_dag(
    deployments: List[Deployment],
) -> List[Deployment]:
    if len(deployments) == 0:
        return deployments
    ingress_deployment = deployments[-1]
    if ingress_deployment.route_prefix in [None, f"/{ingress_deployment.name}"]:
        new_ingress_deployment = ingress_deployment.options(route_prefix="/")
        deployments[-1] = new_ingress_deployment
    for i, deployment in enumerate(deployments[:-1]):
        if (
            deployment.route_prefix is not None
            and deployment.route_prefix != f"/{deployment.name}"
        ):
            raise ValueError(
                "Route prefix is only configurable on the ingress deployment. "
                "Please do not set non-default route prefix: "
                f"{deployment.route_prefix} on non-ingress deployment of the "
                "serve DAG. "
            )
        else:
            deployments[i] = deployment.options(route_prefix=None)
    return deployments
def process_ingress_deployment_in_serve_dag ( deployments : List [ Deployment ] , ) -> List [ Deployment ] : if len ( deployments ) == 0 : return deployments ingress_deployment = deployments [ - 1 ] if ingress_deployment . route_prefix in [ None , f"/{ingress_deployment.name}" ] : new_ingress_deployment = ingress_deployment . options ( route_prefix = "/" ) deployments [ - 1 ] = new_ingress_deployment for i , deployment in enumerate ( deployments [ : - 1 ] ) : if ( deployment . route_prefix is not None and deployment . route_prefix != f"/{deployment.name}" ) : raise ValueError ( "Route prefix is only configurable on the ingress deployment. " "Please do not set non-default route prefix: " f"{deployment.route_prefix} on non-ingress deployment of the " "serve DAG. " ) else : deployments [ i ] = deployment . options ( route_prefix = None ) return deployments
Mark the last fetched deployment in a serve dag as exposed with default
prefix.
Mark the last fetched deployment in a serve dag as exposed with default prefix .
"""Mark the last fetched deployment in a serve dag as exposed with default
    prefix.
    """ # Last element of the list is the root deployment if it's applicable type # that wraps an deployment, given Ray DAG traversal is done bottom-up. # Override default prefix to "/" on the ingress deployment, if user # didn't provide anything in particular. # Erase all non ingress deployment route prefix # Earse all default prefix to None for non-ingress deployments to # disable HTTP
deployments
List[Deployment]