Skip to content

Commit

Permalink
move helper functions to hardware utils
Browse files Browse the repository at this point in the history
  • Loading branch information
carolineechen committed Aug 23, 2024
1 parent 43f769e commit 8caee7e
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions runhouse/resources/hardware/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,26 @@ def _run_ssh_command(
runner = SkySSHRunner(
ip=address,
ssh_user=ssh_user,
port=ssh_port,
ssh_private_key=ssh_private_key,
ssh_mode=SshMode.INTERACTIVE,
ssh_port=ssh_port,
docker_user=docker_user,
)
ssh_command = runner._ssh_base_command(
ssh_mode=SshMode.INTERACTIVE, port_forward=None
)
subprocess.run(ssh_command)


def _docker_ssh_proxy_command(
address: str,
ssh_user: str,
ssh_private_key: str,
):
return lambda ssh: " ".join(
ssh
+ ssh_options_list(ssh_private_key, None)
+ ["-W", "%h:%p", f"{ssh_user}@{address}"]
)


# Adapted from SkyPilot Command Runner
def _ssh_base_command(
address: str,
Expand Down

0 comments on commit 8caee7e

Please sign in to comment.