code: def test_valid_kubernetes_job_spec():  # pylint: disable=unused-argument
      """
      Tests job specification for Kubernetes.
      """
      custom_template = yaml.safe_load(
          "apiVersion: batch/v1\n"
          "kind: Job\n"
          "metadata:\n"
          "  name: pi-with-ttl\n"
          "spec:\n"
          "  ttlSecondsAfterFinished: 100\n"
          "  template:\n"
          "    spec:\n"
          "      containers:\n"
          "      - name: pi\n"
          "        image: perl\n"
          "        command: ['perl',  '-Mbignum=bpi', '-wle']\n"
          "        env: \n"
          "        - name: DUMMY\n"
          '          value: "test_var"\n'
          "      restartPolicy: Never\n"
      )
      project_name = "mlflow-docker-example"
      image_tag = "image_tag"
      image_digest = "5e74a5a"
      command = [
          "mlflow",
          "run",
          ".",
          "--env-manager",
          "local",
          "-P",
          "alpha=0.5",
      ]
      env_vars = {"RUN_ID": "1"}
      job_definition = kb._get_kubernetes_job_definition(
          project_name=project_name,
          image_tag=image_tag,
          image_digest=image_digest,
          command=command,
          env_vars=env_vars,
          job_template=custom_template,
      )
      container_spec = job_definition["spec"]["template"]["spec"][
          "containers"
      ][0]
      assert container_spec["name"] == project_name
      assert container_spec["image"] == image_tag + "@" + image_digest
      assert container_spec["command"] == command
      assert len(container_spec["env"]) == 2
      assert container_spec["env"][0]["name"] == "DUMMY"
      assert container_spec["env"][0]["value"] == "test_var"
      assert container_spec["env"][1]["name"] == "RUN_ID"
      assert container_spec["env"][1]["value"] == "1"
  
file_path: mlflow/tests/projects/test_kubernetes.py
imports: from unittest import mock
  import kubernetes
  import pytest
  import yaml
  from kubernetes.config.config_exception import ConfigException
  from mlflow.entities import RunStatus
  from mlflow.exceptions import ExecutionException
  from mlflow.projects import kubernetes
label_desc: Use image node_id 2 for calling a global function with example usage: test_valid_kubernetes_job_spec() without return types