class_docstr: Placeholder docstring
docstr: Tar triton artifacts and upload to s3
docstr_tok: ["Tar","triton","artifacts","and","upload","to","s3"]
code: def _upload_triton_artifacts(
      self,
      model_path: str,
      sagemaker_session: Session,
      secret_key: str,
      s3_model_data_url: str = None,
      image: str = None,
  ):
      """Tar triton artifacts and upload to s3"""
      if s3_model_data_url:
          bucket, key_prefix = parse_s3_url(url=s3_model_data_url)
      else:
          bucket, key_prefix = None, None
  
      code_key_prefix = fw_utils.model_code_key_prefix(
          key_prefix, None, image
      )
  
      bucket, code_key_prefix = determine_bucket_and_prefix(
          bucket=bucket,
          key_prefix=code_key_prefix,
          sagemaker_session=sagemaker_session,
      )
  
      logger.debug(
          "Uploading the model resources to bucket=%s, key_prefix=%s.",
          bucket,
          code_key_prefix,
      )
      model_repository = model_path + "/model_repository"
      s3_upload_path = upload(
          sagemaker_session, model_repository, bucket, code_key_prefix
      )
      logger.debug("Model resources uploaded to: %s", s3_upload_path)
  
      env_vars = {
          "SAGEMAKER_TRITON_DEFAULT_MODEL_NAME": "model",
          "TRITON_MODEL_DIR": "/opt/ml/model/model",
          "SAGEMAKER_SERVE_SECRET_KEY": secret_key,
          "LOCAL_PYTHON": platform.python_version(),
      }
      return s3_upload_path, env_vars
  
imports: from __future__ import absolute_import
  import uuid
  import logging
  import importlib
  import platform
  from sagemaker import fw_utils
  from sagemaker import Session
  from sagemaker.base_predictor import PredictorBase
  from sagemaker.serve.utils.uploader import upload
  from sagemaker.serve.utils.exceptions import LocalModelInvocationException
  from sagemaker.s3_utils import determine_bucket_and_prefix, parse_s3_url
  from sagemaker.local.utils import get_docker_host
  import docker
  from docker.types import DeviceRequest
label_desc: Use image node_id 2 for calling the SageMakerTritonServer obj's underlying member method code with example usage: obj._upload_triton_artifacts(model_path, sagemaker_session, secret_key, s3_model_data_url, image) and returns: s3_upload_path,  env_vars