class_docstr: A model server runner that runs in a local docker runtime.
  
  You need to pre-install docker in the machine that is running InfraValidator
  component. For that reason, it is recommended to use this runner only for
  testing purpose.
class_docstr_tok: ["A","model","server","runner","that","runs","in","a","local","docker","runtime",".","You","need","to","pre-install","docker","in","the","machine","that","is","running","InfraValidator","component",".","For","that","reason",",","it","is","recommended","to","use","this","runner","only","for","testing","purpose","."]
code: def WaitUntilRunning(self, deadline):
      assert (
          self._container is not None
      ), "container has not been started."
  
      while time.time() < deadline:
          try:
              # Reload container attributes from server. This is the only right way to
              # retrieve the latest container status from docker engine.
              self._container.reload()
              status = self._container.status
          except docker_errors.NotFound as e:
              # If the job has been aborted and container has specified auto_removal
              # to True, we might get a NotFound error during container.reload().
              raise error_types.JobAborted(
                  "Container not found. Possibly removed after the job has been "
                  "aborted."
              ) from e
          # The container is just created and not yet in the running status.
          if status == "created":
              time.sleep(_POLLING_INTERVAL_SEC)
              continue
          # The container is running :)
          if status == "running":
              host_port = _find_host_port(
                  self._container.ports,
                  self._serving_binary.container_port,
              )
              host_ip_address = (
                  self._serving_spec.local_docker.host_ip_address
                  if self._serving_spec.local_docker.host_ip_address
                  else "localhost"
              )
              self._endpoint = f"{host_ip_address}:{host_port}"
              return
          # Docker status is one of {'created', 'restarting', 'running', 'removing',
          # 'paused', 'exited', or 'dead'}. Status other than 'created' and
          # 'running' indicates the job has been aborted.
          raise error_types.JobAborted(
              "Job has been aborted (container status={})".format(
                  status
              )
          )
  
      raise error_types.DeadlineExceeded(
          "Deadline exceeded while waiting for the container to be running."
      )
  
imports: import os
  import time
  from typing import Any, Dict, Optional
  from absl import logging
  import docker
  from docker import errors
  from tfx.components.infra_validator import error_types
  from tfx.components.infra_validator import serving_bins
  from tfx.components.infra_validator.model_server_runners import base_runner
  from tfx.proto import infra_validator_pb2
label_desc: Use image node_id 5 for calling the LocalDockerRunner obj's underlying member method code with example usage: obj.WaitUntilRunning(deadline) without return types