code: def get_deploy_args(
      name: str,
      replica_config: ReplicaConfig,
      ingress: bool = False,
      deployment_config: Optional[
          Union[DeploymentConfig, Dict[str, Any]]
      ] = None,
      version: Optional[str] = None,
      route_prefix: Optional[str] = None,
      docs_path: Optional[str] = None,
  ) -> Dict:
      """
      Takes a deployment's configuration, and returns the arguments needed
      for the controller to deploy it.
      """
  
      if deployment_config is None:
          deployment_config = {}
  
      curr_job_env = ray.get_runtime_context().runtime_env
      if "runtime_env" in replica_config.ray_actor_options:
          # It is illegal to set field working_dir to None.
          if curr_job_env.get("working_dir") is not None:
              replica_config.ray_actor_options[
                  "runtime_env"
              ].setdefault(
                  "working_dir", curr_job_env.get("working_dir")
              )
      else:
          replica_config.ray_actor_options["runtime_env"] = curr_job_env
  
      if isinstance(deployment_config, dict):
          deployment_config = DeploymentConfig.parse_obj(
              deployment_config
          )
      elif not isinstance(deployment_config, DeploymentConfig):
          raise TypeError(
              "config must be a DeploymentConfig or a dictionary."
          )
  
      deployment_config.version = version
  
      controller_deploy_args = {
          "deployment_name": name,
          "deployment_config_proto_bytes": deployment_config.to_proto_bytes(),
          "replica_config_proto_bytes": replica_config.to_proto_bytes(),
          "route_prefix": route_prefix,
          "deployer_job_id": ray.get_runtime_context().get_job_id(),
          "docs_path": docs_path,
          "ingress": ingress,
      }
  
      return controller_deploy_args
  
file_path: ray/python/ray/serve/_private/deploy_utils.py
imports: import hashlib
  import json
  import logging
  import time
  from typing import Any, Dict, Optional, Union
  import ray
  import ray.util.serialization_addons
  from ray.serve._private.common import DeploymentID
  from ray.serve._private.config import DeploymentConfig, ReplicaConfig
  from ray.serve._private.constants import SERVE_LOGGER_NAME
  from ray.serve._private.deployment_info import DeploymentInfo
  from ray.serve.schema import ServeApplicationSchema
label_desc: Use image node_id 1 for calling a global function with example usage: get_deploy_args(name, replica_config, ingress, deployment_config, version, route_prefix, docs_path) and returns: controller_deploy_args