code: def _update_gateway(gateway_compute: GatewayComputeModel, build: str):
      logger.debug("Updating gateway %s", gateway_compute.ip_address)
      stdout = ssh_execute_command(
          host=f"ubuntu@{gateway_compute.ip_address}",
          id_rsa=gateway_compute.ssh_private_key,
          command=f"/bin/sh dstack/update.sh {get_dstack_gateway_wheel(build)} {build}",
          options=["-o", "ConnectTimeout=5"],
      )
      if "Update successfully completed" in stdout:
          logger.info("Gateway %s updated", gateway_compute.ip_address)
  
imports: import asyncio
  import os
  from datetime import timezone
  from typing import List, Optional, Sequence
  import requests
  from sqlalchemy import delete, select, update
  from sqlalchemy.ext.asyncio import AsyncSession
  import dstack._internal.utils.random_names
  from dstack._internal.core.backends.base.compute import get_dstack_gateway_wheel, get_dstack_runner_version
  from dstack._internal.core.errors import GatewayError, ResourceNotExistsError, ServerClientError
  from dstack._internal.core.models.backends.base import BackendType
  from dstack._internal.core.models.gateways import Gateway
  from dstack._internal.core.models.runs import Job
  from dstack._internal.core.services.ssh.exec import ssh_execute_command
  from dstack._internal.server import settings
  from dstack._internal.server.models import GatewayComputeModel, GatewayModel, ProjectModel
  from dstack._internal.server.services.backends import get_project_backend_by_type_or_error, get_project_backends_with_models
  from dstack._internal.server.services.gateways.ssh import gateway_tunnel_client
  from dstack._internal.server.utils.common import run_async
  from dstack._internal.utils.crypto import generate_rsa_key_pair_bytes
  from dstack._internal.utils.logging import get_logger
label_desc: Use image node_id 2 for calling a global function with example usage: _update_gateway(gateway_compute, build) without return types