machineconfig 6.65__py3-none-any.whl → 6.67__py3-none-any.whl
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.
Potentially problematic release.
This version of machineconfig might be problematic. Click here for more details.
- machineconfig/jobs/installer/installer_data.json +17 -0
- machineconfig/scripts/python/env_manager/path_manager_tui.py +1 -1
- machineconfig/scripts/python/helpers_devops/cli_config.py +1 -1
- machineconfig/scripts/python/helpers_devops/cli_self.py +3 -3
- machineconfig/scripts/python/helpers_repos/cloud_repo_sync.py +1 -1
- machineconfig/scripts/python/nw/mount_nfs +1 -1
- machineconfig/scripts/python/sessions.py +0 -6
- machineconfig/scripts/python/utils.py +38 -0
- machineconfig/scripts/windows/mounts/mount_ssh.ps1 +1 -1
- machineconfig/setup_linux/web_shortcuts/interactive.sh +1 -1
- machineconfig/setup_windows/web_shortcuts/interactive.ps1 +1 -1
- machineconfig/utils/accessories.py +0 -1
- machineconfig/utils/scheduler.py +23 -18
- machineconfig/utils/ssh.py +53 -9
- {machineconfig-6.65.dist-info → machineconfig-6.67.dist-info}/METADATA +1 -1
- {machineconfig-6.65.dist-info → machineconfig-6.67.dist-info}/RECORD +19 -19
- {machineconfig-6.65.dist-info → machineconfig-6.67.dist-info}/WHEEL +0 -0
- {machineconfig-6.65.dist-info → machineconfig-6.67.dist-info}/entry_points.txt +0 -0
- {machineconfig-6.65.dist-info → machineconfig-6.67.dist-info}/top_level.txt +0 -0
|
@@ -2178,6 +2178,23 @@
|
|
|
2178
2178
|
}
|
|
2179
2179
|
}
|
|
2180
2180
|
},
|
|
2181
|
+
{
|
|
2182
|
+
"appName": "kilocode",
|
|
2183
|
+
"repoURL": "CMD",
|
|
2184
|
+
"doc": "Kilocode agent extension in the terminal",
|
|
2185
|
+
"fileNamePattern": {
|
|
2186
|
+
"amd64": {
|
|
2187
|
+
"linux": "npm install -g @kilocode/cli@alpha",
|
|
2188
|
+
"windows": "npm install -g @kilocode/cli@alpha",
|
|
2189
|
+
"macos": "npm install -g @kilocode/cli@alpha"
|
|
2190
|
+
},
|
|
2191
|
+
"arm64": {
|
|
2192
|
+
"linux": "npm install -g @kilocode/cli@alpha",
|
|
2193
|
+
"windows": "npm install -g @kilocode/cli@alpha",
|
|
2194
|
+
"macos": "npm install -g @kilocode/cli@alpha"
|
|
2195
|
+
}
|
|
2196
|
+
}
|
|
2197
|
+
},
|
|
2181
2198
|
{
|
|
2182
2199
|
"appName": "copilot",
|
|
2183
2200
|
"repoURL": "CMD",
|
|
@@ -46,7 +46,7 @@ def path():
|
|
|
46
46
|
uv_with = ["textual"]
|
|
47
47
|
uv_project_dir = None
|
|
48
48
|
if not Path.home().joinpath("code/machineconfig").exists():
|
|
49
|
-
uv_with.append("machineconfig>=6.
|
|
49
|
+
uv_with.append("machineconfig>=6.66")
|
|
50
50
|
else:
|
|
51
51
|
uv_project_dir = str(Path.home().joinpath("code/machineconfig"))
|
|
52
52
|
run_shell_script(get_uv_command_executing_python_script(python_script=path.read_text(encoding="utf-8"), uv_with=uv_with, uv_project_dir=uv_project_dir)[0])
|
|
@@ -41,9 +41,9 @@ def install(no_copy_assets: Annotated[bool, typer.Option("--no-assets-copy", "-n
|
|
|
41
41
|
else:
|
|
42
42
|
import platform
|
|
43
43
|
if platform.system() == "Windows":
|
|
44
|
-
run_shell_script(r"""& "$HOME\.local\bin\uv.exe" tool install --upgrade "machineconfig>=6.
|
|
44
|
+
run_shell_script(r"""& "$HOME\.local\bin\uv.exe" tool install --upgrade "machineconfig>=6.66" """)
|
|
45
45
|
else:
|
|
46
|
-
run_shell_script("""$HOME/.local/bin/uv tool install --upgrade "machineconfig>=6.
|
|
46
|
+
run_shell_script("""$HOME/.local/bin/uv tool install --upgrade "machineconfig>=6.66" """)
|
|
47
47
|
from machineconfig.profile.create_shell_profile import create_default_shell_profile
|
|
48
48
|
if not no_copy_assets:
|
|
49
49
|
create_default_shell_profile() # involves copying assets too
|
|
@@ -68,7 +68,7 @@ def navigate():
|
|
|
68
68
|
path = Path(navigator.__file__).resolve().parent.joinpath("devops_navigator.py")
|
|
69
69
|
from machineconfig.utils.code import run_shell_script
|
|
70
70
|
if Path.home().joinpath("code/machineconfig").exists(): executable = f"""--project "{str(Path.home().joinpath("code/machineconfig"))}" --with textual"""
|
|
71
|
-
else: executable = """--with "machineconfig>=6.
|
|
71
|
+
else: executable = """--with "machineconfig>=6.66,textual" """
|
|
72
72
|
run_shell_script(f"""uv run {executable} {path}""")
|
|
73
73
|
|
|
74
74
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
# mkdir ~/data/local
|
|
6
6
|
# sudo mount -o nolock,noatime,nodiratime,proto=tcp,timeo=600,retrans=2,noac alex-p51s-5:/home/alex/data/local ./data/local
|
|
7
7
|
|
|
8
|
-
uv run --python 3.14 --with "machineconfig>=6.
|
|
8
|
+
uv run --python 3.14 --with "machineconfig>=6.66" python -m machineconfig.scripts.python.mount_nfs
|
|
9
9
|
# Check if remote server is reachable and share folder exists
|
|
10
10
|
if ! ping -c 1 "$remote_server" &> /dev/null; then
|
|
11
11
|
echo "💥 Error: Remote server $remote_server is not reachable."
|
|
@@ -130,10 +130,6 @@ def run(ctx: typer.Context,
|
|
|
130
130
|
print(f"❌ Unsupported platform: {platform.system()}")
|
|
131
131
|
|
|
132
132
|
|
|
133
|
-
def kill_process():
|
|
134
|
-
from machineconfig.utils.procs import main
|
|
135
|
-
main()
|
|
136
|
-
|
|
137
133
|
def get_app():
|
|
138
134
|
layouts_app = typer.Typer(help="Layouts management subcommands", no_args_is_help=True, add_help_option=False, add_completion=False)
|
|
139
135
|
from machineconfig.scripts.python.helpers_sessions.sessions_multiprocess import create_from_function
|
|
@@ -143,8 +139,6 @@ def get_app():
|
|
|
143
139
|
layouts_app.command("r", no_args_is_help=True, help="Run the selected layout(s)", hidden=True)(run)
|
|
144
140
|
layouts_app.command("balance-load", no_args_is_help=True, help="[b] Balance the load across sessions")(balance_load)
|
|
145
141
|
layouts_app.command("b", no_args_is_help=True, help="Balance the load across sessions", hidden=True)(balance_load)
|
|
146
|
-
layouts_app.command("kill-process", no_args_is_help=False, help="[k] Choose a process to kill")(kill_process)
|
|
147
|
-
layouts_app.command("k", no_args_is_help=False, help="Choose a process to kill", hidden=True)(kill_process)
|
|
148
142
|
|
|
149
143
|
return layouts_app
|
|
150
144
|
|
|
@@ -2,11 +2,49 @@
|
|
|
2
2
|
|
|
3
3
|
from machineconfig.scripts.python.helpers_devops.cli_utils import download, merge_pdfs, get_machine_specs
|
|
4
4
|
import typer
|
|
5
|
+
from typing import Annotated, Optional
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def kill_process(
|
|
10
|
+
# name: Annotated[Optional[str], typer.Option(..., "--name", "-n", help="Name of the process to kill")],
|
|
11
|
+
# command: Annotated[str, typer.Option(..., "--command", "-c", help="Match by command line instead of process name")] = "",
|
|
12
|
+
interactive: Annotated[bool, typer.Option(..., "--interactive", "-i", help="Interactively choose the process to kill")] = True):
|
|
13
|
+
from machineconfig.utils.procs import main, ProcessManager
|
|
14
|
+
if interactive:
|
|
15
|
+
main()
|
|
16
|
+
return
|
|
17
|
+
_ = ProcessManager
|
|
18
|
+
# pm = ProcessManager()
|
|
19
|
+
# if command:
|
|
20
|
+
# pm.filter_and_kill(name=command
|
|
21
|
+
# )
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def add_dev_packages(repo_dir: Annotated[Optional[str], typer.Option(..., "--repo-dir", "-r", help="Path to the repository root directory")] = None):
|
|
25
|
+
if repo_dir is None:
|
|
26
|
+
r_dir = Path.cwd()
|
|
27
|
+
else:
|
|
28
|
+
r_dir = Path(repo_dir).resolve()
|
|
29
|
+
if not r_dir.exists() or not r_dir.is_dir() or not (r_dir / "pyproject.toml").exists():
|
|
30
|
+
typer.echo(f"❌ The provided repo directory `{r_dir}` is not valid or does not contain a `pyproject.toml` file.")
|
|
31
|
+
raise typer.Exit(code=1)
|
|
32
|
+
command = f"""
|
|
33
|
+
cd "{r_dir}" || exit 1
|
|
34
|
+
uv add nbformat ipdb ipykernel ipython pylint pyright mypy pyrefly ty pytest
|
|
35
|
+
"""
|
|
36
|
+
from machineconfig.utils.code import run_shell_script
|
|
37
|
+
typer.echo(f"➡️ Installing dev packages in repo at `{r_dir}`...")
|
|
38
|
+
run_shell_script(command)
|
|
39
|
+
typer.echo(f"✅ Dev packages installed successfully in repo at `{r_dir}`.")
|
|
40
|
+
# TODO: see upgrade packages.
|
|
5
41
|
|
|
6
42
|
|
|
7
43
|
|
|
8
44
|
def get_app() -> typer.Typer:
|
|
9
45
|
app = typer.Typer(help="🛠️ utilities operations", no_args_is_help=True, add_help_option=False, add_completion=False)
|
|
46
|
+
app.command(name="kill-process", no_args_is_help=False, help="[k] Choose a process to kill")(kill_process)
|
|
47
|
+
app.command(name="k", no_args_is_help=False, help="Choose a process to kill", hidden=True)(kill_process)
|
|
10
48
|
app.command(name="download", no_args_is_help=True, help="[d] Download a file from a URL and optionally decompress it.")(download)
|
|
11
49
|
app.command(name="d", no_args_is_help=True, hidden=True)(download)
|
|
12
50
|
app.command(name="merge-pdfs", no_args_is_help=True, help="[m] Merge two PDF files into one.")(merge_pdfs)
|
|
@@ -7,7 +7,7 @@ $user = ''
|
|
|
7
7
|
$sharePath = ''
|
|
8
8
|
$driveLetter = ''
|
|
9
9
|
|
|
10
|
-
uv run --python 3.14 --with "machineconfig>=6.
|
|
10
|
+
uv run --python 3.14 --with "machineconfig>=6.66" python -m machineconfig.scripts.python.mount_ssh
|
|
11
11
|
|
|
12
12
|
net use T: \\sshfs.kr\$user@$host.local
|
|
13
13
|
# this worked: net use T: \\sshfs\alex@alex-p51s-5.local
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
. <( curl -sSL "https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_linux/uv.sh")
|
|
3
3
|
mcfg() {
|
|
4
|
-
"$HOME/.local/bin/uv" run --python 3.14 --with "machineconfig>=6.
|
|
4
|
+
"$HOME/.local/bin/uv" run --python 3.14 --with "machineconfig>=6.66" mcfg "$@"
|
|
5
5
|
}
|
|
6
6
|
alias d="mcfg devops"
|
|
7
7
|
alias c="mcfg cloud"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
iex (iwr "https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_windows/uv.ps1").Content
|
|
4
4
|
function mcfg {
|
|
5
|
-
& "$HOME\.local\bin\uv.exe" run --python 3.14 --with "machineconfig>=6.
|
|
5
|
+
& "$HOME\.local\bin\uv.exe" run --python 3.14 --with "machineconfig>=6.66" mcfg $args
|
|
6
6
|
}
|
|
7
7
|
function d { mcfg devops @args }
|
|
8
8
|
function c { mcfg cloud @args }
|
|
@@ -72,7 +72,6 @@ def split_list[T](sequence: list[T], every: Optional[int]=None, to: Optional[int
|
|
|
72
72
|
|
|
73
73
|
def pprint(obj: dict[Any, Any], title: str) -> None:
|
|
74
74
|
from rich import inspect
|
|
75
|
-
|
|
76
75
|
inspect(type("TempStruct", (object,), obj)(), value=False, title=title, docs=False, dunder=False, sort=False)
|
|
77
76
|
|
|
78
77
|
|
machineconfig/utils/scheduler.py
CHANGED
|
@@ -164,7 +164,7 @@ class CacheMemory[T]():
|
|
|
164
164
|
def age(self) -> timedelta:
|
|
165
165
|
return datetime.now() - self.time_produced
|
|
166
166
|
|
|
167
|
-
def __call__(self, fresh: bool = False) -> T:
|
|
167
|
+
def __call__(self, fresh: bool = False, tolerance_seconds: int = 1000000000000) -> T:
|
|
168
168
|
if fresh or not hasattr(self, "cache"):
|
|
169
169
|
why = "There was an explicit fresh order." if fresh else "Previous cache never existed."
|
|
170
170
|
t0 = time.time()
|
|
@@ -176,7 +176,7 @@ class CacheMemory[T]():
|
|
|
176
176
|
self.time_produced = datetime.now()
|
|
177
177
|
else:
|
|
178
178
|
age = self.age
|
|
179
|
-
if age > self.expire:
|
|
179
|
+
if (age > self.expire) or (fresh and (age.total_seconds() > tolerance_seconds)):
|
|
180
180
|
self.logger.warning(f"""
|
|
181
181
|
🔄 ════════════════════ CACHE UPDATE ════════════════════
|
|
182
182
|
⚠️ {self.name} cache: Updating cache from source func
|
|
@@ -214,14 +214,24 @@ class Cache[T](): # This class helps to accelrate access to latest data coming
|
|
|
214
214
|
self.logger = logger
|
|
215
215
|
self.expire = expire
|
|
216
216
|
self.name = name if isinstance(name, str) else self.source_func.__name__
|
|
217
|
-
|
|
218
|
-
def age(self):
|
|
219
|
-
"""Throws AttributeError if called before cache is populated and path doesn't exists"""
|
|
217
|
+
def get_age(self):
|
|
220
218
|
return datetime.now() - self.time_produced
|
|
221
|
-
def __call__(self, fresh: bool = False) -> T:
|
|
222
|
-
if
|
|
223
|
-
if
|
|
219
|
+
def __call__(self, fresh: bool = False, tolerance_seconds: int = 1000000000000) -> T:
|
|
220
|
+
if not hasattr(self, "cache"): # populate cache for the first time: we have two options, populate from disk or from source func.
|
|
221
|
+
if self.path.exists(): # prefer to read from disk over source func as a default source of cache.
|
|
224
222
|
age = datetime.now() - datetime.fromtimestamp(self.path.stat().st_mtime)
|
|
223
|
+
if (age > self.expire) or (fresh and (age.total_seconds() > tolerance_seconds)): # cache is old or if fresh flag is raised
|
|
224
|
+
self.logger.warning(f"""
|
|
225
|
+
🔄 ════════════════════ CACHE STALE ════════════════════
|
|
226
|
+
📦 {self.name} cache: Populating fresh cache from source func
|
|
227
|
+
⏱️ Lag = {age}""")
|
|
228
|
+
t0 = time.time()
|
|
229
|
+
self.cache = self.source_func() # fresh data.
|
|
230
|
+
self.logger.warning(f"⏱️ Cache population took {time.time() - t0:.2f} seconds.")
|
|
231
|
+
self.time_produced = datetime.now()
|
|
232
|
+
self.save(self.cache, self.path)
|
|
233
|
+
return self.cache
|
|
234
|
+
|
|
225
235
|
msg1 = f"""
|
|
226
236
|
📦 ════════════════════ CACHE OPERATION ════════════════════
|
|
227
237
|
🔄 {self.name} cache: Reading cached values from `{self.path}`
|
|
@@ -240,10 +250,8 @@ class Cache[T](): # This class helps to accelrate access to latest data coming
|
|
|
240
250
|
self.time_produced = datetime.now()
|
|
241
251
|
self.save(self.cache, self.path)
|
|
242
252
|
return self.cache
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
# Previous cache never existed or there was an explicit fresh order.
|
|
246
|
-
why = "There was an explicit fresh order." if fresh else "Previous cache never existed or is corrupted."
|
|
253
|
+
else: # disk cache does not exist, populate from source func.
|
|
254
|
+
why = "Previous cache never existed."
|
|
247
255
|
self.logger.warning(f"""
|
|
248
256
|
🆕 ════════════════════ NEW CACHE ════════════════════
|
|
249
257
|
🔄 {self.name} cache: Populating fresh cache from source func
|
|
@@ -253,12 +261,9 @@ class Cache[T](): # This class helps to accelrate access to latest data coming
|
|
|
253
261
|
self.logger.warning(f"⏱️ Cache population took {time.time() - t0:.2f} seconds.")
|
|
254
262
|
self.time_produced = datetime.now()
|
|
255
263
|
self.save(self.cache, self.path)
|
|
256
|
-
else: # cache exists
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
except AttributeError: # path doesn't exist (may be deleted) ==> need to repopulate cache form source_func.
|
|
260
|
-
return self(fresh=True)
|
|
261
|
-
if age > self.expire:
|
|
264
|
+
else: # memory cache exists
|
|
265
|
+
age = self.get_age()
|
|
266
|
+
if (age > self.expire) or (fresh and (age.total_seconds() > tolerance_seconds)): # cache is old or if fresh flag is raised
|
|
262
267
|
self.logger.warning(f"""
|
|
263
268
|
🔄 ════════════════════ CACHE UPDATE ════════════════════
|
|
264
269
|
⚠️ {self.name} cache: Updating cache from source func
|
machineconfig/utils/ssh.py
CHANGED
|
@@ -8,10 +8,14 @@ from machineconfig.utils.terminal import Response
|
|
|
8
8
|
from machineconfig.utils.accessories import pprint, randstr
|
|
9
9
|
from machineconfig.utils.meta import lambda_to_python_script
|
|
10
10
|
UV_RUN_CMD = "$HOME/.local/bin/uv run" if platform.system() != "Windows" else """& "$env:USERPROFILE/.local/bin/uv" run"""
|
|
11
|
-
MACHINECONFIG_VERSION = "machineconfig>=6.
|
|
11
|
+
MACHINECONFIG_VERSION = "machineconfig>=6.66"
|
|
12
12
|
DEFAULT_PICKLE_SUBDIR = "tmp_results/tmp_scripts/ssh"
|
|
13
13
|
|
|
14
14
|
class SSH:
|
|
15
|
+
@staticmethod
|
|
16
|
+
def from_config_file(host: str) -> "SSH":
|
|
17
|
+
"""Create SSH instance from SSH config file entry."""
|
|
18
|
+
return SSH(host=host, username=None, hostname=None, ssh_key_path=None, password=None, port=22, enable_compression=False)
|
|
15
19
|
def __init__(
|
|
16
20
|
self, host: Optional[str], username: Optional[str], hostname: Optional[str], ssh_key_path: Optional[str], password: Optional[str], port: int, enable_compression: bool):
|
|
17
21
|
self.password = password
|
|
@@ -112,12 +116,36 @@ class SSH:
|
|
|
112
116
|
from machineconfig.scripts.python.helpers_devops.cli_utils import get_machine_specs
|
|
113
117
|
self.local_specs: MachineSpecs = get_machine_specs()
|
|
114
118
|
resp = self.run_shell(command=f"""~/.local/bin/utils get-machine-specs """, verbose_output=False, description="Getting remote machine specs", strict_stderr=False, strict_return_code=False)
|
|
115
|
-
# import json
|
|
116
119
|
json_str = resp.op
|
|
117
|
-
print(f"Remote machine specs JSON: {resp.op}")
|
|
118
120
|
import ast
|
|
119
121
|
self.remote_specs: MachineSpecs = cast(MachineSpecs, ast.literal_eval(json_str))
|
|
120
122
|
self.terminal_responses: list[Response] = []
|
|
123
|
+
|
|
124
|
+
from rich import inspect
|
|
125
|
+
|
|
126
|
+
local_info = dict(distro=self.local_specs.get("distro"), system=self.local_specs.get("system"), home_dir=self.local_specs.get("home_dir"))
|
|
127
|
+
remote_info = dict(distro=self.remote_specs.get("distro"), system=self.remote_specs.get("system"), home_dir=self.remote_specs.get("home_dir"))
|
|
128
|
+
|
|
129
|
+
console = rich.console.Console()
|
|
130
|
+
|
|
131
|
+
from io import StringIO
|
|
132
|
+
local_buffer = StringIO()
|
|
133
|
+
remote_buffer = StringIO()
|
|
134
|
+
|
|
135
|
+
local_console = rich.console.Console(file=local_buffer, width=40)
|
|
136
|
+
remote_console = rich.console.Console(file=remote_buffer, width=40)
|
|
137
|
+
|
|
138
|
+
inspect(type("LocalInfo", (object,), local_info)(), value=False, title="SSHing From", docs=False, dunder=False, sort=False, console=local_console)
|
|
139
|
+
inspect(type("RemoteInfo", (object,), remote_info)(), value=False, title="SSHing To", docs=False, dunder=False, sort=False, console=remote_console)
|
|
140
|
+
|
|
141
|
+
local_lines = local_buffer.getvalue().split("\n")
|
|
142
|
+
remote_lines = remote_buffer.getvalue().split("\n")
|
|
143
|
+
|
|
144
|
+
max_lines = max(len(local_lines), len(remote_lines))
|
|
145
|
+
for i in range(max_lines):
|
|
146
|
+
left = local_lines[i] if i < len(local_lines) else ""
|
|
147
|
+
right = remote_lines[i] if i < len(remote_lines) else ""
|
|
148
|
+
console.print(f"{left:<42} {right}")
|
|
121
149
|
|
|
122
150
|
def __enter__(self) -> "SSH":
|
|
123
151
|
return self
|
|
@@ -165,8 +193,8 @@ class SSH:
|
|
|
165
193
|
res.capture().print_if_unsuccessful(desc=description, strict_err=strict_stderr, strict_returncode=strict_return_code, assert_success=False)
|
|
166
194
|
# self.terminal_responses.append(res)
|
|
167
195
|
return res
|
|
168
|
-
|
|
169
|
-
|
|
196
|
+
|
|
197
|
+
def _run_py_prep(self, python_code: str, uv_with: Optional[list[str]], uv_project_dir: Optional[str],) -> str:
|
|
170
198
|
py_path = Path.home().joinpath(f"{DEFAULT_PICKLE_SUBDIR}/runpy_{randstr()}.py")
|
|
171
199
|
py_path.parent.mkdir(parents=True, exist_ok=True)
|
|
172
200
|
py_path.write_text(python_code, encoding="utf-8")
|
|
@@ -180,13 +208,29 @@ class SSH:
|
|
|
180
208
|
else:
|
|
181
209
|
with_clause += ""
|
|
182
210
|
uv_cmd = f"""{UV_RUN_CMD} {with_clause} python {py_path.relative_to(Path.home())}"""
|
|
211
|
+
return uv_cmd
|
|
212
|
+
|
|
213
|
+
def run_py(self, python_code: str, uv_with: Optional[list[str]], uv_project_dir: Optional[str],
|
|
214
|
+
description: str, verbose_output: bool, strict_stderr: bool, strict_return_code: bool) -> Response:
|
|
215
|
+
uv_cmd = self._run_py_prep(python_code=python_code, uv_with=uv_with, uv_project_dir=uv_project_dir)
|
|
183
216
|
return self.run_shell(command=uv_cmd, verbose_output=verbose_output, description=description or f"run_py on {self.get_remote_repr(add_machine=False)}", strict_stderr=strict_stderr, strict_return_code=strict_return_code)
|
|
184
217
|
|
|
185
|
-
def run_lambda_function(self, func: Callable[..., Any], import_module: bool, uv_with: Optional[list[str]], uv_project_dir: Optional[str])
|
|
218
|
+
def run_lambda_function(self, func: Callable[..., Any], import_module: bool, uv_with: Optional[list[str]], uv_project_dir: Optional[str]):
|
|
186
219
|
command = lambda_to_python_script(lmb=func, in_global=True, import_module=import_module)
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
220
|
+
# turns ou that the code below for some reason runs but zellij doesn't start, looks like things are assigned to different user.
|
|
221
|
+
# return self.run_py(python_code=command, uv_with=uv_with, uv_project_dir=uv_project_dir,
|
|
222
|
+
# description=f"run_py_func {func.__name__} on {self.get_remote_repr(add_machine=False)}",
|
|
223
|
+
# verbose_output=True, strict_stderr=True, strict_return_code=True)
|
|
224
|
+
uv_cmd = self._run_py_prep(python_code=command, uv_with=uv_with, uv_project_dir=uv_project_dir)
|
|
225
|
+
if self.remote_specs["system"] == "Linux":
|
|
226
|
+
uv_cmd_modified = f'bash -l -c "{uv_cmd}"'
|
|
227
|
+
else: uv_cmd_modified = uv_cmd
|
|
228
|
+
# This works even withou the modified uv cmd:
|
|
229
|
+
# from machineconfig.utils.code import run_shell_script
|
|
230
|
+
# assert self.host is not None, "SSH host must be specified to run remote commands"
|
|
231
|
+
# process = run_shell_script(f"ssh {self.host} -n '. ~/.profile; . ~/.bashrc; {uv_cmd}'")
|
|
232
|
+
# return process
|
|
233
|
+
return self.run_shell(command=uv_cmd_modified, verbose_output=True, description=f"run_py_func {func.__name__} on {self.get_remote_repr(add_machine=False)}", strict_stderr=True, strict_return_code=True)
|
|
190
234
|
|
|
191
235
|
def _simple_sftp_get(self, remote_path: str, local_path: Path) -> None:
|
|
192
236
|
"""Simple SFTP get without any recursion or path expansion - for internal use only."""
|
|
@@ -47,7 +47,7 @@ machineconfig/cluster/templates/cli_trogon.py,sha256=PFWGy8SFYIhT9r3ZV4oIEYfImsQ
|
|
|
47
47
|
machineconfig/jobs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
48
48
|
machineconfig/jobs/installer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
49
49
|
machineconfig/jobs/installer/check_installations.py,sha256=hkHmmT7Bx3_QWRn2v8dCKOzAapFzqHRzbe-Q08GLnKE,10743
|
|
50
|
-
machineconfig/jobs/installer/installer_data.json,sha256=
|
|
50
|
+
machineconfig/jobs/installer/installer_data.json,sha256=PPpfmo2WZi6RSHMsb7YvqewRr9IQ81B5-tN7bCXjCFc,77032
|
|
51
51
|
machineconfig/jobs/installer/package_groups.py,sha256=i4z83F_rk7BVsrwFhz5Vn4SLF0IHxyQBFSxpAaZBl8M,5270
|
|
52
52
|
machineconfig/jobs/installer/custom/gh.py,sha256=gn7TUSrsLx7uqFqj1Z-iYglS0EYBSgtJ9jWHxaJIfXM,4119
|
|
53
53
|
machineconfig/jobs/installer/custom/hx.py,sha256=YQClQXqWtGvon8BLFGf1Fp20JPkHgZeEZ6ebmCJQQfI,5838
|
|
@@ -129,8 +129,8 @@ machineconfig/scripts/python/entry.py,sha256=liCf186Msa6R-EjcQ0I6K80Km7Wi8qckJB6
|
|
|
129
129
|
machineconfig/scripts/python/fire_jobs.py,sha256=My7sFn1R2vh21uIHGfNppgX99WTEitCFgJ1MSasBUOQ,13597
|
|
130
130
|
machineconfig/scripts/python/ftpx.py,sha256=A13hL_tDYfcsaK9PkshK-0lrUS6KPhPCtwqWtLSo6IM,9764
|
|
131
131
|
machineconfig/scripts/python/interactive.py,sha256=zt3g6nGKR_Y5A57UnR4Y5-JpLzrpnCOSaqU1bnaikK0,11666
|
|
132
|
-
machineconfig/scripts/python/sessions.py,sha256=
|
|
133
|
-
machineconfig/scripts/python/utils.py,sha256=
|
|
132
|
+
machineconfig/scripts/python/sessions.py,sha256=JfN8M7r7f8DkfiGJ4jz2NfXvABm90nOZJmLGxPgw_2M,9518
|
|
133
|
+
machineconfig/scripts/python/utils.py,sha256=9ckI_2Nu9Z8W9cT6QNKreXVtwNA5RXD05nWemPb2sIg,2797
|
|
134
134
|
machineconfig/scripts/python/ai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
135
135
|
machineconfig/scripts/python/ai/generate_files.py,sha256=VfjKdwgF8O6E4oiRtfWNliibLmmwGe7f9ld6wpOsXTw,14498
|
|
136
136
|
machineconfig/scripts/python/ai/initai.py,sha256=9SZtWOcRuwk8ZU3wHOfPzjInERD79ZTYFY8tVACgza4,2260
|
|
@@ -163,7 +163,7 @@ machineconfig/scripts/python/ai/solutions/opencode/opencode.json,sha256=nahHKRw1
|
|
|
163
163
|
machineconfig/scripts/python/ai/solutions/opencode/opencode.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
164
164
|
machineconfig/scripts/python/env_manager/__init__.py,sha256=E4LAHbU1wo2dLjE36ntv8U7QNTe8TasujUAYK9SLvWk,6
|
|
165
165
|
machineconfig/scripts/python/env_manager/path_manager_backend.py,sha256=ZVGlGJALhg7zNABDdwXxL7MFbL2BXPebObipXSLGbic,1552
|
|
166
|
-
machineconfig/scripts/python/env_manager/path_manager_tui.py,sha256=
|
|
166
|
+
machineconfig/scripts/python/env_manager/path_manager_tui.py,sha256=v6vMcGpK7Yu-y-CJW4OYPQkgV2FPUoxg_toWm5hgkQk,6932
|
|
167
167
|
machineconfig/scripts/python/helpers_cloud/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
168
168
|
machineconfig/scripts/python/helpers_cloud/cloud_copy.py,sha256=OV1w3ajFVFs6FJytjIPOntYB_aW2ywGohKi73V4Dm2Y,8691
|
|
169
169
|
machineconfig/scripts/python/helpers_cloud/cloud_helpers.py,sha256=GA-bxXouUmknk9fyQAsPT-Xl3RG9-yBed71a2tu9Pig,4914
|
|
@@ -179,12 +179,12 @@ machineconfig/scripts/python/helpers_croshell/start_slidev.py,sha256=HfJReOusTPh
|
|
|
179
179
|
machineconfig/scripts/python/helpers_croshell/viewer.py,sha256=heQNjB9fwn3xxbPgMofhv1Lp6Vtkl76YjjexWWBM0pM,2041
|
|
180
180
|
machineconfig/scripts/python/helpers_croshell/viewer_template.py,sha256=ve3Q1-iKhCLc0VJijKvAeOYp2xaFOeIOC_XW956GWCc,3944
|
|
181
181
|
machineconfig/scripts/python/helpers_devops/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
182
|
-
machineconfig/scripts/python/helpers_devops/cli_config.py,sha256=
|
|
182
|
+
machineconfig/scripts/python/helpers_devops/cli_config.py,sha256=2Wt1uj9s8VBJnx3nkA6-kdAgU591mQrmGRYgfhc-v0c,7218
|
|
183
183
|
machineconfig/scripts/python/helpers_devops/cli_config_dotfile.py,sha256=rjTys4FNf9_feP9flWM7Zvq17dxWmetSiGaHPxp25nk,2737
|
|
184
184
|
machineconfig/scripts/python/helpers_devops/cli_data.py,sha256=79Xvx7YnbueruEnl69hrDg2AhVxf_zCUdlVcKfeMGyQ,1774
|
|
185
185
|
machineconfig/scripts/python/helpers_devops/cli_nw.py,sha256=B5Xa9pV5MdC4vPo3EmKaHvNMlThsY3c5F92YPE5j3rI,4176
|
|
186
186
|
machineconfig/scripts/python/helpers_devops/cli_repos.py,sha256=Xwkv1adqHZvTfRSPWiqSK3PZ1XADyx3llw_YkbxaKyE,12505
|
|
187
|
-
machineconfig/scripts/python/helpers_devops/cli_self.py,sha256=
|
|
187
|
+
machineconfig/scripts/python/helpers_devops/cli_self.py,sha256=ZWU3EeiLM4JhgXVbKnbRht3wne0y59sPnu1viFNmhco,6225
|
|
188
188
|
machineconfig/scripts/python/helpers_devops/cli_share_server.py,sha256=q9pFJ6AxPuygMr3onMNOKEuuQHbVE_6Qoyo7xRT5FX0,4196
|
|
189
189
|
machineconfig/scripts/python/helpers_devops/cli_terminal.py,sha256=k_PzXaiGyE0vXr0Ii1XcJz2A7UvyPJrR31TRWt4RKRI,6019
|
|
190
190
|
machineconfig/scripts/python/helpers_devops/cli_utils.py,sha256=gj9KNY6GyzSflXJRkX0lzyvypvwdgseudXhgJcmAtPY,6074
|
|
@@ -225,7 +225,7 @@ machineconfig/scripts/python/helpers_navigator/main_app.py,sha256=R1vOBMUKaiFHOg
|
|
|
225
225
|
machineconfig/scripts/python/helpers_navigator/search_bar.py,sha256=kDi8Jhxap8wdm7YpDBtfhwcPnSqDPFrV2LqbcSBWMT4,414
|
|
226
226
|
machineconfig/scripts/python/helpers_repos/action.py,sha256=9AxWy8mB9HFeV5t11-qD_l-KA5jkUmm0pXVKT1L6-Qk,14894
|
|
227
227
|
machineconfig/scripts/python/helpers_repos/clone.py,sha256=UULEG5xJuXlPGU0nqXH6U45jA9DOFqLw8B4iPytCwOQ,5471
|
|
228
|
-
machineconfig/scripts/python/helpers_repos/cloud_repo_sync.py,sha256=
|
|
228
|
+
machineconfig/scripts/python/helpers_repos/cloud_repo_sync.py,sha256=S25zle7gJ3agi2qlDA3aqwYvoJkLGpMvmx7btm3OmUk,10450
|
|
229
229
|
machineconfig/scripts/python/helpers_repos/count_lines.py,sha256=Q5c7b-DxvTlQmljoic7niTuiAVyFlwYvkVQ7uRJHiTo,16009
|
|
230
230
|
machineconfig/scripts/python/helpers_repos/count_lines_frontend.py,sha256=vSDtrF4829jziwp6WZmGt9G8MJ9jY4hfXqtf0vhkYSE,607
|
|
231
231
|
machineconfig/scripts/python/helpers_repos/entrypoint.py,sha256=WYEFGUJp9HWImlFjbs_hiFZrUqM_KEYm5VvSUjWd04I,2810
|
|
@@ -241,7 +241,7 @@ machineconfig/scripts/python/nw/add_ssh_key.py,sha256=9JLmWu8pE7PAL5VuCFd19iVEdC
|
|
|
241
241
|
machineconfig/scripts/python/nw/devops_add_identity.py,sha256=aPjcHbTLhxYwWYcandyAHdwuO15ZBu3fB82u6bI0tMQ,3773
|
|
242
242
|
machineconfig/scripts/python/nw/devops_add_ssh_key.py,sha256=CkIl85hZLtG9k7yXLSzqi88YrilHV4hIUWHAPBwxWjw,8922
|
|
243
243
|
machineconfig/scripts/python/nw/mount_drive,sha256=zemKofv7hOmRN_V3qK0q580GkfWw3VdikyVVQyiu8j8,3514
|
|
244
|
-
machineconfig/scripts/python/nw/mount_nfs,sha256=
|
|
244
|
+
machineconfig/scripts/python/nw/mount_nfs,sha256=R900EQEVjZScZenqEjaYL9dLkobBsNxKpXq-nOCkdZQ,1855
|
|
245
245
|
machineconfig/scripts/python/nw/mount_nfs.py,sha256=lOMDY4RS7tx8gsCazVR5tNNwFbaRyO2PJlnwBCDQgCM,3573
|
|
246
246
|
machineconfig/scripts/python/nw/mount_nw_drive,sha256=BqjGBCbwe5ZAsZDO3L0zHhh_gJfZy1CYOcqXA4Y-WkQ,2262
|
|
247
247
|
machineconfig/scripts/python/nw/mount_nw_drive.py,sha256=iru6AtnTyvyuk6WxlK5R4lDkuliVpPV5_uBTVVhXtjQ,1550
|
|
@@ -258,7 +258,7 @@ machineconfig/scripts/windows/fzfrga.bat,sha256=rU_KBMO6ii2EZ0akMnmDk9vpuhKSUZqk
|
|
|
258
258
|
machineconfig/scripts/windows/mounts/mount_nfs.ps1,sha256=XrAdzpxE6a4OccSmWJ7YWHJTnsZK8uXnFE5j9GOPA20,2026
|
|
259
259
|
machineconfig/scripts/windows/mounts/mount_nw.ps1,sha256=puxcfZc3ZCJerm8pj8OZGVoTYkhzp-h7oV-MrksSqIE,454
|
|
260
260
|
machineconfig/scripts/windows/mounts/mount_smb.ps1,sha256=PzYWpIO9BpwXjdWlUQL9pnMRnOGNSkxfh4bHukJFme8,69
|
|
261
|
-
machineconfig/scripts/windows/mounts/mount_ssh.ps1,sha256=
|
|
261
|
+
machineconfig/scripts/windows/mounts/mount_ssh.ps1,sha256=ExQ6XMWhs7uP5lf6qHHTbu5A4NjP9ARSFxKERWTM7uw,322
|
|
262
262
|
machineconfig/scripts/windows/mounts/share_cloud.cmd,sha256=exD7JCdxw2LqVjw2MKCYHbVZlEqmelXtwnATng-dhJ4,1028
|
|
263
263
|
machineconfig/scripts/windows/mounts/share_smb.ps1,sha256=U7x8ULYSjbgzTtiHNSKQuTaZ_apilDvkGV5Xm5hXk5M,384
|
|
264
264
|
machineconfig/scripts/windows/mounts/unlock_bitlocker.ps1,sha256=Wv-SLscdckV-1mG3p82VXKPY9zW3hgkRmcLUXIZ1daE,253
|
|
@@ -375,7 +375,7 @@ machineconfig/setup_linux/others/mint_keyboard_shortcuts.sh,sha256=F5dbg0n9RHsKG
|
|
|
375
375
|
machineconfig/setup_linux/ssh/openssh_all.sh,sha256=3dg6HEUFbHQOzLfSAtzK_D_GB8rGCCp_aBnxNdnidVc,824
|
|
376
376
|
machineconfig/setup_linux/ssh/openssh_wsl.sh,sha256=1eeRGrloVB34K5z8yWVUMG5b9pV-WBfHgV9jqXiYgCQ,1398
|
|
377
377
|
machineconfig/setup_linux/web_shortcuts/android.sh,sha256=gzep6bBhK7FCBvGcXK0fdJCtkSfBOftt0aFyDZq_eMs,68
|
|
378
|
-
machineconfig/setup_linux/web_shortcuts/interactive.sh,sha256=
|
|
378
|
+
machineconfig/setup_linux/web_shortcuts/interactive.sh,sha256=tItrgkk3kG9-ylEDRgr9MZa1EHtATpNLPyq9-95GdOk,464
|
|
379
379
|
machineconfig/setup_mac/__init__.py,sha256=Q1waupi5vCBroLqc8Rtnw69_7jLnm2Cs7_zH_GSZgMs,616
|
|
380
380
|
machineconfig/setup_mac/apps.sh,sha256=R0N6fBwLCzwy4qAormyMerXXXrHazibSkY6NrNOpTQU,2772
|
|
381
381
|
machineconfig/setup_mac/uv.sh,sha256=CSN8oCBKS-LK1vJJqYOhAMcrouTf4Q_F3cpplc_ddMA,1157
|
|
@@ -389,11 +389,11 @@ machineconfig/setup_windows/others/power_options.ps1,sha256=c7Hn94jBD5GWF29CxMhm
|
|
|
389
389
|
machineconfig/setup_windows/ssh/add-sshkey.ps1,sha256=qfPdqCpd9KP3VhH4ifsUm1Xvec7c0QVl4Wt8JIAm9HQ,1653
|
|
390
390
|
machineconfig/setup_windows/ssh/add_identity.ps1,sha256=b8ZXpmNUSw3IMYvqSY7ClpdWPG39FS7MefoWnRhWN2U,506
|
|
391
391
|
machineconfig/setup_windows/ssh/openssh-server.ps1,sha256=OMlYQdvuJQNxF5EILLPizB6BZAT3jAmDsv1WcVVxpFQ,2529
|
|
392
|
-
machineconfig/setup_windows/web_shortcuts/interactive.ps1,sha256=
|
|
392
|
+
machineconfig/setup_windows/web_shortcuts/interactive.ps1,sha256=r3WkAf0Br9MvsH5ow7tadkSyBAhOC8aL1AMR57jRCKo,581
|
|
393
393
|
machineconfig/setup_windows/wt_and_pwsh/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
394
394
|
machineconfig/setup_windows/wt_and_pwsh/set_wt_settings.py,sha256=ogxJnwpdcpH7N6dFJu95UCNoGYirZKQho_3X0F_hmXs,6791
|
|
395
395
|
machineconfig/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
396
|
-
machineconfig/utils/accessories.py,sha256=
|
|
396
|
+
machineconfig/utils/accessories.py,sha256=Rs8R0GUb2Ub6YimkgXHnI02CShS5BKlrZdCigVxfPlk,4339
|
|
397
397
|
machineconfig/utils/code.py,sha256=GWSaKwugLm-r11JA4bnkyrEe1ZyDw0L2mqiGyZqWbS8,5817
|
|
398
398
|
machineconfig/utils/installer.py,sha256=UzI_DtTcKbgvkAkWkNLAPUtx-RVqITHCpvZyLiCpD9g,10377
|
|
399
399
|
machineconfig/utils/io.py,sha256=4dSieoqZO8Vvi4vW8lLoITDHBvmFp4dtl3kyeZHQ6Co,2528
|
|
@@ -404,10 +404,10 @@ machineconfig/utils/options.py,sha256=vUO4Kej-vDOv64wHr2HNDyu6PATURpjd7xp6N8OOoJ
|
|
|
404
404
|
machineconfig/utils/path_extended.py,sha256=WyJwoHnXdvSQQJ-yrxTX78FpqYmgVeKDYpNEB9UsRck,53223
|
|
405
405
|
machineconfig/utils/path_helper.py,sha256=0e3Xh3BAEv27oqcezNeVLHJllGmLEgLH4T1l90m-650,8014
|
|
406
406
|
machineconfig/utils/procs.py,sha256=YPA_vEYQGwPd_o_Lc6nOTBo5BrB1tSs8PJ42XiGpenM,10957
|
|
407
|
-
machineconfig/utils/scheduler.py,sha256=
|
|
407
|
+
machineconfig/utils/scheduler.py,sha256=vOdkk1wHz3A0hF6bGJJ84AbprhqAEv-69Wf65qPLnuo,14861
|
|
408
408
|
machineconfig/utils/scheduling.py,sha256=6x5zLA7sY5gohrEtN6zGrXIqNFasMoyBfwLcOjrjiME,11109
|
|
409
409
|
machineconfig/utils/source_of_truth.py,sha256=ZAnCRltiM07ig--P6g9_6nEAvNFC4X4ERFTVcvpIYsE,764
|
|
410
|
-
machineconfig/utils/ssh.py,sha256=
|
|
410
|
+
machineconfig/utils/ssh.py,sha256=8LEH4n1H5CNEItuA3kWIc_B_doa9nieS31St7CWwkCo,38991
|
|
411
411
|
machineconfig/utils/terminal.py,sha256=VDgsjTjBmMGgZN0YIc0pJ8YksLDrBtiXON1EThy7_is,4264
|
|
412
412
|
machineconfig/utils/tst.py,sha256=6u1GI49NdcpxH2BYGAusNfY5q9G_ytCGVzFM5b6HYpM,674
|
|
413
413
|
machineconfig/utils/upgrade_packages.py,sha256=mSFyKvB3JhHte_x1dtmEgrJZCAXgTUQoaJUSx1OXQ3Y,4145
|
|
@@ -436,8 +436,8 @@ machineconfig/utils/schemas/installer/installer_types.py,sha256=QClRY61QaduBPJoS
|
|
|
436
436
|
machineconfig/utils/schemas/layouts/layout_types.py,sha256=TcqlZdGVoH8htG5fHn1KWXhRdPueAcoyApppZsPAPto,2020
|
|
437
437
|
machineconfig/utils/schemas/repos/repos_types.py,sha256=ECVr-3IVIo8yjmYmVXX2mnDDN1SLSwvQIhx4KDDQHBQ,405
|
|
438
438
|
machineconfig/utils/ssh_utils/utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
439
|
-
machineconfig-6.
|
|
440
|
-
machineconfig-6.
|
|
441
|
-
machineconfig-6.
|
|
442
|
-
machineconfig-6.
|
|
443
|
-
machineconfig-6.
|
|
439
|
+
machineconfig-6.67.dist-info/METADATA,sha256=pnBakIwJbF5CqCnGDgJikbFmsla3QmwkSY2n20edgx8,2928
|
|
440
|
+
machineconfig-6.67.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
441
|
+
machineconfig-6.67.dist-info/entry_points.txt,sha256=NTW7hbUlpt5Vx9DdQrONLkYMCuBXpvYh1dt0AtlGxeI,466
|
|
442
|
+
machineconfig-6.67.dist-info/top_level.txt,sha256=porRtB8qms8fOIUJgK-tO83_FeH6Bpe12oUVC670teA,14
|
|
443
|
+
machineconfig-6.67.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|