ominfra 0.0.0.dev156__tar.gz → 0.0.0.dev157__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {ominfra-0.0.0.dev156/ominfra.egg-info → ominfra-0.0.0.dev157}/PKG-INFO +3 -3
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/main.py +33 -4
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/remote/spawning.py +1 -6
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/scripts/journald2aws.py +3 -2
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/scripts/manage.py +946 -11
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/scripts/supervisor.py +44 -31
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/configs.py +2 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/supervisor.py +2 -33
- ominfra-0.0.0.dev157/ominfra/supervisor/utils/os.py +86 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157/ominfra.egg-info}/PKG-INFO +3 -3
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra.egg-info/requires.txt +2 -2
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/pyproject.toml +3 -3
- ominfra-0.0.0.dev156/ominfra/supervisor/utils/os.py +0 -45
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/LICENSE +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/MANIFEST.in +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/README.rst +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/.manifests.json +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/__about__.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/__init__.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/clouds/__init__.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/clouds/aws/__init__.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/clouds/aws/__main__.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/clouds/aws/auth.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/clouds/aws/cli.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/clouds/aws/dataclasses.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/clouds/aws/journald2aws/__init__.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/clouds/aws/journald2aws/__main__.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/clouds/aws/journald2aws/cursor.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/clouds/aws/journald2aws/driver.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/clouds/aws/journald2aws/main.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/clouds/aws/journald2aws/poster.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/clouds/aws/logs.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/clouds/aws/metadata.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/clouds/gcp/__init__.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/clouds/gcp/auth.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/cmds.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/configs.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/journald/__init__.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/journald/fields.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/journald/genmessages.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/journald/messages.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/journald/tailer.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/__init__.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/__main__.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/bootstrap.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/bootstrap_.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/commands/__init__.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/commands/base.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/commands/inject.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/commands/local.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/commands/marshal.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/commands/ping.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/commands/subprocess.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/commands/types.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/config.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/deploy/__init__.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/deploy/apps.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/deploy/commands.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/deploy/config.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/deploy/git.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/deploy/inject.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/deploy/interp.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/deploy/paths.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/deploy/types.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/deploy/venvs.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/inject.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/marshal.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/remote/__init__.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/remote/_main.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/remote/channel.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/remote/config.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/remote/connection.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/remote/execution.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/remote/inject.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/remote/payload.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/system/__init__.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/system/commands.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/system/config.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/system/inject.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/system/packages.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/system/platforms.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/targets/__init__.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/targets/connection.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/targets/inject.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/manage/targets/targets.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/pyremote.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/scripts/__init__.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/ssh.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/LICENSE.txt +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/__init__.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/__main__.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/dispatchers.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/dispatchersimpl.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/events.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/exceptions.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/groups.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/groupsimpl.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/http.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/inject.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/io.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/main.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/pipes.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/privileges.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/process.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/processimpl.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/setup.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/setupimpl.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/signals.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/spawning.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/spawningimpl.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/states.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/types.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/utils/__init__.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/utils/collections.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/utils/diag.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/utils/fds.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/utils/fs.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/utils/ostypes.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/utils/signals.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/utils/strings.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/supervisor/utils/users.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/tailscale/__init__.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/tailscale/api.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/tailscale/cli.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/threadworkers.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/tools/__init__.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra/tools/listresources.py +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra.egg-info/SOURCES.txt +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra.egg-info/dependency_links.txt +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra.egg-info/entry_points.txt +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/ominfra.egg-info/top_level.txt +0 -0
- {ominfra-0.0.0.dev156 → ominfra-0.0.0.dev157}/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.dev157
|
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.dev157
|
16
|
+
Requires-Dist: omlish==0.0.0.dev157
|
17
17
|
Provides-Extra: all
|
18
18
|
Requires-Dist: paramiko~=3.5; extra == "all"
|
19
19
|
Requires-Dist: asyncssh~=2.18; extra == "all"
|
@@ -6,18 +6,23 @@ 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
8
|
import asyncio
|
9
|
+
import dataclasses as dc
|
9
10
|
import json
|
11
|
+
import os.path
|
10
12
|
import sys
|
11
13
|
import typing as ta
|
12
14
|
|
13
15
|
from omlish.argparse.cli import ArgparseCli
|
14
16
|
from omlish.argparse.cli import argparse_arg
|
15
17
|
from omlish.argparse.cli import argparse_command
|
18
|
+
from omlish.lite.cached import cached_nullary
|
19
|
+
from omlish.lite.check import check
|
16
20
|
from omlish.lite.logs import log # noqa
|
17
21
|
from omlish.lite.marshal import ObjMarshalerManager
|
18
22
|
from omlish.lite.marshal import ObjMarshalOptions
|
19
23
|
from omlish.lite.pycharm import PycharmRemoteDebug
|
20
24
|
|
25
|
+
from ..configs import read_config_file
|
21
26
|
from .bootstrap import MainBootstrap
|
22
27
|
from .bootstrap_ import main_bootstrap
|
23
28
|
from .commands.base import Command
|
@@ -28,7 +33,28 @@ from .targets.connection import ManageTargetConnector
|
|
28
33
|
from .targets.targets import ManageTarget
|
29
34
|
|
30
35
|
|
36
|
+
@dc.dataclass(frozen=True)
|
37
|
+
class ManageConfig:
|
38
|
+
targets: ta.Optional[ta.Mapping[str, ManageTarget]] = None
|
39
|
+
|
40
|
+
|
31
41
|
class MainCli(ArgparseCli):
|
42
|
+
config_file: ta.Optional[str] = argparse_arg('--config-file', help='Config file path') # type: ignore
|
43
|
+
|
44
|
+
@cached_nullary
|
45
|
+
def config(self) -> ManageConfig:
|
46
|
+
if (cf := self.config_file) is None:
|
47
|
+
cf = os.path.expanduser('~/.omlish/manage.yml')
|
48
|
+
if not os.path.isfile(cf):
|
49
|
+
cf = None
|
50
|
+
|
51
|
+
if cf is None:
|
52
|
+
return ManageConfig()
|
53
|
+
else:
|
54
|
+
return read_config_file(cf, ManageConfig)
|
55
|
+
|
56
|
+
#
|
57
|
+
|
32
58
|
@argparse_command(
|
33
59
|
argparse_arg('--_payload-file'),
|
34
60
|
|
@@ -80,10 +106,13 @@ class MainCli(ArgparseCli):
|
|
80
106
|
|
81
107
|
msh = injector[ObjMarshalerManager]
|
82
108
|
|
83
|
-
|
84
|
-
if not ts.startswith('{'):
|
85
|
-
|
86
|
-
|
109
|
+
tgt: ManageTarget
|
110
|
+
if not (ts := self.args.target).startswith('{'):
|
111
|
+
tgt = check.not_none(self.config().targets)[ts]
|
112
|
+
else:
|
113
|
+
tgt = msh.unmarshal_obj(json.loads(ts), ManageTarget)
|
114
|
+
|
115
|
+
#
|
87
116
|
|
88
117
|
cmds: ta.List[Command] = []
|
89
118
|
cmd: Command
|
@@ -11,7 +11,6 @@ from omlish.lite.asyncio.subprocesses import asyncio_subprocesses
|
|
11
11
|
from omlish.lite.check import check
|
12
12
|
from omlish.lite.subprocesses import SUBPROCESS_CHANNEL_OPTION_VALUES
|
13
13
|
from omlish.lite.subprocesses import SubprocessChannelOption
|
14
|
-
from omlish.lite.subprocesses import subprocess_maybe_shell_wrap_exec
|
15
14
|
|
16
15
|
|
17
16
|
##
|
@@ -82,12 +81,8 @@ class SubprocessRemoteSpawning(RemoteSpawning):
|
|
82
81
|
) -> ta.AsyncGenerator[RemoteSpawning.Spawned, None]:
|
83
82
|
pc = self._prepare_cmd(tgt, src)
|
84
83
|
|
85
|
-
cmd = pc.cmd
|
86
|
-
if not debug:
|
87
|
-
cmd = subprocess_maybe_shell_wrap_exec(*cmd)
|
88
|
-
|
89
84
|
async with asyncio_subprocesses.popen(
|
90
|
-
*cmd,
|
85
|
+
*pc.cmd,
|
91
86
|
shell=pc.shell,
|
92
87
|
stdin=subprocess.PIPE,
|
93
88
|
stdout=subprocess.PIPE,
|
@@ -932,8 +932,8 @@ class _CachedNullary(_AbstractCachedNullary):
|
|
932
932
|
return self._value
|
933
933
|
|
934
934
|
|
935
|
-
def cached_nullary(fn
|
936
|
-
return _CachedNullary(fn)
|
935
|
+
def cached_nullary(fn: CallableT) -> CallableT:
|
936
|
+
return _CachedNullary(fn) # type: ignore
|
937
937
|
|
938
938
|
|
939
939
|
def static_init(fn: CallableT) -> CallableT:
|
@@ -2559,6 +2559,7 @@ TODO:
|
|
2559
2559
|
- pickle stdlib objs? have to pin to 3.8 pickle protocol, will be cross-version
|
2560
2560
|
- namedtuple
|
2561
2561
|
- literals
|
2562
|
+
- newtypes?
|
2562
2563
|
"""
|
2563
2564
|
|
2564
2565
|
|