class_docstr: RunnerTunnel cancel forwarding without closing the connection on close()
class_docstr_tok: ["RunnerTunnel","cancel","forwarding","without","closing","the","connection","on","close","(",")"]
code: def __init__(
      self,
      hostname: str,
      ssh_port: int,
      user: str,
      ports: Dict[int, int],
      id_rsa: str,
      *,
      control_sock_path: Optional[PathLike] = None,
      disconnect_delay: int = 5,
  ):
      self.temp_dir = tempfile.TemporaryDirectory()
      id_rsa_path = os.path.join(self.temp_dir.name, "id_rsa")
      with open(
          id_rsa_path,
          opener=lambda path, flags: os.open(path, flags, 0o600),
          mode="w",
      ) as f:
          f.write(id_rsa)
      if control_sock_path is None:
          control_sock_path = os.path.join(
              self.temp_dir.name, "control.sock"
          )
      super().__init__(
          host=f"{user}@{hostname}",
          id_rsa_path=id_rsa_path,
          ports=ports,
          control_sock_path=control_sock_path,
          options={
              "StrictHostKeyChecking": "no",
              "UserKnownHostsFile": "/dev/null",
              "ExitOnForwardFailure": "yes",
              "ConnectTimeout": "1",
              # "ControlPersist": f"{disconnect_delay}s",
              "Port": ssh_port,
          },
      )
  
file_path: dstack/src/dstack/_internal/core/services/ssh/tunnel.py
imports: import os
  import subprocess
  import tempfile
  from typing import Dict, Optional
  from dstack._internal.core.services.ssh import get_ssh_error
  from dstack._internal.utils.logging import get_logger
  from dstack._internal.utils.path import PathLike
label_desc: Use image node_id 1 to create a new RunnerTunnel object from inherited base classes: SSHTunnel with example: obj = RunnerTunnel(hostname, ssh_port, user, ports, id_rsa)