ominfra 0.0.0.dev190__py3-none-any.whl → 0.0.0.dev192__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- ominfra/manage/deploy/apps.py +82 -3
- ominfra/manage/deploy/conf/manager.py +70 -7
- ominfra/manage/deploy/deploy.py +127 -32
- ominfra/manage/deploy/git.py +3 -1
- ominfra/manage/deploy/specs.py +11 -0
- ominfra/manage/deploy/systemd.py +49 -27
- ominfra/manage/deploy/tags.py +1 -1
- ominfra/manage/deploy/venvs.py +8 -4
- ominfra/scripts/manage.py +337 -74
- ominfra/scripts/supervisor.py +18 -9
- ominfra/supervisor/configs.py +6 -0
- ominfra/supervisor/http.py +1 -1
- ominfra/supervisor/inject.py +11 -8
- ominfra/systemd.py +49 -0
- {ominfra-0.0.0.dev190.dist-info → ominfra-0.0.0.dev192.dist-info}/METADATA +4 -4
- {ominfra-0.0.0.dev190.dist-info → ominfra-0.0.0.dev192.dist-info}/RECORD +20 -19
- {ominfra-0.0.0.dev190.dist-info → ominfra-0.0.0.dev192.dist-info}/LICENSE +0 -0
- {ominfra-0.0.0.dev190.dist-info → ominfra-0.0.0.dev192.dist-info}/WHEEL +0 -0
- {ominfra-0.0.0.dev190.dist-info → ominfra-0.0.0.dev192.dist-info}/entry_points.txt +0 -0
- {ominfra-0.0.0.dev190.dist-info → ominfra-0.0.0.dev192.dist-info}/top_level.txt +0 -0
ominfra/scripts/supervisor.py
CHANGED
@@ -6481,6 +6481,12 @@ class ServerConfig:
|
|
6481
6481
|
# TODO: implement - make sure to accept broken symlinks
|
6482
6482
|
group_config_dirs: ta.Optional[ta.Sequence[str]] = None
|
6483
6483
|
|
6484
|
+
#
|
6485
|
+
|
6486
|
+
http_port: ta.Optional[int] = None
|
6487
|
+
|
6488
|
+
#
|
6489
|
+
|
6484
6490
|
@classmethod
|
6485
6491
|
def new(
|
6486
6492
|
cls,
|
@@ -8354,7 +8360,7 @@ class HttpServer(HasDispatchers):
|
|
8354
8360
|
def __init__(
|
8355
8361
|
self,
|
8356
8362
|
handler: Handler,
|
8357
|
-
addr: Address = Address(('localhost', 8000)),
|
8363
|
+
addr: Address, # = Address(('localhost', 8000)),
|
8358
8364
|
*,
|
8359
8365
|
exit_stack: contextlib.ExitStack,
|
8360
8366
|
) -> None:
|
@@ -9617,16 +9623,19 @@ def bind_server(
|
|
9617
9623
|
|
9618
9624
|
#
|
9619
9625
|
|
9620
|
-
|
9621
|
-
|
9626
|
+
if config.http_port is not None:
|
9627
|
+
def _provide_http_handler(s: SupervisorHttpHandler) -> HttpServer.Handler:
|
9628
|
+
return HttpServer.Handler(s.handle)
|
9622
9629
|
|
9623
|
-
|
9624
|
-
|
9625
|
-
|
9630
|
+
lst.extend([
|
9631
|
+
inj.bind(HttpServer, singleton=True, eager=True),
|
9632
|
+
inj.bind(HasDispatchers, array=True, to_key=HttpServer),
|
9626
9633
|
|
9627
|
-
|
9628
|
-
|
9629
|
-
|
9634
|
+
inj.bind(HttpServer.Address(('localhost', config.http_port))),
|
9635
|
+
|
9636
|
+
inj.bind(SupervisorHttpHandler, singleton=True),
|
9637
|
+
inj.bind(_provide_http_handler),
|
9638
|
+
])
|
9630
9639
|
|
9631
9640
|
#
|
9632
9641
|
|
ominfra/supervisor/configs.py
CHANGED
@@ -248,6 +248,12 @@ class ServerConfig:
|
|
248
248
|
# TODO: implement - make sure to accept broken symlinks
|
249
249
|
group_config_dirs: ta.Optional[ta.Sequence[str]] = None
|
250
250
|
|
251
|
+
#
|
252
|
+
|
253
|
+
http_port: ta.Optional[int] = None
|
254
|
+
|
255
|
+
#
|
256
|
+
|
251
257
|
@classmethod
|
252
258
|
def new(
|
253
259
|
cls,
|
ominfra/supervisor/http.py
CHANGED
ominfra/supervisor/inject.py
CHANGED
@@ -131,16 +131,19 @@ def bind_server(
|
|
131
131
|
|
132
132
|
#
|
133
133
|
|
134
|
-
|
135
|
-
|
134
|
+
if config.http_port is not None:
|
135
|
+
def _provide_http_handler(s: SupervisorHttpHandler) -> HttpServer.Handler:
|
136
|
+
return HttpServer.Handler(s.handle)
|
136
137
|
|
137
|
-
|
138
|
-
|
139
|
-
|
138
|
+
lst.extend([
|
139
|
+
inj.bind(HttpServer, singleton=True, eager=True),
|
140
|
+
inj.bind(HasDispatchers, array=True, to_key=HttpServer),
|
140
141
|
|
141
|
-
|
142
|
-
|
143
|
-
|
142
|
+
inj.bind(HttpServer.Address(('localhost', config.http_port))),
|
143
|
+
|
144
|
+
inj.bind(SupervisorHttpHandler, singleton=True),
|
145
|
+
inj.bind(_provide_http_handler),
|
146
|
+
])
|
144
147
|
|
145
148
|
#
|
146
149
|
|
ominfra/systemd.py
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# ruff: noqa: UP006 UP007
|
2
|
+
# @omlish-lite
|
3
|
+
import dataclasses as dc
|
4
|
+
import typing as ta
|
5
|
+
|
6
|
+
|
7
|
+
##
|
8
|
+
|
9
|
+
|
10
|
+
@dc.dataclass(frozen=True)
|
11
|
+
class SystemdListUnit:
|
12
|
+
unit: str
|
13
|
+
load: str # loaded, not-found
|
14
|
+
active: str # active, inactive
|
15
|
+
sub: str # running, exited, dead
|
16
|
+
description: str
|
17
|
+
|
18
|
+
@classmethod
|
19
|
+
def parse(cls, s: str) -> 'SystemdListUnit':
|
20
|
+
return SystemdListUnit(*[p.strip() for p in s.strip().split(None, 4)])
|
21
|
+
|
22
|
+
@classmethod
|
23
|
+
def parse_all(cls, s: str) -> ta.List['SystemdListUnit']:
|
24
|
+
return [
|
25
|
+
cls.parse(sl)
|
26
|
+
for l in s.strip().splitlines()
|
27
|
+
if (sl := l.strip())
|
28
|
+
]
|
29
|
+
|
30
|
+
|
31
|
+
PARSABLE_SYSTEMD_LIST_UNIT_ARGS: ta.Sequence[str] = [
|
32
|
+
'--all',
|
33
|
+
'--no-legend',
|
34
|
+
'--no-pager',
|
35
|
+
'--plain',
|
36
|
+
]
|
37
|
+
|
38
|
+
|
39
|
+
##
|
40
|
+
|
41
|
+
|
42
|
+
def parse_systemd_show_output(s: str) -> ta.Mapping[str, str]:
|
43
|
+
d: ta.Dict[str, str] = {}
|
44
|
+
for l in s.strip().splitlines():
|
45
|
+
if not (l := l.strip()):
|
46
|
+
continue
|
47
|
+
k, _, v = l.partition('=')
|
48
|
+
d[k] = v
|
49
|
+
return d
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ominfra
|
3
|
-
Version: 0.0.0.
|
3
|
+
Version: 0.0.0.dev192
|
4
4
|
Summary: ominfra
|
5
5
|
Author: wrmsr
|
6
6
|
License: BSD-3-Clause
|
@@ -12,9 +12,9 @@ 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.
|
17
|
-
Requires-Dist: omserv==0.0.0.
|
15
|
+
Requires-Dist: omdev==0.0.0.dev192
|
16
|
+
Requires-Dist: omlish==0.0.0.dev192
|
17
|
+
Requires-Dist: omserv==0.0.0.dev192
|
18
18
|
Provides-Extra: all
|
19
19
|
Requires-Dist: paramiko~=3.5; extra == "all"
|
20
20
|
Requires-Dist: asyncssh~=2.18; extra == "all"
|
@@ -5,6 +5,7 @@ ominfra/cmds.py,sha256=E0AfnvEmnKntXWvmLW5L05_NeDpBET1VBXn7vV6EwBQ,2083
|
|
5
5
|
ominfra/configs.py,sha256=UrwZrzsnU4E305OoFH_eAcyI8e82LQZ2yhy8WnuAUGM,3055
|
6
6
|
ominfra/pyremote.py,sha256=HLfAZl3Xw5CpxLS5PS380zqCyE7n3vKVksIYT2Fbdc8,15197
|
7
7
|
ominfra/ssh.py,sha256=jQpc4WvkMckIfk4vILda8zFaeharRqc_6wxW50b0OjQ,5431
|
8
|
+
ominfra/systemd.py,sha256=d61NVrJoItzSaqhMDgKGrQjbrxEVAujUMDsj8WggXos,1022
|
8
9
|
ominfra/threadworkers.py,sha256=oX4ubZn7h932saXpRIJu2MNhBExgGGMuGhdXarZxLJw,4948
|
9
10
|
ominfra/clouds/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
11
|
ominfra/clouds/aws/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -44,24 +45,24 @@ ominfra/manage/commands/ping.py,sha256=DVZFzL1Z_f-Bq53vxMrL3xOi0iK_nMonJE4KvQf9w
|
|
44
45
|
ominfra/manage/commands/subprocess.py,sha256=yHGMbAI-xKe_9BUs5IZ3Yav8qRE-I9aGnBtTwW15Pnw,2440
|
45
46
|
ominfra/manage/commands/types.py,sha256=XFZPeqeIBAaIIQF3pdPbGxLlb-LCrz6WtlDWO2q_vz0,210
|
46
47
|
ominfra/manage/deploy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
47
|
-
ominfra/manage/deploy/apps.py,sha256=
|
48
|
+
ominfra/manage/deploy/apps.py,sha256=T0eU0Jw-h33_ZPIs0zy9DOx_fgs3YSAAGzu-H0pvt2U,4865
|
48
49
|
ominfra/manage/deploy/commands.py,sha256=OVZzSY4EP_SD7KJRkIIPeqUxcV4mcwrc_WYNvM16ahM,830
|
49
50
|
ominfra/manage/deploy/config.py,sha256=kPpl8TRisz295cM4oj-RHA6oh5jdcJ_N9pVpkl_doO8,114
|
50
|
-
ominfra/manage/deploy/deploy.py,sha256=
|
51
|
-
ominfra/manage/deploy/git.py,sha256=
|
51
|
+
ominfra/manage/deploy/deploy.py,sha256=YRr_0OPIZJ9LnOeMaHYCSSvqh81a5_LB7OZy-bR2GeA,8966
|
52
|
+
ominfra/manage/deploy/git.py,sha256=AnZCUuJt9infrWLAgxwELSEJVkDACNwQCen2Qi81-IA,4047
|
52
53
|
ominfra/manage/deploy/inject.py,sha256=lVNik0CfQMd31fiqzFlM828oQKVUTJY-zTmU1pGOopQ,3467
|
53
54
|
ominfra/manage/deploy/inject_.py,sha256=LR7gEkVx2ldUoQZsGvIcm1Y4QXCVDnLIAdc3LHhQiD4,392
|
54
55
|
ominfra/manage/deploy/interp.py,sha256=_5fuHrY5ZA0eGbnNcOqAhAMSWI1UNvbm0l29eDjE5fI,1037
|
55
56
|
ominfra/manage/deploy/nginx.py,sha256=cU9GjWMSxqeNhbuSBZYRuBXUokiRiY4OWMLAgbj_4m4,89
|
56
|
-
ominfra/manage/deploy/specs.py,sha256=
|
57
|
-
ominfra/manage/deploy/systemd.py,sha256=
|
58
|
-
ominfra/manage/deploy/tags.py,sha256=
|
57
|
+
ominfra/manage/deploy/specs.py,sha256=0mZnMeMYLChcryXQhQ1V72zr8ooCWaw9AMvnPVJBZFE,2866
|
58
|
+
ominfra/manage/deploy/systemd.py,sha256=5hJ6d2zT24zBMUkuJwkhsvm7r4MqNBtm4_ov0kF2Jus,3612
|
59
|
+
ominfra/manage/deploy/tags.py,sha256=h2kJEmizzeKcn7hG-oKnakCquS87xw8EPb2nkB-XkaI,5118
|
59
60
|
ominfra/manage/deploy/tmp.py,sha256=FqXoVpIpVe8-KWNu7kXt37A4jKdK_y7h_YFvtrUoOG8,729
|
60
61
|
ominfra/manage/deploy/types.py,sha256=ZcIoheZ3zW7n0IZiqTRW_Uo3JyWWeWg5nyKGryvGc2I,112
|
61
|
-
ominfra/manage/deploy/venvs.py,sha256=
|
62
|
+
ominfra/manage/deploy/venvs.py,sha256=PlvhyhZavgiSwGt8BXrhoSwQFVKpU0zCtq2C2N1_8Ak,1696
|
62
63
|
ominfra/manage/deploy/conf/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
63
64
|
ominfra/manage/deploy/conf/inject.py,sha256=xHZQr7oaJCxaKgpJ0H-hgiQNGt4QsskhT3f5v7xrFwE,451
|
64
|
-
ominfra/manage/deploy/conf/manager.py,sha256=
|
65
|
+
ominfra/manage/deploy/conf/manager.py,sha256=ZJPwLuly5Jwd6-42umv_hDNr3J86zNrZkNU-RuM0ees,8302
|
65
66
|
ominfra/manage/deploy/conf/specs.py,sha256=AWeofV1YbcNZS-7WX7EpsX8i_7stJAXndXktB6fDWw8,2187
|
66
67
|
ominfra/manage/deploy/paths/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
67
68
|
ominfra/manage/deploy/paths/inject.py,sha256=X81C-Qhef1LQ7tILWvkomBwFTvgooLVmWRnKL7TeVoI,596
|
@@ -93,20 +94,20 @@ ominfra/manage/targets/inject.py,sha256=P4597xWM-V3I_gCt2O71OLhYQkkXtuJvkYRsIbhh
|
|
93
94
|
ominfra/manage/targets/targets.py,sha256=7GP6UAZyJFEhpkJN6UQdpr_WN3p7C76v-s445y-WB6U,1885
|
94
95
|
ominfra/scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
95
96
|
ominfra/scripts/journald2aws.py,sha256=jxBI2ETft-GMJn0hFwV_lZgT55tj2kqKl0PszxUkOg8,158938
|
96
|
-
ominfra/scripts/manage.py,sha256=
|
97
|
-
ominfra/scripts/supervisor.py,sha256=
|
97
|
+
ominfra/scripts/manage.py,sha256=_C2fwegFHqx7OK0dfPZ631HwZHYfCYubi24sDHwSk4U,346082
|
98
|
+
ominfra/scripts/supervisor.py,sha256=5Nskq1fVdgwXvRXojDmkMO3JlcfQkxOwJ5vgexFi9EE,283429
|
98
99
|
ominfra/supervisor/LICENSE.txt,sha256=yvqaMNsDhWxziHa9ien6qCW1SkZv-DQlAg96XjfSee8,1746
|
99
100
|
ominfra/supervisor/__init__.py,sha256=Y3l4WY4JRi2uLG6kgbGp93fuGfkxkKwZDvhsa0Rwgtk,15
|
100
101
|
ominfra/supervisor/__main__.py,sha256=I0yFw-C08OOiZ3BF6lF1Oiv789EQXu-_j6whDhQUTEA,66
|
101
|
-
ominfra/supervisor/configs.py,sha256=
|
102
|
+
ominfra/supervisor/configs.py,sha256=rA32edDnkfcUYSUPVRG4QIoGwCvnhstaNN2jTXvoqt4,13825
|
102
103
|
ominfra/supervisor/dispatchers.py,sha256=zXLwQS4Vc6dWw5o9QOL04UMDt7w6CKu9wf19CjUiS2Q,1005
|
103
104
|
ominfra/supervisor/dispatchersimpl.py,sha256=q3dEyOHWTPKm28nmAGisjgIW1BX6O3-SzbYa7nWuTEs,11349
|
104
105
|
ominfra/supervisor/events.py,sha256=XGrtzHr1xm0dwjz329fn9eR0_Ap-LQL6Sk8LJ8eVDEo,6692
|
105
106
|
ominfra/supervisor/exceptions.py,sha256=Qbu211H3CLlSmi9LsSikOwrcL5HgJP9ugvcKWlGTAoI,750
|
106
107
|
ominfra/supervisor/groups.py,sha256=MBbsbt8Zh_WEYkGOr1KXa82gnPVw9wPB2lAnqhugXSc,2457
|
107
108
|
ominfra/supervisor/groupsimpl.py,sha256=PCDyc_Wc-pnvIj56_aEyiA5exCpK6n9iErqnJzO2rZk,2281
|
108
|
-
ominfra/supervisor/http.py,sha256=
|
109
|
-
ominfra/supervisor/inject.py,sha256=
|
109
|
+
ominfra/supervisor/http.py,sha256=Tl5eT6dyf4KuQXKbhGo1B6CFEzUDtPl_DZAuUFVD9zI,3453
|
110
|
+
ominfra/supervisor/inject.py,sha256=IeR-WKvK1sGNxMe6G2OBT5kSP7EUP5ipkDgcUFmDPCA,4838
|
110
111
|
ominfra/supervisor/io.py,sha256=moaGNaPuYXEAUzLg8Qjo05DEIcOUNYUj8SSr8eT0d24,3198
|
111
112
|
ominfra/supervisor/main.py,sha256=7YrreFNntdRCp6MplCclfnRcgrRIb_UCeohJkDC9Few,4251
|
112
113
|
ominfra/supervisor/pipes.py,sha256=2ZihNTnRNjnIPOtPbm3_pyqO15f7BNs7WnNtO5V8ahM,2231
|
@@ -136,9 +137,9 @@ ominfra/tailscale/api.py,sha256=C5-t_b6jZXUWcy5k8bXm7CFnk73pSdrlMOgGDeGVrpw,1370
|
|
136
137
|
ominfra/tailscale/cli.py,sha256=3FnJbgpLw6gInTfhERd1mDy9ijjMUGxkdYVo43Tnxx4,3555
|
137
138
|
ominfra/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
138
139
|
ominfra/tools/listresources.py,sha256=4qVg5txsb10EHhvqXXeM6gJ2jx9LbroEnPydDv1uXs0,6176
|
139
|
-
ominfra-0.0.0.
|
140
|
-
ominfra-0.0.0.
|
141
|
-
ominfra-0.0.0.
|
142
|
-
ominfra-0.0.0.
|
143
|
-
ominfra-0.0.0.
|
144
|
-
ominfra-0.0.0.
|
140
|
+
ominfra-0.0.0.dev192.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
141
|
+
ominfra-0.0.0.dev192.dist-info/METADATA,sha256=R7AOfKOeQacurgpdYE4zsQs9JRq0tCFHDEVItCCS5Lg,767
|
142
|
+
ominfra-0.0.0.dev192.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
143
|
+
ominfra-0.0.0.dev192.dist-info/entry_points.txt,sha256=kgecQ2MgGrM9qK744BoKS3tMesaC3yjLnl9pa5CRczg,37
|
144
|
+
ominfra-0.0.0.dev192.dist-info/top_level.txt,sha256=E-b2OHkk_AOBLXHYZQ2EOFKl-_6uOGd8EjeG-Zy6h_w,8
|
145
|
+
ominfra-0.0.0.dev192.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|