ominfra 0.0.0.dev195__py3-none-any.whl → 0.0.0.dev196__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- ominfra/manage/commands/inject.py +1 -20
- ominfra/manage/commands/injection.py +28 -0
- ominfra/manage/deploy/conf/inject.py +1 -1
- ominfra/manage/deploy/conf/manager.py +3 -3
- ominfra/manage/deploy/conf/specs.py +1 -1
- ominfra/manage/deploy/git.py +71 -15
- ominfra/manage/deploy/inject.py +2 -2
- ominfra/manage/deploy/specs.py +2 -0
- ominfra/manage/system/inject.py +1 -1
- ominfra/scripts/manage.py +191 -36
- ominfra/scripts/supervisor.py +4 -0
- ominfra/supervisor/LICENSE.txt +3 -0
- ominfra/supervisor/main.py +4 -0
- {ominfra-0.0.0.dev195.dist-info → ominfra-0.0.0.dev196.dist-info}/METADATA +4 -4
- {ominfra-0.0.0.dev195.dist-info → ominfra-0.0.0.dev196.dist-info}/RECORD +20 -19
- {ominfra-0.0.0.dev195.dist-info → ominfra-0.0.0.dev196.dist-info}/WHEEL +1 -1
- /ominfra/manage/deploy/{inject_.py → injection.py} +0 -0
- {ominfra-0.0.0.dev195.dist-info → ominfra-0.0.0.dev196.dist-info}/LICENSE +0 -0
- {ominfra-0.0.0.dev195.dist-info → ominfra-0.0.0.dev196.dist-info}/entry_points.txt +0 -0
- {ominfra-0.0.0.dev195.dist-info → ominfra-0.0.0.dev196.dist-info}/top_level.txt +0 -0
@@ -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 ..
|
8
|
+
from ..injection import bind_deploy_manager
|
9
9
|
from .manager import DeployConfManager
|
10
10
|
|
11
11
|
|
@@ -21,15 +21,15 @@ import functools
|
|
21
21
|
import os.path
|
22
22
|
import typing as ta
|
23
23
|
|
24
|
+
from omlish.configs.nginx import NginxConfigItems
|
25
|
+
from omlish.configs.nginx import render_nginx_config_str
|
26
|
+
from omlish.formats.ini.sections import render_ini_sections
|
24
27
|
from omlish.lite.check import check
|
25
28
|
from omlish.lite.json import json_dumps_pretty
|
26
29
|
from omlish.lite.strings import strip_with_newline
|
27
30
|
from omlish.os.paths import is_path_in_dir
|
28
31
|
from omlish.os.paths import relative_symlink
|
29
|
-
from omlish.configs.nginx import NginxConfigItems
|
30
|
-
from omlish.configs.nginx import render_nginx_config_str
|
31
32
|
|
32
|
-
from omlish.formats.ini.sections import render_ini_sections
|
33
33
|
from ..paths.paths import DeployPath
|
34
34
|
from ..tags import DEPLOY_TAG_SEPARATOR
|
35
35
|
from ..tags import DeployApp
|
@@ -3,10 +3,10 @@ import abc
|
|
3
3
|
import dataclasses as dc
|
4
4
|
import typing as ta
|
5
5
|
|
6
|
+
from omlish.formats.ini.sections import IniSectionSettingsMap
|
6
7
|
from omlish.lite.check import check
|
7
8
|
from omlish.lite.marshal import register_single_field_type_obj_marshaler
|
8
9
|
|
9
|
-
from omlish.formats.ini.sections import IniSectionSettingsMap
|
10
10
|
from ..paths.specs import check_valid_deploy_spec_path
|
11
11
|
|
12
12
|
|
ominfra/manage/deploy/git.py
CHANGED
@@ -1,10 +1,8 @@
|
|
1
1
|
# ruff: noqa: UP006 UP007
|
2
2
|
"""
|
3
3
|
TODO:
|
4
|
-
-
|
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
|
-
|
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
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
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
|
+
)
|
ominfra/manage/deploy/inject.py
CHANGED
@@ -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.
|
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 .
|
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
|
ominfra/manage/deploy/specs.py
CHANGED
ominfra/manage/system/inject.py
CHANGED
@@ -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.
|
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
|
ominfra/scripts/manage.py
CHANGED
@@ -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/
|
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
|
-
-
|
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
|
-
|
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
|
-
|
11342
|
-
|
11343
|
-
|
11344
|
-
|
11345
|
-
|
11346
|
-
|
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
|
########################################
|
ominfra/scripts/supervisor.py
CHANGED
@@ -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.
|
ominfra/supervisor/LICENSE.txt
CHANGED
@@ -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.
|
ominfra/supervisor/main.py
CHANGED
@@ -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.
|
3
|
+
Version: 0.0.0.dev196
|
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.dev196
|
16
|
+
Requires-Dist: omlish==0.0.0.dev196
|
17
|
+
Requires-Dist: omserv==0.0.0.dev196
|
18
18
|
Provides-Extra: all
|
19
19
|
Requires-Dist: paramiko~=3.5; extra == "all"
|
20
20
|
Requires-Dist: asyncssh~=2.18; extra == "all"
|
@@ -37,7 +37,8 @@ ominfra/manage/main.py,sha256=1-PIAWnmd9XIy8pVcWGsME9xNTSj_t0sWWQTq9GYIzc,4403
|
|
37
37
|
ominfra/manage/marshal.py,sha256=WKj7IU9bo4fBMSSzT6ZMm_WFalXIJZ-V7j8oi92fNhk,305
|
38
38
|
ominfra/manage/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
39
39
|
ominfra/manage/commands/base.py,sha256=LtaI0AgnplttQK7gNncNItq8yuTZQimJTaprVpZktI8,3993
|
40
|
-
ominfra/manage/commands/inject.py,sha256=
|
40
|
+
ominfra/manage/commands/inject.py,sha256=dgYm1HlLZzLHZ_nppMDvJHL_ZVbCXZNo1s5bqL8nTyg,2954
|
41
|
+
ominfra/manage/commands/injection.py,sha256=lhiSzcGM-lLDsvuxakyc_8XViCzF7JPuAicQnY5ncH8,835
|
41
42
|
ominfra/manage/commands/local.py,sha256=DyHIsQ03_YS6kAA8WLeMyXyGgyizkd1WZUZdATkSsZE,532
|
42
43
|
ominfra/manage/commands/marshal.py,sha256=Xl_yRgCD94yDmAx6e2uKVRjkmhV5EOr-Akqo3C0DGXw,689
|
43
44
|
ominfra/manage/commands/ping.py,sha256=DVZFzL1Z_f-Bq53vxMrL3xOi0iK_nMonJE4KvQf9wsI,546
|
@@ -48,21 +49,21 @@ ominfra/manage/deploy/apps.py,sha256=T0eU0Jw-h33_ZPIs0zy9DOx_fgs3YSAAGzu-H0pvt2U
|
|
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
51
|
ominfra/manage/deploy/deploy.py,sha256=YRr_0OPIZJ9LnOeMaHYCSSvqh81a5_LB7OZy-bR2GeA,8966
|
51
|
-
ominfra/manage/deploy/git.py,sha256=
|
52
|
-
ominfra/manage/deploy/inject.py,sha256=
|
53
|
-
ominfra/manage/deploy/
|
52
|
+
ominfra/manage/deploy/git.py,sha256=ILrIPSy-6JObg3xBzIcDwe-iPQt-AiiL2J6AX4l3Pco,5534
|
53
|
+
ominfra/manage/deploy/inject.py,sha256=XeBMwoCsKhO-4VffCVgXOrp_tTAYt15AyVmc4vvIDso,3472
|
54
|
+
ominfra/manage/deploy/injection.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/specs.py,sha256=J8hfWIgrxRYsiIT2ccqKTB5LOGL1rJ7GTZ59aOcDDU0,2893
|
57
58
|
ominfra/manage/deploy/systemd.py,sha256=5hJ6d2zT24zBMUkuJwkhsvm7r4MqNBtm4_ov0kF2Jus,3612
|
58
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
62
|
ominfra/manage/deploy/venvs.py,sha256=PlvhyhZavgiSwGt8BXrhoSwQFVKpU0zCtq2C2N1_8Ak,1696
|
62
63
|
ominfra/manage/deploy/conf/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
63
|
-
ominfra/manage/deploy/conf/inject.py,sha256=
|
64
|
-
ominfra/manage/deploy/conf/manager.py,sha256=
|
65
|
-
ominfra/manage/deploy/conf/specs.py,sha256=
|
64
|
+
ominfra/manage/deploy/conf/inject.py,sha256=s1jJ9I0qj8VxF0JAjfUdpB1OXFXC_rGkQcW1RkQU8aM,453
|
65
|
+
ominfra/manage/deploy/conf/manager.py,sha256=7NL8otu-b-q4dpscbtkn61LH8FT_kvvzeFgH8Y-TsGw,8322
|
66
|
+
ominfra/manage/deploy/conf/specs.py,sha256=DQD0IpzGkDiBt_ofQz4dMopJH4SWIkEvBworRVLWJ90,2191
|
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
|
68
69
|
ominfra/manage/deploy/paths/manager.py,sha256=Dnl8euyZQYDGwDzkMvgPAwOssseducr5kP6T0qzVXQk,929
|
@@ -82,7 +83,7 @@ ominfra/manage/remote/spawning.py,sha256=H4NqyfPr-58V3e495NwlVGRmUfs5sDjNWSKLW7H
|
|
82
83
|
ominfra/manage/system/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
83
84
|
ominfra/manage/system/commands.py,sha256=XrYvsxiwTJh17buIWmoFGH8zTUIXmrXvYkLy1INtmkU,1173
|
84
85
|
ominfra/manage/system/config.py,sha256=mEVBL1cy4twO6F0bdnCI01Sm0xuLe1Z5eiAzCvbmoAc,196
|
85
|
-
ominfra/manage/system/inject.py,sha256=
|
86
|
+
ominfra/manage/system/inject.py,sha256=E19kxskgXd29tRGNXmQnX3XPr3pQFWc-pJzMnuYnNio,1874
|
86
87
|
ominfra/manage/system/packages.py,sha256=HImCsgzXxcfzAoD2PjrstaSE_qgBWtTFUVb0lTEOxkI,4614
|
87
88
|
ominfra/manage/system/platforms.py,sha256=F0bgYzUzCjZ2LbWVvnEq2ya_X_LfRW406LQYFL7bG44,1202
|
88
89
|
ominfra/manage/targets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -93,9 +94,9 @@ 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=Bo_24qN3YI_72BcZYBHid9_SJWnCAmbKRJ3-wE6dGMU,166250
|
96
|
-
ominfra/scripts/manage.py,sha256=
|
97
|
-
ominfra/scripts/supervisor.py,sha256=
|
98
|
-
ominfra/supervisor/LICENSE.txt,sha256=
|
97
|
+
ominfra/scripts/manage.py,sha256=lF4YgDpjAgEUwjvA6BQ6iOxUttnwrz9OgU0zODEcGL4,357186
|
98
|
+
ominfra/scripts/supervisor.py,sha256=6OQnZfnHfXT-hHsGQA_OhA_BjOs01vzInkmEZWYhiVY,291847
|
99
|
+
ominfra/supervisor/LICENSE.txt,sha256=ZrHY15PVR98y26Yg6iQfa-SXnUaYTDhrUsPVcEO5OKM,1874
|
99
100
|
ominfra/supervisor/__init__.py,sha256=Y3l4WY4JRi2uLG6kgbGp93fuGfkxkKwZDvhsa0Rwgtk,15
|
100
101
|
ominfra/supervisor/__main__.py,sha256=I0yFw-C08OOiZ3BF6lF1Oiv789EQXu-_j6whDhQUTEA,66
|
101
102
|
ominfra/supervisor/configs.py,sha256=zpNZmei-Ajild6WNIGnxsPMGbGBFzr0K81L_gR0vBIA,13847
|
@@ -108,7 +109,7 @@ ominfra/supervisor/groupsimpl.py,sha256=PCDyc_Wc-pnvIj56_aEyiA5exCpK6n9iErqnJzO2
|
|
108
109
|
ominfra/supervisor/http.py,sha256=Tl5eT6dyf4KuQXKbhGo1B6CFEzUDtPl_DZAuUFVD9zI,3453
|
109
110
|
ominfra/supervisor/inject.py,sha256=IeR-WKvK1sGNxMe6G2OBT5kSP7EUP5ipkDgcUFmDPCA,4838
|
110
111
|
ominfra/supervisor/io.py,sha256=moaGNaPuYXEAUzLg8Qjo05DEIcOUNYUj8SSr8eT0d24,3198
|
111
|
-
ominfra/supervisor/main.py,sha256
|
112
|
+
ominfra/supervisor/main.py,sha256=--oFVmoCfJuyenet4u5x2pCv9rXbYuVxuUT5tnUQOPw,4404
|
112
113
|
ominfra/supervisor/pipes.py,sha256=2ZihNTnRNjnIPOtPbm3_pyqO15f7BNs7WnNtO5V8ahM,2231
|
113
114
|
ominfra/supervisor/privileges.py,sha256=kaRTHI7XjqzxEWCeHp3_0J0Vc4gSPugRbXEwxuw6MYE,2054
|
114
115
|
ominfra/supervisor/process.py,sha256=UaubVxsxVqDnbuWVpTH0DTGbJGLO0vGJ9mNcvy2kCXM,217
|
@@ -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.dev196.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
141
|
+
ominfra-0.0.0.dev196.dist-info/METADATA,sha256=HRrrf4Bq4gKVYpTYJsv1ER4kcGUx5CMZHnc_qm69z34,767
|
142
|
+
ominfra-0.0.0.dev196.dist-info/WHEEL,sha256=A3WOREP4zgxI0fKrHUG8DC8013e3dK3n7a6HDbcEIwE,91
|
143
|
+
ominfra-0.0.0.dev196.dist-info/entry_points.txt,sha256=kgecQ2MgGrM9qK744BoKS3tMesaC3yjLnl9pa5CRczg,37
|
144
|
+
ominfra-0.0.0.dev196.dist-info/top_level.txt,sha256=E-b2OHkk_AOBLXHYZQ2EOFKl-_6uOGd8EjeG-Zy6h_w,8
|
145
|
+
ominfra-0.0.0.dev196.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|