ominfra 0.0.0.dev143__tar.gz → 0.0.0.dev144__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {ominfra-0.0.0.dev143/ominfra.egg-info → ominfra-0.0.0.dev144}/PKG-INFO +3 -3
- ominfra-0.0.0.dev144/ominfra/manage/deploy/command.py +23 -0
- ominfra-0.0.0.dev144/ominfra/manage/deploy/inject.py +19 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/manage/inject.py +3 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/manage/main.py +30 -16
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/scripts/manage.py +60 -15
- ominfra-0.0.0.dev144/ominfra/tools/__init__.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144/ominfra.egg-info}/PKG-INFO +3 -3
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra.egg-info/SOURCES.txt +3 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra.egg-info/requires.txt +2 -2
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/pyproject.toml +3 -3
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/LICENSE +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/MANIFEST.in +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/README.rst +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/.manifests.json +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/__about__.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/__init__.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/clouds/__init__.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/clouds/aws/__init__.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/clouds/aws/__main__.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/clouds/aws/auth.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/clouds/aws/cli.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/clouds/aws/dataclasses.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/clouds/aws/journald2aws/__init__.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/clouds/aws/journald2aws/__main__.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/clouds/aws/journald2aws/cursor.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/clouds/aws/journald2aws/driver.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/clouds/aws/journald2aws/main.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/clouds/aws/journald2aws/poster.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/clouds/aws/logs.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/clouds/aws/metadata.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/clouds/gcp/__init__.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/clouds/gcp/auth.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/cmds.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/configs.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/journald/__init__.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/journald/fields.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/journald/genmessages.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/journald/messages.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/journald/tailer.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/manage/__init__.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/manage/__main__.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/manage/bootstrap.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/manage/bootstrap_.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/manage/commands/__init__.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/manage/commands/base.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/manage/commands/execution.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/manage/commands/inject.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/manage/commands/marshal.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/manage/commands/subprocess.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/manage/config.py +0 -0
- {ominfra-0.0.0.dev143/ominfra/manage/remote → ominfra-0.0.0.dev144/ominfra/manage/deploy}/__init__.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/manage/marshal.py +0 -0
- {ominfra-0.0.0.dev143/ominfra/scripts → ominfra-0.0.0.dev144/ominfra/manage/remote}/__init__.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/manage/remote/channel.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/manage/remote/config.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/manage/remote/execution.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/manage/remote/inject.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/manage/remote/payload.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/manage/remote/spawning.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/pyremote.py +0 -0
- {ominfra-0.0.0.dev143/ominfra/supervisor/utils → ominfra-0.0.0.dev144/ominfra/scripts}/__init__.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/scripts/journald2aws.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/scripts/supervisor.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/ssh.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/LICENSE.txt +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/__init__.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/__main__.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/configs.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/dispatchers.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/dispatchersimpl.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/events.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/exceptions.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/groups.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/groupsimpl.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/http.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/inject.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/io.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/main.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/pipes.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/privileges.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/process.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/processimpl.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/setup.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/setupimpl.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/signals.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/spawning.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/spawningimpl.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/states.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/supervisor.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/types.py +0 -0
- {ominfra-0.0.0.dev143/ominfra/tailscale → ominfra-0.0.0.dev144/ominfra/supervisor/utils}/__init__.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/utils/collections.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/utils/diag.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/utils/fds.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/utils/fs.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/utils/os.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/utils/ostypes.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/utils/signals.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/utils/strings.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/supervisor/utils/users.py +0 -0
- {ominfra-0.0.0.dev143/ominfra/tools → ominfra-0.0.0.dev144/ominfra/tailscale}/__init__.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/tailscale/api.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/tailscale/cli.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/threadworkers.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra/tools/listresources.py +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra.egg-info/dependency_links.txt +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra.egg-info/entry_points.txt +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/ominfra.egg-info/top_level.txt +0 -0
- {ominfra-0.0.0.dev143 → ominfra-0.0.0.dev144}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ominfra
|
3
|
-
Version: 0.0.0.
|
3
|
+
Version: 0.0.0.dev144
|
4
4
|
Summary: ominfra
|
5
5
|
Author: wrmsr
|
6
6
|
License: BSD-3-Clause
|
@@ -12,8 +12,8 @@ Classifier: Operating System :: OS Independent
|
|
12
12
|
Classifier: Operating System :: POSIX
|
13
13
|
Requires-Python: >=3.12
|
14
14
|
License-File: LICENSE
|
15
|
-
Requires-Dist: omdev==0.0.0.
|
16
|
-
Requires-Dist: omlish==0.0.0.
|
15
|
+
Requires-Dist: omdev==0.0.0.dev144
|
16
|
+
Requires-Dist: omlish==0.0.0.dev144
|
17
17
|
Provides-Extra: all
|
18
18
|
Requires-Dist: paramiko~=3.5; extra == "all"
|
19
19
|
Requires-Dist: asyncssh~=2.18; extra == "all"
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# ruff: noqa: UP006 UP007
|
2
|
+
import dataclasses as dc
|
3
|
+
|
4
|
+
from ..commands.base import Command
|
5
|
+
from ..commands.base import CommandExecutor
|
6
|
+
|
7
|
+
|
8
|
+
##
|
9
|
+
|
10
|
+
|
11
|
+
@dc.dataclass(frozen=True)
|
12
|
+
class DeployCommand(Command['DeployCommand.Output']):
|
13
|
+
@dc.dataclass(frozen=True)
|
14
|
+
class Output(Command.Output):
|
15
|
+
pass
|
16
|
+
|
17
|
+
|
18
|
+
##
|
19
|
+
|
20
|
+
|
21
|
+
class DeployCommandExecutor(CommandExecutor[DeployCommand, DeployCommand.Output]):
|
22
|
+
def execute(self, cmd: DeployCommand) -> DeployCommand.Output:
|
23
|
+
return DeployCommand.Output()
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# ruff: noqa: UP006 UP007
|
2
|
+
import typing as ta
|
3
|
+
|
4
|
+
from omlish.lite.inject import InjectorBindingOrBindings
|
5
|
+
from omlish.lite.inject import InjectorBindings
|
6
|
+
from omlish.lite.inject import inj
|
7
|
+
|
8
|
+
from ..commands.inject import bind_command
|
9
|
+
from .command import DeployCommand
|
10
|
+
from .command import DeployCommandExecutor
|
11
|
+
|
12
|
+
|
13
|
+
def bind_deploy(
|
14
|
+
) -> InjectorBindings:
|
15
|
+
lst: ta.List[InjectorBindingOrBindings] = [
|
16
|
+
bind_command(DeployCommand, DeployCommandExecutor),
|
17
|
+
]
|
18
|
+
|
19
|
+
return inj.as_bindings(*lst)
|
@@ -8,6 +8,7 @@ from omlish.lite.marshal import ObjMarshalerManager
|
|
8
8
|
|
9
9
|
from .commands.inject import bind_commands
|
10
10
|
from .config import MainConfig
|
11
|
+
from .deploy.inject import bind_deploy
|
11
12
|
from .marshal import ObjMarshalerInstaller
|
12
13
|
from .marshal import ObjMarshalerInstallers
|
13
14
|
from .remote.config import RemoteConfig
|
@@ -32,6 +33,8 @@ def bind_main(
|
|
32
33
|
bind_remote(
|
33
34
|
remote_config=remote_config,
|
34
35
|
),
|
36
|
+
|
37
|
+
bind_deploy(),
|
35
38
|
]
|
36
39
|
|
37
40
|
#
|
@@ -5,15 +5,21 @@
|
|
5
5
|
manage.py -s 'docker run -i python:3.12'
|
6
6
|
manage.py -s 'ssh -i /foo/bar.pem foo@bar.baz' -q --python=python3.8
|
7
7
|
"""
|
8
|
+
import contextlib
|
9
|
+
import typing as ta
|
10
|
+
|
8
11
|
from omlish.lite.logs import log # noqa
|
9
|
-
from omlish.lite.marshal import ObjMarshalOptions
|
10
12
|
from omlish.lite.marshal import ObjMarshalerManager
|
13
|
+
from omlish.lite.marshal import ObjMarshalOptions
|
11
14
|
from omlish.lite.pycharm import PycharmRemoteDebug
|
12
15
|
|
13
16
|
from .bootstrap import MainBootstrap
|
14
17
|
from .bootstrap_ import main_bootstrap
|
18
|
+
from .commands.base import Command
|
19
|
+
from .commands.base import CommandExecutor
|
15
20
|
from .commands.subprocess import SubprocessCommand
|
16
21
|
from .config import MainConfig
|
22
|
+
from .deploy.command import DeployCommand
|
17
23
|
from .remote.config import RemoteConfig
|
18
24
|
from .remote.execution import RemoteExecution
|
19
25
|
from .remote.spawning import RemoteSpawning
|
@@ -39,6 +45,8 @@ def _main() -> None:
|
|
39
45
|
|
40
46
|
parser.add_argument('--debug', action='store_true')
|
41
47
|
|
48
|
+
parser.add_argument('--local', action='store_true')
|
49
|
+
|
42
50
|
parser.add_argument('command', nargs='+')
|
43
51
|
|
44
52
|
args = parser.parse_args()
|
@@ -69,28 +77,34 @@ def _main() -> None:
|
|
69
77
|
|
70
78
|
#
|
71
79
|
|
72
|
-
cmds = [
|
73
|
-
|
74
|
-
|
75
|
-
|
80
|
+
cmds: ta.List[Command] = []
|
81
|
+
for c in args.command:
|
82
|
+
if c == 'deploy':
|
83
|
+
cmds.append(DeployCommand())
|
84
|
+
else:
|
85
|
+
cmds.append(SubprocessCommand([c]))
|
76
86
|
|
77
87
|
#
|
78
88
|
|
79
|
-
|
80
|
-
|
81
|
-
shell_quote=args.shell_quote,
|
82
|
-
python=args.python,
|
83
|
-
)
|
89
|
+
with contextlib.ExitStack() as es:
|
90
|
+
ce: CommandExecutor
|
84
91
|
|
85
|
-
|
86
|
-
|
87
|
-
r = rce.try_execute(cmd)
|
92
|
+
if args.local:
|
93
|
+
ce = injector[CommandExecutor]
|
88
94
|
|
89
|
-
|
95
|
+
else:
|
96
|
+
tgt = RemoteSpawning.Target(
|
97
|
+
shell=args.shell,
|
98
|
+
shell_quote=args.shell_quote,
|
99
|
+
python=args.python,
|
100
|
+
)
|
90
101
|
|
91
|
-
|
102
|
+
ce = es.enter_context(injector[RemoteExecution].connect(tgt, bs)) # noqa
|
92
103
|
|
93
|
-
|
104
|
+
for cmd in cmds:
|
105
|
+
r = ce.try_execute(cmd)
|
106
|
+
|
107
|
+
print(injector[ObjMarshalerManager].marshal_obj(r, opts=ObjMarshalOptions(raw_bytes=True)))
|
94
108
|
|
95
109
|
|
96
110
|
if __name__ == '__main__':
|
@@ -2807,6 +2807,28 @@ def install_command_marshaling(
|
|
2807
2807
|
)
|
2808
2808
|
|
2809
2809
|
|
2810
|
+
########################################
|
2811
|
+
# ../deploy/command.py
|
2812
|
+
|
2813
|
+
|
2814
|
+
##
|
2815
|
+
|
2816
|
+
|
2817
|
+
@dc.dataclass(frozen=True)
|
2818
|
+
class DeployCommand(Command['DeployCommand.Output']):
|
2819
|
+
@dc.dataclass(frozen=True)
|
2820
|
+
class Output(Command.Output):
|
2821
|
+
pass
|
2822
|
+
|
2823
|
+
|
2824
|
+
##
|
2825
|
+
|
2826
|
+
|
2827
|
+
class DeployCommandExecutor(CommandExecutor[DeployCommand, DeployCommand.Output]):
|
2828
|
+
def execute(self, cmd: DeployCommand) -> DeployCommand.Output:
|
2829
|
+
return DeployCommand.Output()
|
2830
|
+
|
2831
|
+
|
2810
2832
|
########################################
|
2811
2833
|
# ../marshal.py
|
2812
2834
|
|
@@ -3423,6 +3445,19 @@ class RemoteExecution:
|
|
3423
3445
|
yield RemoteCommandExecutor(chan)
|
3424
3446
|
|
3425
3447
|
|
3448
|
+
########################################
|
3449
|
+
# ../deploy/inject.py
|
3450
|
+
|
3451
|
+
|
3452
|
+
def bind_deploy(
|
3453
|
+
) -> InjectorBindings:
|
3454
|
+
lst: ta.List[InjectorBindingOrBindings] = [
|
3455
|
+
bind_command(DeployCommand, DeployCommandExecutor),
|
3456
|
+
]
|
3457
|
+
|
3458
|
+
return inj.as_bindings(*lst)
|
3459
|
+
|
3460
|
+
|
3426
3461
|
########################################
|
3427
3462
|
# ../remote/inject.py
|
3428
3463
|
|
@@ -3467,6 +3502,8 @@ def bind_main(
|
|
3467
3502
|
bind_remote(
|
3468
3503
|
remote_config=remote_config,
|
3469
3504
|
),
|
3505
|
+
|
3506
|
+
bind_deploy(),
|
3470
3507
|
]
|
3471
3508
|
|
3472
3509
|
#
|
@@ -3530,6 +3567,8 @@ def _main() -> None:
|
|
3530
3567
|
|
3531
3568
|
parser.add_argument('--debug', action='store_true')
|
3532
3569
|
|
3570
|
+
parser.add_argument('--local', action='store_true')
|
3571
|
+
|
3533
3572
|
parser.add_argument('command', nargs='+')
|
3534
3573
|
|
3535
3574
|
args = parser.parse_args()
|
@@ -3560,28 +3599,34 @@ def _main() -> None:
|
|
3560
3599
|
|
3561
3600
|
#
|
3562
3601
|
|
3563
|
-
cmds = [
|
3564
|
-
|
3565
|
-
|
3566
|
-
|
3602
|
+
cmds: ta.List[Command] = []
|
3603
|
+
for c in args.command:
|
3604
|
+
if c == 'deploy':
|
3605
|
+
cmds.append(DeployCommand())
|
3606
|
+
else:
|
3607
|
+
cmds.append(SubprocessCommand([c]))
|
3567
3608
|
|
3568
3609
|
#
|
3569
3610
|
|
3570
|
-
|
3571
|
-
|
3572
|
-
shell_quote=args.shell_quote,
|
3573
|
-
python=args.python,
|
3574
|
-
)
|
3611
|
+
with contextlib.ExitStack() as es:
|
3612
|
+
ce: CommandExecutor
|
3575
3613
|
|
3576
|
-
|
3577
|
-
|
3578
|
-
r = rce.try_execute(cmd)
|
3614
|
+
if args.local:
|
3615
|
+
ce = injector[CommandExecutor]
|
3579
3616
|
|
3580
|
-
|
3617
|
+
else:
|
3618
|
+
tgt = RemoteSpawning.Target(
|
3619
|
+
shell=args.shell,
|
3620
|
+
shell_quote=args.shell_quote,
|
3621
|
+
python=args.python,
|
3622
|
+
)
|
3581
3623
|
|
3582
|
-
|
3624
|
+
ce = es.enter_context(injector[RemoteExecution].connect(tgt, bs)) # noqa
|
3583
3625
|
|
3584
|
-
|
3626
|
+
for cmd in cmds:
|
3627
|
+
r = ce.try_execute(cmd)
|
3628
|
+
|
3629
|
+
print(injector[ObjMarshalerManager].marshal_obj(r, opts=ObjMarshalOptions(raw_bytes=True)))
|
3585
3630
|
|
3586
3631
|
|
3587
3632
|
if __name__ == '__main__':
|
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ominfra
|
3
|
-
Version: 0.0.0.
|
3
|
+
Version: 0.0.0.dev144
|
4
4
|
Summary: ominfra
|
5
5
|
Author: wrmsr
|
6
6
|
License: BSD-3-Clause
|
@@ -12,8 +12,8 @@ Classifier: Operating System :: OS Independent
|
|
12
12
|
Classifier: Operating System :: POSIX
|
13
13
|
Requires-Python: >=3.12
|
14
14
|
License-File: LICENSE
|
15
|
-
Requires-Dist: omdev==0.0.0.
|
16
|
-
Requires-Dist: omlish==0.0.0.
|
15
|
+
Requires-Dist: omdev==0.0.0.dev144
|
16
|
+
Requires-Dist: omlish==0.0.0.dev144
|
17
17
|
Provides-Extra: all
|
18
18
|
Requires-Dist: paramiko~=3.5; extra == "all"
|
19
19
|
Requires-Dist: asyncssh~=2.18; extra == "all"
|
@@ -51,6 +51,9 @@ ominfra/manage/commands/execution.py
|
|
51
51
|
ominfra/manage/commands/inject.py
|
52
52
|
ominfra/manage/commands/marshal.py
|
53
53
|
ominfra/manage/commands/subprocess.py
|
54
|
+
ominfra/manage/deploy/__init__.py
|
55
|
+
ominfra/manage/deploy/command.py
|
56
|
+
ominfra/manage/deploy/inject.py
|
54
57
|
ominfra/manage/remote/__init__.py
|
55
58
|
ominfra/manage/remote/channel.py
|
56
59
|
ominfra/manage/remote/config.py
|
@@ -12,7 +12,7 @@ authors = [
|
|
12
12
|
urls = {source = 'https://github.com/wrmsr/omlish'}
|
13
13
|
license = {text = 'BSD-3-Clause'}
|
14
14
|
requires-python = '>=3.12'
|
15
|
-
version = '0.0.0.
|
15
|
+
version = '0.0.0.dev144'
|
16
16
|
classifiers = [
|
17
17
|
'License :: OSI Approved :: BSD License',
|
18
18
|
'Development Status :: 2 - Pre-Alpha',
|
@@ -22,8 +22,8 @@ classifiers = [
|
|
22
22
|
]
|
23
23
|
description = 'ominfra'
|
24
24
|
dependencies = [
|
25
|
-
'omdev == 0.0.0.
|
26
|
-
'omlish == 0.0.0.
|
25
|
+
'omdev == 0.0.0.dev144',
|
26
|
+
'omlish == 0.0.0.dev144',
|
27
27
|
]
|
28
28
|
|
29
29
|
[project.optional-dependencies]
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ominfra-0.0.0.dev143/ominfra/scripts → ominfra-0.0.0.dev144/ominfra/manage/remote}/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ominfra-0.0.0.dev143/ominfra/supervisor/utils → ominfra-0.0.0.dev144/ominfra/scripts}/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ominfra-0.0.0.dev143/ominfra/tailscale → ominfra-0.0.0.dev144/ominfra/supervisor/utils}/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|