arkitekt-next 0.7.32__py3-none-any.whl → 0.7.33__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of arkitekt-next might be problematic. Click here for more details.
- arkitekt_next/__blok__.py +25 -0
- arkitekt_next/bloks/__init__.py +1 -0
- arkitekt_next/bloks/admin.py +53 -0
- arkitekt_next/bloks/arkitekt.py +51 -0
- arkitekt_next/bloks/fluss.py +138 -0
- arkitekt_next/bloks/gateway.py +153 -0
- arkitekt_next/bloks/kabinet.py +143 -0
- arkitekt_next/bloks/livekit.py +71 -0
- arkitekt_next/bloks/lok.py +345 -0
- arkitekt_next/bloks/mikro.py +152 -0
- arkitekt_next/bloks/minio.py +180 -0
- arkitekt_next/bloks/postgres.py +92 -0
- arkitekt_next/bloks/redis.py +86 -0
- arkitekt_next/bloks/services.py +2 -0
- {arkitekt_next-0.7.32.dist-info → arkitekt_next-0.7.33.dist-info}/METADATA +1 -1
- {arkitekt_next-0.7.32.dist-info → arkitekt_next-0.7.33.dist-info}/RECORD +19 -5
- {arkitekt_next-0.7.32.dist-info → arkitekt_next-0.7.33.dist-info}/LICENSE +0 -0
- {arkitekt_next-0.7.32.dist-info → arkitekt_next-0.7.33.dist-info}/WHEEL +0 -0
- {arkitekt_next-0.7.32.dist-info → arkitekt_next-0.7.33.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from blok import blok, InitContext, ExecutionContext, CLIOption
|
|
4
|
+
from blok.tree import YamlFile, Repo
|
|
5
|
+
from pydantic import BaseModel
|
|
6
|
+
import pydantic
|
|
7
|
+
import namegenerator
|
|
8
|
+
import secrets
|
|
9
|
+
from blok import blok, InitContext
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class AccessCredentials(BaseModel):
|
|
13
|
+
password: str
|
|
14
|
+
username: str
|
|
15
|
+
host: str
|
|
16
|
+
port: str
|
|
17
|
+
db_name: str
|
|
18
|
+
dependency: Optional[str] = None
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@blok("live.arkitekt.postgres")
|
|
22
|
+
class PostgresBlok(BaseModel):
|
|
23
|
+
host: str = "db"
|
|
24
|
+
port: int = 5432
|
|
25
|
+
skip: bool = False
|
|
26
|
+
password: str = pydantic.Field(default_factory=lambda: secrets.token_hex(16))
|
|
27
|
+
user: str = pydantic.Field(default_factory=lambda: namegenerator.gen(separator=""))
|
|
28
|
+
image: str = "jhnnsrs/daten:next"
|
|
29
|
+
|
|
30
|
+
registered_dbs: dict[str, AccessCredentials] = {}
|
|
31
|
+
|
|
32
|
+
def get_dependencies(self):
|
|
33
|
+
return []
|
|
34
|
+
|
|
35
|
+
def get_identifier(self):
|
|
36
|
+
return "live.arkitekt.postgres"
|
|
37
|
+
|
|
38
|
+
def register_db(self, db_name: str) -> AccessCredentials:
|
|
39
|
+
if db_name in self.registered_dbs:
|
|
40
|
+
return self.registered_dbs[db_name]
|
|
41
|
+
else:
|
|
42
|
+
access_credentials = AccessCredentials(
|
|
43
|
+
password=self.password,
|
|
44
|
+
username=self.user,
|
|
45
|
+
host=self.host,
|
|
46
|
+
port=self.port,
|
|
47
|
+
db_name=db_name,
|
|
48
|
+
dependency=self.host if not self.skip else None,
|
|
49
|
+
)
|
|
50
|
+
self.registered_dbs[db_name] = access_credentials
|
|
51
|
+
return access_credentials
|
|
52
|
+
|
|
53
|
+
def init(self, init: InitContext):
|
|
54
|
+
for key, value in init.kwargs.items():
|
|
55
|
+
setattr(self, key, value)
|
|
56
|
+
|
|
57
|
+
def build(self, context: ExecutionContext):
|
|
58
|
+
db_service = {
|
|
59
|
+
"environment": {
|
|
60
|
+
"POSTGRES_USER": self.user,
|
|
61
|
+
"POSTGRES_PASSWORD": self.password,
|
|
62
|
+
"POSTGRES_MULTIPLE_DATABASES": ",".join(self.registered_dbs.keys()),
|
|
63
|
+
},
|
|
64
|
+
"image": "jhnnsrs/daten-next",
|
|
65
|
+
"labels": ["fakts.service=live.arkitekt.postgres"],
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
context.docker_compose.set_nested(f"services", self.host, db_service)
|
|
69
|
+
|
|
70
|
+
def get_options(self):
|
|
71
|
+
with_postgres_password = CLIOption(
|
|
72
|
+
subcommand="password",
|
|
73
|
+
help="The postgres password for connection",
|
|
74
|
+
default=self.password,
|
|
75
|
+
)
|
|
76
|
+
with_user_password = CLIOption(
|
|
77
|
+
subcommand="user",
|
|
78
|
+
help="The postgress user_name",
|
|
79
|
+
default=self.password,
|
|
80
|
+
)
|
|
81
|
+
skip_build = CLIOption(
|
|
82
|
+
subcommand="skip",
|
|
83
|
+
help="Should the service not be created? E.g when pointing outwards?",
|
|
84
|
+
default=self.skip,
|
|
85
|
+
)
|
|
86
|
+
with_image = CLIOption(
|
|
87
|
+
subcommand="image",
|
|
88
|
+
help="The image to use for the service",
|
|
89
|
+
default=self.image,
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
return [with_postgres_password, skip_build, with_user_password, with_image]
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import click
|
|
2
|
+
|
|
3
|
+
from blok import blok, InitContext, ExecutionContext, CLIOption
|
|
4
|
+
from blok.tree import YamlFile, Repo
|
|
5
|
+
from pydantic import BaseModel
|
|
6
|
+
from typing import Dict, Any, Optional
|
|
7
|
+
|
|
8
|
+
from blok import blok, InitContext
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
DEFAULT_PUBLIC_URLS = ["127.0.0.1"]
|
|
12
|
+
DEFAULT_PUBLIC_HOSTS = ["localhost"]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class RedisConnection(BaseModel):
|
|
16
|
+
host: str
|
|
17
|
+
port: str
|
|
18
|
+
dependency: Optional[str] = None
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@blok("live.arkitekt.redis")
|
|
22
|
+
class RedisBlok:
|
|
23
|
+
def __init__(self) -> None:
|
|
24
|
+
self.host = "redis"
|
|
25
|
+
self.port = 6379
|
|
26
|
+
self.skip = False
|
|
27
|
+
self.image = "redis"
|
|
28
|
+
|
|
29
|
+
def get_identifier(self):
|
|
30
|
+
return "live.arkitekt.redis"
|
|
31
|
+
|
|
32
|
+
def get_dependencies(self):
|
|
33
|
+
return []
|
|
34
|
+
|
|
35
|
+
def register(self) -> RedisConnection:
|
|
36
|
+
return RedisConnection(
|
|
37
|
+
host=self.host,
|
|
38
|
+
port=self.port,
|
|
39
|
+
dependency=self.host if not self.skip else None,
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
def init(self, init: InitContext):
|
|
43
|
+
for key, value in init.kwargs.items():
|
|
44
|
+
setattr(self, key, value)
|
|
45
|
+
|
|
46
|
+
def build(self, context: ExecutionContext):
|
|
47
|
+
redis_service = {
|
|
48
|
+
"environment": {
|
|
49
|
+
"REDIS_HOST": self.host,
|
|
50
|
+
"REDIS_PORT": self.port,
|
|
51
|
+
},
|
|
52
|
+
"image": self.image,
|
|
53
|
+
"ports": [f"{self.port}:{self.port}"],
|
|
54
|
+
"name": self.host,
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
context.docker_compose.set_nested(f"services", self.host, redis_service)
|
|
58
|
+
|
|
59
|
+
def get_options(self):
|
|
60
|
+
with_port = CLIOption(
|
|
61
|
+
subcommand="port",
|
|
62
|
+
help="Which port to use",
|
|
63
|
+
type=int,
|
|
64
|
+
default=self.port,
|
|
65
|
+
show_default=True,
|
|
66
|
+
)
|
|
67
|
+
with_host = CLIOption(
|
|
68
|
+
subcommand="host",
|
|
69
|
+
help="Which public hosts to use",
|
|
70
|
+
type=str,
|
|
71
|
+
default=self.host,
|
|
72
|
+
show_default=True,
|
|
73
|
+
)
|
|
74
|
+
with_skip = CLIOption(
|
|
75
|
+
subcommand="skip",
|
|
76
|
+
help="Skip docker creation (if using external redis?)",
|
|
77
|
+
is_flag=True,
|
|
78
|
+
default=self.skip,
|
|
79
|
+
)
|
|
80
|
+
with_image = CLIOption(
|
|
81
|
+
subcommand="image",
|
|
82
|
+
help="The image to use for the service",
|
|
83
|
+
default=self.image,
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
return [with_port, with_host, with_skip, with_image]
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
arkitekt_next/__blok__.py,sha256=ZLa8JQZnG7-E5eEutkxH-mUwD4CfC1yiXPk-9j_ZkZE,752
|
|
1
2
|
arkitekt_next/__init__.py,sha256=KFM_HlnIQWX7hXSZnYba3rdmZrsBE69K58rwh8ewxoM,970
|
|
2
3
|
arkitekt_next/apps/__init__.py,sha256=cx_5Y-RkJFkSQJH-hUEC_L3eW1jU2E426c4e6_csIyM,42
|
|
3
4
|
arkitekt_next/apps/easy.py,sha256=8eu-0DCWit2Ok4SPw_QCyriBZHPnLc1oK9qxPUxnElg,3135
|
|
@@ -11,6 +12,19 @@ arkitekt_next/apps/service/grant_registry.py,sha256=3om8YoVf_HFWEJbpjQCin1Zvm8Sz
|
|
|
11
12
|
arkitekt_next/apps/service/herre.py,sha256=DuIhyEujgXrYzhG2tKTMUgHkTScfg6UCX5eCV1vUPYI,760
|
|
12
13
|
arkitekt_next/apps/service/herre_qt.py,sha256=GntkKHmwcQqEFab02SWwdd3xONo0fLVGEPQMKH6tlCE,1628
|
|
13
14
|
arkitekt_next/apps/types.py,sha256=cKRqHyKlNcGamPUxzvY0wyz0sEI4sBPa4CnvFnT1sTo,1140
|
|
15
|
+
arkitekt_next/bloks/__init__.py,sha256=_4EeR63d6avQUWLG4mK2n_FvogTPQ_Jx6f2_RvNbWeA,29
|
|
16
|
+
arkitekt_next/bloks/admin.py,sha256=ymvfESzuZijLGxlWXd7H8ge-QX8c6H89-E9bT1V-KPE,1366
|
|
17
|
+
arkitekt_next/bloks/arkitekt.py,sha256=3HmTquQXFypdXElgi2thrqVej_OLq8MBB1gYWWnszKk,1296
|
|
18
|
+
arkitekt_next/bloks/fluss.py,sha256=H8a9Cjd6KE8KUZNB9Kk1chErikEdCedzeq8JerGmPOA,4586
|
|
19
|
+
arkitekt_next/bloks/gateway.py,sha256=qcHSQk7NtQ4UGQ_7Z5sJgM6EBdaNWxxhzV-gHj8b0OQ,4236
|
|
20
|
+
arkitekt_next/bloks/kabinet.py,sha256=_dP1fbDET5iN7a0tHwj5pR15OaDsTWSeuZ64D4jS5kA,4765
|
|
21
|
+
arkitekt_next/bloks/livekit.py,sha256=OADB8_7akkeR3mzhAoMD-_sRjdfc3SoITl0hXSWGyKQ,2061
|
|
22
|
+
arkitekt_next/bloks/lok.py,sha256=6rpbufR1iq6dx1vBcCiY0iamUvun2NTv6mFlZ0e4JoQ,10547
|
|
23
|
+
arkitekt_next/bloks/mikro.py,sha256=v0KjlbVWKOE2A7VnM_NAXcNb5F-QM3DjQNqx4k-bqQ4,4659
|
|
24
|
+
arkitekt_next/bloks/minio.py,sha256=lR7StmLaLR58kqcrgT9uJIW_VPKMJwBNrQF2uMbLHWo,5519
|
|
25
|
+
arkitekt_next/bloks/postgres.py,sha256=03P5XQ_wDzclYm25ZVQL1BMejB17V6r45kKR755Eqqk,2909
|
|
26
|
+
arkitekt_next/bloks/redis.py,sha256=Evyo5oSlhfzxfM_C3WJZB5l3H1w0A4RaEkgKJFPekp4,2282
|
|
27
|
+
arkitekt_next/bloks/services.py,sha256=YNzcKs5_R6zVNQsCkJmlCNGHhPgpAfj85ig0w2Z2i1U,59
|
|
14
28
|
arkitekt_next/builders.py,sha256=8HeQsNqyxpbFsnTrA9AAm0_BqxGjU1_ylS1Z-hbjAFw,6074
|
|
15
29
|
arkitekt_next/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
30
|
arkitekt_next/cli/commands/call/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -110,8 +124,8 @@ arkitekt_next/qt/utils.py,sha256=MgBPtPmCSBkIuATov3UgREESwxAHh77lWNNxyE7Qs48,773
|
|
|
110
124
|
arkitekt_next/service_registry.py,sha256=pczUuP_Nve7OYwB7-oDBLIw6bkjZPnzL3xFca5TF1io,3405
|
|
111
125
|
arkitekt_next/tqdm.py,sha256=DlrxPluHao7TvW-Cqgt0UokRS-fM2_ZNiWiddqvCqCc,1488
|
|
112
126
|
arkitekt_next/utils.py,sha256=gmKWy9M51vimohmmaoIpAJ0CaB22TFP0w3JszRrwiak,2379
|
|
113
|
-
arkitekt_next-0.7.
|
|
114
|
-
arkitekt_next-0.7.
|
|
115
|
-
arkitekt_next-0.7.
|
|
116
|
-
arkitekt_next-0.7.
|
|
117
|
-
arkitekt_next-0.7.
|
|
127
|
+
arkitekt_next-0.7.33.dist-info/LICENSE,sha256=YZ2oRjC248t-GpoEyw7J13vwKYNG6zhYMaEAix6EzF0,1089
|
|
128
|
+
arkitekt_next-0.7.33.dist-info/METADATA,sha256=LxMq0uNpCivKxu0CUqgdX8UKmi6wNgmankHOZv7GDsI,5500
|
|
129
|
+
arkitekt_next-0.7.33.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
130
|
+
arkitekt_next-0.7.33.dist-info/entry_points.txt,sha256=-hxikQx4xZ6TiOnWVDOlTN_kcAISgGFvTHXIchsCHSc,60
|
|
131
|
+
arkitekt_next-0.7.33.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|