gpu-server-setup 0.4.9__tar.gz → 0.4.10__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (18) hide show
  1. {gpu_server_setup-0.4.9 → gpu_server_setup-0.4.10}/PKG-INFO +1 -1
  2. {gpu_server_setup-0.4.9 → gpu_server_setup-0.4.10}/gpu_server_setup.egg-info/PKG-INFO +1 -1
  3. {gpu_server_setup-0.4.9 → gpu_server_setup-0.4.10}/gpu_setup/cli.py +13 -0
  4. {gpu_server_setup-0.4.9 → gpu_server_setup-0.4.10}/gpu_setup/core.py +16 -24
  5. {gpu_server_setup-0.4.9 → gpu_server_setup-0.4.10}/pyproject.toml +1 -1
  6. {gpu_server_setup-0.4.9 → gpu_server_setup-0.4.10}/LICENSE +0 -0
  7. {gpu_server_setup-0.4.9 → gpu_server_setup-0.4.10}/README.md +0 -0
  8. {gpu_server_setup-0.4.9 → gpu_server_setup-0.4.10}/gpu_server_setup.egg-info/SOURCES.txt +0 -0
  9. {gpu_server_setup-0.4.9 → gpu_server_setup-0.4.10}/gpu_server_setup.egg-info/dependency_links.txt +0 -0
  10. {gpu_server_setup-0.4.9 → gpu_server_setup-0.4.10}/gpu_server_setup.egg-info/entry_points.txt +0 -0
  11. {gpu_server_setup-0.4.9 → gpu_server_setup-0.4.10}/gpu_server_setup.egg-info/requires.txt +0 -0
  12. {gpu_server_setup-0.4.9 → gpu_server_setup-0.4.10}/gpu_server_setup.egg-info/top_level.txt +0 -0
  13. {gpu_server_setup-0.4.9 → gpu_server_setup-0.4.10}/gpu_setup/__init__.py +0 -0
  14. {gpu_server_setup-0.4.9 → gpu_server_setup-0.4.10}/gpu_setup/__version__.py +0 -0
  15. {gpu_server_setup-0.4.9 → gpu_server_setup-0.4.10}/gpu_setup/config.py +0 -0
  16. {gpu_server_setup-0.4.9 → gpu_server_setup-0.4.10}/gpu_setup/rich_console.py +0 -0
  17. {gpu_server_setup-0.4.9 → gpu_server_setup-0.4.10}/gpu_setup/utils.py +0 -0
  18. {gpu_server_setup-0.4.9 → gpu_server_setup-0.4.10}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gpu-server-setup
3
- Version: 0.4.9
3
+ Version: 0.4.10
4
4
  Summary: Один клик — удалённый GPU-сервер с Ollama + VS Code Remote
5
5
  Author: The Fool
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gpu-server-setup
3
- Version: 0.4.9
3
+ Version: 0.4.10
4
4
  Summary: Один клик — удалённый GPU-сервер с Ollama + VS Code Remote
5
5
  Author: The Fool
6
6
  License: MIT
@@ -17,6 +17,7 @@ app = typer.Typer(
17
17
  @app.command()
18
18
  def plan(
19
19
  ip: str = typer.Option(..., "--ip", help="IP-адрес сервера"),
20
+ port: int = typer.Option(22, "--port", help="SSH порт (по умолчанию 22)"),
20
21
  user: str = typer.Option(..., "--user", help="Имя пользователя"),
21
22
  model: Optional[str] = typer.Option(None, "--model", help="Модель Ollama"),
22
23
  install_ollama: bool = typer.Option(True, "--install-ollama/--no-install"),
@@ -31,6 +32,7 @@ def plan(
31
32
  server = GPUServer(
32
33
  ip=ip,
33
34
  user=user,
35
+ port=port,
34
36
  dry_run=True,
35
37
  external_key=pem_key,
36
38
  )
@@ -43,6 +45,7 @@ def plan(
43
45
  def setup(
44
46
  ip: str = typer.Option(..., "--ip", help="IP-адрес сервера"),
45
47
  user: str = typer.Option(..., "--user", help="Имя пользователя"),
48
+ port: int = typer.Option(22, "--port", help="SSH порт (по умолчанию 22)"),
46
49
  password: Optional[str] = typer.Option(
47
50
  None,
48
51
  "--password",
@@ -65,6 +68,7 @@ def setup(
65
68
  plan(
66
69
  ip=ip,
67
70
  user=user,
71
+ port=port,
68
72
  model=model,
69
73
  install_ollama=install_ollama,
70
74
  no_vscode=no_vscode,
@@ -75,6 +79,7 @@ def setup(
75
79
  server = GPUServer(
76
80
  ip=ip,
77
81
  user=user,
82
+ port=port,
78
83
  password=password,
79
84
  key_type=key_type,
80
85
  external_key=pem_key,
@@ -104,6 +109,7 @@ def setup(
104
109
  def ssh(
105
110
  ip: str = typer.Option(..., "--ip", help="IP-адрес сервера"),
106
111
  user: str = typer.Option(..., "--user", help="Имя пользователя"),
112
+ port: int = typer.Option(22, "--port", help="SSH порт (по умолчанию 22)"),
107
113
  password: Optional[str] = typer.Option(
108
114
  None,
109
115
  "--password",
@@ -121,6 +127,7 @@ def ssh(
121
127
  ):
122
128
  server = GPUServer(
123
129
  ip=ip,
130
+ port=port,
124
131
  user=user,
125
132
  password=password,
126
133
  key_type=key_type,
@@ -137,6 +144,7 @@ def ssh(
137
144
  @app.command("ollama-install")
138
145
  def ollama_install(
139
146
  ip: str = typer.Option(..., "--ip"),
147
+ port: int = typer.Option(22, "--port", help="SSH порт (по умолчанию 22)"),
140
148
  user: str = typer.Option(..., "--user"),
141
149
  password: Optional[str] = typer.Option(
142
150
  None,
@@ -155,6 +163,7 @@ def ollama_install(
155
163
  server = GPUServer(
156
164
  ip=ip,
157
165
  user=user,
166
+ port=port,
158
167
  password=password,
159
168
  external_key=pem_key,
160
169
  dry_run=dry_run,
@@ -166,6 +175,7 @@ def ollama_install(
166
175
  def model_pull(
167
176
  model: str = typer.Argument(..., help="Название модели (llama3.2, gemma2 и т.д.)"),
168
177
  ip: str = typer.Option(..., "--ip"),
178
+ port: int = typer.Option(22, "--port", help="SSH порт (по умолчанию 22)"),
169
179
  user: str = typer.Option(..., "--user"),
170
180
  password: Optional[str] = typer.Option(None, "--password", hide_input=True),
171
181
  dry_run: bool = typer.Option(False, "--dry-run"),
@@ -179,6 +189,7 @@ def model_pull(
179
189
  server = GPUServer(
180
190
  ip=ip,
181
191
  user=user,
192
+ port=port,
182
193
  password=password,
183
194
  external_key=pem_key,
184
195
  dry_run=dry_run,
@@ -189,6 +200,7 @@ def model_pull(
189
200
  @app.command()
190
201
  def vscode(
191
202
  ip: str = typer.Option(..., "--ip"),
203
+ port: int = typer.Option(22, "--port", help="SSH порт (по умолчанию 22)"),
192
204
  user: str = typer.Option(..., "--user"),
193
205
  password: Optional[str] = typer.Option(None, "--password", hide_input=True),
194
206
  dry_run: bool = typer.Option(False, "--dry-run"),
@@ -202,6 +214,7 @@ def vscode(
202
214
  server = GPUServer(
203
215
  ip=ip,
204
216
  user=user,
217
+ port=port,
205
218
  password=password,
206
219
  external_key=pem_key,
207
220
  dry_run=dry_run,
@@ -19,6 +19,7 @@ class GPUServer:
19
19
  self,
20
20
  ip: str,
21
21
  user: str,
22
+ port: int = 22,
22
23
  password: Optional[str] = None,
23
24
  key_type: str = "ed25519",
24
25
  external_key: Optional[str] = None,
@@ -26,6 +27,7 @@ class GPUServer:
26
27
  ):
27
28
  self.ip = ip
28
29
  self.user = user
30
+ self.port = port
29
31
  self.password = password
30
32
  self.dry_run = dry_run
31
33
  self.key_type = key_type
@@ -46,33 +48,23 @@ class GPUServer:
46
48
  client = SSHClient()
47
49
  client.set_missing_host_key_policy(AutoAddPolicy())
48
50
 
51
+ connect_kwargs = {
52
+ "hostname": self.ip,
53
+ "port": self.port,
54
+ "username": self.user,
55
+ "timeout": 15,
56
+ "look_for_keys": False,
57
+ "allow_agent": False,
58
+ }
59
+
49
60
  if self.use_external_key:
50
- client.connect(
51
- hostname=self.ip,
52
- username=self.user,
53
- key_filename=str(self.key_path),
54
- timeout=15,
55
- look_for_keys=False,
56
- allow_agent=False,
57
- )
61
+ connect_kwargs["key_filename"] = str(self.key_path)
58
62
  elif use_password and self.password:
59
- client.connect(
60
- hostname=self.ip,
61
- username=self.user,
62
- password=self.password,
63
- timeout=15,
64
- look_for_keys=False,
65
- allow_agent=False,
66
- )
63
+ connect_kwargs["password"] = self.password
67
64
  else:
68
- client.connect(
69
- hostname=self.ip,
70
- username=self.user,
71
- key_filename=str(self.key_path),
72
- timeout=15,
73
- look_for_keys=False,
74
- allow_agent=False,
75
- )
65
+ connect_kwargs["key_filename"] = str(self.key_path)
66
+
67
+ client.connect(**connect_kwargs)
76
68
  return client
77
69
 
78
70
  def _sudo_stream(self, client: SSHClient, cmd: str):
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "gpu-server-setup"
3
- version = "0.4.9"
3
+ version = "0.4.10"
4
4
  description = "Один клик — удалённый GPU-сервер с Ollama + VS Code Remote"
5
5
  readme = "README.md"
6
6
  license = {text = "MIT"}