arkitekt-next 0.7.31__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.

@@ -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]
@@ -0,0 +1,2 @@
1
+ from blok import service
2
+ from dataclasses import dataclass
@@ -24,6 +24,7 @@ from arkitekt_next.cli.options import (
24
24
  with_instance_id,
25
25
  with_headless,
26
26
  with_log_level,
27
+ with_redeem_token,
27
28
  with_skip_cache,
28
29
  )
29
30
  from arkitekt_next.cli.vars import get_console, get_manifest
@@ -330,6 +331,7 @@ async def run_dev(
330
331
  @with_builder
331
332
  @with_token
332
333
  @with_instance_id
334
+ @with_redeem_token
333
335
  @with_headless
334
336
  @with_log_level
335
337
  @with_skip_cache
@@ -23,6 +23,7 @@ async def run_app(app):
23
23
  )
24
24
  @with_builder
25
25
  @with_token
26
+ @with_redeem_token
26
27
  @with_instance_id
27
28
  @with_headless
28
29
  @with_log_level
@@ -21,6 +21,13 @@ with_token = click.option(
21
21
  envvar="FAKTS_TOKEN",
22
22
  required=False,
23
23
  )
24
+ with_redeem_token = click.option(
25
+ "--redeem-token",
26
+ "-r",
27
+ help="The token for the fakts instance",
28
+ envvar="FAKTS_REDEEM_TOKEN",
29
+ required=False,
30
+ )
24
31
  with_version = click.option(
25
32
  "--version",
26
33
  "-v",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: arkitekt-next
3
- Version: 0.7.31
3
+ Version: 0.7.33
4
4
  Summary: client for the arkitekt_next platform
5
5
  License: MIT
6
6
  Author: jhnnsrs
@@ -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
@@ -45,9 +59,9 @@ arkitekt_next/cli/commands/manifest/scopes.py,sha256=sw0HRy8GliEcmx3Sh6cPRpBkf1v
45
59
  arkitekt_next/cli/commands/manifest/version.py,sha256=tA-a35QlcobUwoPsgGLQL9_D0E-HZvawsfO4l7DoX-Y,4832
46
60
  arkitekt_next/cli/commands/manifest/wizard.py,sha256=a8rIHgtmKuw-L4E3eO3kXwXv0TM2pN4Lq75y2QKXmcA,2498
47
61
  arkitekt_next/cli/commands/run/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
48
- arkitekt_next/cli/commands/run/dev.py,sha256=KRcAHM-MCsy2-Wv2UIONCzdezEF214rEVbRPWec33FE,9991
62
+ arkitekt_next/cli/commands/run/dev.py,sha256=mobsKX155O6NXGzLK-c4_l2RN4vlM4-1lj2gQaX9HeA,10033
49
63
  arkitekt_next/cli/commands/run/main.py,sha256=0bNO3DqwbZ4ddMsDWbCGmlPD6Cs3Jlg4yh2-zilsEbY,552
50
- arkitekt_next/cli/commands/run/prod.py,sha256=5GmZayfvYvKqSYWmicT1hhadq2hFJ-q8taEL17qKK78,1513
64
+ arkitekt_next/cli/commands/run/prod.py,sha256=5wbpKt8atp_Cz81v3iRUcOWCInStzlmlA2UmNQmg9Tw,1532
51
65
  arkitekt_next/cli/commands/run/utils.py,sha256=zH-MNNEfKgyOYQvwP6Ph8KUHVqH48fw3ZI6tiQ9unwQ,325
52
66
  arkitekt_next/cli/commands/server/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
67
  arkitekt_next/cli/commands/server/down.py,sha256=POFe9OtzhSdlwWY7JBakGqVDZvQ9LrsiFDRSik2Hn2U,1490
@@ -66,7 +80,7 @@ arkitekt_next/cli/errors.py,sha256=zLTjaCbun6qM2nTldjyZd-DvykqKn5A3Gn80uYdx7Vc,9
66
80
  arkitekt_next/cli/inspect.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
67
81
  arkitekt_next/cli/io.py,sha256=Jp8F8vYPIcAow7IAh_tgWFrsM9KRaElipAH7wj26lIo,6899
68
82
  arkitekt_next/cli/main.py,sha256=A_JgqAKmmmXNK-yxuuQ9bG6HX2I6pV2ccImCQ5fjfZQ,2329
69
- arkitekt_next/cli/options.py,sha256=TeHFBuoTdhI908DY2D7gw5pDFkuyCXUFgEr01TZn42I,3625
83
+ arkitekt_next/cli/options.py,sha256=hSKdSYabK1MuioBRUsADjQIPSp9H2YeczmcyAsFUprI,3791
70
84
  arkitekt_next/cli/schemas/fluss.schema.graphql,sha256=MqrSpOxtWO9kWFCoUn9ySBPhIH3XozFiqrQl2zjEbiQ,35803
71
85
  arkitekt_next/cli/schemas/gucker.schema.graphql,sha256=r_KL-MoFRCGUobbtcBLCnpmFcali2A12TguynqQgmN4,152947
72
86
  arkitekt_next/cli/schemas/kabinet.schema.graphql,sha256=-N7igrfzFphjA2qV-abW59k8jtdJh1py4008W0MkqrM,9915
@@ -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.31.dist-info/LICENSE,sha256=YZ2oRjC248t-GpoEyw7J13vwKYNG6zhYMaEAix6EzF0,1089
114
- arkitekt_next-0.7.31.dist-info/METADATA,sha256=jGYkZtbNo8OrW63JVav8xELycJbGvijp-LurUDt_sM8,5500
115
- arkitekt_next-0.7.31.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
116
- arkitekt_next-0.7.31.dist-info/entry_points.txt,sha256=-hxikQx4xZ6TiOnWVDOlTN_kcAISgGFvTHXIchsCHSc,60
117
- arkitekt_next-0.7.31.dist-info/RECORD,,
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,,