code: def run(attach, image, gpu, cpu, memory, volume, args):
      """Run a command on a kubernetes cluster with fiber."""
      platform = CONFIG["platform"]
      print(
          'Running "{}" on Kubernetes cluster ({}) '.format(
              " ".join(args), platform
          )
      )
  
      if image:
          full_image_name = image
      else:
          if platform == "gcp":
              builder = GCPImageBuilder()
          elif platform == "aws":
              registry = CONFIG["docker_registry"]
              if not registry:
                  registry = input(
                      "What docker registry do you plan to use? "
                      "AWS registry format: "
                      '"[aws_account_id].dkr.ecr.[region].amazonaws.com"\n> '
                  )
              builder = AWSImageBuilder(registry)
          else:
              raise ValueError('Unknow platform "{}"'.format(platform))
  
          full_image_name = builder.build()
  
      # run this to refresh access tokens
      exitcode = os.system("kubectl get po > /dev/null")
  
      job_name = os.path.basename(os.getcwd())
  
      k8s_backend = get_backend(platform)
  
      job_spec = core.JobSpec(
          image=full_image_name,
          name=job_name,
          command=args,
      )
      if gpu:
          job_spec.gpu = gpu
  
      if cpu:
          job_spec.cpu = cpu
  
      if memory:
          job_spec.mem = memory
  
      if volume:
          volumes = {volume: {"mode": "rw", "bind": "/persistent"}}
          job_spec.volumes = volumes
  
      job = k8s_backend.create_job(job_spec)
      pod_name = job.data.metadata.name
      exitcode = 0
  
      print("Created pod: {}".format(pod_name))
  
      if attach:
          # wait until job is running
          """
          os.system(
              "kubectl wait --for=condition=Ready pod/{}".format(pod_name)
          )
          """
  
          exitcode = os.system("kubectl logs -f {}".format(pod_name))
  
      if exitcode != 0:
          return exitcode
  
      return 0
  
imports: import os
  import json
  import subprocess
  from pathlib import Path
  import click
  import fiber
  import fiber.core
  from fiber.core import ProcessStatus
label_desc: Use image node_id 9 for calling a global function with example usage: run(attach, image, gpu, cpu, memory, volume, args) and returns: int, exitcode