ominfra 0.0.0.dev254__py3-none-any.whl → 0.0.0.dev255__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.
- ominfra/pyremote.py +122 -76
- ominfra/scripts/manage.py +122 -76
- {ominfra-0.0.0.dev254.dist-info → ominfra-0.0.0.dev255.dist-info}/METADATA +3 -3
- {ominfra-0.0.0.dev254.dist-info → ominfra-0.0.0.dev255.dist-info}/RECORD +8 -8
- {ominfra-0.0.0.dev254.dist-info → ominfra-0.0.0.dev255.dist-info}/WHEEL +1 -1
- {ominfra-0.0.0.dev254.dist-info → ominfra-0.0.0.dev255.dist-info}/LICENSE +0 -0
- {ominfra-0.0.0.dev254.dist-info → ominfra-0.0.0.dev255.dist-info}/entry_points.txt +0 -0
- {ominfra-0.0.0.dev254.dist-info → ominfra-0.0.0.dev255.dist-info}/top_level.txt +0 -0
ominfra/pyremote.py
CHANGED
@@ -35,46 +35,82 @@ class PyremoteBootstrapOptions:
|
|
35
35
|
|
36
36
|
@dc.dataclass(frozen=True)
|
37
37
|
class PyremoteEnvInfo:
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
38
|
+
@dc.dataclass(frozen=True)
|
39
|
+
class Sys:
|
40
|
+
base_prefix: str
|
41
|
+
byteorder: str
|
42
|
+
defaultencoding: str
|
43
|
+
exec_prefix: str
|
44
|
+
executable: str
|
45
|
+
implementation_name: str
|
46
|
+
path: ta.List[str]
|
47
|
+
platform: str
|
48
|
+
prefix: str
|
49
|
+
version: str
|
50
|
+
version_info: ta.List[ta.Union[int, str]]
|
51
|
+
|
52
|
+
sys: Sys
|
53
|
+
|
54
|
+
@dc.dataclass(frozen=True)
|
55
|
+
class Platform:
|
56
|
+
architecture: ta.List[str]
|
57
|
+
machine: str
|
58
|
+
platform: str
|
59
|
+
processor: str
|
60
|
+
system: str
|
61
|
+
release: str
|
62
|
+
version: str
|
63
|
+
|
64
|
+
platform: Platform
|
65
|
+
|
66
|
+
@dc.dataclass(frozen=True)
|
67
|
+
class Site:
|
68
|
+
userbase: str
|
69
|
+
|
70
|
+
site: Site
|
71
|
+
|
72
|
+
@dc.dataclass(frozen=True)
|
73
|
+
class Os:
|
74
|
+
cwd: str
|
75
|
+
gid: int
|
76
|
+
loadavg: ta.List[float]
|
77
|
+
login: ta.Optional[str]
|
78
|
+
pgrp: int
|
79
|
+
pid: int
|
80
|
+
ppid: int
|
81
|
+
uid: int
|
82
|
+
|
83
|
+
os: Os
|
84
|
+
|
85
|
+
@dc.dataclass(frozen=True)
|
86
|
+
class Pw:
|
87
|
+
name: str
|
88
|
+
uid: int
|
89
|
+
gid: int
|
90
|
+
gecos: str
|
91
|
+
dir: str
|
92
|
+
shell: str
|
93
|
+
|
94
|
+
pw: Pw
|
75
95
|
|
76
96
|
env_path: ta.Optional[str]
|
77
97
|
|
98
|
+
#
|
99
|
+
|
100
|
+
def to_dict(self) -> dict:
|
101
|
+
return {
|
102
|
+
f.name: dc.asdict(v) if dc.is_dataclass(v := getattr(self, f.name)) else v # type: ignore[arg-type]
|
103
|
+
for f in dc.fields(self)
|
104
|
+
}
|
105
|
+
|
106
|
+
@classmethod
|
107
|
+
def from_dict(cls, dct: dict) -> 'PyremoteEnvInfo':
|
108
|
+
flds_dct = {f.name: f for f in dc.fields(cls)}
|
109
|
+
return cls(**{
|
110
|
+
k: ft(**v) if isinstance((ft := flds_dct[k].type), type) and dc.is_dataclass(ft) is not None else v
|
111
|
+
for k, v in dct.items()
|
112
|
+
})
|
113
|
+
|
78
114
|
|
79
115
|
def _get_pyremote_env_info() -> PyremoteEnvInfo:
|
80
116
|
os_uid = os.getuid()
|
@@ -88,43 +124,53 @@ def _get_pyremote_env_info() -> PyremoteEnvInfo:
|
|
88
124
|
os_login = None
|
89
125
|
|
90
126
|
return PyremoteEnvInfo(
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
127
|
+
sys=PyremoteEnvInfo.Sys(
|
128
|
+
base_prefix=sys.base_prefix,
|
129
|
+
byteorder=sys.byteorder,
|
130
|
+
defaultencoding=sys.getdefaultencoding(),
|
131
|
+
exec_prefix=sys.exec_prefix,
|
132
|
+
executable=sys.executable,
|
133
|
+
implementation_name=sys.implementation.name,
|
134
|
+
path=sys.path,
|
135
|
+
platform=sys.platform,
|
136
|
+
prefix=sys.prefix,
|
137
|
+
version=sys.version,
|
138
|
+
version_info=list(sys.version_info),
|
139
|
+
),
|
140
|
+
|
141
|
+
platform=PyremoteEnvInfo.Platform(
|
142
|
+
architecture=list(platform.architecture()),
|
143
|
+
machine=platform.machine(),
|
144
|
+
platform=platform.platform(),
|
145
|
+
processor=platform.processor(),
|
146
|
+
system=platform.system(),
|
147
|
+
release=platform.release(),
|
148
|
+
version=platform.version(),
|
149
|
+
),
|
150
|
+
|
151
|
+
site=PyremoteEnvInfo.Site(
|
152
|
+
userbase=site.getuserbase(),
|
153
|
+
),
|
154
|
+
|
155
|
+
os=PyremoteEnvInfo.Os(
|
156
|
+
cwd=os.getcwd(),
|
157
|
+
gid=os.getgid(),
|
158
|
+
loadavg=list(os.getloadavg()),
|
159
|
+
login=os_login,
|
160
|
+
pgrp=os.getpgrp(),
|
161
|
+
pid=os.getpid(),
|
162
|
+
ppid=os.getppid(),
|
163
|
+
uid=os_uid,
|
164
|
+
),
|
165
|
+
|
166
|
+
pw=PyremoteEnvInfo.Pw(
|
167
|
+
name=pw.pw_name,
|
168
|
+
uid=pw.pw_uid,
|
169
|
+
gid=pw.pw_gid,
|
170
|
+
gecos=pw.pw_gecos,
|
171
|
+
dir=pw.pw_dir,
|
172
|
+
shell=pw.pw_shell,
|
173
|
+
),
|
128
174
|
|
129
175
|
env_path=os.environ.get('PATH'),
|
130
176
|
)
|
@@ -335,7 +381,7 @@ def pyremote_bootstrap_finalize() -> PyremotePayloadRuntime:
|
|
335
381
|
|
336
382
|
# Write env info
|
337
383
|
env_info = _get_pyremote_env_info()
|
338
|
-
env_info_json = json.dumps(
|
384
|
+
env_info_json = json.dumps(env_info.to_dict(), indent=None, separators=(',', ':')) # noqa
|
339
385
|
os.write(1, struct.pack('<I', len(env_info_json)))
|
340
386
|
os.write(1, env_info_json.encode('utf-8'))
|
341
387
|
|
@@ -449,7 +495,7 @@ class PyremoteBootstrapDriver:
|
|
449
495
|
env_info_json_len = struct.unpack('<I', d)[0]
|
450
496
|
d = yield from self._read(env_info_json_len)
|
451
497
|
env_info_json = d.decode('utf-8')
|
452
|
-
env_info = PyremoteEnvInfo(
|
498
|
+
env_info = PyremoteEnvInfo.from_dict(json.loads(env_info_json))
|
453
499
|
|
454
500
|
# Read fourth ack (after finalization completed)
|
455
501
|
yield from self._expect(_PYREMOTE_BOOTSTRAP_ACK3)
|
ominfra/scripts/manage.py
CHANGED
@@ -697,46 +697,82 @@ class PyremoteBootstrapOptions:
|
|
697
697
|
|
698
698
|
@dc.dataclass(frozen=True)
|
699
699
|
class PyremoteEnvInfo:
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
700
|
+
@dc.dataclass(frozen=True)
|
701
|
+
class Sys:
|
702
|
+
base_prefix: str
|
703
|
+
byteorder: str
|
704
|
+
defaultencoding: str
|
705
|
+
exec_prefix: str
|
706
|
+
executable: str
|
707
|
+
implementation_name: str
|
708
|
+
path: ta.List[str]
|
709
|
+
platform: str
|
710
|
+
prefix: str
|
711
|
+
version: str
|
712
|
+
version_info: ta.List[ta.Union[int, str]]
|
713
|
+
|
714
|
+
sys: Sys
|
715
|
+
|
716
|
+
@dc.dataclass(frozen=True)
|
717
|
+
class Platform:
|
718
|
+
architecture: ta.List[str]
|
719
|
+
machine: str
|
720
|
+
platform: str
|
721
|
+
processor: str
|
722
|
+
system: str
|
723
|
+
release: str
|
724
|
+
version: str
|
725
|
+
|
726
|
+
platform: Platform
|
727
|
+
|
728
|
+
@dc.dataclass(frozen=True)
|
729
|
+
class Site:
|
730
|
+
userbase: str
|
731
|
+
|
732
|
+
site: Site
|
733
|
+
|
734
|
+
@dc.dataclass(frozen=True)
|
735
|
+
class Os:
|
736
|
+
cwd: str
|
737
|
+
gid: int
|
738
|
+
loadavg: ta.List[float]
|
739
|
+
login: ta.Optional[str]
|
740
|
+
pgrp: int
|
741
|
+
pid: int
|
742
|
+
ppid: int
|
743
|
+
uid: int
|
744
|
+
|
745
|
+
os: Os
|
746
|
+
|
747
|
+
@dc.dataclass(frozen=True)
|
748
|
+
class Pw:
|
749
|
+
name: str
|
750
|
+
uid: int
|
751
|
+
gid: int
|
752
|
+
gecos: str
|
753
|
+
dir: str
|
754
|
+
shell: str
|
755
|
+
|
756
|
+
pw: Pw
|
737
757
|
|
738
758
|
env_path: ta.Optional[str]
|
739
759
|
|
760
|
+
#
|
761
|
+
|
762
|
+
def to_dict(self) -> dict:
|
763
|
+
return {
|
764
|
+
f.name: dc.asdict(v) if dc.is_dataclass(v := getattr(self, f.name)) else v # type: ignore[arg-type]
|
765
|
+
for f in dc.fields(self)
|
766
|
+
}
|
767
|
+
|
768
|
+
@classmethod
|
769
|
+
def from_dict(cls, dct: dict) -> 'PyremoteEnvInfo':
|
770
|
+
flds_dct = {f.name: f for f in dc.fields(cls)}
|
771
|
+
return cls(**{
|
772
|
+
k: ft(**v) if isinstance((ft := flds_dct[k].type), type) and dc.is_dataclass(ft) is not None else v
|
773
|
+
for k, v in dct.items()
|
774
|
+
})
|
775
|
+
|
740
776
|
|
741
777
|
def _get_pyremote_env_info() -> PyremoteEnvInfo:
|
742
778
|
os_uid = os.getuid()
|
@@ -750,43 +786,53 @@ def _get_pyremote_env_info() -> PyremoteEnvInfo:
|
|
750
786
|
os_login = None
|
751
787
|
|
752
788
|
return PyremoteEnvInfo(
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
789
|
+
sys=PyremoteEnvInfo.Sys(
|
790
|
+
base_prefix=sys.base_prefix,
|
791
|
+
byteorder=sys.byteorder,
|
792
|
+
defaultencoding=sys.getdefaultencoding(),
|
793
|
+
exec_prefix=sys.exec_prefix,
|
794
|
+
executable=sys.executable,
|
795
|
+
implementation_name=sys.implementation.name,
|
796
|
+
path=sys.path,
|
797
|
+
platform=sys.platform,
|
798
|
+
prefix=sys.prefix,
|
799
|
+
version=sys.version,
|
800
|
+
version_info=list(sys.version_info),
|
801
|
+
),
|
802
|
+
|
803
|
+
platform=PyremoteEnvInfo.Platform(
|
804
|
+
architecture=list(platform.architecture()),
|
805
|
+
machine=platform.machine(),
|
806
|
+
platform=platform.platform(),
|
807
|
+
processor=platform.processor(),
|
808
|
+
system=platform.system(),
|
809
|
+
release=platform.release(),
|
810
|
+
version=platform.version(),
|
811
|
+
),
|
812
|
+
|
813
|
+
site=PyremoteEnvInfo.Site(
|
814
|
+
userbase=site.getuserbase(),
|
815
|
+
),
|
816
|
+
|
817
|
+
os=PyremoteEnvInfo.Os(
|
818
|
+
cwd=os.getcwd(),
|
819
|
+
gid=os.getgid(),
|
820
|
+
loadavg=list(os.getloadavg()),
|
821
|
+
login=os_login,
|
822
|
+
pgrp=os.getpgrp(),
|
823
|
+
pid=os.getpid(),
|
824
|
+
ppid=os.getppid(),
|
825
|
+
uid=os_uid,
|
826
|
+
),
|
827
|
+
|
828
|
+
pw=PyremoteEnvInfo.Pw(
|
829
|
+
name=pw.pw_name,
|
830
|
+
uid=pw.pw_uid,
|
831
|
+
gid=pw.pw_gid,
|
832
|
+
gecos=pw.pw_gecos,
|
833
|
+
dir=pw.pw_dir,
|
834
|
+
shell=pw.pw_shell,
|
835
|
+
),
|
790
836
|
|
791
837
|
env_path=os.environ.get('PATH'),
|
792
838
|
)
|
@@ -997,7 +1043,7 @@ def pyremote_bootstrap_finalize() -> PyremotePayloadRuntime:
|
|
997
1043
|
|
998
1044
|
# Write env info
|
999
1045
|
env_info = _get_pyremote_env_info()
|
1000
|
-
env_info_json = json.dumps(
|
1046
|
+
env_info_json = json.dumps(env_info.to_dict(), indent=None, separators=(',', ':')) # noqa
|
1001
1047
|
os.write(1, struct.pack('<I', len(env_info_json)))
|
1002
1048
|
os.write(1, env_info_json.encode('utf-8'))
|
1003
1049
|
|
@@ -1111,7 +1157,7 @@ class PyremoteBootstrapDriver:
|
|
1111
1157
|
env_info_json_len = struct.unpack('<I', d)[0]
|
1112
1158
|
d = yield from self._read(env_info_json_len)
|
1113
1159
|
env_info_json = d.decode('utf-8')
|
1114
|
-
env_info = PyremoteEnvInfo(
|
1160
|
+
env_info = PyremoteEnvInfo.from_dict(json.loads(env_info_json))
|
1115
1161
|
|
1116
1162
|
# Read fourth ack (after finalization completed)
|
1117
1163
|
yield from self._expect(_PYREMOTE_BOOTSTRAP_ACK3)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: ominfra
|
3
|
-
Version: 0.0.0.
|
3
|
+
Version: 0.0.0.dev255
|
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.dev255
|
16
|
+
Requires-Dist: omlish==0.0.0.dev255
|
17
17
|
Provides-Extra: all
|
18
18
|
Requires-Dist: paramiko~=3.5; extra == "all"
|
19
19
|
Requires-Dist: asyncssh~=2.18; extra == "all"
|
@@ -1,7 +1,7 @@
|
|
1
1
|
ominfra/.manifests.json,sha256=8KREXxMAlsilZOktXPYru1ND3V5hFI22vnrp6hT3bio,589
|
2
2
|
ominfra/__about__.py,sha256=6i1AoruFYQCd-PyhhbDQDWY2d1tiQu9nkwWr-fXAqfY,705
|
3
3
|
ominfra/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
-
ominfra/pyremote.py,sha256=
|
4
|
+
ominfra/pyremote.py,sha256=I8775ohUGn1DsI-6NQFAV2hxa6TPsH4ksINHxeIEw0w,16228
|
5
5
|
ominfra/systemd.py,sha256=d61NVrJoItzSaqhMDgKGrQjbrxEVAujUMDsj8WggXos,1022
|
6
6
|
ominfra/threadworkers.py,sha256=ADWHAdvjzPxm94yJcEt5_nM7q7aahdQUNP_EGQeOWAw,4974
|
7
7
|
ominfra/clouds/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -113,7 +113,7 @@ ominfra/manage/targets/inject.py,sha256=P4597xWM-V3I_gCt2O71OLhYQkkXtuJvkYRsIbhh
|
|
113
113
|
ominfra/manage/targets/targets.py,sha256=7GP6UAZyJFEhpkJN6UQdpr_WN3p7C76v-s445y-WB6U,1885
|
114
114
|
ominfra/scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
115
115
|
ominfra/scripts/journald2aws.py,sha256=vvuAU6O3tu5deEg5TjPjepgytXCqEvi7EQAMnGZ8NjY,168285
|
116
|
-
ominfra/scripts/manage.py,sha256=
|
116
|
+
ominfra/scripts/manage.py,sha256=Jpsbj9DUB852agbxWS2wOBWOJUZ1wK-WlRfyDvbhiVs,379523
|
117
117
|
ominfra/scripts/supervisor.py,sha256=U9soYrTfOpwei1681aNdCkq94HqGxh5g1IHTMiqM8oU,296898
|
118
118
|
ominfra/supervisor/LICENSE.txt,sha256=ZrHY15PVR98y26Yg6iQfa-SXnUaYTDhrUsPVcEO5OKM,1874
|
119
119
|
ominfra/supervisor/__init__.py,sha256=Y3l4WY4JRi2uLG6kgbGp93fuGfkxkKwZDvhsa0Rwgtk,15
|
@@ -156,9 +156,9 @@ ominfra/tailscale/api.py,sha256=C5-t_b6jZXUWcy5k8bXm7CFnk73pSdrlMOgGDeGVrpw,1370
|
|
156
156
|
ominfra/tailscale/cli.py,sha256=3FnJbgpLw6gInTfhERd1mDy9ijjMUGxkdYVo43Tnxx4,3555
|
157
157
|
ominfra/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
158
158
|
ominfra/tools/listresources.py,sha256=auGP1LlbBJSFKUWNvQo_UzA8IsBNZBTMwEkFFRJ4FX4,6185
|
159
|
-
ominfra-0.0.0.
|
160
|
-
ominfra-0.0.0.
|
161
|
-
ominfra-0.0.0.
|
162
|
-
ominfra-0.0.0.
|
163
|
-
ominfra-0.0.0.
|
164
|
-
ominfra-0.0.0.
|
159
|
+
ominfra-0.0.0.dev255.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
160
|
+
ominfra-0.0.0.dev255.dist-info/METADATA,sha256=-xkqB_4uWQxlGx7OUEvXQgAywP4HWkp_6DKSPmcDR6E,731
|
161
|
+
ominfra-0.0.0.dev255.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
|
162
|
+
ominfra-0.0.0.dev255.dist-info/entry_points.txt,sha256=kgecQ2MgGrM9qK744BoKS3tMesaC3yjLnl9pa5CRczg,37
|
163
|
+
ominfra-0.0.0.dev255.dist-info/top_level.txt,sha256=E-b2OHkk_AOBLXHYZQ2EOFKl-_6uOGd8EjeG-Zy6h_w,8
|
164
|
+
ominfra-0.0.0.dev255.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|