code: def trigger_preemption(signum: int, frame: types.FrameType) -> None:
      info = det.get_cluster_info()
      if info and info.container_rank == 0:
          # Chief container, requests preemption, others ignore
          logger.info("SIGTERM: Preemption imminent.")
          # Notify the master that we need to be preempted
          api.post(
              info.master_url,
              f"/api/v1/allocations/{info.allocation_id}/signals/pending_preemption",
          )
  
file_path: determined/harness/determined/exec/launch.py
imports: import json
  import logging
  import os
  import signal
  import subprocess
  import sys
  import types
  import determined
  import determined.common
  from determined.common import api, constants, storage
  from determined.exec import prep_container
label_desc: Use image node_id 1 for calling a global function with example usage: trigger_preemption(signum, frame) without return types