class_docstr: TensorFlow Serving binary.
class_docstr_tok: ["TensorFlow","Serving","binary","."]
docstr: Make parameters for docker `client.containers.run`.
  
  Args:
    model_path: A path to the model.
    needs_mount: If True, model_path will be mounted to the container.
  
  Returns:
    A dictionary of docker run parameters.
docstr_tok: ["Make","parameters","for","docker","`","client.containers.run","`",".","Args",":","model_path",":","A","path","to","the","model",".","needs_mount",":","If","True",",","model_path","will","be","mounted","to","the","container",".","Returns",":","A","dictionary","of","docker","run","parameters","."]
code: def MakeDockerRunParams(
      self, model_path: str, needs_mount: bool
  ) -> Dict[str, Any]:
      """Make parameters for docker `client.containers.run`.
  
      Args:
        model_path: A path to the model.
        needs_mount: If True, model_path will be mounted to the container.
  
      Returns:
        A dictionary of docker run parameters.
      """
      result = dict(self._BASE_DOCKER_RUN_PARAMS, image=self._image)
  
      if needs_mount:
          # model_path should be a local directory. In order to make TF Serving see
          # the host model path, we need to mount model path volume to the
          # container.
          assert os.path.isdir(model_path), "{} does not exist".format(
              model_path
          )
          container_model_path = tf_serving_flavor.make_model_path(
              model_base_path=self._DEFAULT_MODEL_BASE_PATH,
              model_name=self._model_name,
              version=1,
          )
          result.update(
              environment=self.MakeEnvVars(),
              mounts=[
                  docker_types.Mount(
                      type="bind",
                      target=container_model_path,
                      source=model_path,
                      read_only=True,
                  )
              ],
          )
      else:
          # model_path is presumably a remote URI. TF Serving is able to pickup
          # model in remote directly using gfile, so all we need to do is setting
          # environment variables correctly.
          result.update(
              environment=self.MakeEnvVars(model_path=model_path)
          )
  
      return result
  
imports: import abc
  import os
  from typing import Any, Dict, List, Optional
  from docker import types
  from tfx.components.infra_validator.model_server_clients import base_client
  from tfx.components.infra_validator.model_server_clients import tensorflow_serving_client
  from tfx.proto import infra_validator_pb2
  from tfx.utils.model_paths import tf_serving_flavor
label_desc: Use image node_id 5 for calling the TensorFlowServing obj's underlying member method code with example usage: obj.MakeDockerRunParams(model_path, needs_mount) and returns: result