SSH Utils
capture_tmux_pane(ssh, tmux_session_name='vllm_server', verbose=True)
Capture the content of the specified tmux pane.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ssh |
SSHClient
|
The SSH client for the connection. |
required |
tmux_session_name |
str
|
The name of the tmux session. Defaults to "vllm_server". |
'vllm_server'
|
verbose |
bool
|
If True, display verbose output. Defaults to True. |
True
|
Returns:
Name | Type | Description |
---|---|---|
tuple |
A tuple containing stdin, stdout, and stderr from the SSH command execution. |
Source code in app/utils/ssh_utils.py
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
|
execute_ssh_command(ssh, cmd, verbose=True)
Runs the given command in paramiko ssh client
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ssh |
SSHClient
|
The SSH client for the connection. |
required |
cmd |
str
|
Command that can run in tmux session terminal. |
required |
Source code in app/utils/ssh_utils.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
|
get_ssh_session(ip_address, timeout=15, key_path='app/keys/connection-key.pem')
Get paramiko SSHClient
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ip_address |
str
|
ip address |
required |
timeout |
int
|
Defaults to 15. |
15
|
key_path |
str)
|
Path to the pem file required to connect to ec2 instance. |
'app/keys/connection-key.pem'
|
Source code in app/utils/ssh_utils.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
is_running_vllm_server(ssh, tmux_session_name='vllm_server', verbose=True)
Check if vllm server has started successfully.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ssh |
SSHClient
|
(paramiko.SSHClient): The SSH client for the connection. |
required |
tmux_session_name |
str
|
Defaults to "vllm_server". |
'vllm_server'
|
Source code in app/utils/ssh_utils.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
|
start_vllm_server(ssh, model_id, ip_address, port=8000, conda_env_name='pytorch', tmux_session_name='vllm_server')
Starts a VLLM Server for the provided Model ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ssh |
SSHClient
|
The SSH client for the connection. |
required |
model_id |
str
|
HF supported model ID. TODO: Support s3 checkpoint path downloading. |
required |
ip_address |
str
|
The IP address for the EC2 instance. |
required |
port |
str
|
VLLM runs a server that listens on this port. Ensure that this port is open for requests. |
8000
|
conda_env_name |
str
|
The specified environment should have VLLM installed. |
'pytorch'
|
tmux_session_name |
str
|
This is the name of the tmux session that runs the VLLM server. |
'vllm_server'
|
Source code in app/utils/ssh_utils.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
|