class_docstr: A class that holds methods to deploy model to a container in local environment
class_docstr_tok: ["A","class","that","holds","methods","to","deploy","model","to","a","container","in","local","environment"]
docstr: Placeholder docstring
docstr_tok: ["Placeholder","docstring"]
code: def create_server(
      self,
      image: str,
      container_timeout_seconds: int,
      secret_key: str,
      predictor: PredictorBase,
      env_vars: Dict[str, str] = None,
      model_path: str = None,
      jumpstart: bool = False,
  ):
      """Placeholder docstring"""
  
      self._pull_image(image=image)
  
      self.destroy_server()
  
      logger.info(
          "Waiting for model server %s to start up...",
          self.model_server,
      )
  
      if self.model_server == ModelServer.TRITON:
          self._start_triton_server(
              docker_client=self.client,
              model_path=model_path if model_path else self.model_path,
              image_uri=image,
              secret_key=secret_key,
              env_vars=env_vars if env_vars else self.env_vars,
          )
          self._ping_container = self._triton_deep_ping
      elif self.model_server == ModelServer.DJL_SERVING:
          self._start_djl_serving(
              client=self.client,
              image=image,
              model_path=model_path if model_path else self.model_path,
              secret_key=secret_key,
              env_vars=env_vars if env_vars else self.env_vars,
          )
          self._ping_container = self._djl_deep_ping
      elif self.model_server == ModelServer.TORCHSERVE:
          self._start_torch_serve(
              client=self.client,
              image=image,
              model_path=model_path if model_path else self.model_path,
              secret_key=secret_key,
              env_vars=env_vars if env_vars else self.env_vars,
          )
          self._ping_container = self._torchserve_deep_ping
      elif self.model_server == ModelServer.TGI:
          self._start_tgi_serving(
              client=self.client,
              image=image,
              model_path=model_path if model_path else self.model_path,
              secret_key=secret_key,
              env_vars=env_vars if env_vars else self.env_vars,
              jumpstart=jumpstart,
          )
          self._ping_container = self._tgi_deep_ping
  
      # allow some time for container to be ready
      time.sleep(10)
  
      log_generator = self.container.logs(follow=True, stream=True)
      time_limit = datetime.now() + timedelta(
          seconds=container_timeout_seconds
      )
      healthy = False
      while True:
          now = datetime.now()
          final_pull = now > time_limit
          pull_logs(
              (x.decode("UTF-8").rstrip() for x in log_generator),
              log_generator.close,
              datetime.now()
              + timedelta(seconds=_PING_HEALTH_CHECK_INTERVAL_SEC),
              now > time_limit,
          )
  
          if final_pull:
              break
  
          # allow some time for container to be ready
          time.sleep(10)
  
          healthy, response = self._ping_container(predictor)
          if healthy:
              logger.debug(
                  "Ping health check has passed. Returned %s",
                  str(response),
              )
              break
  
      if not healthy:
          raise LocalDeepPingException(_PING_HEALTH_CHECK_FAIL_MSG)
  
imports: from __future__ import absolute_import
  from pathlib import Path
  import logging
  from datetime import datetime, timedelta
  from typing import Dict, Type
  import base64
  import time
  import subprocess
  import docker
  from sagemaker.base_predictor import PredictorBase
  from sagemaker.serve.spec.inference_spec import InferenceSpec
  from sagemaker.serve.builder.schema_builder import SchemaBuilder
  from sagemaker.serve.utils.logging_agent import pull_logs
  from sagemaker.serve.utils.types import ModelServer
  from sagemaker.serve.utils.exceptions import LocalDeepPingException
  from sagemaker.serve.model_server.torchserve.server import LocalTorchServe
  from sagemaker.serve.model_server.djl_serving.server import LocalDJLServing
  from sagemaker.serve.model_server.triton.server import LocalTritonServer
  from sagemaker.serve.model_server.tgi.server import LocalTgiServing
  from sagemaker.session import Session
label_desc: Use image node_id 4 for calling the LocalContainerMode obj's underlying member method code with example usage: obj.create_server(image, container_timeout_seconds, secret_key, predictor, env_vars, model_path, jumpstart) without return types