code: def test_get_serve_instance_details(
      ray_start_stop, f_deployment_options, url
  ):
      grpc_port = 9001
      grpc_servicer_functions = [
          "ray.serve.generated.serve_pb2_grpc.add_UserDefinedServiceServicer_to_server",
          "ray.serve.generated.serve_pb2_grpc.add_FruitServiceServicer_to_server",
      ]
      world_import_path = (
          "ray.serve.tests.test_config_files.world.DagNode"
      )
      fastapi_import_path = (
          "ray.serve.tests.test_config_files.fastapi_deployment.node"
      )
      config = {
          "proxy_location": "HeadOnly",
          "http_options": {
              "host": "127.0.0.1",
              "port": 8005,
          },
          "grpc_options": {
              "port": grpc_port,
              "grpc_servicer_functions": grpc_servicer_functions,
          },
          "applications": [
              {
                  "name": "app1",
                  "route_prefix": "/apple",
                  "import_path": world_import_path,
                  "deployments": [f_deployment_options],
              },
              {
                  "name": "app2",
                  "route_prefix": "/banana",
                  "import_path": fastapi_import_path,
              },
          ],
      }
      expected_values = {
          "app1": {
              "route_prefix": "/apple",
              "docs_path": None,
              "deployments": {"f", "BasicDriver"},
          },
          "app2": {
              "route_prefix": "/banana",
              "docs_path": "/my_docs",
              "deployments": {"FastAPIDeployment"},
          },
      }
  
      deploy_config_multi_app(config, url)
  
      def applications_running():
          response = requests.get(url, timeout=15)
          assert response.status_code == 200
  
          serve_details = ServeInstanceDetails(**response.json())
          return (
              serve_details.applications["app1"].status
              == ApplicationStatus.RUNNING
              and serve_details.applications["app2"].status
              == ApplicationStatus.RUNNING
          )
  
      wait_for_condition(applications_running, timeout=15)
      print("All applications are in a RUNNING state.")
  
      serve_details = ServeInstanceDetails(**requests.get(url).json())
      # CHECK: proxy location, HTTP host, and HTTP port
      assert serve_details.proxy_location == "HeadOnly"
      assert serve_details.http_options.host == "127.0.0.1"
      assert serve_details.http_options.port == 8005
  
      # CHECK: gRPC port and grpc_servicer_functions
      assert serve_details.grpc_options.port == grpc_port
      assert (
          serve_details.grpc_options.grpc_servicer_functions
          == grpc_servicer_functions
      )
      print(
          "Confirmed fetched proxy location, HTTP host, HTTP port, gRPC port, and grpc_"
          "servicer_functions metadata correct."
      )
  
      # Check HTTP Proxy statuses
      for proxy in serve_details.proxies.values():
          assert proxy.status == ProxyStatus.HEALTHY
          assert os.path.exists(
              "/tmp/ray/session_latest/logs" + proxy.log_file_path
          )
      print("Checked HTTP Proxy details.")
      # Check controller info
      assert serve_details.controller_info.actor_id
      assert serve_details.controller_info.actor_name
      assert serve_details.controller_info.node_id
      assert serve_details.controller_info.node_ip
      assert os.path.exists(
          "/tmp/ray/session_latest/logs"
          + serve_details.controller_info.log_file_path
      )
  
      app_details = serve_details.applications
      # CHECK: application details
      for i, app in enumerate(["app1", "app2"]):
          assert (
              app_details[app].deployed_app_config.dict(
                  exclude_unset=True
              )
              == config["applications"][i]
          )
          assert app_details[app].last_deployed_time_s > 0
          assert (
              app_details[app].route_prefix
              == expected_values[app]["route_prefix"]
          )
          assert (
              app_details[app].docs_path
              == expected_values[app]["docs_path"]
          )
  
          # CHECK: all deployments are present
          assert (
              app_details[app].deployments.keys()
              == expected_values[app]["deployments"]
          )
  
          for deployment in app_details[app].deployments.values():
              assert deployment.status == DeploymentStatus.HEALTHY
              assert (
                  deployment.status_trigger
                  == DeploymentStatusTrigger.CONFIG_UPDATE_COMPLETED
              )
              # Route prefix should be app level options eventually
              assert (
                  "route_prefix"
                  not in deployment.deployment_config.dict(
                      exclude_unset=True
                  )
              )
              if isinstance(
                  deployment.deployment_config.num_replicas, int
              ):
                  assert (
                      len(deployment.replicas)
                      == deployment.deployment_config.num_replicas
                  )
  
              for replica in deployment.replicas:
                  assert replica.state == ReplicaState.RUNNING
                  assert (
                      deployment.name in replica.replica_id
                      and deployment.name in replica.actor_name
                  )
                  assert (
                      replica.actor_id
                      and replica.node_id
                      and replica.node_ip
                  )
                  assert (
                      replica.start_time_s
                      > app_details[app].last_deployed_time_s
                  )
                  file_path = (
                      "/tmp/ray/session_latest/logs"
                      + replica.log_file_path
                  )
                  assert os.path.exists(file_path)
  
      print("Finished checking application details.")
  
imports: import copy
  import grpc
  import re
  import os
  import sys
  from typing import Dict
  import pytest
  import requests
  import ray
  from ray import serve
  from ray._private.test_utils import wait_for_condition
  import ray._private.ray_constants
  from ray.util.state import list_actors
  from ray.serve._private.constants import SERVE_NAMESPACE
  from ray.serve.tests.conftest import *
  from ray.tests.conftest import *
  from ray._private.test_utils import generate_system_config_map
  from ray.serve.schema import ServeInstanceDetails, HTTPOptionsSchema
  from ray.serve._private.common import ApplicationStatus, DeploymentStatus, DeploymentStatusTrigger, ReplicaState, ProxyStatus
  from ray.serve.generated import serve_pb2, serve_pb2_grpc
label_desc: Use image node_id 8 for calling a global function with example usage: test_get_serve_instance_details(ray_start_stop, f_deployment_options, url) and returns: unknown