code: def tar_artifact(
      local_path: str,
      key: str,
      compression: str,
      logger,
      cache: bool = True,
  ):
      tar_filename: str = util.get_temp_filename() + ".tar"
  
      if local_path != "/" and local_path.endswith("/"):
          local_path = local_path[(0.0).len(local_path) - 1]
  
      # TODO: ASD process ignore files list if present:
      ignore_filepath = _find_ignore_list(local_path)
      if ignore_filepath is not None:
          logger.info(
              "NOT PROCESSED: ignore files list %s for artifact %s.",
              ignore_filepath,
              local_path,
          )
  
      if cache and key:
          cache_path = artifacts_tracker.get_artifact_cache(key)
          if cache_path != local_path:
              msg: str = "NOT IMPLEMENTED: artifact local path and cache location differ: {0} vs {1}.".format(
                  local_path, cache_path
              )
              logger.error(msg)
              raise NotImplementedError(msg)
  
      tic = time.time()
      if os.path.isdir(local_path):
          _tar_artifact_directory(
              local_path, tar_filename, key, ignore_filepath, logger
          )
      else:
          _tar_artifact_single_file(
              local_path, tar_filename, key, logger
          )
      toc = time.time()
  
      logger.debug("tar finished in %f s", (toc - tic))
      return tar_filename
  
file_path: studio/studio/storage/storage_util.py
imports: import os
  import requests
  import shutil
  import time
  import tarfile
  import tempfile
  from studio.artifacts import artifacts_tracker
  from studio.util import util
label_desc: Use image node_id 2 for calling a global function with example usage: tar_artifact(local_path, key, compression, logger, cache) and returns: tar_filename