ominfra 0.0.0.dev176__py3-none-any.whl → 0.0.0.dev177__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 +7 -8
- ominfra/manage/deploy/conf.py +0 -12
- ominfra/manage/deploy/config.py +1 -2
- ominfra/manage/deploy/deploy.py +13 -0
- ominfra/manage/deploy/git.py +24 -9
- ominfra/manage/deploy/inject.py +7 -8
- ominfra/manage/deploy/paths/manager.py +0 -3
- ominfra/manage/deploy/paths/owners.py +4 -10
- ominfra/manage/deploy/specs.py +5 -0
- ominfra/manage/deploy/tmp.py +9 -28
- ominfra/manage/deploy/venvs.py +2 -10
- ominfra/manage/main.py +1 -7
- ominfra/scripts/manage.py +175 -193
- {ominfra-0.0.0.dev176.dist-info → ominfra-0.0.0.dev177.dist-info}/METADATA +3 -3
- {ominfra-0.0.0.dev176.dist-info → ominfra-0.0.0.dev177.dist-info}/RECORD +19 -19
- {ominfra-0.0.0.dev176.dist-info → ominfra-0.0.0.dev177.dist-info}/LICENSE +0 -0
- {ominfra-0.0.0.dev176.dist-info → ominfra-0.0.0.dev177.dist-info}/WHEEL +0 -0
- {ominfra-0.0.0.dev176.dist-info → ominfra-0.0.0.dev177.dist-info}/entry_points.txt +0 -0
- {ominfra-0.0.0.dev176.dist-info → ominfra-0.0.0.dev177.dist-info}/top_level.txt +0 -0
ominfra/manage/deploy/apps.py
CHANGED
@@ -20,16 +20,12 @@ class DeployAppManager(DeployPathOwner):
|
|
20
20
|
def __init__(
|
21
21
|
self,
|
22
22
|
*,
|
23
|
-
deploy_home: ta.Optional[DeployHome] = None,
|
24
|
-
|
25
23
|
conf: DeployConfManager,
|
26
24
|
git: DeployGitManager,
|
27
25
|
venvs: DeployVenvManager,
|
28
26
|
) -> None:
|
29
27
|
super().__init__()
|
30
28
|
|
31
|
-
self._deploy_home = deploy_home
|
32
|
-
|
33
29
|
self._conf = conf
|
34
30
|
self._git = git
|
35
31
|
self._venvs = venvs
|
@@ -70,12 +66,13 @@ class DeployAppManager(DeployPathOwner):
|
|
70
66
|
async def prepare_app(
|
71
67
|
self,
|
72
68
|
spec: DeployAppSpec,
|
69
|
+
home: DeployHome,
|
73
70
|
tags: DeployTagMap,
|
74
71
|
) -> None:
|
75
|
-
|
72
|
+
check.non_empty_str(home)
|
76
73
|
|
77
74
|
def build_path(pth: DeployPath) -> str:
|
78
|
-
return os.path.join(
|
75
|
+
return os.path.join(home, pth.render(tags))
|
79
76
|
|
80
77
|
app_dir = build_path(self._APP_DIR)
|
81
78
|
deploy_dir = build_path(self._DEPLOY_DIR)
|
@@ -85,7 +82,7 @@ class DeployAppManager(DeployPathOwner):
|
|
85
82
|
|
86
83
|
os.makedirs(deploy_dir, exist_ok=True)
|
87
84
|
|
88
|
-
deploying_link = os.path.join(
|
85
|
+
deploying_link = os.path.join(home, 'deploys/deploying')
|
89
86
|
if os.path.exists(deploying_link):
|
90
87
|
os.unlink(deploying_link)
|
91
88
|
relative_symlink(
|
@@ -132,7 +129,7 @@ class DeployAppManager(DeployPathOwner):
|
|
132
129
|
# else:
|
133
130
|
# os.makedirs(os.path.join(dst, os.path.relpath(dp2, src)))
|
134
131
|
|
135
|
-
current_link = os.path.join(
|
132
|
+
current_link = os.path.join(home, 'deploys/current')
|
136
133
|
|
137
134
|
# if os.path.exists(current_link):
|
138
135
|
# mirror_symlinks(
|
@@ -149,6 +146,7 @@ class DeployAppManager(DeployPathOwner):
|
|
149
146
|
app_git_dir = os.path.join(app_dir, 'git')
|
150
147
|
await self._git.checkout(
|
151
148
|
spec.git,
|
149
|
+
home,
|
152
150
|
app_git_dir,
|
153
151
|
)
|
154
152
|
|
@@ -158,6 +156,7 @@ class DeployAppManager(DeployPathOwner):
|
|
158
156
|
app_venv_dir = os.path.join(app_dir, 'venv')
|
159
157
|
await self._venvs.setup_venv(
|
160
158
|
spec.venv,
|
159
|
+
home,
|
161
160
|
app_git_dir,
|
162
161
|
app_venv_dir,
|
163
162
|
)
|
ominfra/manage/deploy/conf.py
CHANGED
@@ -31,21 +31,9 @@ from .tags import DEPLOY_TAG_SEPARATOR
|
|
31
31
|
from .tags import DeployApp
|
32
32
|
from .tags import DeployConf
|
33
33
|
from .tags import DeployTagMap
|
34
|
-
from .types import DeployHome
|
35
34
|
|
36
35
|
|
37
36
|
class DeployConfManager:
|
38
|
-
def __init__(
|
39
|
-
self,
|
40
|
-
*,
|
41
|
-
deploy_home: ta.Optional[DeployHome] = None,
|
42
|
-
) -> None:
|
43
|
-
super().__init__()
|
44
|
-
|
45
|
-
self._deploy_home = deploy_home
|
46
|
-
|
47
|
-
#
|
48
|
-
|
49
37
|
async def _write_app_conf_file(
|
50
38
|
self,
|
51
39
|
acf: DeployAppConfFile,
|
ominfra/manage/deploy/config.py
CHANGED
ominfra/manage/deploy/deploy.py
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
# ruff: noqa: UP006 UP007
|
2
2
|
import datetime
|
3
|
+
import os.path
|
3
4
|
import typing as ta
|
4
5
|
|
6
|
+
from omlish.lite.check import check
|
5
7
|
from omlish.lite.typing import Func0
|
6
8
|
|
7
9
|
from .apps import DeployAppManager
|
@@ -10,6 +12,7 @@ from .specs import DeploySpec
|
|
10
12
|
from .tags import DeployAppRev
|
11
13
|
from .tags import DeployTagMap
|
12
14
|
from .tags import DeployTime
|
15
|
+
from .types import DeployHome
|
13
16
|
|
14
17
|
|
15
18
|
DEPLOY_TAG_DATETIME_FMT = '%Y%m%dT%H%M%SZ'
|
@@ -51,6 +54,15 @@ class DeployManager:
|
|
51
54
|
|
52
55
|
#
|
53
56
|
|
57
|
+
hs = check.non_empty_str(spec.home)
|
58
|
+
hs = os.path.expanduser(hs)
|
59
|
+
hs = os.path.realpath(hs)
|
60
|
+
hs = os.path.abspath(hs)
|
61
|
+
|
62
|
+
home = DeployHome(hs)
|
63
|
+
|
64
|
+
#
|
65
|
+
|
54
66
|
deploy_tags = DeployTagMap(
|
55
67
|
self._make_deploy_time(),
|
56
68
|
spec.key(),
|
@@ -67,5 +79,6 @@ class DeployManager:
|
|
67
79
|
|
68
80
|
await self._apps.prepare_app(
|
69
81
|
app,
|
82
|
+
home,
|
70
83
|
app_tags,
|
71
84
|
)
|
ominfra/manage/deploy/git.py
CHANGED
@@ -15,11 +15,11 @@ import typing as ta
|
|
15
15
|
from omlish.asyncs.asyncio.subprocesses import asyncio_subprocesses
|
16
16
|
from omlish.lite.cached import async_cached_nullary
|
17
17
|
from omlish.lite.check import check
|
18
|
-
from omlish.os.atomics import AtomicPathSwapping
|
19
18
|
|
20
19
|
from .paths.owners import SingleDirDeployPathOwner
|
21
20
|
from .specs import DeployGitRepo
|
22
21
|
from .specs import DeployGitSpec
|
22
|
+
from .tmp import DeployHomeAtomics
|
23
23
|
from .types import DeployHome
|
24
24
|
from .types import DeployRev
|
25
25
|
|
@@ -31,12 +31,10 @@ class DeployGitManager(SingleDirDeployPathOwner):
|
|
31
31
|
def __init__(
|
32
32
|
self,
|
33
33
|
*,
|
34
|
-
|
35
|
-
atomics: AtomicPathSwapping,
|
34
|
+
atomics: DeployHomeAtomics,
|
36
35
|
) -> None:
|
37
36
|
super().__init__(
|
38
37
|
owned_dir='git',
|
39
|
-
deploy_home=deploy_home,
|
40
38
|
)
|
41
39
|
|
42
40
|
self._atomics = atomics
|
@@ -48,13 +46,15 @@ class DeployGitManager(SingleDirDeployPathOwner):
|
|
48
46
|
self,
|
49
47
|
git: 'DeployGitManager',
|
50
48
|
repo: DeployGitRepo,
|
49
|
+
home: DeployHome,
|
51
50
|
) -> None:
|
52
51
|
super().__init__()
|
53
52
|
|
54
53
|
self._git = git
|
55
54
|
self._repo = repo
|
55
|
+
self._home = home
|
56
56
|
self._dir = os.path.join(
|
57
|
-
self._git._make_dir(), # noqa
|
57
|
+
self._git._make_dir(home), # noqa
|
58
58
|
check.non_empty_str(repo.host),
|
59
59
|
check.non_empty_str(repo.path),
|
60
60
|
)
|
@@ -97,7 +97,7 @@ class DeployGitManager(SingleDirDeployPathOwner):
|
|
97
97
|
|
98
98
|
async def checkout(self, spec: DeployGitSpec, dst_dir: str) -> None:
|
99
99
|
check.state(not os.path.exists(dst_dir))
|
100
|
-
with self._git._atomics.begin_atomic_path_swap( # noqa
|
100
|
+
with self._git._atomics(self._home).begin_atomic_path_swap( # noqa
|
101
101
|
'dir',
|
102
102
|
dst_dir,
|
103
103
|
auto_commit=True,
|
@@ -112,16 +112,31 @@ class DeployGitManager(SingleDirDeployPathOwner):
|
|
112
112
|
await dst_call('git', 'fetch', '--depth=1', 'local', spec.rev)
|
113
113
|
await dst_call('git', 'checkout', spec.rev, *(spec.subtrees or []))
|
114
114
|
|
115
|
-
def get_repo_dir(
|
115
|
+
def get_repo_dir(
|
116
|
+
self,
|
117
|
+
repo: DeployGitRepo,
|
118
|
+
home: DeployHome,
|
119
|
+
) -> RepoDir:
|
116
120
|
try:
|
117
121
|
return self._repo_dirs[repo]
|
118
122
|
except KeyError:
|
119
|
-
repo_dir = self._repo_dirs[repo] = DeployGitManager.RepoDir(
|
123
|
+
repo_dir = self._repo_dirs[repo] = DeployGitManager.RepoDir(
|
124
|
+
self,
|
125
|
+
repo,
|
126
|
+
home,
|
127
|
+
)
|
120
128
|
return repo_dir
|
121
129
|
|
122
130
|
async def checkout(
|
123
131
|
self,
|
124
132
|
spec: DeployGitSpec,
|
133
|
+
home: DeployHome,
|
125
134
|
dst_dir: str,
|
126
135
|
) -> None:
|
127
|
-
await self.get_repo_dir(
|
136
|
+
await self.get_repo_dir(
|
137
|
+
spec.repo,
|
138
|
+
home,
|
139
|
+
).checkout(
|
140
|
+
spec,
|
141
|
+
dst_dir,
|
142
|
+
)
|
ominfra/manage/deploy/inject.py
CHANGED
@@ -1,11 +1,9 @@
|
|
1
1
|
# ruff: noqa: UP006 UP007
|
2
|
-
import os.path
|
3
2
|
import typing as ta
|
4
3
|
|
5
4
|
from omlish.lite.inject import InjectorBindingOrBindings
|
6
5
|
from omlish.lite.inject import InjectorBindings
|
7
6
|
from omlish.lite.inject import inj
|
8
|
-
from omlish.os.atomics import AtomicPathSwapping
|
9
7
|
|
10
8
|
from ..commands.inject import bind_command
|
11
9
|
from .apps import DeployAppManager
|
@@ -19,8 +17,8 @@ from .interp import InterpCommand
|
|
19
17
|
from .interp import InterpCommandExecutor
|
20
18
|
from .paths.inject import bind_deploy_paths
|
21
19
|
from .paths.owners import DeployPathOwner
|
20
|
+
from .tmp import DeployHomeAtomics
|
22
21
|
from .tmp import DeployTmpManager
|
23
|
-
from .types import DeployHome
|
24
22
|
from .venvs import DeployVenvManager
|
25
23
|
|
26
24
|
|
@@ -55,13 +53,18 @@ def bind_deploy(
|
|
55
53
|
bind_manager(DeployManager),
|
56
54
|
|
57
55
|
bind_manager(DeployTmpManager),
|
58
|
-
inj.bind(AtomicPathSwapping, to_key=DeployTmpManager),
|
59
56
|
|
60
57
|
bind_manager(DeployVenvManager),
|
61
58
|
])
|
62
59
|
|
63
60
|
#
|
64
61
|
|
62
|
+
def provide_deploy_home_atomics(tmp: DeployTmpManager) -> DeployHomeAtomics:
|
63
|
+
return DeployHomeAtomics(tmp.get_swapping)
|
64
|
+
lst.append(inj.bind(provide_deploy_home_atomics, singleton=True))
|
65
|
+
|
66
|
+
#
|
67
|
+
|
65
68
|
lst.extend([
|
66
69
|
bind_command(DeployCommand, DeployCommandExecutor),
|
67
70
|
bind_command(InterpCommand, InterpCommandExecutor),
|
@@ -69,8 +72,4 @@ def bind_deploy(
|
|
69
72
|
|
70
73
|
#
|
71
74
|
|
72
|
-
if (dh := deploy_config.deploy_home) is not None:
|
73
|
-
dh = os.path.abspath(os.path.expanduser(dh))
|
74
|
-
lst.append(inj.bind(dh, key=DeployHome))
|
75
|
-
|
76
75
|
return inj.as_bindings(*lst)
|
@@ -3,7 +3,6 @@ import typing as ta
|
|
3
3
|
|
4
4
|
from omlish.lite.cached import cached_nullary
|
5
5
|
|
6
|
-
from ..types import DeployHome
|
7
6
|
from .owners import DeployPathOwner
|
8
7
|
from .owners import DeployPathOwners
|
9
8
|
from .paths import DeployPath
|
@@ -14,12 +13,10 @@ class DeployPathsManager:
|
|
14
13
|
def __init__(
|
15
14
|
self,
|
16
15
|
*,
|
17
|
-
deploy_home: ta.Optional[DeployHome],
|
18
16
|
deploy_path_owners: DeployPathOwners,
|
19
17
|
) -> None:
|
20
18
|
super().__init__()
|
21
19
|
|
22
|
-
self._deploy_home = deploy_home
|
23
20
|
self._deploy_path_owners = deploy_path_owners
|
24
21
|
|
25
22
|
@cached_nullary
|
@@ -3,7 +3,6 @@ import abc
|
|
3
3
|
import os.path
|
4
4
|
import typing as ta
|
5
5
|
|
6
|
-
from omlish.lite.cached import cached_nullary
|
7
6
|
from omlish.lite.check import check
|
8
7
|
|
9
8
|
from ..types import DeployHome
|
@@ -24,7 +23,6 @@ class SingleDirDeployPathOwner(DeployPathOwner, abc.ABC):
|
|
24
23
|
self,
|
25
24
|
*args: ta.Any,
|
26
25
|
owned_dir: str,
|
27
|
-
deploy_home: ta.Optional[DeployHome],
|
28
26
|
**kwargs: ta.Any,
|
29
27
|
) -> None:
|
30
28
|
super().__init__(*args, **kwargs)
|
@@ -32,17 +30,13 @@ class SingleDirDeployPathOwner(DeployPathOwner, abc.ABC):
|
|
32
30
|
check.not_in('/', owned_dir)
|
33
31
|
self._owned_dir: str = check.non_empty_str(owned_dir)
|
34
32
|
|
35
|
-
self._deploy_home = deploy_home
|
36
|
-
|
37
33
|
self._owned_deploy_paths = frozenset([DeployPath.parse(self._owned_dir + '/')])
|
38
34
|
|
39
|
-
|
40
|
-
|
41
|
-
return os.path.join(check.non_empty_str(self._deploy_home), self._owned_dir)
|
35
|
+
def _dir(self, home: DeployHome) -> str:
|
36
|
+
return os.path.join(check.non_empty_str(home), self._owned_dir)
|
42
37
|
|
43
|
-
|
44
|
-
|
45
|
-
if not os.path.isdir(d := self._dir()):
|
38
|
+
def _make_dir(self, home: DeployHome) -> str:
|
39
|
+
if not os.path.isdir(d := self._dir(home)):
|
46
40
|
os.makedirs(d, exist_ok=True)
|
47
41
|
return d
|
48
42
|
|
ominfra/manage/deploy/specs.py
CHANGED
@@ -11,6 +11,7 @@ from .tags import DeployApp
|
|
11
11
|
from .tags import DeployAppKey
|
12
12
|
from .tags import DeployKey
|
13
13
|
from .tags import KeyDeployTag # noqa
|
14
|
+
from .types import DeployHome
|
14
15
|
from .types import DeployRev
|
15
16
|
|
16
17
|
|
@@ -153,9 +154,13 @@ class DeployAppSpec(DeploySpecKeyed[DeployAppKey]):
|
|
153
154
|
|
154
155
|
@dc.dataclass(frozen=True)
|
155
156
|
class DeploySpec(DeploySpecKeyed[DeployKey]):
|
157
|
+
home: DeployHome
|
158
|
+
|
156
159
|
apps: ta.Sequence[DeployAppSpec]
|
157
160
|
|
158
161
|
def __post_init__(self) -> None:
|
162
|
+
check.non_empty_str(self.home)
|
163
|
+
|
159
164
|
seen: ta.Set[DeployApp] = set()
|
160
165
|
for a in self.apps:
|
161
166
|
if a.app in seen:
|
ominfra/manage/deploy/tmp.py
CHANGED
@@ -1,10 +1,6 @@
|
|
1
1
|
# ruff: noqa: UP006 UP007
|
2
|
-
import typing as ta
|
3
|
-
|
4
|
-
from omlish.lite.cached import cached_nullary
|
5
2
|
from omlish.lite.check import check
|
6
|
-
from omlish.
|
7
|
-
from omlish.os.atomics import AtomicPathSwapKind
|
3
|
+
from omlish.lite.typing import Func1
|
8
4
|
from omlish.os.atomics import AtomicPathSwapping
|
9
5
|
from omlish.os.atomics import TempDirAtomicPathSwapping
|
10
6
|
|
@@ -12,35 +8,20 @@ from .paths.owners import SingleDirDeployPathOwner
|
|
12
8
|
from .types import DeployHome
|
13
9
|
|
14
10
|
|
11
|
+
class DeployHomeAtomics(Func1[DeployHome, AtomicPathSwapping]):
|
12
|
+
pass
|
13
|
+
|
14
|
+
|
15
15
|
class DeployTmpManager(
|
16
16
|
SingleDirDeployPathOwner,
|
17
|
-
AtomicPathSwapping,
|
18
17
|
):
|
19
|
-
def __init__(
|
20
|
-
self,
|
21
|
-
*,
|
22
|
-
deploy_home: ta.Optional[DeployHome] = None,
|
23
|
-
) -> None:
|
18
|
+
def __init__(self) -> None:
|
24
19
|
super().__init__(
|
25
20
|
owned_dir='tmp',
|
26
|
-
deploy_home=deploy_home,
|
27
21
|
)
|
28
22
|
|
29
|
-
|
30
|
-
def _swapping(self) -> AtomicPathSwapping:
|
23
|
+
def get_swapping(self, home: DeployHome) -> AtomicPathSwapping:
|
31
24
|
return TempDirAtomicPathSwapping(
|
32
|
-
temp_dir=self._make_dir(),
|
33
|
-
root_dir=check.non_empty_str(
|
34
|
-
)
|
35
|
-
|
36
|
-
def begin_atomic_path_swap(
|
37
|
-
self,
|
38
|
-
kind: AtomicPathSwapKind,
|
39
|
-
dst_path: str,
|
40
|
-
**kwargs: ta.Any,
|
41
|
-
) -> AtomicPathSwap:
|
42
|
-
return self._swapping().begin_atomic_path_swap(
|
43
|
-
kind,
|
44
|
-
dst_path,
|
45
|
-
**kwargs,
|
25
|
+
temp_dir=self._make_dir(home),
|
26
|
+
root_dir=check.non_empty_str(home),
|
46
27
|
)
|
ominfra/manage/deploy/venvs.py
CHANGED
@@ -10,24 +10,16 @@ from omdev.interp.resolvers import DEFAULT_INTERP_RESOLVER
|
|
10
10
|
from omdev.interp.types import InterpSpecifier
|
11
11
|
from omlish.asyncs.asyncio.subprocesses import asyncio_subprocesses
|
12
12
|
from omlish.lite.check import check
|
13
|
-
from omlish.os.atomics import AtomicPathSwapping
|
14
13
|
|
15
14
|
from .specs import DeployVenvSpec
|
15
|
+
from .types import DeployHome
|
16
16
|
|
17
17
|
|
18
18
|
class DeployVenvManager:
|
19
|
-
def __init__(
|
20
|
-
self,
|
21
|
-
*,
|
22
|
-
atomics: AtomicPathSwapping,
|
23
|
-
) -> None:
|
24
|
-
super().__init__()
|
25
|
-
|
26
|
-
self._atomics = atomics
|
27
|
-
|
28
19
|
async def setup_venv(
|
29
20
|
self,
|
30
21
|
spec: DeployVenvSpec,
|
22
|
+
home: DeployHome,
|
31
23
|
git_dir: str,
|
32
24
|
venv_dir: str,
|
33
25
|
) -> None:
|
ominfra/manage/main.py
CHANGED
@@ -35,8 +35,6 @@ from .targets.targets import ManageTarget
|
|
35
35
|
|
36
36
|
@dc.dataclass(frozen=True)
|
37
37
|
class ManageConfig:
|
38
|
-
deploy_home: ta.Optional[str] = None
|
39
|
-
|
40
38
|
targets: ta.Optional[ta.Mapping[str, ManageTarget]] = None
|
41
39
|
|
42
40
|
|
@@ -68,8 +66,6 @@ class MainCli(ArgparseCli):
|
|
68
66
|
|
69
67
|
argparse_arg('--debug', action='store_true'),
|
70
68
|
|
71
|
-
argparse_arg('--deploy-home'),
|
72
|
-
|
73
69
|
argparse_arg('target'),
|
74
70
|
argparse_arg('-f', '--command-file', action='append'),
|
75
71
|
argparse_arg('command', nargs='*'),
|
@@ -82,9 +78,7 @@ class MainCli(ArgparseCli):
|
|
82
78
|
debug=bool(self.args.debug),
|
83
79
|
),
|
84
80
|
|
85
|
-
deploy_config=DeployConfig(
|
86
|
-
deploy_home=self.args.deploy_home or self.config().deploy_home,
|
87
|
-
),
|
81
|
+
deploy_config=DeployConfig(),
|
88
82
|
|
89
83
|
remote_config=RemoteConfig(
|
90
84
|
payload_file=self.args._payload_file, # noqa
|
ominfra/scripts/manage.py
CHANGED
@@ -1384,7 +1384,7 @@ class MainConfig:
|
|
1384
1384
|
|
1385
1385
|
@dc.dataclass(frozen=True)
|
1386
1386
|
class DeployConfig:
|
1387
|
-
|
1387
|
+
pass
|
1388
1388
|
|
1389
1389
|
|
1390
1390
|
########################################
|
@@ -7885,9 +7885,13 @@ class DeployAppSpec(DeploySpecKeyed[DeployAppKey]):
|
|
7885
7885
|
|
7886
7886
|
@dc.dataclass(frozen=True)
|
7887
7887
|
class DeploySpec(DeploySpecKeyed[DeployKey]):
|
7888
|
+
home: DeployHome
|
7889
|
+
|
7888
7890
|
apps: ta.Sequence[DeployAppSpec]
|
7889
7891
|
|
7890
7892
|
def __post_init__(self) -> None:
|
7893
|
+
check.non_empty_str(self.home)
|
7894
|
+
|
7891
7895
|
seen: ta.Set[DeployApp] = set()
|
7892
7896
|
for a in self.apps:
|
7893
7897
|
if a.app in seen:
|
@@ -8707,17 +8711,6 @@ TODO:
|
|
8707
8711
|
|
8708
8712
|
|
8709
8713
|
class DeployConfManager:
|
8710
|
-
def __init__(
|
8711
|
-
self,
|
8712
|
-
*,
|
8713
|
-
deploy_home: ta.Optional[DeployHome] = None,
|
8714
|
-
) -> None:
|
8715
|
-
super().__init__()
|
8716
|
-
|
8717
|
-
self._deploy_home = deploy_home
|
8718
|
-
|
8719
|
-
#
|
8720
|
-
|
8721
8714
|
async def _write_app_conf_file(
|
8722
8715
|
self,
|
8723
8716
|
acf: DeployAppConfFile,
|
@@ -8884,7 +8877,6 @@ class SingleDirDeployPathOwner(DeployPathOwner, abc.ABC):
|
|
8884
8877
|
self,
|
8885
8878
|
*args: ta.Any,
|
8886
8879
|
owned_dir: str,
|
8887
|
-
deploy_home: ta.Optional[DeployHome],
|
8888
8880
|
**kwargs: ta.Any,
|
8889
8881
|
) -> None:
|
8890
8882
|
super().__init__(*args, **kwargs)
|
@@ -8892,17 +8884,13 @@ class SingleDirDeployPathOwner(DeployPathOwner, abc.ABC):
|
|
8892
8884
|
check.not_in('/', owned_dir)
|
8893
8885
|
self._owned_dir: str = check.non_empty_str(owned_dir)
|
8894
8886
|
|
8895
|
-
self._deploy_home = deploy_home
|
8896
|
-
|
8897
8887
|
self._owned_deploy_paths = frozenset([DeployPath.parse(self._owned_dir + '/')])
|
8898
8888
|
|
8899
|
-
|
8900
|
-
|
8901
|
-
return os.path.join(check.non_empty_str(self._deploy_home), self._owned_dir)
|
8889
|
+
def _dir(self, home: DeployHome) -> str:
|
8890
|
+
return os.path.join(check.non_empty_str(home), self._owned_dir)
|
8902
8891
|
|
8903
|
-
|
8904
|
-
|
8905
|
-
if not os.path.isdir(d := self._dir()):
|
8892
|
+
def _make_dir(self, home: DeployHome) -> str:
|
8893
|
+
if not os.path.isdir(d := self._dir(home)):
|
8906
8894
|
os.makedirs(d, exist_ok=True)
|
8907
8895
|
return d
|
8908
8896
|
|
@@ -9442,122 +9430,6 @@ def bind_commands(
|
|
9442
9430
|
return inj.as_bindings(*lst)
|
9443
9431
|
|
9444
9432
|
|
9445
|
-
########################################
|
9446
|
-
# ../deploy/git.py
|
9447
|
-
"""
|
9448
|
-
TODO:
|
9449
|
-
- 'repos'?
|
9450
|
-
|
9451
|
-
git/github.com/wrmsr/omlish <- bootstrap repo
|
9452
|
-
- shallow clone off bootstrap into /apps
|
9453
|
-
|
9454
|
-
github.com/wrmsr/omlish@rev
|
9455
|
-
"""
|
9456
|
-
|
9457
|
-
|
9458
|
-
##
|
9459
|
-
|
9460
|
-
|
9461
|
-
class DeployGitManager(SingleDirDeployPathOwner):
|
9462
|
-
def __init__(
|
9463
|
-
self,
|
9464
|
-
*,
|
9465
|
-
deploy_home: ta.Optional[DeployHome] = None,
|
9466
|
-
atomics: AtomicPathSwapping,
|
9467
|
-
) -> None:
|
9468
|
-
super().__init__(
|
9469
|
-
owned_dir='git',
|
9470
|
-
deploy_home=deploy_home,
|
9471
|
-
)
|
9472
|
-
|
9473
|
-
self._atomics = atomics
|
9474
|
-
|
9475
|
-
self._repo_dirs: ta.Dict[DeployGitRepo, DeployGitManager.RepoDir] = {}
|
9476
|
-
|
9477
|
-
class RepoDir:
|
9478
|
-
def __init__(
|
9479
|
-
self,
|
9480
|
-
git: 'DeployGitManager',
|
9481
|
-
repo: DeployGitRepo,
|
9482
|
-
) -> None:
|
9483
|
-
super().__init__()
|
9484
|
-
|
9485
|
-
self._git = git
|
9486
|
-
self._repo = repo
|
9487
|
-
self._dir = os.path.join(
|
9488
|
-
self._git._make_dir(), # noqa
|
9489
|
-
check.non_empty_str(repo.host),
|
9490
|
-
check.non_empty_str(repo.path),
|
9491
|
-
)
|
9492
|
-
|
9493
|
-
@property
|
9494
|
-
def repo(self) -> DeployGitRepo:
|
9495
|
-
return self._repo
|
9496
|
-
|
9497
|
-
@property
|
9498
|
-
def url(self) -> str:
|
9499
|
-
if self._repo.username is not None:
|
9500
|
-
return f'{self._repo.username}@{self._repo.host}:{self._repo.path}'
|
9501
|
-
else:
|
9502
|
-
return f'https://{self._repo.host}/{self._repo.path}'
|
9503
|
-
|
9504
|
-
#
|
9505
|
-
|
9506
|
-
async def _call(self, *cmd: str) -> None:
|
9507
|
-
await asyncio_subprocesses.check_call(
|
9508
|
-
*cmd,
|
9509
|
-
cwd=self._dir,
|
9510
|
-
)
|
9511
|
-
|
9512
|
-
#
|
9513
|
-
|
9514
|
-
@async_cached_nullary
|
9515
|
-
async def init(self) -> None:
|
9516
|
-
os.makedirs(self._dir, exist_ok=True)
|
9517
|
-
if os.path.exists(os.path.join(self._dir, '.git')):
|
9518
|
-
return
|
9519
|
-
|
9520
|
-
await self._call('git', 'init')
|
9521
|
-
await self._call('git', 'remote', 'add', 'origin', self.url)
|
9522
|
-
|
9523
|
-
async def fetch(self, rev: DeployRev) -> None:
|
9524
|
-
await self.init()
|
9525
|
-
await self._call('git', 'fetch', '--depth=1', 'origin', rev)
|
9526
|
-
|
9527
|
-
#
|
9528
|
-
|
9529
|
-
async def checkout(self, spec: DeployGitSpec, dst_dir: str) -> None:
|
9530
|
-
check.state(not os.path.exists(dst_dir))
|
9531
|
-
with self._git._atomics.begin_atomic_path_swap( # noqa
|
9532
|
-
'dir',
|
9533
|
-
dst_dir,
|
9534
|
-
auto_commit=True,
|
9535
|
-
make_dirs=True,
|
9536
|
-
) as dst_swap:
|
9537
|
-
await self.fetch(spec.rev)
|
9538
|
-
|
9539
|
-
dst_call = functools.partial(asyncio_subprocesses.check_call, cwd=dst_swap.tmp_path)
|
9540
|
-
await dst_call('git', 'init')
|
9541
|
-
|
9542
|
-
await dst_call('git', 'remote', 'add', 'local', self._dir)
|
9543
|
-
await dst_call('git', 'fetch', '--depth=1', 'local', spec.rev)
|
9544
|
-
await dst_call('git', 'checkout', spec.rev, *(spec.subtrees or []))
|
9545
|
-
|
9546
|
-
def get_repo_dir(self, repo: DeployGitRepo) -> RepoDir:
|
9547
|
-
try:
|
9548
|
-
return self._repo_dirs[repo]
|
9549
|
-
except KeyError:
|
9550
|
-
repo_dir = self._repo_dirs[repo] = DeployGitManager.RepoDir(self, repo)
|
9551
|
-
return repo_dir
|
9552
|
-
|
9553
|
-
async def checkout(
|
9554
|
-
self,
|
9555
|
-
spec: DeployGitSpec,
|
9556
|
-
dst_dir: str,
|
9557
|
-
) -> None:
|
9558
|
-
await self.get_repo_dir(spec.repo).checkout(spec, dst_dir)
|
9559
|
-
|
9560
|
-
|
9561
9433
|
########################################
|
9562
9434
|
# ../deploy/paths/manager.py
|
9563
9435
|
|
@@ -9566,12 +9438,10 @@ class DeployPathsManager:
|
|
9566
9438
|
def __init__(
|
9567
9439
|
self,
|
9568
9440
|
*,
|
9569
|
-
deploy_home: ta.Optional[DeployHome],
|
9570
9441
|
deploy_path_owners: DeployPathOwners,
|
9571
9442
|
) -> None:
|
9572
9443
|
super().__init__()
|
9573
9444
|
|
9574
|
-
self._deploy_home = deploy_home
|
9575
9445
|
self._deploy_path_owners = deploy_path_owners
|
9576
9446
|
|
9577
9447
|
@cached_nullary
|
@@ -9592,37 +9462,22 @@ class DeployPathsManager:
|
|
9592
9462
|
# ../deploy/tmp.py
|
9593
9463
|
|
9594
9464
|
|
9465
|
+
class DeployHomeAtomics(Func1[DeployHome, AtomicPathSwapping]):
|
9466
|
+
pass
|
9467
|
+
|
9468
|
+
|
9595
9469
|
class DeployTmpManager(
|
9596
9470
|
SingleDirDeployPathOwner,
|
9597
|
-
AtomicPathSwapping,
|
9598
9471
|
):
|
9599
|
-
def __init__(
|
9600
|
-
self,
|
9601
|
-
*,
|
9602
|
-
deploy_home: ta.Optional[DeployHome] = None,
|
9603
|
-
) -> None:
|
9472
|
+
def __init__(self) -> None:
|
9604
9473
|
super().__init__(
|
9605
9474
|
owned_dir='tmp',
|
9606
|
-
deploy_home=deploy_home,
|
9607
9475
|
)
|
9608
9476
|
|
9609
|
-
|
9610
|
-
def _swapping(self) -> AtomicPathSwapping:
|
9477
|
+
def get_swapping(self, home: DeployHome) -> AtomicPathSwapping:
|
9611
9478
|
return TempDirAtomicPathSwapping(
|
9612
|
-
temp_dir=self._make_dir(),
|
9613
|
-
root_dir=check.non_empty_str(
|
9614
|
-
)
|
9615
|
-
|
9616
|
-
def begin_atomic_path_swap(
|
9617
|
-
self,
|
9618
|
-
kind: AtomicPathSwapKind,
|
9619
|
-
dst_path: str,
|
9620
|
-
**kwargs: ta.Any,
|
9621
|
-
) -> AtomicPathSwap:
|
9622
|
-
return self._swapping().begin_atomic_path_swap(
|
9623
|
-
kind,
|
9624
|
-
dst_path,
|
9625
|
-
**kwargs,
|
9479
|
+
temp_dir=self._make_dir(home),
|
9480
|
+
root_dir=check.non_empty_str(home),
|
9626
9481
|
)
|
9627
9482
|
|
9628
9483
|
|
@@ -10081,11 +9936,11 @@ class PyenvVersionInstaller:
|
|
10081
9936
|
full_args = [
|
10082
9937
|
os.path.join(check.not_none(await self._pyenv.root()), 'plugins', 'python-build', 'bin', 'python-build'), # noqa
|
10083
9938
|
*conf_args,
|
10084
|
-
self.install_dir(),
|
9939
|
+
await self.install_dir(),
|
10085
9940
|
]
|
10086
9941
|
else:
|
10087
9942
|
full_args = [
|
10088
|
-
self._pyenv.exe(),
|
9943
|
+
await self._pyenv.exe(),
|
10089
9944
|
'install',
|
10090
9945
|
*conf_args,
|
10091
9946
|
]
|
@@ -10340,6 +10195,137 @@ class SystemInterpProvider(InterpProvider):
|
|
10340
10195
|
raise KeyError(version)
|
10341
10196
|
|
10342
10197
|
|
10198
|
+
########################################
|
10199
|
+
# ../deploy/git.py
|
10200
|
+
"""
|
10201
|
+
TODO:
|
10202
|
+
- 'repos'?
|
10203
|
+
|
10204
|
+
git/github.com/wrmsr/omlish <- bootstrap repo
|
10205
|
+
- shallow clone off bootstrap into /apps
|
10206
|
+
|
10207
|
+
github.com/wrmsr/omlish@rev
|
10208
|
+
"""
|
10209
|
+
|
10210
|
+
|
10211
|
+
##
|
10212
|
+
|
10213
|
+
|
10214
|
+
class DeployGitManager(SingleDirDeployPathOwner):
|
10215
|
+
def __init__(
|
10216
|
+
self,
|
10217
|
+
*,
|
10218
|
+
atomics: DeployHomeAtomics,
|
10219
|
+
) -> None:
|
10220
|
+
super().__init__(
|
10221
|
+
owned_dir='git',
|
10222
|
+
)
|
10223
|
+
|
10224
|
+
self._atomics = atomics
|
10225
|
+
|
10226
|
+
self._repo_dirs: ta.Dict[DeployGitRepo, DeployGitManager.RepoDir] = {}
|
10227
|
+
|
10228
|
+
class RepoDir:
|
10229
|
+
def __init__(
|
10230
|
+
self,
|
10231
|
+
git: 'DeployGitManager',
|
10232
|
+
repo: DeployGitRepo,
|
10233
|
+
home: DeployHome,
|
10234
|
+
) -> None:
|
10235
|
+
super().__init__()
|
10236
|
+
|
10237
|
+
self._git = git
|
10238
|
+
self._repo = repo
|
10239
|
+
self._home = home
|
10240
|
+
self._dir = os.path.join(
|
10241
|
+
self._git._make_dir(home), # noqa
|
10242
|
+
check.non_empty_str(repo.host),
|
10243
|
+
check.non_empty_str(repo.path),
|
10244
|
+
)
|
10245
|
+
|
10246
|
+
@property
|
10247
|
+
def repo(self) -> DeployGitRepo:
|
10248
|
+
return self._repo
|
10249
|
+
|
10250
|
+
@property
|
10251
|
+
def url(self) -> str:
|
10252
|
+
if self._repo.username is not None:
|
10253
|
+
return f'{self._repo.username}@{self._repo.host}:{self._repo.path}'
|
10254
|
+
else:
|
10255
|
+
return f'https://{self._repo.host}/{self._repo.path}'
|
10256
|
+
|
10257
|
+
#
|
10258
|
+
|
10259
|
+
async def _call(self, *cmd: str) -> None:
|
10260
|
+
await asyncio_subprocesses.check_call(
|
10261
|
+
*cmd,
|
10262
|
+
cwd=self._dir,
|
10263
|
+
)
|
10264
|
+
|
10265
|
+
#
|
10266
|
+
|
10267
|
+
@async_cached_nullary
|
10268
|
+
async def init(self) -> None:
|
10269
|
+
os.makedirs(self._dir, exist_ok=True)
|
10270
|
+
if os.path.exists(os.path.join(self._dir, '.git')):
|
10271
|
+
return
|
10272
|
+
|
10273
|
+
await self._call('git', 'init')
|
10274
|
+
await self._call('git', 'remote', 'add', 'origin', self.url)
|
10275
|
+
|
10276
|
+
async def fetch(self, rev: DeployRev) -> None:
|
10277
|
+
await self.init()
|
10278
|
+
await self._call('git', 'fetch', '--depth=1', 'origin', rev)
|
10279
|
+
|
10280
|
+
#
|
10281
|
+
|
10282
|
+
async def checkout(self, spec: DeployGitSpec, dst_dir: str) -> None:
|
10283
|
+
check.state(not os.path.exists(dst_dir))
|
10284
|
+
with self._git._atomics(self._home).begin_atomic_path_swap( # noqa
|
10285
|
+
'dir',
|
10286
|
+
dst_dir,
|
10287
|
+
auto_commit=True,
|
10288
|
+
make_dirs=True,
|
10289
|
+
) as dst_swap:
|
10290
|
+
await self.fetch(spec.rev)
|
10291
|
+
|
10292
|
+
dst_call = functools.partial(asyncio_subprocesses.check_call, cwd=dst_swap.tmp_path)
|
10293
|
+
await dst_call('git', 'init')
|
10294
|
+
|
10295
|
+
await dst_call('git', 'remote', 'add', 'local', self._dir)
|
10296
|
+
await dst_call('git', 'fetch', '--depth=1', 'local', spec.rev)
|
10297
|
+
await dst_call('git', 'checkout', spec.rev, *(spec.subtrees or []))
|
10298
|
+
|
10299
|
+
def get_repo_dir(
|
10300
|
+
self,
|
10301
|
+
repo: DeployGitRepo,
|
10302
|
+
home: DeployHome,
|
10303
|
+
) -> RepoDir:
|
10304
|
+
try:
|
10305
|
+
return self._repo_dirs[repo]
|
10306
|
+
except KeyError:
|
10307
|
+
repo_dir = self._repo_dirs[repo] = DeployGitManager.RepoDir(
|
10308
|
+
self,
|
10309
|
+
repo,
|
10310
|
+
home,
|
10311
|
+
)
|
10312
|
+
return repo_dir
|
10313
|
+
|
10314
|
+
async def checkout(
|
10315
|
+
self,
|
10316
|
+
spec: DeployGitSpec,
|
10317
|
+
home: DeployHome,
|
10318
|
+
dst_dir: str,
|
10319
|
+
) -> None:
|
10320
|
+
await self.get_repo_dir(
|
10321
|
+
spec.repo,
|
10322
|
+
home,
|
10323
|
+
).checkout(
|
10324
|
+
spec,
|
10325
|
+
dst_dir,
|
10326
|
+
)
|
10327
|
+
|
10328
|
+
|
10343
10329
|
########################################
|
10344
10330
|
# ../deploy/paths/inject.py
|
10345
10331
|
|
@@ -10739,18 +10725,10 @@ TODO:
|
|
10739
10725
|
|
10740
10726
|
|
10741
10727
|
class DeployVenvManager:
|
10742
|
-
def __init__(
|
10743
|
-
self,
|
10744
|
-
*,
|
10745
|
-
atomics: AtomicPathSwapping,
|
10746
|
-
) -> None:
|
10747
|
-
super().__init__()
|
10748
|
-
|
10749
|
-
self._atomics = atomics
|
10750
|
-
|
10751
10728
|
async def setup_venv(
|
10752
10729
|
self,
|
10753
10730
|
spec: DeployVenvSpec,
|
10731
|
+
home: DeployHome,
|
10754
10732
|
git_dir: str,
|
10755
10733
|
venv_dir: str,
|
10756
10734
|
) -> None:
|
@@ -10793,16 +10771,12 @@ class DeployAppManager(DeployPathOwner):
|
|
10793
10771
|
def __init__(
|
10794
10772
|
self,
|
10795
10773
|
*,
|
10796
|
-
deploy_home: ta.Optional[DeployHome] = None,
|
10797
|
-
|
10798
10774
|
conf: DeployConfManager,
|
10799
10775
|
git: DeployGitManager,
|
10800
10776
|
venvs: DeployVenvManager,
|
10801
10777
|
) -> None:
|
10802
10778
|
super().__init__()
|
10803
10779
|
|
10804
|
-
self._deploy_home = deploy_home
|
10805
|
-
|
10806
10780
|
self._conf = conf
|
10807
10781
|
self._git = git
|
10808
10782
|
self._venvs = venvs
|
@@ -10843,12 +10817,13 @@ class DeployAppManager(DeployPathOwner):
|
|
10843
10817
|
async def prepare_app(
|
10844
10818
|
self,
|
10845
10819
|
spec: DeployAppSpec,
|
10820
|
+
home: DeployHome,
|
10846
10821
|
tags: DeployTagMap,
|
10847
10822
|
) -> None:
|
10848
|
-
|
10823
|
+
check.non_empty_str(home)
|
10849
10824
|
|
10850
10825
|
def build_path(pth: DeployPath) -> str:
|
10851
|
-
return os.path.join(
|
10826
|
+
return os.path.join(home, pth.render(tags))
|
10852
10827
|
|
10853
10828
|
app_dir = build_path(self._APP_DIR)
|
10854
10829
|
deploy_dir = build_path(self._DEPLOY_DIR)
|
@@ -10858,7 +10833,7 @@ class DeployAppManager(DeployPathOwner):
|
|
10858
10833
|
|
10859
10834
|
os.makedirs(deploy_dir, exist_ok=True)
|
10860
10835
|
|
10861
|
-
deploying_link = os.path.join(
|
10836
|
+
deploying_link = os.path.join(home, 'deploys/deploying')
|
10862
10837
|
if os.path.exists(deploying_link):
|
10863
10838
|
os.unlink(deploying_link)
|
10864
10839
|
relative_symlink(
|
@@ -10905,7 +10880,7 @@ class DeployAppManager(DeployPathOwner):
|
|
10905
10880
|
# else:
|
10906
10881
|
# os.makedirs(os.path.join(dst, os.path.relpath(dp2, src)))
|
10907
10882
|
|
10908
|
-
current_link = os.path.join(
|
10883
|
+
current_link = os.path.join(home, 'deploys/current')
|
10909
10884
|
|
10910
10885
|
# if os.path.exists(current_link):
|
10911
10886
|
# mirror_symlinks(
|
@@ -10922,6 +10897,7 @@ class DeployAppManager(DeployPathOwner):
|
|
10922
10897
|
app_git_dir = os.path.join(app_dir, 'git')
|
10923
10898
|
await self._git.checkout(
|
10924
10899
|
spec.git,
|
10900
|
+
home,
|
10925
10901
|
app_git_dir,
|
10926
10902
|
)
|
10927
10903
|
|
@@ -10931,6 +10907,7 @@ class DeployAppManager(DeployPathOwner):
|
|
10931
10907
|
app_venv_dir = os.path.join(app_dir, 'venv')
|
10932
10908
|
await self._venvs.setup_venv(
|
10933
10909
|
spec.venv,
|
10910
|
+
home,
|
10934
10911
|
app_git_dir,
|
10935
10912
|
app_venv_dir,
|
10936
10913
|
)
|
@@ -10994,6 +10971,15 @@ class DeployManager:
|
|
10994
10971
|
|
10995
10972
|
#
|
10996
10973
|
|
10974
|
+
hs = check.non_empty_str(spec.home)
|
10975
|
+
hs = os.path.expanduser(hs)
|
10976
|
+
hs = os.path.realpath(hs)
|
10977
|
+
hs = os.path.abspath(hs)
|
10978
|
+
|
10979
|
+
home = DeployHome(hs)
|
10980
|
+
|
10981
|
+
#
|
10982
|
+
|
10997
10983
|
deploy_tags = DeployTagMap(
|
10998
10984
|
self._make_deploy_time(),
|
10999
10985
|
spec.key(),
|
@@ -11010,6 +10996,7 @@ class DeployManager:
|
|
11010
10996
|
|
11011
10997
|
await self._apps.prepare_app(
|
11012
10998
|
app,
|
10999
|
+
home,
|
11013
11000
|
app_tags,
|
11014
11001
|
)
|
11015
11002
|
|
@@ -11077,13 +11064,18 @@ def bind_deploy(
|
|
11077
11064
|
bind_manager(DeployManager),
|
11078
11065
|
|
11079
11066
|
bind_manager(DeployTmpManager),
|
11080
|
-
inj.bind(AtomicPathSwapping, to_key=DeployTmpManager),
|
11081
11067
|
|
11082
11068
|
bind_manager(DeployVenvManager),
|
11083
11069
|
])
|
11084
11070
|
|
11085
11071
|
#
|
11086
11072
|
|
11073
|
+
def provide_deploy_home_atomics(tmp: DeployTmpManager) -> DeployHomeAtomics:
|
11074
|
+
return DeployHomeAtomics(tmp.get_swapping)
|
11075
|
+
lst.append(inj.bind(provide_deploy_home_atomics, singleton=True))
|
11076
|
+
|
11077
|
+
#
|
11078
|
+
|
11087
11079
|
lst.extend([
|
11088
11080
|
bind_command(DeployCommand, DeployCommandExecutor),
|
11089
11081
|
bind_command(InterpCommand, InterpCommandExecutor),
|
@@ -11091,10 +11083,6 @@ def bind_deploy(
|
|
11091
11083
|
|
11092
11084
|
#
|
11093
11085
|
|
11094
|
-
if (dh := deploy_config.deploy_home) is not None:
|
11095
|
-
dh = os.path.abspath(os.path.expanduser(dh))
|
11096
|
-
lst.append(inj.bind(dh, key=DeployHome))
|
11097
|
-
|
11098
11086
|
return inj.as_bindings(*lst)
|
11099
11087
|
|
11100
11088
|
|
@@ -11190,8 +11178,6 @@ def main_bootstrap(bs: MainBootstrap) -> Injector:
|
|
11190
11178
|
|
11191
11179
|
@dc.dataclass(frozen=True)
|
11192
11180
|
class ManageConfig:
|
11193
|
-
deploy_home: ta.Optional[str] = None
|
11194
|
-
|
11195
11181
|
targets: ta.Optional[ta.Mapping[str, ManageTarget]] = None
|
11196
11182
|
|
11197
11183
|
|
@@ -11223,8 +11209,6 @@ class MainCli(ArgparseCli):
|
|
11223
11209
|
|
11224
11210
|
argparse_arg('--debug', action='store_true'),
|
11225
11211
|
|
11226
|
-
argparse_arg('--deploy-home'),
|
11227
|
-
|
11228
11212
|
argparse_arg('target'),
|
11229
11213
|
argparse_arg('-f', '--command-file', action='append'),
|
11230
11214
|
argparse_arg('command', nargs='*'),
|
@@ -11237,9 +11221,7 @@ class MainCli(ArgparseCli):
|
|
11237
11221
|
debug=bool(self.args.debug),
|
11238
11222
|
),
|
11239
11223
|
|
11240
|
-
deploy_config=DeployConfig(
|
11241
|
-
deploy_home=self.args.deploy_home or self.config().deploy_home,
|
11242
|
-
),
|
11224
|
+
deploy_config=DeployConfig(),
|
11243
11225
|
|
11244
11226
|
remote_config=RemoteConfig(
|
11245
11227
|
payload_file=self.args._payload_file, # noqa
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ominfra
|
3
|
-
Version: 0.0.0.
|
3
|
+
Version: 0.0.0.dev177
|
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.dev177
|
16
|
+
Requires-Dist: omlish==0.0.0.dev177
|
17
17
|
Provides-Extra: all
|
18
18
|
Requires-Dist: paramiko~=3.5; extra == "all"
|
19
19
|
Requires-Dist: asyncssh~=2.18; extra == "all"
|
@@ -33,7 +33,7 @@ ominfra/manage/bootstrap.py,sha256=1RIRhVkUZjxZcZerHMg8U6xgWhhemGgPN5cDye8dQ68,4
|
|
33
33
|
ominfra/manage/bootstrap_.py,sha256=B9UfR9J7mS3J54PFaSe1MQS5lCnKgxt5dDRJ9mnHYwg,656
|
34
34
|
ominfra/manage/config.py,sha256=1y2N_8nXHBZc6YbW6BaRZoDDCTBmiHuWtTOQ7zdr5VE,184
|
35
35
|
ominfra/manage/inject.py,sha256=_FVaMZUBKi-oObv14H77luWYCodxNJJD1t4pNQzckFE,2030
|
36
|
-
ominfra/manage/main.py,sha256=
|
36
|
+
ominfra/manage/main.py,sha256=6KulKJqgKHl_wdWEOdY9btoI-pq11tDFqugsUtOpW8A,4389
|
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
|
@@ -44,23 +44,23 @@ ominfra/manage/commands/ping.py,sha256=DVZFzL1Z_f-Bq53vxMrL3xOi0iK_nMonJE4KvQf9w
|
|
44
44
|
ominfra/manage/commands/subprocess.py,sha256=yHGMbAI-xKe_9BUs5IZ3Yav8qRE-I9aGnBtTwW15Pnw,2440
|
45
45
|
ominfra/manage/commands/types.py,sha256=XFZPeqeIBAaIIQF3pdPbGxLlb-LCrz6WtlDWO2q_vz0,210
|
46
46
|
ominfra/manage/deploy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
47
|
-
ominfra/manage/deploy/apps.py,sha256=
|
47
|
+
ominfra/manage/deploy/apps.py,sha256=LeZ2iX2YHviOAnvgut7Oz15301eJoYYCpmD3ffoIagA,4742
|
48
48
|
ominfra/manage/deploy/commands.py,sha256=fKFKhFwqIqC_PsgA-W66qIJ5S32xRgBBaRt3lbPX5Zg,763
|
49
|
-
ominfra/manage/deploy/conf.py,sha256=
|
50
|
-
ominfra/manage/deploy/config.py,sha256=
|
51
|
-
ominfra/manage/deploy/deploy.py,sha256=
|
52
|
-
ominfra/manage/deploy/git.py,sha256=
|
53
|
-
ominfra/manage/deploy/inject.py,sha256=
|
49
|
+
ominfra/manage/deploy/conf.py,sha256=fNfFlIb-bB3KAzaYZcjrbqaqKSiSq0Lpk0mIF6WgXiw,5410
|
50
|
+
ominfra/manage/deploy/config.py,sha256=kPpl8TRisz295cM4oj-RHA6oh5jdcJ_N9pVpkl_doO8,114
|
51
|
+
ominfra/manage/deploy/deploy.py,sha256=OqZOOjT2C_LjK8kwpP8T5VF2vtiDTHnsI-G6yNs4oDg,1965
|
52
|
+
ominfra/manage/deploy/git.py,sha256=g4wzUuSu9HwWSDhdVX-7BvA2htMwtWbRcHaoDy-xOJ4,3960
|
53
|
+
ominfra/manage/deploy/inject.py,sha256=vubWT09WfDrSb2f3rLtApl3S_0WJIPwRd_ENVggLmhM,1896
|
54
54
|
ominfra/manage/deploy/interp.py,sha256=OKkenH8YKEW_mEDR6X7_ZLxK9a1Ox6KHSwFPTHT6OzA,1029
|
55
|
-
ominfra/manage/deploy/specs.py,sha256=
|
55
|
+
ominfra/manage/deploy/specs.py,sha256=usi5AmTlv8OGFcwhVHnu8Qrz1Criu5QP6_ScNMi9ehM,3748
|
56
56
|
ominfra/manage/deploy/tags.py,sha256=NVEJhHKMwoDuCFd8lInH_jIe99FQILBX3wrulh3GiDg,5166
|
57
|
-
ominfra/manage/deploy/tmp.py,sha256=
|
57
|
+
ominfra/manage/deploy/tmp.py,sha256=FqXoVpIpVe8-KWNu7kXt37A4jKdK_y7h_YFvtrUoOG8,729
|
58
58
|
ominfra/manage/deploy/types.py,sha256=ZcIoheZ3zW7n0IZiqTRW_Uo3JyWWeWg5nyKGryvGc2I,112
|
59
|
-
ominfra/manage/deploy/venvs.py,sha256=
|
59
|
+
ominfra/manage/deploy/venvs.py,sha256=h_9Bb4NpvXqO2Hb5t_5qbWs3zfMDPfmKZvMACJ4CY5M,1584
|
60
60
|
ominfra/manage/deploy/paths/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
61
61
|
ominfra/manage/deploy/paths/inject.py,sha256=X81C-Qhef1LQ7tILWvkomBwFTvgooLVmWRnKL7TeVoI,596
|
62
|
-
ominfra/manage/deploy/paths/manager.py,sha256=
|
63
|
-
ominfra/manage/deploy/paths/owners.py,sha256=
|
62
|
+
ominfra/manage/deploy/paths/manager.py,sha256=Dnl8euyZQYDGwDzkMvgPAwOssseducr5kP6T0qzVXQk,929
|
63
|
+
ominfra/manage/deploy/paths/owners.py,sha256=sgCdKOFve8XZOtoTjrFrOrJd_MhZOGXo4yFJAFGRQ_s,1229
|
64
64
|
ominfra/manage/deploy/paths/paths.py,sha256=i7g8YdYOh4M_jgJXtafTbFkRhlu469cfGxAJAuB3fVY,5531
|
65
65
|
ominfra/manage/deploy/paths/types.py,sha256=TGgtSASmdyuZ2maZnvahfA0QxPLWlHBtpDeIEoEDGxk,112
|
66
66
|
ominfra/manage/remote/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -86,7 +86,7 @@ ominfra/manage/targets/inject.py,sha256=P4597xWM-V3I_gCt2O71OLhYQkkXtuJvkYRsIbhh
|
|
86
86
|
ominfra/manage/targets/targets.py,sha256=7GP6UAZyJFEhpkJN6UQdpr_WN3p7C76v-s445y-WB6U,1885
|
87
87
|
ominfra/scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
88
88
|
ominfra/scripts/journald2aws.py,sha256=yEnBAd0Q_3lBkVoTvlJ_uCcUxz7Ckn2qoSWZVhMihvQ,157696
|
89
|
-
ominfra/scripts/manage.py,sha256=
|
89
|
+
ominfra/scripts/manage.py,sha256=4tzrENQzD7G31SoN2gZxyk0ZBTinEOXGhPzhcTCrjK4,317752
|
90
90
|
ominfra/scripts/supervisor.py,sha256=9pEop3S5txoA2Gip9mcOrOJWFjMJVXCH6-NKYYnOVic,276462
|
91
91
|
ominfra/supervisor/LICENSE.txt,sha256=yvqaMNsDhWxziHa9ien6qCW1SkZv-DQlAg96XjfSee8,1746
|
92
92
|
ominfra/supervisor/__init__.py,sha256=Y3l4WY4JRi2uLG6kgbGp93fuGfkxkKwZDvhsa0Rwgtk,15
|
@@ -129,9 +129,9 @@ ominfra/tailscale/api.py,sha256=C5-t_b6jZXUWcy5k8bXm7CFnk73pSdrlMOgGDeGVrpw,1370
|
|
129
129
|
ominfra/tailscale/cli.py,sha256=h6akQJMl0KuWLHS7Ur6WcBZ2JwF0DJQhsPTnFBdGyNk,3571
|
130
130
|
ominfra/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
131
131
|
ominfra/tools/listresources.py,sha256=4qVg5txsb10EHhvqXXeM6gJ2jx9LbroEnPydDv1uXs0,6176
|
132
|
-
ominfra-0.0.0.
|
133
|
-
ominfra-0.0.0.
|
134
|
-
ominfra-0.0.0.
|
135
|
-
ominfra-0.0.0.
|
136
|
-
ominfra-0.0.0.
|
137
|
-
ominfra-0.0.0.
|
132
|
+
ominfra-0.0.0.dev177.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
133
|
+
ominfra-0.0.0.dev177.dist-info/METADATA,sha256=FHfsifQBdOhfEGn69cR4bKYjNxAx_DBQH0OkVjdPMQ8,731
|
134
|
+
ominfra-0.0.0.dev177.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
135
|
+
ominfra-0.0.0.dev177.dist-info/entry_points.txt,sha256=kgecQ2MgGrM9qK744BoKS3tMesaC3yjLnl9pa5CRczg,37
|
136
|
+
ominfra-0.0.0.dev177.dist-info/top_level.txt,sha256=E-b2OHkk_AOBLXHYZQ2EOFKl-_6uOGd8EjeG-Zy6h_w,8
|
137
|
+
ominfra-0.0.0.dev177.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|