code: def _submit_job_to_runner(
      runner_client: client.RunnerClient,
      run: Run,
      job_model: JobModel,
      job: Job,
      code: bytes,
      secrets: Dict[str, str],
      repo_credentials: Optional[RemoteRepoCreds],
  ):
      logger.debug(*job_log("submitting job spec", job_model))
      logger.debug(
          *job_log(
              "repo credentials are %s",
              job_model,
              None
              if repo_credentials is None
              else repo_credentials.protocol.value,
          )
      )
      runner_client.submit_job(
          run_spec=run.run_spec,
          job_spec=job.job_spec,
          secrets=secrets,
          repo_credentials=repo_credentials,
      )
      logger.debug(*job_log("uploading code", job_model))
      runner_client.upload_code(code)
      logger.debug(*job_log("starting job", job_model))
      runner_client.run_job()
  
      job_model.status = JobStatus.RUNNING
  
imports: from datetime import timedelta
  from typing import Dict, Optional
  from uuid import UUID
  import requests
  from sqlalchemy import select
  from sqlalchemy.ext.asyncio import AsyncSession
  from sqlalchemy.orm import joinedload
  from dstack._internal.core.errors import GatewayError
  from dstack._internal.core.models.backends.base import BackendType
  from dstack._internal.core.models.configurations import RegistryAuth
  from dstack._internal.core.models.repos import RemoteRepoCreds
  from dstack._internal.core.models.runs import Job, JobErrorCode, JobProvisioningData, JobStatus, Run
  from dstack._internal.server.db import get_session_ctx
  from dstack._internal.server.models import GatewayModel, JobModel, ProjectModel, RepoModel, RunModel
  from dstack._internal.server.services import logs
  from dstack._internal.server.services.gateways.ssh import gateway_tunnel_client
  from dstack._internal.server.services.jobs import RUNNING_PROCESSING_JOBS_IDS, RUNNING_PROCESSING_JOBS_LOCK, delay_job_instance_termination, job_model_to_job_submission
  from dstack._internal.server.services.logging import job_log
  from dstack._internal.server.services.repos import get_code_model, repo_model_to_repo_head
  from dstack._internal.server.services.runner import client
  from dstack._internal.server.services.runner.ssh import runner_ssh_tunnel
  from dstack._internal.server.services.runs import create_job_model_for_new_submission, run_model_to_run
  from dstack._internal.server.services.storage import get_default_storage
  from dstack._internal.server.utils.common import run_async
  from dstack._internal.utils import common
  from dstack._internal.utils.interpolator import VariablesInterpolator
  from dstack._internal.utils.logging import get_logger
label_desc: Use image node_id 5 for calling a global function with example usage: _submit_job_to_runner(runner_client, run, job_model, job, code, secrets, repo_credentials) without return types