arkitekt-next 0.16.0__py3-none-any.whl → 0.18.0__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/app/fakts.py +32 -1
- arkitekt_next/builders.py +3 -0
- arkitekt_next/cli/commands/call/local.py +1 -1
- arkitekt_next/cli/commands/call/main.py +14 -7
- arkitekt_next/cli/templates/filter.py +7 -7
- arkitekt_next/cli/templates/simple.py +4 -1
- arkitekt_next/py.typed +0 -0
- {arkitekt_next-0.16.0.dist-info → arkitekt_next-0.18.0.dist-info}/METADATA +8 -8
- {arkitekt_next-0.16.0.dist-info → arkitekt_next-0.18.0.dist-info}/RECORD +12 -57
- arkitekt_next/__blok__.py +0 -58
- arkitekt_next/bloks/__init__.py +0 -1
- arkitekt_next/bloks/admin.py +0 -43
- arkitekt_next/bloks/alpaka.py +0 -139
- arkitekt_next/bloks/arkitekt.py +0 -55
- arkitekt_next/bloks/base.py +0 -217
- arkitekt_next/bloks/channel.py +0 -27
- arkitekt_next/bloks/config.py +0 -43
- arkitekt_next/bloks/elektro.py +0 -42
- arkitekt_next/bloks/fluss.py +0 -33
- arkitekt_next/bloks/gateway.py +0 -224
- arkitekt_next/bloks/internal_docker.py +0 -90
- arkitekt_next/bloks/kabinet.py +0 -46
- arkitekt_next/bloks/kraph.py +0 -45
- arkitekt_next/bloks/livekit.py +0 -85
- arkitekt_next/bloks/lok.py +0 -415
- arkitekt_next/bloks/lovekit.py +0 -202
- arkitekt_next/bloks/mikro.py +0 -42
- arkitekt_next/bloks/minio.py +0 -178
- arkitekt_next/bloks/mount.py +0 -34
- arkitekt_next/bloks/namegen.py +0 -34
- arkitekt_next/bloks/ollama.py +0 -90
- arkitekt_next/bloks/orkestrator.py +0 -122
- arkitekt_next/bloks/postgres.py +0 -134
- arkitekt_next/bloks/redis.py +0 -79
- arkitekt_next/bloks/rekuest.py +0 -30
- arkitekt_next/bloks/secret.py +0 -32
- arkitekt_next/bloks/self_signed.py +0 -91
- arkitekt_next/bloks/services/__init__.py +0 -27
- arkitekt_next/bloks/services/admin.py +0 -21
- arkitekt_next/bloks/services/certer.py +0 -14
- arkitekt_next/bloks/services/channel.py +0 -12
- arkitekt_next/bloks/services/config.py +0 -13
- arkitekt_next/bloks/services/db.py +0 -23
- arkitekt_next/bloks/services/gateway.py +0 -39
- arkitekt_next/bloks/services/livekit.py +0 -20
- arkitekt_next/bloks/services/lok.py +0 -24
- arkitekt_next/bloks/services/mount.py +0 -9
- arkitekt_next/bloks/services/name.py +0 -11
- arkitekt_next/bloks/services/ollama.py +0 -21
- arkitekt_next/bloks/services/redis.py +0 -19
- arkitekt_next/bloks/services/s3.py +0 -21
- arkitekt_next/bloks/services/secret.py +0 -16
- arkitekt_next/bloks/services/socket.py +0 -13
- arkitekt_next/bloks/socket.py +0 -40
- arkitekt_next/bloks/tailscale.py +0 -90
- {arkitekt_next-0.16.0.dist-info → arkitekt_next-0.18.0.dist-info}/WHEEL +0 -0
- {arkitekt_next-0.16.0.dist-info → arkitekt_next-0.18.0.dist-info}/entry_points.txt +0 -0
- {arkitekt_next-0.16.0.dist-info → arkitekt_next-0.18.0.dist-info}/licenses/LICENSE +0 -0
arkitekt_next/bloks/postgres.py
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
from typing import Any, Dict, Optional
|
|
2
|
-
|
|
3
|
-
from arkitekt_next.bloks.services.db import DBService, DBCredentials
|
|
4
|
-
from arkitekt_next.bloks.services.mount import MountService
|
|
5
|
-
from blok import blok, InitContext, ExecutionContext, Option
|
|
6
|
-
from blok.tree import YamlFile, Repo
|
|
7
|
-
from pydantic import BaseModel
|
|
8
|
-
import pydantic
|
|
9
|
-
import namegenerator
|
|
10
|
-
import secrets
|
|
11
|
-
from blok import blok, InitContext
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
@blok(
|
|
15
|
-
DBService,
|
|
16
|
-
description="Postgres with Apache AGE",
|
|
17
|
-
)
|
|
18
|
-
class PostgresBlok(BaseModel):
|
|
19
|
-
host: str = "db"
|
|
20
|
-
port: int = 5432
|
|
21
|
-
skip: bool = False
|
|
22
|
-
password: str = pydantic.Field(default_factory=lambda: secrets.token_hex(16))
|
|
23
|
-
user: str = pydantic.Field(default_factory=lambda: namegenerator.gen(separator=""))
|
|
24
|
-
image: str = "jhnnsrs/daten_next:nightly"
|
|
25
|
-
mount_repo: bool = False
|
|
26
|
-
build_repo: bool = False
|
|
27
|
-
repo: str = "https://github.com/arkitektio/daten-server"
|
|
28
|
-
dev: bool = False
|
|
29
|
-
|
|
30
|
-
registered_dbs: dict[str, DBCredentials] = {}
|
|
31
|
-
build_image: Optional[Dict[str, Any]] = None
|
|
32
|
-
|
|
33
|
-
def get_dependencies(self):
|
|
34
|
-
return []
|
|
35
|
-
|
|
36
|
-
def get_identifier(self):
|
|
37
|
-
return "live.arkitekt.postgres"
|
|
38
|
-
|
|
39
|
-
def register_db(self, db_name: str) -> DBCredentials:
|
|
40
|
-
if db_name in self.registered_dbs:
|
|
41
|
-
return self.registered_dbs[db_name]
|
|
42
|
-
else:
|
|
43
|
-
access_credentials = DBCredentials(
|
|
44
|
-
password=self.password,
|
|
45
|
-
username=self.user,
|
|
46
|
-
host=self.host,
|
|
47
|
-
port=self.port,
|
|
48
|
-
db_name=db_name,
|
|
49
|
-
dependency=self.host if not self.skip else None,
|
|
50
|
-
)
|
|
51
|
-
self.registered_dbs[db_name] = access_credentials
|
|
52
|
-
return access_credentials
|
|
53
|
-
|
|
54
|
-
def preflight(self, init: InitContext, mount: MountService):
|
|
55
|
-
for key, value in init.kwargs.items():
|
|
56
|
-
setattr(self, key, value)
|
|
57
|
-
|
|
58
|
-
self.build_image = {
|
|
59
|
-
"environment": {
|
|
60
|
-
"POSTGRES_USER": self.user,
|
|
61
|
-
"POSTGRES_PASSWORD": self.password,
|
|
62
|
-
"POSTGRES_MULTIPLE_DATABASES": "",
|
|
63
|
-
},
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
if self.build_repo or self.dev:
|
|
67
|
-
mount = init.get_service(MountService).register_mount(
|
|
68
|
-
self.host, Repo(self.repo)
|
|
69
|
-
)
|
|
70
|
-
self.build_image["build"] = mount
|
|
71
|
-
else:
|
|
72
|
-
self.build_image["image"] = self.image
|
|
73
|
-
|
|
74
|
-
def build(self, context: ExecutionContext):
|
|
75
|
-
self.build_image["environment"]["POSTGRES_MULTIPLE_DATABASES"] = ",".join(
|
|
76
|
-
self.registered_dbs.keys()
|
|
77
|
-
)
|
|
78
|
-
|
|
79
|
-
context.docker_compose.set_nested(f"services", self.host, self.build_image)
|
|
80
|
-
|
|
81
|
-
def get_options(self):
|
|
82
|
-
with_postgres_password = Option(
|
|
83
|
-
subcommand="password",
|
|
84
|
-
help="The postgres password for connection",
|
|
85
|
-
default=self.password,
|
|
86
|
-
)
|
|
87
|
-
with_user_password = Option(
|
|
88
|
-
subcommand="user",
|
|
89
|
-
help="The postgress user_name",
|
|
90
|
-
default=self.user,
|
|
91
|
-
)
|
|
92
|
-
skip_build = Option(
|
|
93
|
-
subcommand="skip",
|
|
94
|
-
help="Should the service not be created? E.g when pointing outwards?",
|
|
95
|
-
default=self.skip,
|
|
96
|
-
)
|
|
97
|
-
with_image = Option(
|
|
98
|
-
subcommand="image",
|
|
99
|
-
help="The image to use for the service",
|
|
100
|
-
default=self.image,
|
|
101
|
-
)
|
|
102
|
-
with_repo = Option(
|
|
103
|
-
subcommand="repo",
|
|
104
|
-
help="The repo to use for the service",
|
|
105
|
-
default=self.repo,
|
|
106
|
-
)
|
|
107
|
-
build_repo = Option(
|
|
108
|
-
subcommand="build_repo",
|
|
109
|
-
help="Should we build the repo?",
|
|
110
|
-
default=self.build_repo,
|
|
111
|
-
)
|
|
112
|
-
|
|
113
|
-
mount_repo = Option(
|
|
114
|
-
subcommand="mount_repo",
|
|
115
|
-
help="Should we mount the repo?",
|
|
116
|
-
default=self.mount_repo,
|
|
117
|
-
)
|
|
118
|
-
|
|
119
|
-
dev = Option(
|
|
120
|
-
subcommand="dev",
|
|
121
|
-
help="Should we run the service in development mode (includes withrepo, mountrepo)?",
|
|
122
|
-
default=self.dev,
|
|
123
|
-
)
|
|
124
|
-
|
|
125
|
-
return [
|
|
126
|
-
with_postgres_password,
|
|
127
|
-
skip_build,
|
|
128
|
-
with_user_password,
|
|
129
|
-
with_image,
|
|
130
|
-
with_repo,
|
|
131
|
-
build_repo,
|
|
132
|
-
mount_repo,
|
|
133
|
-
dev,
|
|
134
|
-
]
|
arkitekt_next/bloks/redis.py
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import click
|
|
2
|
-
|
|
3
|
-
from arkitekt_next.bloks.services.redis import RedisService, RedisConnection
|
|
4
|
-
from blok import blok, InitContext, ExecutionContext, Option
|
|
5
|
-
from blok.tree import YamlFile, Repo
|
|
6
|
-
from pydantic import BaseModel
|
|
7
|
-
from typing import Dict, Any, Optional
|
|
8
|
-
|
|
9
|
-
from blok import blok, InitContext
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
@blok(
|
|
13
|
-
RedisService,
|
|
14
|
-
description="Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker",
|
|
15
|
-
)
|
|
16
|
-
class RedisBlok:
|
|
17
|
-
def __init__(self) -> None:
|
|
18
|
-
self.host = "redis"
|
|
19
|
-
self.port = 6379
|
|
20
|
-
self.skip = False
|
|
21
|
-
self.image = "redis"
|
|
22
|
-
|
|
23
|
-
def get_identifier(self):
|
|
24
|
-
return "live.arkitekt.redis"
|
|
25
|
-
|
|
26
|
-
def get_dependencies(self):
|
|
27
|
-
return []
|
|
28
|
-
|
|
29
|
-
def register(self) -> RedisConnection:
|
|
30
|
-
return RedisConnection(
|
|
31
|
-
host=self.host,
|
|
32
|
-
port=self.port,
|
|
33
|
-
dependency=self.host if not self.skip else None,
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
def preflight(self, init: InitContext):
|
|
37
|
-
for key, value in init.kwargs.items():
|
|
38
|
-
setattr(self, key, value)
|
|
39
|
-
|
|
40
|
-
def build(self, context: ExecutionContext):
|
|
41
|
-
redis_service = {
|
|
42
|
-
"environment": {
|
|
43
|
-
"REDIS_HOST": self.host,
|
|
44
|
-
"REDIS_PORT": self.port,
|
|
45
|
-
},
|
|
46
|
-
"image": self.image,
|
|
47
|
-
"ports": [f"{self.port}:{self.port}"],
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
context.docker_compose.set_nested(f"services", self.host, redis_service)
|
|
51
|
-
|
|
52
|
-
def get_options(self):
|
|
53
|
-
with_port = Option(
|
|
54
|
-
subcommand="port",
|
|
55
|
-
help="Which port to use",
|
|
56
|
-
type=int,
|
|
57
|
-
default=self.port,
|
|
58
|
-
show_default=True,
|
|
59
|
-
)
|
|
60
|
-
with_host = Option(
|
|
61
|
-
subcommand="host",
|
|
62
|
-
help="Which public hosts to use",
|
|
63
|
-
type=str,
|
|
64
|
-
default=self.host,
|
|
65
|
-
show_default=True,
|
|
66
|
-
)
|
|
67
|
-
with_skip = Option(
|
|
68
|
-
subcommand="skip",
|
|
69
|
-
help="Skip docker creation (if using external redis?)",
|
|
70
|
-
type=bool,
|
|
71
|
-
default=self.skip,
|
|
72
|
-
)
|
|
73
|
-
with_image = Option(
|
|
74
|
-
subcommand="image",
|
|
75
|
-
help="The image to use for the service",
|
|
76
|
-
default=self.image,
|
|
77
|
-
)
|
|
78
|
-
|
|
79
|
-
return [with_port, with_host, with_skip, with_image]
|
arkitekt_next/bloks/rekuest.py
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
from typing import Dict, Any
|
|
2
|
-
import secrets
|
|
3
|
-
|
|
4
|
-
from blok import blok, InitContext, ExecutionContext, Option
|
|
5
|
-
from blok.tree import Repo, YamlFile
|
|
6
|
-
from arkitekt_next.bloks.base import BaseArkitektService
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
@blok("live.arkitekt.rekuest", description="Rekuest is the RPC and Functionaliy hub")
|
|
10
|
-
class RekuestBlok(BaseArkitektService):
|
|
11
|
-
def __init__(self) -> None:
|
|
12
|
-
self.dev = False
|
|
13
|
-
self.host = "rekuest"
|
|
14
|
-
self.command = "bash run-debug.sh"
|
|
15
|
-
self.repo = "https://github.com/jhnnsrs/rekuest-server-next"
|
|
16
|
-
self.scopes = {
|
|
17
|
-
"rekuest_agent": "Act as an agent",
|
|
18
|
-
"rekuest_call": "Call other apps with rekuest",
|
|
19
|
-
}
|
|
20
|
-
self.mount_repo = False
|
|
21
|
-
self.build_repo = False
|
|
22
|
-
self.buckets = ["media"]
|
|
23
|
-
self.secret_key = secrets.token_hex(16)
|
|
24
|
-
self.image = "jhnnsrs/rekuest_next:nightly"
|
|
25
|
-
|
|
26
|
-
def get_builder(self):
|
|
27
|
-
return "arkitekt.rekuest"
|
|
28
|
-
|
|
29
|
-
def build(self, context: ExecutionContext):
|
|
30
|
-
context.docker_compose.set_nested("services", self.host, self.service)
|
arkitekt_next/bloks/secret.py
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
from pydantic import BaseModel
|
|
2
|
-
from typing import Dict, Any
|
|
3
|
-
from blok import blok, InitContext, Option, ExecutionContext
|
|
4
|
-
from blok.tree import YamlFile
|
|
5
|
-
from arkitekt_next.bloks.services.secret import SecretService
|
|
6
|
-
import secrets
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
@blok(SecretService, description="Preformed secrets that will not change")
|
|
10
|
-
class SecretBlok:
|
|
11
|
-
def __init__(self) -> None:
|
|
12
|
-
self.preformed_secrets = [secrets.token_urlsafe(32) for _ in range(100)]
|
|
13
|
-
self.registered_secrets = []
|
|
14
|
-
|
|
15
|
-
def preflight(self, init: InitContext, preformed_secrets: list[str]):
|
|
16
|
-
self.preformed_secrets = list(preformed_secrets)
|
|
17
|
-
|
|
18
|
-
def retrieve_secret(self) -> str:
|
|
19
|
-
new_secret = self.preformed_secrets.pop()
|
|
20
|
-
self.registered_secrets.append(new_secret)
|
|
21
|
-
return new_secret
|
|
22
|
-
|
|
23
|
-
def get_options(self):
|
|
24
|
-
config_path = Option(
|
|
25
|
-
subcommand="preformed_secrets",
|
|
26
|
-
help="Which path to use for configs",
|
|
27
|
-
default=self.preformed_secrets,
|
|
28
|
-
multiple=True,
|
|
29
|
-
show_default=False,
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
return [config_path]
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
from arkitekt_next.bloks.services.certer import CerterService
|
|
2
|
-
from arkitekt_next.bloks.services.name import NameService
|
|
3
|
-
from blok import blok, InitContext, ExecutionContext, Option
|
|
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
|
-
from blok.bloks.services.dns import DnsService
|
|
10
|
-
|
|
11
|
-
DEFAULT_PUBLIC_URLS = ["127.0.0.1"]
|
|
12
|
-
DEFAULT_PUBLIC_HOSTS = ["localhost"]
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class ExposedHost(BaseModel):
|
|
16
|
-
host: str
|
|
17
|
-
port: int
|
|
18
|
-
stip_prefix: bool = True
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class ExpostedToHost(BaseModel):
|
|
22
|
-
port: int
|
|
23
|
-
host: str
|
|
24
|
-
to: str
|
|
25
|
-
tls: bool = False
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
class ExposedPort(BaseModel):
|
|
29
|
-
port: int
|
|
30
|
-
host: str
|
|
31
|
-
tls: bool = False
|
|
32
|
-
to: int
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
@blok("live.arkitekt.certer", description="A self-signed certificate generator")
|
|
36
|
-
class SelfSignedBlok:
|
|
37
|
-
def __init__(self) -> None:
|
|
38
|
-
self.host = "certer"
|
|
39
|
-
self.certer_image = "jhnnsrs/certer:next"
|
|
40
|
-
self.certs_mount = "./certs"
|
|
41
|
-
|
|
42
|
-
def retrieve_certs_mount(self):
|
|
43
|
-
return self.certs_mount
|
|
44
|
-
|
|
45
|
-
def retrieve_depends_on(self):
|
|
46
|
-
return ["certer"]
|
|
47
|
-
|
|
48
|
-
def preflight(self, init: InitContext, dns: DnsService):
|
|
49
|
-
for key, value in init.kwargs.items():
|
|
50
|
-
setattr(self, key, value)
|
|
51
|
-
|
|
52
|
-
self.public_ips = dns.get_dns_result().ip_addresses
|
|
53
|
-
self.public_hosts = dns.get_dns_result().hostnames
|
|
54
|
-
|
|
55
|
-
def build(
|
|
56
|
-
self,
|
|
57
|
-
context: ExecutionContext,
|
|
58
|
-
):
|
|
59
|
-
|
|
60
|
-
context.file_tree.set_nested("certs", {})
|
|
61
|
-
|
|
62
|
-
certer_container = {
|
|
63
|
-
"image": self.certer_image,
|
|
64
|
-
"volumes": ["./certs:/certs"],
|
|
65
|
-
"environment": {
|
|
66
|
-
"DOMAIN_NAMES": ",".join(self.public_hosts),
|
|
67
|
-
"IP_ADDRESSED": ",".join(self.public_ips),
|
|
68
|
-
},
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
context.docker_compose.set_nested("services", self.host, certer_container)
|
|
72
|
-
|
|
73
|
-
def get_options(self):
|
|
74
|
-
with_public_urls = Option(
|
|
75
|
-
subcommand="public_url",
|
|
76
|
-
help="Which public urls to use",
|
|
77
|
-
type=str,
|
|
78
|
-
multiple=True,
|
|
79
|
-
default=DEFAULT_PUBLIC_URLS,
|
|
80
|
-
show_default=True,
|
|
81
|
-
)
|
|
82
|
-
with_public_services = Option(
|
|
83
|
-
subcommand="public_hosts",
|
|
84
|
-
help="Which public hosts to use",
|
|
85
|
-
type=str,
|
|
86
|
-
multiple=True,
|
|
87
|
-
default=DEFAULT_PUBLIC_HOSTS,
|
|
88
|
-
show_default=True,
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
return [with_public_urls, with_public_services]
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
from .admin import AdminService
|
|
2
|
-
from .lok import LokService
|
|
3
|
-
from .db import DBService
|
|
4
|
-
from .redis import RedisService
|
|
5
|
-
from .s3 import S3Service
|
|
6
|
-
from .config import ConfigService
|
|
7
|
-
from .mount import MountService
|
|
8
|
-
from .secret import SecretService
|
|
9
|
-
from .gateway import GatewayService
|
|
10
|
-
from .livekit import LivekitService
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
__all__ = [
|
|
14
|
-
"AdminService",
|
|
15
|
-
"LokService",
|
|
16
|
-
"DBService",
|
|
17
|
-
"RedisService",
|
|
18
|
-
"S3Service",
|
|
19
|
-
"ConfigService",
|
|
20
|
-
"MountService",
|
|
21
|
-
"SecretService",
|
|
22
|
-
"GatewayService",
|
|
23
|
-
"LivekitService",
|
|
24
|
-
"MountService",
|
|
25
|
-
"ConfigService",
|
|
26
|
-
"SecretService",
|
|
27
|
-
]
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
from typing import Dict, Any, Protocol
|
|
2
|
-
from blok import blok, InitContext, Option
|
|
3
|
-
from blok import service
|
|
4
|
-
from dataclasses import dataclass
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
@dataclass
|
|
8
|
-
class AdminCredentials:
|
|
9
|
-
password: str
|
|
10
|
-
username: str
|
|
11
|
-
email: str
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
@service("live.arkitekt.admin")
|
|
15
|
-
class AdminService(Protocol):
|
|
16
|
-
def retrieve(self) -> AdminCredentials:
|
|
17
|
-
"""Retrieve the admin credentials.
|
|
18
|
-
|
|
19
|
-
Admin credentials should be used to access the admin interface of the application.
|
|
20
|
-
|
|
21
|
-
"""
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
from blok import blok, InitContext, ExecutionContext, Option
|
|
2
|
-
from blok.tree import YamlFile, Repo
|
|
3
|
-
from dataclasses import dataclass
|
|
4
|
-
from typing import Dict, Any, Protocol
|
|
5
|
-
|
|
6
|
-
from blok import blok, InitContext, service
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
@service("live.arkitekt.certer", description="Generate HTTPS certificates for services")
|
|
10
|
-
class CerterService(Protocol):
|
|
11
|
-
|
|
12
|
-
def retrieve_certs_mount(self) -> str: ...
|
|
13
|
-
|
|
14
|
-
def retrieve_depends_on(self) -> list[str]: ...
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
from typing import Dict, Any, Protocol
|
|
2
|
-
from blok import blok, InitContext, Option
|
|
3
|
-
from blok import service
|
|
4
|
-
from dataclasses import dataclass
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
@service("live.arkitekt.channel")
|
|
9
|
-
class ChannelService(Protocol):
|
|
10
|
-
|
|
11
|
-
def retrieve_channel(self) -> str:
|
|
12
|
-
return str
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
from typing import Dict, Any, Protocol
|
|
2
|
-
from blok import blok, InitContext, Option, ExecutionContext, service
|
|
3
|
-
from blok.tree import YamlFile
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
@service("live.arkitekt.config")
|
|
7
|
-
class ConfigService(Protocol):
|
|
8
|
-
|
|
9
|
-
def register_config(self, name: str, file: YamlFile) -> str: ...
|
|
10
|
-
|
|
11
|
-
def get_path(self, name: str) -> str:
|
|
12
|
-
...
|
|
13
|
-
return f"./{self.config_path}/" + name
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
from blok import blok, InitContext, ExecutionContext, Option
|
|
2
|
-
from blok.tree import YamlFile, Repo
|
|
3
|
-
from dataclasses import dataclass
|
|
4
|
-
from typing import Dict, Any, Protocol, Optional
|
|
5
|
-
|
|
6
|
-
from blok import blok, InitContext, service
|
|
7
|
-
from dataclasses import dataclass
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
@dataclass
|
|
11
|
-
class DBCredentials:
|
|
12
|
-
password: str
|
|
13
|
-
username: str
|
|
14
|
-
host: str
|
|
15
|
-
port: int
|
|
16
|
-
db_name: str
|
|
17
|
-
engine: str = "django.db.backends.postgresql"
|
|
18
|
-
dependency: Optional[str] = None
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
@service("live.arkitekt.postgres")
|
|
22
|
-
class DBService(Protocol):
|
|
23
|
-
def register_db(self, db_name: str) -> DBCredentials: ...
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
from blok import blok, InitContext, ExecutionContext, Option
|
|
2
|
-
from blok.tree import YamlFile, Repo
|
|
3
|
-
from dataclasses import dataclass
|
|
4
|
-
from typing import Dict, Any, Protocol
|
|
5
|
-
|
|
6
|
-
from blok import blok, InitContext, service
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
@service("live.arkitekt.gateway")
|
|
10
|
-
class GatewayService(Protocol):
|
|
11
|
-
def expose_service(
|
|
12
|
-
self, path_name: str, port: int, host: str, strip_prefix: bool = True
|
|
13
|
-
) -> str:
|
|
14
|
-
"""
|
|
15
|
-
Expose a service on the gateway.
|
|
16
|
-
|
|
17
|
-
:param path_name: The name of the path to expose.
|
|
18
|
-
:param port: The port to expose the service on.
|
|
19
|
-
:param host: The host to expose the service on.
|
|
20
|
-
:param strip_prefix: Whether to strip the prefix from the path.
|
|
21
|
-
:return: The name of the exposed service.
|
|
22
|
-
"""
|
|
23
|
-
...
|
|
24
|
-
|
|
25
|
-
def retrieve_gateway_network(self): ...
|
|
26
|
-
|
|
27
|
-
def expose_mapped(self, path_name: str, port: int, host: str, to_name: str): ...
|
|
28
|
-
|
|
29
|
-
def expose_default(self, port: int, host: str): ...
|
|
30
|
-
|
|
31
|
-
def expose_port(self, port: int, host: str, tls: bool = False): ...
|
|
32
|
-
|
|
33
|
-
def expose_port_to(self, port: int, host: str, to_port: str, tls: bool = False): ...
|
|
34
|
-
|
|
35
|
-
def get_internal_host(self): ...
|
|
36
|
-
|
|
37
|
-
def get_https_port(self): ...
|
|
38
|
-
|
|
39
|
-
def get_http_port(self): ...
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
from typing import Dict, Any, Protocol
|
|
2
|
-
|
|
3
|
-
from cv2 import HOUGH_STANDARD
|
|
4
|
-
from blok import blok, InitContext, Option
|
|
5
|
-
from blok import service
|
|
6
|
-
from dataclasses import dataclass
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
@dataclass
|
|
10
|
-
class LivekitCredentials:
|
|
11
|
-
api_key: str
|
|
12
|
-
api_secret: str
|
|
13
|
-
host: str
|
|
14
|
-
port: int
|
|
15
|
-
dependency: str | None = None
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
@service("io.livekit.livekit")
|
|
19
|
-
class LivekitService(Protocol):
|
|
20
|
-
def get_access(self) -> LivekitCredentials: ...
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
from typing import Dict, Any, Protocol
|
|
2
|
-
from blok import blok, InitContext, Option
|
|
3
|
-
from blok import service
|
|
4
|
-
from dataclasses import dataclass
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
@dataclass
|
|
8
|
-
class LokCredentials:
|
|
9
|
-
issuer: str
|
|
10
|
-
key_type: str
|
|
11
|
-
public_key: str
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
@service("live.arkitekt.lok")
|
|
15
|
-
class LokService(Protocol):
|
|
16
|
-
def retrieve_credentials(self) -> LokCredentials: ...
|
|
17
|
-
|
|
18
|
-
def retrieve_labels(self, service_name: str, builder_name: str) -> list[str]: ...
|
|
19
|
-
|
|
20
|
-
def register_scopes(self, scopes_dict: Dict[str, str]): ...
|
|
21
|
-
|
|
22
|
-
def register_service_on_subpath(
|
|
23
|
-
self, service_name: str, subpath: str, htpath: str = ""
|
|
24
|
-
) -> None: ...
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
from typing import Dict, Any, Protocol
|
|
2
|
-
from blok import blok, InitContext, Option, ExecutionContext, service
|
|
3
|
-
from blok.tree import YamlFile
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
@service("live.arkitekt.mount")
|
|
7
|
-
class MountService(Protocol):
|
|
8
|
-
|
|
9
|
-
def register_mount(self, name: str, file: YamlFile) -> str: ...
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
from typing import Dict, Any, Protocol
|
|
2
|
-
from blok import blok, InitContext, Option
|
|
3
|
-
from blok import service
|
|
4
|
-
from dataclasses import dataclass
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
@service("live.arkitekt.names")
|
|
8
|
-
class NameService(Protocol):
|
|
9
|
-
|
|
10
|
-
def retrieve_name(self) -> str:
|
|
11
|
-
pass
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
from typing import Dict, Any, Optional, Protocol
|
|
2
|
-
from blok import blok, InitContext, Option
|
|
3
|
-
from blok import service
|
|
4
|
-
from dataclasses import dataclass
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
@dataclass
|
|
8
|
-
class OllamaAccess:
|
|
9
|
-
api_key: str
|
|
10
|
-
api_secret: str
|
|
11
|
-
api_url: str
|
|
12
|
-
dependency: Optional[str] = None
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
@service("io.ollama.ollama", description=" A self-hosted ollama LLM server")
|
|
16
|
-
class OllamaService(Protocol):
|
|
17
|
-
pass
|
|
18
|
-
|
|
19
|
-
def get_access(self) -> OllamaAccess:
|
|
20
|
-
"""Get the credentials for the ollama service."""
|
|
21
|
-
...
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
from blok import blok, InitContext, ExecutionContext, Option
|
|
2
|
-
from blok.tree import YamlFile, Repo
|
|
3
|
-
from dataclasses import dataclass
|
|
4
|
-
from typing import Dict, Any, Protocol, Optional
|
|
5
|
-
|
|
6
|
-
from blok import blok, InitContext, service
|
|
7
|
-
from dataclasses import dataclass
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
@dataclass
|
|
11
|
-
class RedisConnection:
|
|
12
|
-
host: str
|
|
13
|
-
port: int
|
|
14
|
-
dependency: Optional[str] = None
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
@service("live.arkitekt.redis")
|
|
18
|
-
class RedisService(Protocol):
|
|
19
|
-
def register(self) -> RedisConnection: ...
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
from typing import Dict, Any, List, Protocol, Optional
|
|
2
|
-
from blok import blok, InitContext, Option
|
|
3
|
-
from blok import service
|
|
4
|
-
from dataclasses import dataclass
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
@dataclass
|
|
8
|
-
class S3Credentials:
|
|
9
|
-
name: str
|
|
10
|
-
access_key: str
|
|
11
|
-
buckets: Dict[str, str]
|
|
12
|
-
host: str
|
|
13
|
-
port: int
|
|
14
|
-
secret_key: str
|
|
15
|
-
protocol: str
|
|
16
|
-
dependency: Optional[str] = None
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
@service("live.arkitekt.s3")
|
|
20
|
-
class S3Service(Protocol):
|
|
21
|
-
def create_buckets(self, buckets: List[str]) -> S3Credentials: ...
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
from typing import Dict, Any, Protocol
|
|
2
|
-
from blok import blok, InitContext, Option
|
|
3
|
-
from blok import service
|
|
4
|
-
from dataclasses import dataclass
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
@dataclass
|
|
8
|
-
class AdminCredentials:
|
|
9
|
-
password: str
|
|
10
|
-
username: str
|
|
11
|
-
email: str
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
@service("live.arkitekt.secrets")
|
|
15
|
-
class SecretService(Protocol):
|
|
16
|
-
def retrieve_secret(self) -> str: ...
|