ominfra 0.0.0.dev195__tar.gz → 0.0.0.dev197__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. {ominfra-0.0.0.dev195/ominfra.egg-info → ominfra-0.0.0.dev197}/PKG-INFO +4 -4
  2. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/commands/inject.py +1 -20
  3. ominfra-0.0.0.dev197/ominfra/manage/commands/injection.py +28 -0
  4. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/deploy/conf/inject.py +1 -1
  5. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/deploy/git.py +71 -15
  6. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/deploy/inject.py +2 -2
  7. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/deploy/specs.py +2 -0
  8. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/system/inject.py +1 -1
  9. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/scripts/manage.py +191 -36
  10. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/scripts/supervisor.py +4 -0
  11. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/LICENSE.txt +3 -0
  12. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/main.py +4 -0
  13. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197/ominfra.egg-info}/PKG-INFO +4 -4
  14. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra.egg-info/SOURCES.txt +2 -1
  15. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra.egg-info/requires.txt +3 -3
  16. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/pyproject.toml +4 -4
  17. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/LICENSE +0 -0
  18. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/MANIFEST.in +0 -0
  19. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/README.rst +0 -0
  20. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/.manifests.json +0 -0
  21. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/__about__.py +0 -0
  22. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/__init__.py +0 -0
  23. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/clouds/__init__.py +0 -0
  24. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/clouds/aws/__init__.py +0 -0
  25. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/clouds/aws/__main__.py +0 -0
  26. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/clouds/aws/auth.py +0 -0
  27. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/clouds/aws/cli.py +0 -0
  28. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/clouds/aws/dataclasses.py +0 -0
  29. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/clouds/aws/journald2aws/__init__.py +0 -0
  30. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/clouds/aws/journald2aws/__main__.py +0 -0
  31. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/clouds/aws/journald2aws/cursor.py +0 -0
  32. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/clouds/aws/journald2aws/driver.py +0 -0
  33. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/clouds/aws/journald2aws/main.py +0 -0
  34. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/clouds/aws/journald2aws/poster.py +0 -0
  35. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/clouds/aws/logs.py +0 -0
  36. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/clouds/aws/metadata.py +0 -0
  37. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/clouds/gcp/__init__.py +0 -0
  38. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/clouds/gcp/auth.py +0 -0
  39. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/cmds.py +0 -0
  40. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/journald/__init__.py +0 -0
  41. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/journald/fields.py +0 -0
  42. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/journald/genmessages.py +0 -0
  43. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/journald/messages.py +0 -0
  44. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/journald/tailer.py +0 -0
  45. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/__init__.py +0 -0
  46. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/__main__.py +0 -0
  47. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/bootstrap.py +0 -0
  48. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/bootstrap_.py +0 -0
  49. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/commands/__init__.py +0 -0
  50. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/commands/base.py +0 -0
  51. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/commands/local.py +0 -0
  52. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/commands/marshal.py +0 -0
  53. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/commands/ping.py +0 -0
  54. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/commands/subprocess.py +0 -0
  55. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/commands/types.py +0 -0
  56. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/config.py +0 -0
  57. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/deploy/__init__.py +0 -0
  58. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/deploy/apps.py +0 -0
  59. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/deploy/commands.py +0 -0
  60. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/deploy/conf/__init__.py +0 -0
  61. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/deploy/conf/manager.py +3 -3
  62. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/deploy/conf/specs.py +1 -1
  63. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/deploy/config.py +0 -0
  64. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/deploy/deploy.py +0 -0
  65. /ominfra-0.0.0.dev195/ominfra/manage/deploy/inject_.py → /ominfra-0.0.0.dev197/ominfra/manage/deploy/injection.py +0 -0
  66. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/deploy/interp.py +0 -0
  67. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/deploy/nginx.py +0 -0
  68. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/deploy/paths/__init__.py +0 -0
  69. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/deploy/paths/inject.py +0 -0
  70. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/deploy/paths/manager.py +0 -0
  71. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/deploy/paths/owners.py +0 -0
  72. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/deploy/paths/paths.py +0 -0
  73. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/deploy/paths/specs.py +0 -0
  74. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/deploy/paths/types.py +0 -0
  75. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/deploy/systemd.py +0 -0
  76. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/deploy/tags.py +0 -0
  77. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/deploy/tmp.py +0 -0
  78. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/deploy/types.py +0 -0
  79. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/deploy/venvs.py +0 -0
  80. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/inject.py +0 -0
  81. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/main.py +0 -0
  82. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/marshal.py +0 -0
  83. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/remote/__init__.py +0 -0
  84. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/remote/_main.py +0 -0
  85. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/remote/channel.py +0 -0
  86. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/remote/config.py +0 -0
  87. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/remote/connection.py +0 -0
  88. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/remote/execution.py +0 -0
  89. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/remote/inject.py +0 -0
  90. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/remote/payload.py +0 -0
  91. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/remote/spawning.py +0 -0
  92. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/system/__init__.py +0 -0
  93. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/system/commands.py +0 -0
  94. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/system/config.py +0 -0
  95. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/system/packages.py +0 -0
  96. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/system/platforms.py +0 -0
  97. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/targets/__init__.py +0 -0
  98. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/targets/bestpython.py +0 -0
  99. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/targets/bestpython.sh +0 -0
  100. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/targets/connection.py +0 -0
  101. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/targets/inject.py +0 -0
  102. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/manage/targets/targets.py +0 -0
  103. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/pyremote.py +0 -0
  104. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/scripts/__init__.py +0 -0
  105. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/scripts/journald2aws.py +0 -0
  106. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/ssh.py +0 -0
  107. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/__init__.py +0 -0
  108. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/__main__.py +0 -0
  109. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/configs.py +0 -0
  110. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/dispatchers.py +0 -0
  111. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/dispatchersimpl.py +0 -0
  112. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/events.py +0 -0
  113. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/exceptions.py +0 -0
  114. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/groups.py +0 -0
  115. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/groupsimpl.py +0 -0
  116. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/http.py +0 -0
  117. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/inject.py +0 -0
  118. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/io.py +0 -0
  119. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/pipes.py +0 -0
  120. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/privileges.py +0 -0
  121. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/process.py +0 -0
  122. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/processimpl.py +0 -0
  123. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/setup.py +0 -0
  124. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/setupimpl.py +0 -0
  125. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/signals.py +0 -0
  126. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/spawning.py +0 -0
  127. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/spawningimpl.py +0 -0
  128. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/states.py +0 -0
  129. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/supervisor.py +0 -0
  130. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/types.py +0 -0
  131. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/utils/__init__.py +0 -0
  132. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/utils/collections.py +0 -0
  133. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/utils/diag.py +0 -0
  134. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/utils/fds.py +0 -0
  135. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/utils/fs.py +0 -0
  136. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/utils/os.py +0 -0
  137. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/utils/ostypes.py +0 -0
  138. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/utils/signals.py +0 -0
  139. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/utils/strings.py +0 -0
  140. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/supervisor/utils/users.py +0 -0
  141. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/systemd.py +0 -0
  142. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/tailscale/__init__.py +0 -0
  143. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/tailscale/api.py +0 -0
  144. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/tailscale/cli.py +0 -0
  145. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/threadworkers.py +0 -0
  146. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/tools/__init__.py +0 -0
  147. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra/tools/listresources.py +0 -0
  148. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra.egg-info/dependency_links.txt +0 -0
  149. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra.egg-info/entry_points.txt +0 -0
  150. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/ominfra.egg-info/top_level.txt +0 -0
  151. {ominfra-0.0.0.dev195 → ominfra-0.0.0.dev197}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ominfra
3
- Version: 0.0.0.dev195
3
+ Version: 0.0.0.dev197
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.dev195
16
- Requires-Dist: omlish==0.0.0.dev195
17
- Requires-Dist: omserv==0.0.0.dev195
15
+ Requires-Dist: omdev==0.0.0.dev197
16
+ Requires-Dist: omlish==0.0.0.dev197
17
+ Requires-Dist: omserv==0.0.0.dev197
18
18
  Provides-Extra: all
19
19
  Requires-Dist: paramiko~=3.5; extra == "all"
20
20
  Requires-Dist: asyncssh~=2.18; extra == "all"
@@ -18,6 +18,7 @@ from .base import CommandNameMap
18
18
  from .base import CommandRegistration
19
19
  from .base import CommandRegistrations
20
20
  from .base import build_command_name_map
21
+ from .injection import bind_command
21
22
  from .local import LocalCommandExecutor
22
23
  from .marshal import install_command_marshaling
23
24
  from .ping import PingCommand
@@ -30,26 +31,6 @@ from .types import CommandExecutorMap
30
31
  ##
31
32
 
32
33
 
33
- def bind_command(
34
- command_cls: ta.Type[Command],
35
- executor_cls: ta.Optional[ta.Type[CommandExecutor]],
36
- ) -> InjectorBindings:
37
- lst: ta.List[InjectorBindingOrBindings] = [
38
- inj.bind(CommandRegistration(command_cls), array=True),
39
- ]
40
-
41
- if executor_cls is not None:
42
- lst.extend([
43
- inj.bind(executor_cls, singleton=True),
44
- inj.bind(CommandExecutorRegistration(command_cls, executor_cls), array=True),
45
- ])
46
-
47
- return inj.as_bindings(*lst)
48
-
49
-
50
- ##
51
-
52
-
53
34
  @dc.dataclass(frozen=True)
54
35
  class _FactoryCommandExecutor(CommandExecutor):
55
36
  factory: ta.Callable[[], CommandExecutor]
@@ -0,0 +1,28 @@
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 .base import Command
9
+ from .base import CommandExecutor
10
+ from .base import CommandExecutorRegistration
11
+ from .base import CommandRegistration
12
+
13
+
14
+ def bind_command(
15
+ command_cls: ta.Type[Command],
16
+ executor_cls: ta.Optional[ta.Type[CommandExecutor]],
17
+ ) -> InjectorBindings:
18
+ lst: ta.List[InjectorBindingOrBindings] = [
19
+ inj.bind(CommandRegistration(command_cls), array=True),
20
+ ]
21
+
22
+ if executor_cls is not None:
23
+ lst.extend([
24
+ inj.bind(executor_cls, singleton=True),
25
+ inj.bind(CommandExecutorRegistration(command_cls, executor_cls), array=True),
26
+ ])
27
+
28
+ return inj.as_bindings(*lst)
@@ -5,7 +5,7 @@ from omlish.lite.inject import InjectorBindingOrBindings
5
5
  from omlish.lite.inject import InjectorBindings
6
6
  from omlish.lite.inject import inj
7
7
 
8
- from ..inject_ import bind_deploy_manager
8
+ from ..injection import bind_deploy_manager
9
9
  from .manager import DeployConfManager
10
10
 
11
11
 
@@ -1,10 +1,8 @@
1
1
  # ruff: noqa: UP006 UP007
2
2
  """
3
3
  TODO:
4
- - 'repos'?
5
-
6
- git/github.com/wrmsr/omlish <- bootstrap repo
7
- - shallow clone off bootstrap into /apps
4
+ - parse refs, resolve revs
5
+ - non-subtree shallow clone
8
6
 
9
7
  github.com/wrmsr/omlish@rev
10
8
  """
@@ -12,6 +10,7 @@ import functools
12
10
  import os.path
13
11
  import typing as ta
14
12
 
13
+ from omdev.git.subtrees import GitSubtreeCloner
15
14
  from omlish.asyncs.asyncio.subprocesses import asyncio_subprocesses
16
15
  from omlish.lite.cached import async_cached_nullary
17
16
  from omlish.lite.check import check
@@ -41,6 +40,16 @@ class DeployGitManager(SingleDirDeployPathOwner):
41
40
 
42
41
  self._repo_dirs: ta.Dict[DeployGitRepo, DeployGitManager.RepoDir] = {}
43
42
 
43
+ #
44
+
45
+ def make_repo_url(self, repo: DeployGitRepo) -> str:
46
+ if repo.username is not None:
47
+ return f'{repo.username}@{repo.host}:{repo.path}'
48
+ else:
49
+ return f'https://{repo.host}/{repo.path}'
50
+
51
+ #
52
+
44
53
  class RepoDir:
45
54
  def __init__(
46
55
  self,
@@ -59,16 +68,15 @@ class DeployGitManager(SingleDirDeployPathOwner):
59
68
  check.non_empty_str(repo.path),
60
69
  )
61
70
 
71
+ #
72
+
62
73
  @property
63
74
  def repo(self) -> DeployGitRepo:
64
75
  return self._repo
65
76
 
66
77
  @property
67
78
  def url(self) -> str:
68
- if self._repo.username is not None:
69
- return f'{self._repo.username}@{self._repo.host}:{self._repo.path}'
70
- else:
71
- return f'https://{self._repo.host}/{self._repo.path}'
79
+ return self._git.make_repo_url(self._repo)
72
80
 
73
81
  #
74
82
 
@@ -129,16 +137,64 @@ class DeployGitManager(SingleDirDeployPathOwner):
129
137
  )
130
138
  return repo_dir
131
139
 
140
+ #
141
+
142
+ async def shallow_clone(
143
+ self,
144
+ spec: DeployGitSpec,
145
+ home: DeployHome,
146
+ dst_dir: str,
147
+ ) -> None:
148
+ check.state(not os.path.exists(dst_dir))
149
+ with self._atomics(home).begin_atomic_path_swap( # noqa
150
+ 'dir',
151
+ dst_dir,
152
+ auto_commit=True,
153
+ make_dirs=True,
154
+ ) as dst_swap:
155
+ tdn = '.omlish-git-shallow-clone'
156
+
157
+ for cmd in GitSubtreeCloner(
158
+ base_dir=dst_swap.tmp_path,
159
+ repo_url=self.make_repo_url(spec.repo),
160
+ repo_dir=tdn,
161
+ rev=spec.rev,
162
+ repo_subtrees=spec.subtrees,
163
+ ).build_commands():
164
+ await asyncio_subprocesses.check_call(
165
+ *cmd.cmd,
166
+ cwd=cmd.cwd,
167
+ )
168
+
169
+ td = os.path.join(dst_swap.tmp_path, tdn)
170
+ check.state(os.path.isdir(td))
171
+ for n in sorted(os.listdir(td)):
172
+ os.rename(
173
+ os.path.join(td, n),
174
+ os.path.join(dst_swap.tmp_path, n),
175
+ )
176
+ os.rmdir(td)
177
+
178
+ #
179
+
132
180
  async def checkout(
133
181
  self,
134
182
  spec: DeployGitSpec,
135
183
  home: DeployHome,
136
184
  dst_dir: str,
137
185
  ) -> None:
138
- await self.get_repo_dir(
139
- spec.repo,
140
- home,
141
- ).checkout(
142
- spec,
143
- dst_dir,
144
- )
186
+ if spec.shallow:
187
+ await self.shallow_clone(
188
+ spec,
189
+ home,
190
+ dst_dir,
191
+ )
192
+
193
+ else:
194
+ await self.get_repo_dir(
195
+ spec.repo,
196
+ home,
197
+ ).checkout(
198
+ spec,
199
+ dst_dir,
200
+ )
@@ -10,7 +10,7 @@ from omlish.lite.inject import InjectorBindingOrBindings
10
10
  from omlish.lite.inject import InjectorBindings
11
11
  from omlish.lite.inject import inj
12
12
 
13
- from ..commands.inject import bind_command
13
+ from ..commands.injection import bind_command
14
14
  from .apps import DeployAppManager
15
15
  from .commands import DeployCommand
16
16
  from .commands import DeployCommandExecutor
@@ -20,7 +20,7 @@ from .deploy import DeployDriver
20
20
  from .deploy import DeployDriverFactory
21
21
  from .deploy import DeployManager
22
22
  from .git import DeployGitManager
23
- from .inject_ import bind_deploy_manager
23
+ from .injection import bind_deploy_manager
24
24
  from .interp import InterpCommand
25
25
  from .interp import InterpCommandExecutor
26
26
  from .paths.inject import bind_deploy_paths
@@ -53,6 +53,8 @@ class DeployGitSpec:
53
53
 
54
54
  subtrees: ta.Optional[ta.Sequence[str]] = None
55
55
 
56
+ shallow: bool = False
57
+
56
58
  def __post_init__(self) -> None:
57
59
  check.non_empty_str(self.rev)
58
60
  if self.subtrees is not None:
@@ -5,7 +5,7 @@ from omlish.lite.inject import InjectorBindingOrBindings
5
5
  from omlish.lite.inject import InjectorBindings
6
6
  from omlish.lite.inject import inj
7
7
 
8
- from ..commands.inject import bind_command
8
+ from ..commands.injection import bind_command
9
9
  from .commands import CheckSystemPackageCommand
10
10
  from .commands import CheckSystemPackageCommandExecutor
11
11
  from .config import SystemConfig
@@ -7301,6 +7301,27 @@ def bind_interp_uv() -> InjectorBindings:
7301
7301
  return inj.as_bindings(*lst)
7302
7302
 
7303
7303
 
7304
+ ########################################
7305
+ # ../commands/injection.py
7306
+
7307
+
7308
+ def bind_command(
7309
+ command_cls: ta.Type[Command],
7310
+ executor_cls: ta.Optional[ta.Type[CommandExecutor]],
7311
+ ) -> InjectorBindings:
7312
+ lst: ta.List[InjectorBindingOrBindings] = [
7313
+ inj.bind(CommandRegistration(command_cls), array=True),
7314
+ ]
7315
+
7316
+ if executor_cls is not None:
7317
+ lst.extend([
7318
+ inj.bind(executor_cls, singleton=True),
7319
+ inj.bind(CommandExecutorRegistration(command_cls, executor_cls), array=True),
7320
+ ])
7321
+
7322
+ return inj.as_bindings(*lst)
7323
+
7324
+
7304
7325
  ########################################
7305
7326
  # ../commands/marshal.py
7306
7327
 
@@ -8327,6 +8348,103 @@ class AbstractAsyncSubprocesses(BaseSubprocesses):
8327
8348
  return ret.decode().strip()
8328
8349
 
8329
8350
 
8351
+ ########################################
8352
+ # ../../../omdev/git/subtrees.py
8353
+
8354
+
8355
+ @dc.dataclass(frozen=True)
8356
+ class GitSubtreeCloner:
8357
+ base_dir: str
8358
+ repo_url: str
8359
+ repo_dir: str
8360
+
8361
+ # _: dc.KW_ONLY
8362
+
8363
+ repo_subtrees: ta.Optional[ta.Sequence[str]] = None
8364
+
8365
+ branch: ta.Optional[str] = None
8366
+ rev: ta.Optional[str] = None
8367
+
8368
+ def __post_init__(self) -> None:
8369
+ if not bool(self.branch) ^ bool(self.rev):
8370
+ raise ValueError('must set branch or rev')
8371
+
8372
+ if isinstance(self.repo_subtrees, str):
8373
+ raise TypeError(self.repo_subtrees)
8374
+
8375
+ @dc.dataclass(frozen=True)
8376
+ class Command:
8377
+ cmd: ta.Sequence[str]
8378
+ cwd: str
8379
+
8380
+ def build_commands(self) -> ta.Iterator[Command]:
8381
+ git_opts = [
8382
+ '-c', 'advice.detachedHead=false',
8383
+ ]
8384
+
8385
+ yield GitSubtreeCloner.Command(
8386
+ cmd=(
8387
+ 'git',
8388
+ *git_opts,
8389
+ 'clone',
8390
+ '-n',
8391
+ '--depth=1',
8392
+ '--filter=tree:0',
8393
+ *(['-b', self.branch] if self.branch else []),
8394
+ '--single-branch',
8395
+ self.repo_url,
8396
+ self.repo_dir,
8397
+ ),
8398
+ cwd=self.base_dir,
8399
+ )
8400
+
8401
+ rd = os.path.join(self.base_dir, self.repo_dir)
8402
+ yield GitSubtreeCloner.Command(
8403
+ cmd=(
8404
+ 'git',
8405
+ *git_opts,
8406
+ 'sparse-checkout',
8407
+ 'set',
8408
+ '--no-cone',
8409
+ *(self.repo_subtrees or []),
8410
+ ),
8411
+ cwd=rd,
8412
+ )
8413
+
8414
+ yield GitSubtreeCloner.Command(
8415
+ cmd=(
8416
+ 'git',
8417
+ *git_opts,
8418
+ 'checkout',
8419
+ *([self.rev] if self.rev else []),
8420
+ ),
8421
+ cwd=rd,
8422
+ )
8423
+
8424
+
8425
+ def git_clone_subtree(
8426
+ *,
8427
+ base_dir: str,
8428
+ repo_url: str,
8429
+ repo_dir: str,
8430
+ branch: ta.Optional[str] = None,
8431
+ rev: ta.Optional[str] = None,
8432
+ repo_subtrees: ta.Optional[ta.Sequence[str]] = None,
8433
+ ) -> None:
8434
+ for cmd in GitSubtreeCloner(
8435
+ base_dir=base_dir,
8436
+ repo_url=repo_url,
8437
+ repo_dir=repo_dir,
8438
+ branch=branch,
8439
+ rev=rev,
8440
+ repo_subtrees=repo_subtrees,
8441
+ ).build_commands():
8442
+ subprocesses.check_call(
8443
+ *cmd.cmd,
8444
+ cwd=cmd.cwd,
8445
+ )
8446
+
8447
+
8330
8448
  ########################################
8331
8449
  # ../../../omdev/interp/providers/base.py
8332
8450
  """
@@ -8645,6 +8763,8 @@ class DeployGitSpec:
8645
8763
 
8646
8764
  subtrees: ta.Optional[ta.Sequence[str]] = None
8647
8765
 
8766
+ shallow: bool = False
8767
+
8648
8768
  def __post_init__(self) -> None:
8649
8769
  check.non_empty_str(self.rev)
8650
8770
  if self.subtrees is not None:
@@ -10740,26 +10860,6 @@ class PyenvVersionInstaller:
10740
10860
  ##
10741
10861
 
10742
10862
 
10743
- def bind_command(
10744
- command_cls: ta.Type[Command],
10745
- executor_cls: ta.Optional[ta.Type[CommandExecutor]],
10746
- ) -> InjectorBindings:
10747
- lst: ta.List[InjectorBindingOrBindings] = [
10748
- inj.bind(CommandRegistration(command_cls), array=True),
10749
- ]
10750
-
10751
- if executor_cls is not None:
10752
- lst.extend([
10753
- inj.bind(executor_cls, singleton=True),
10754
- inj.bind(CommandExecutorRegistration(command_cls, executor_cls), array=True),
10755
- ])
10756
-
10757
- return inj.as_bindings(*lst)
10758
-
10759
-
10760
- ##
10761
-
10762
-
10763
10863
  @dc.dataclass(frozen=True)
10764
10864
  class _FactoryCommandExecutor(CommandExecutor):
10765
10865
  factory: ta.Callable[[], CommandExecutor]
@@ -10834,7 +10934,7 @@ def bind_commands(
10834
10934
 
10835
10935
 
10836
10936
  ########################################
10837
- # ../deploy/inject_.py
10937
+ # ../deploy/injection.py
10838
10938
 
10839
10939
 
10840
10940
  def bind_deploy_manager(cls: type) -> InjectorBindings:
@@ -11218,10 +11318,8 @@ def bind_deploy_conf() -> InjectorBindings:
11218
11318
  # ../deploy/git.py
11219
11319
  """
11220
11320
  TODO:
11221
- - 'repos'?
11222
-
11223
- git/github.com/wrmsr/omlish <- bootstrap repo
11224
- - shallow clone off bootstrap into /apps
11321
+ - parse refs, resolve revs
11322
+ - non-subtree shallow clone
11225
11323
 
11226
11324
  github.com/wrmsr/omlish@rev
11227
11325
  """
@@ -11244,6 +11342,16 @@ class DeployGitManager(SingleDirDeployPathOwner):
11244
11342
 
11245
11343
  self._repo_dirs: ta.Dict[DeployGitRepo, DeployGitManager.RepoDir] = {}
11246
11344
 
11345
+ #
11346
+
11347
+ def make_repo_url(self, repo: DeployGitRepo) -> str:
11348
+ if repo.username is not None:
11349
+ return f'{repo.username}@{repo.host}:{repo.path}'
11350
+ else:
11351
+ return f'https://{repo.host}/{repo.path}'
11352
+
11353
+ #
11354
+
11247
11355
  class RepoDir:
11248
11356
  def __init__(
11249
11357
  self,
@@ -11262,16 +11370,15 @@ class DeployGitManager(SingleDirDeployPathOwner):
11262
11370
  check.non_empty_str(repo.path),
11263
11371
  )
11264
11372
 
11373
+ #
11374
+
11265
11375
  @property
11266
11376
  def repo(self) -> DeployGitRepo:
11267
11377
  return self._repo
11268
11378
 
11269
11379
  @property
11270
11380
  def url(self) -> str:
11271
- if self._repo.username is not None:
11272
- return f'{self._repo.username}@{self._repo.host}:{self._repo.path}'
11273
- else:
11274
- return f'https://{self._repo.host}/{self._repo.path}'
11381
+ return self._git.make_repo_url(self._repo)
11275
11382
 
11276
11383
  #
11277
11384
 
@@ -11332,19 +11439,67 @@ class DeployGitManager(SingleDirDeployPathOwner):
11332
11439
  )
11333
11440
  return repo_dir
11334
11441
 
11442
+ #
11443
+
11444
+ async def shallow_clone(
11445
+ self,
11446
+ spec: DeployGitSpec,
11447
+ home: DeployHome,
11448
+ dst_dir: str,
11449
+ ) -> None:
11450
+ check.state(not os.path.exists(dst_dir))
11451
+ with self._atomics(home).begin_atomic_path_swap( # noqa
11452
+ 'dir',
11453
+ dst_dir,
11454
+ auto_commit=True,
11455
+ make_dirs=True,
11456
+ ) as dst_swap:
11457
+ tdn = '.omlish-git-shallow-clone'
11458
+
11459
+ for cmd in GitSubtreeCloner(
11460
+ base_dir=dst_swap.tmp_path,
11461
+ repo_url=self.make_repo_url(spec.repo),
11462
+ repo_dir=tdn,
11463
+ rev=spec.rev,
11464
+ repo_subtrees=spec.subtrees,
11465
+ ).build_commands():
11466
+ await asyncio_subprocesses.check_call(
11467
+ *cmd.cmd,
11468
+ cwd=cmd.cwd,
11469
+ )
11470
+
11471
+ td = os.path.join(dst_swap.tmp_path, tdn)
11472
+ check.state(os.path.isdir(td))
11473
+ for n in sorted(os.listdir(td)):
11474
+ os.rename(
11475
+ os.path.join(td, n),
11476
+ os.path.join(dst_swap.tmp_path, n),
11477
+ )
11478
+ os.rmdir(td)
11479
+
11480
+ #
11481
+
11335
11482
  async def checkout(
11336
11483
  self,
11337
11484
  spec: DeployGitSpec,
11338
11485
  home: DeployHome,
11339
11486
  dst_dir: str,
11340
11487
  ) -> None:
11341
- await self.get_repo_dir(
11342
- spec.repo,
11343
- home,
11344
- ).checkout(
11345
- spec,
11346
- dst_dir,
11347
- )
11488
+ if spec.shallow:
11489
+ await self.shallow_clone(
11490
+ spec,
11491
+ home,
11492
+ dst_dir,
11493
+ )
11494
+
11495
+ else:
11496
+ await self.get_repo_dir(
11497
+ spec.repo,
11498
+ home,
11499
+ ).checkout(
11500
+ spec,
11501
+ dst_dir,
11502
+ )
11348
11503
 
11349
11504
 
11350
11505
  ########################################
@@ -4,6 +4,10 @@
4
4
  # @omlish-script
5
5
  # @omlish-amalg-output ../supervisor/main.py
6
6
  # ruff: noqa: N802 UP006 UP007 UP012 UP036
7
+ #
8
+ # Supervisor is Copyright (c) 2006-2015 Agendaless Consulting and Contributors.
9
+ # (http://www.agendaless.com), All Rights Reserved
10
+ #
7
11
  # Supervisor is licensed under the following license:
8
12
  #
9
13
  # A copyright notice accompanies this license document that identifies the copyright holders.
@@ -1,3 +1,6 @@
1
+ Supervisor is Copyright (c) 2006-2015 Agendaless Consulting and Contributors.
2
+ (http://www.agendaless.com), All Rights Reserved
3
+
1
4
  Supervisor is licensed under the following license:
2
5
 
3
6
  A copyright notice accompanies this license document that identifies the copyright holders.
@@ -1,6 +1,10 @@
1
1
  #!/usr/bin/env python3
2
2
  # ruff: noqa: UP006 UP007
3
3
  # @omlish-amalg ../scripts/supervisor.py
4
+ #
5
+ # Supervisor is Copyright (c) 2006-2015 Agendaless Consulting and Contributors.
6
+ # (http://www.agendaless.com), All Rights Reserved
7
+ #
4
8
  # Supervisor is licensed under the following license:
5
9
  #
6
10
  # A copyright notice accompanies this license document that identifies the copyright holders.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ominfra
3
- Version: 0.0.0.dev195
3
+ Version: 0.0.0.dev197
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.dev195
16
- Requires-Dist: omlish==0.0.0.dev195
17
- Requires-Dist: omserv==0.0.0.dev195
15
+ Requires-Dist: omdev==0.0.0.dev197
16
+ Requires-Dist: omlish==0.0.0.dev197
17
+ Requires-Dist: omserv==0.0.0.dev197
18
18
  Provides-Extra: all
19
19
  Requires-Dist: paramiko~=3.5; extra == "all"
20
20
  Requires-Dist: asyncssh~=2.18; extra == "all"
@@ -48,6 +48,7 @@ ominfra/manage/marshal.py
48
48
  ominfra/manage/commands/__init__.py
49
49
  ominfra/manage/commands/base.py
50
50
  ominfra/manage/commands/inject.py
51
+ ominfra/manage/commands/injection.py
51
52
  ominfra/manage/commands/local.py
52
53
  ominfra/manage/commands/marshal.py
53
54
  ominfra/manage/commands/ping.py
@@ -60,7 +61,7 @@ ominfra/manage/deploy/config.py
60
61
  ominfra/manage/deploy/deploy.py
61
62
  ominfra/manage/deploy/git.py
62
63
  ominfra/manage/deploy/inject.py
63
- ominfra/manage/deploy/inject_.py
64
+ ominfra/manage/deploy/injection.py
64
65
  ominfra/manage/deploy/interp.py
65
66
  ominfra/manage/deploy/nginx.py
66
67
  ominfra/manage/deploy/specs.py
@@ -1,6 +1,6 @@
1
- omdev==0.0.0.dev195
2
- omlish==0.0.0.dev195
3
- omserv==0.0.0.dev195
1
+ omdev==0.0.0.dev197
2
+ omlish==0.0.0.dev197
3
+ omserv==0.0.0.dev197
4
4
 
5
5
  [all]
6
6
  paramiko~=3.5
@@ -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.dev195'
15
+ version = '0.0.0.dev197'
16
16
  classifiers = [
17
17
  'License :: OSI Approved :: BSD License',
18
18
  'Development Status :: 2 - Pre-Alpha',
@@ -22,9 +22,9 @@ classifiers = [
22
22
  ]
23
23
  description = 'ominfra'
24
24
  dependencies = [
25
- 'omdev == 0.0.0.dev195',
26
- 'omlish == 0.0.0.dev195',
27
- 'omserv == 0.0.0.dev195',
25
+ 'omdev == 0.0.0.dev197',
26
+ 'omlish == 0.0.0.dev197',
27
+ 'omserv == 0.0.0.dev197',
28
28
  ]
29
29
 
30
30
  [project.optional-dependencies]
File without changes