arkitekt-next 0.7.32__tar.gz → 0.7.34__tar.gz
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-0.7.32 → arkitekt_next-0.7.34}/PKG-INFO +1 -1
- arkitekt_next-0.7.34/arkitekt_next/__blok__.py +37 -0
- arkitekt_next-0.7.34/arkitekt_next/bloks/__init__.py +2 -0
- arkitekt_next-0.7.34/arkitekt_next/bloks/admin.py +45 -0
- arkitekt_next-0.7.34/arkitekt_next/bloks/arkitekt.py +38 -0
- arkitekt_next-0.7.34/arkitekt_next/bloks/config.py +42 -0
- arkitekt_next-0.7.34/arkitekt_next/bloks/fluss.py +88 -0
- arkitekt_next-0.7.34/arkitekt_next/bloks/funcs.py +86 -0
- arkitekt_next-0.7.34/arkitekt_next/bloks/gateway.py +173 -0
- arkitekt_next-0.7.34/arkitekt_next/bloks/internal_docker.py +80 -0
- arkitekt_next-0.7.34/arkitekt_next/bloks/kabinet.py +93 -0
- arkitekt_next-0.7.34/arkitekt_next/bloks/livekit.py +92 -0
- arkitekt_next-0.7.34/arkitekt_next/bloks/lok.py +381 -0
- arkitekt_next-0.7.34/arkitekt_next/bloks/mikro.py +98 -0
- arkitekt_next-0.7.34/arkitekt_next/bloks/minio.py +180 -0
- arkitekt_next-0.7.34/arkitekt_next/bloks/mount.py +35 -0
- arkitekt_next-0.7.34/arkitekt_next/bloks/postgres.py +86 -0
- arkitekt_next-0.7.34/arkitekt_next/bloks/redis.py +77 -0
- arkitekt_next-0.7.34/arkitekt_next/bloks/rekuest.py +93 -0
- arkitekt_next-0.7.34/arkitekt_next/bloks/services/admin.py +22 -0
- arkitekt_next-0.7.34/arkitekt_next/bloks/services/config.py +18 -0
- arkitekt_next-0.7.34/arkitekt_next/bloks/services/db.py +27 -0
- arkitekt_next-0.7.34/arkitekt_next/bloks/services/gateway.py +20 -0
- arkitekt_next-0.7.34/arkitekt_next/bloks/services/livekit.py +19 -0
- arkitekt_next-0.7.34/arkitekt_next/bloks/services/lok.py +27 -0
- arkitekt_next-0.7.34/arkitekt_next/bloks/services/mount.py +15 -0
- arkitekt_next-0.7.34/arkitekt_next/bloks/services/redis.py +28 -0
- arkitekt_next-0.7.34/arkitekt_next/bloks/services/s3.py +26 -0
- arkitekt_next-0.7.34/arkitekt_next/bloks/services/socket.py +16 -0
- arkitekt_next-0.7.34/arkitekt_next/bloks/socket.py +38 -0
- arkitekt_next-0.7.34/arkitekt_next/cli/commands/server/__init__.py +0 -0
- arkitekt_next-0.7.34/arkitekt_next/cli/commands/server/init.py +15 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/pyproject.toml +1 -1
- arkitekt_next-0.7.32/arkitekt_next/cli/commands/server/init.py +0 -74
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/LICENSE +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/README.md +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/__init__.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/apps/__init__.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/apps/easy.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/apps/next.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/apps/qt.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/apps/service/__init__.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/apps/service/fakts.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/apps/service/fakts_next.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/apps/service/fakts_qt.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/apps/service/grant_registry.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/apps/service/herre.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/apps/service/herre_qt.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/apps/types.py +0 -0
- {arkitekt_next-0.7.32/arkitekt_next/cli → arkitekt_next-0.7.34/arkitekt_next/bloks/services}/__init__.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/builders.py +0 -0
- {arkitekt_next-0.7.32/arkitekt_next/cli/commands/call → arkitekt_next-0.7.34/arkitekt_next/cli}/__init__.py +0 -0
- {arkitekt_next-0.7.32/arkitekt_next/cli/commands/gen → arkitekt_next-0.7.34/arkitekt_next/cli/commands/call}/__init__.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/call/local.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/call/main.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/call/remote.py +0 -0
- {arkitekt_next-0.7.32/arkitekt_next/cli/commands/init → arkitekt_next-0.7.34/arkitekt_next/cli/commands/gen}/__init__.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/gen/compile.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/gen/init.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/gen/main.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/gen/watch.py +0 -0
- {arkitekt_next-0.7.32/arkitekt_next/cli/commands/inspect → arkitekt_next-0.7.34/arkitekt_next/cli/commands/init}/__init__.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/init/main.py +0 -0
- {arkitekt_next-0.7.32/arkitekt_next/cli/commands/kabinet → arkitekt_next-0.7.34/arkitekt_next/cli/commands/inspect}/__init__.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/inspect/main.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/inspect/requirements.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/inspect/templates.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/inspect/variables.py +0 -0
- {arkitekt_next-0.7.32/arkitekt_next/cli/commands/manifest → arkitekt_next-0.7.34/arkitekt_next/cli/commands/kabinet}/__init__.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/kabinet/build.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/kabinet/init.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/kabinet/main.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/kabinet/publish.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/kabinet/stage.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/kabinet/utils.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/kabinet/validate.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/kabinet/wizard.py +0 -0
- {arkitekt_next-0.7.32/arkitekt_next/cli/commands/run → arkitekt_next-0.7.34/arkitekt_next/cli/commands/manifest}/__init__.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/manifest/inspect.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/manifest/main.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/manifest/scopes.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/manifest/version.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/manifest/wizard.py +0 -0
- {arkitekt_next-0.7.32/arkitekt_next/cli/commands/server → arkitekt_next-0.7.34/arkitekt_next/cli/commands/run}/__init__.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/run/dev.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/run/main.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/run/prod.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/run/utils.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/server/down.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/server/inspect.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/server/main.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/server/open.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/server/remove.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/server/stop.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/server/up.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/commands/server/utils.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/configs/base.yaml +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/constants.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/dockerfiles/vanilla.dockerfile +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/errors.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/inspect.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/io.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/main.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/options.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/schemas/fluss.schema.graphql +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/schemas/gucker.schema.graphql +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/schemas/kabinet.schema.graphql +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/schemas/kluster.schema.graphql +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/schemas/konviktion.schema.graphql +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/schemas/kuay.schema.graphql +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/schemas/mikro.schema.graphql +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/schemas/mikro_next.schema.graphql +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/schemas/napari.schema.graphql +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/schemas/omero_ark.schema.graphql +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/schemas/port.schema.graphql +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/schemas/rekuest.schema.graphql +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/schemas/rekuest_next.schema.graphql +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/schemas/unlok.schema.graphql +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/templates/filter.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/templates/simple.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/texts.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/types.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/ui.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/utils.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/validators.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/vars.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/cli/versions/v1.yaml +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/constants.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/model.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/qt/__init__.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/qt/assets/dark/gear.png +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/qt/assets/dark/green pulse.gif +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/qt/assets/dark/orange pulse.gif +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/qt/assets/dark/pink pulse.gif +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/qt/assets/dark/red pulse.gif +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/qt/assets/light/gear.png +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/qt/assets/light/green pulse.gif +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/qt/assets/light/orange pulse.gif +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/qt/assets/light/pink pulse.gif +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/qt/assets/light/red pulse.gif +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/qt/builders.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/qt/magic_bar.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/qt/types.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/qt/utils.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/service_registry.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/tqdm.py +0 -0
- {arkitekt_next-0.7.32 → arkitekt_next-0.7.34}/arkitekt_next/utils.py +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
from arkitekt_next.bloks.admin import AdminBlok
|
|
2
|
+
from arkitekt_next.bloks.arkitekt import ArkitektBlok
|
|
3
|
+
from arkitekt_next.bloks.mikro import MikroBlok
|
|
4
|
+
from arkitekt_next.bloks.fluss import FlussBlok
|
|
5
|
+
from arkitekt_next.bloks.redis import RedisBlok
|
|
6
|
+
from arkitekt_next.bloks.gateway import GatewayBlok
|
|
7
|
+
from arkitekt_next.bloks.livekit import LocalLiveKitBlok
|
|
8
|
+
from arkitekt_next.bloks.postgres import PostgresBlok
|
|
9
|
+
from arkitekt_next.bloks.minio import MinioBlok
|
|
10
|
+
from arkitekt_next.bloks.kabinet import KabinetBlok
|
|
11
|
+
from arkitekt_next.bloks.lok import LokBlok
|
|
12
|
+
from arkitekt_next.bloks.config import ConfigBlok
|
|
13
|
+
from arkitekt_next.bloks.mount import MountBlok
|
|
14
|
+
from arkitekt_next.bloks.internal_docker import InternalDockerBlok
|
|
15
|
+
from arkitekt_next.bloks.socket import DockerSocketBlok
|
|
16
|
+
from arkitekt_next.bloks.rekuest import RekuestBlok
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def get_bloks():
|
|
20
|
+
return [
|
|
21
|
+
AdminBlok(),
|
|
22
|
+
ArkitektBlok(),
|
|
23
|
+
MikroBlok(),
|
|
24
|
+
FlussBlok(),
|
|
25
|
+
RedisBlok(),
|
|
26
|
+
GatewayBlok(),
|
|
27
|
+
LocalLiveKitBlok(),
|
|
28
|
+
PostgresBlok(),
|
|
29
|
+
MinioBlok(),
|
|
30
|
+
LokBlok(),
|
|
31
|
+
KabinetBlok(),
|
|
32
|
+
MountBlok(),
|
|
33
|
+
ConfigBlok(),
|
|
34
|
+
InternalDockerBlok(),
|
|
35
|
+
DockerSocketBlok(),
|
|
36
|
+
RekuestBlok(),
|
|
37
|
+
]
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
from pydantic import BaseModel
|
|
2
|
+
from typing import Dict, Any
|
|
3
|
+
from blok import blok, InitContext, Option
|
|
4
|
+
from arkitekt_next.bloks.services.admin import AdminService, AdminCredentials
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@blok(AdminService)
|
|
8
|
+
class AdminBlok:
|
|
9
|
+
def __init__(self) -> None:
|
|
10
|
+
self.password = "admin"
|
|
11
|
+
self.username = "admin"
|
|
12
|
+
self.email = "admin@admin.com"
|
|
13
|
+
|
|
14
|
+
def preflight(self, init: InitContext):
|
|
15
|
+
for key, value in init.kwargs.items():
|
|
16
|
+
setattr(self, key, value)
|
|
17
|
+
|
|
18
|
+
def retrieve(self):
|
|
19
|
+
return AdminCredentials(
|
|
20
|
+
password=self.password,
|
|
21
|
+
username=self.username,
|
|
22
|
+
email=self.email,
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
def get_options(self):
|
|
26
|
+
with_username = Option(
|
|
27
|
+
subcommand="username",
|
|
28
|
+
help="Which admin username to use",
|
|
29
|
+
default=self.username,
|
|
30
|
+
show_default=True,
|
|
31
|
+
)
|
|
32
|
+
with_username = Option(
|
|
33
|
+
subcommand="password",
|
|
34
|
+
help="Which password to use",
|
|
35
|
+
default=self.password,
|
|
36
|
+
show_default=True,
|
|
37
|
+
)
|
|
38
|
+
with_email = Option(
|
|
39
|
+
subcommand="password",
|
|
40
|
+
help="Which password to use",
|
|
41
|
+
default=self.password,
|
|
42
|
+
show_default=True,
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
return [with_username, with_username, with_email]
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from pydantic import BaseModel
|
|
2
|
+
from typing import Dict, Any
|
|
3
|
+
from blok import blok, InitContext, Renderer, Panel
|
|
4
|
+
from .livekit import LocalLiveKitBlok
|
|
5
|
+
from .mikro import MikroBlok
|
|
6
|
+
from .kabinet import KabinetBlok
|
|
7
|
+
from .rekuest import RekuestBlok
|
|
8
|
+
from .fluss import FlussBlok
|
|
9
|
+
from .gateway import GatewayBlok
|
|
10
|
+
from .internal_docker import InternalDockerBlok
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class AdminCredentials(BaseModel):
|
|
14
|
+
password: str
|
|
15
|
+
username: str
|
|
16
|
+
email: str
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@blok("live.arkitekt")
|
|
20
|
+
class ArkitektBlok:
|
|
21
|
+
|
|
22
|
+
def entry(self, renderer: Renderer):
|
|
23
|
+
renderer.render(
|
|
24
|
+
Panel(
|
|
25
|
+
f"This is the arkitekt build that allows you to setup a full stack arkitekt application. Make sure to understand how bloks work before proceeding.",
|
|
26
|
+
expand=False,
|
|
27
|
+
title="Welcome to Arkitekt!",
|
|
28
|
+
style="bold magenta",
|
|
29
|
+
)
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
def preflight(self, lok: LocalLiveKitBlok, mikro: MikroBlok, kabinet: KabinetBlok, rekuest: RekuestBlok, fluss: FlussBlok, gateway: GatewayBlok, internal_engine: InternalDockerBlok):
|
|
33
|
+
print (lok, mikro, kabinet, rekuest, fluss, gateway, internal_engine)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def build(self, cwd):
|
|
37
|
+
pass
|
|
38
|
+
|
|
@@ -0,0 +1,42 @@
|
|
|
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.config import ConfigService
|
|
6
|
+
|
|
7
|
+
class AdminCredentials(BaseModel):
|
|
8
|
+
password: str
|
|
9
|
+
username: str
|
|
10
|
+
email: str
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@blok(ConfigService)
|
|
14
|
+
class ConfigBlok:
|
|
15
|
+
def __init__(self) -> None:
|
|
16
|
+
self.config_path = "configs"
|
|
17
|
+
self.registered_configs = {}
|
|
18
|
+
|
|
19
|
+
def preflight(self, init: InitContext):
|
|
20
|
+
for key, value in init.kwargs.items():
|
|
21
|
+
setattr(self, key, value)
|
|
22
|
+
|
|
23
|
+
def build(self, ex: ExecutionContext):
|
|
24
|
+
for name, file in self.registered_configs.items():
|
|
25
|
+
ex.file_tree.set_nested(*f"{self.config_path}/{name}".split("/"), file)
|
|
26
|
+
|
|
27
|
+
def register_config(self, name: str, file: YamlFile) -> str:
|
|
28
|
+
self.registered_configs[name] = file
|
|
29
|
+
return f"./{self.config_path}/" + name
|
|
30
|
+
|
|
31
|
+
def get_path(self, name: str) -> str:
|
|
32
|
+
return f"./{self.config_path}/" + name
|
|
33
|
+
|
|
34
|
+
def get_options(self):
|
|
35
|
+
config_path = Option(
|
|
36
|
+
subcommand="config_path",
|
|
37
|
+
help="Which path to use for configs",
|
|
38
|
+
default=self.config_path,
|
|
39
|
+
show_default=True,
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
return [config_path]
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import secrets
|
|
2
|
+
from arkitekt_next.bloks.funcs import create_default_service_yaml
|
|
3
|
+
from blok import blok, InitContext, ExecutionContext, Option
|
|
4
|
+
from blok.tree import YamlFile, Repo
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
DEFAULT_ARKITEKT_URL = "http://localhost:8000"
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@blok("live.arkitekt.fluss")
|
|
11
|
+
class FlussBlok:
|
|
12
|
+
def __init__(self) -> None:
|
|
13
|
+
self.host = "fluss"
|
|
14
|
+
self.command = "bash run-debug.sh"
|
|
15
|
+
self.image = "jhnnsrs/fluss:next"
|
|
16
|
+
self.repo = "https://github.com/jhnnsrs/fluss-server-next"
|
|
17
|
+
self.scopes = {"read_image": "Read image from the database"}
|
|
18
|
+
self.mount_repo = False
|
|
19
|
+
self.build_repo = False
|
|
20
|
+
self.buckets = ["media"]
|
|
21
|
+
self.secret_key = secrets.token_hex(16)
|
|
22
|
+
self.ensured_repos = []
|
|
23
|
+
|
|
24
|
+
def get_dependencies(self):
|
|
25
|
+
return [
|
|
26
|
+
"live.arkitekt.mount",
|
|
27
|
+
"live.arkitekt.config",
|
|
28
|
+
"live.arkitekt.gateway",
|
|
29
|
+
"live.arkitekt.postgres",
|
|
30
|
+
"live.arkitekt.lok",
|
|
31
|
+
"live.arkitekt.admin",
|
|
32
|
+
"live.arkitekt.redis",
|
|
33
|
+
"live.arkitekt.s3",
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
def preflight(self, init: InitContext):
|
|
37
|
+
for key, value in init.kwargs.items():
|
|
38
|
+
setattr(self, key, value)
|
|
39
|
+
|
|
40
|
+
self.service = create_default_service_yaml(init, self)
|
|
41
|
+
|
|
42
|
+
self.initialized = True
|
|
43
|
+
|
|
44
|
+
def build(self, context: ExecutionContext):
|
|
45
|
+
context.docker_compose.set_nested("services", self.host, self.service)
|
|
46
|
+
|
|
47
|
+
def get_options(self):
|
|
48
|
+
with_repo = Option(
|
|
49
|
+
subcommand="with_repo",
|
|
50
|
+
help="Which repo should we use when building the service? Only active if build_repo or mount_repo is active",
|
|
51
|
+
default=self.repo,
|
|
52
|
+
)
|
|
53
|
+
with_command = Option(
|
|
54
|
+
subcommand="command",
|
|
55
|
+
help="Which command should be run when starting the service",
|
|
56
|
+
default=self.command,
|
|
57
|
+
)
|
|
58
|
+
mount_repo = Option(
|
|
59
|
+
subcommand="mount_repo",
|
|
60
|
+
help="Should we mount the repo into the container?",
|
|
61
|
+
is_flag=True,
|
|
62
|
+
default=self.mount_repo,
|
|
63
|
+
)
|
|
64
|
+
build_repo = Option(
|
|
65
|
+
subcommand="build_repo",
|
|
66
|
+
help="Should we build the container from the repo?",
|
|
67
|
+
is_flag=True,
|
|
68
|
+
default=self.build_repo,
|
|
69
|
+
)
|
|
70
|
+
with_host = Option(
|
|
71
|
+
subcommand="host",
|
|
72
|
+
help="How should the service be named inside the docker-compose file?",
|
|
73
|
+
default=self.host,
|
|
74
|
+
)
|
|
75
|
+
with_secret_key = Option(
|
|
76
|
+
subcommand="secret_key",
|
|
77
|
+
help="The secret key to use for the django service",
|
|
78
|
+
default=self.secret_key,
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
return [
|
|
82
|
+
with_repo,
|
|
83
|
+
mount_repo,
|
|
84
|
+
build_repo,
|
|
85
|
+
with_host,
|
|
86
|
+
with_command,
|
|
87
|
+
with_secret_key,
|
|
88
|
+
]
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
from blok import blok, InitContext, Option
|
|
2
|
+
from blok.tree import YamlFile, Repo
|
|
3
|
+
from typing import Protocol
|
|
4
|
+
from blok.utils import check_protocol_compliance
|
|
5
|
+
from dataclasses import asdict
|
|
6
|
+
|
|
7
|
+
class DefaultService(Protocol):
|
|
8
|
+
service_name: str
|
|
9
|
+
host: str
|
|
10
|
+
buckets: list[str]
|
|
11
|
+
scopes: dict[str, str]
|
|
12
|
+
secret_key: str
|
|
13
|
+
mount_repo: bool
|
|
14
|
+
build_repo: bool
|
|
15
|
+
|
|
16
|
+
def get_identifier(self) -> str: ...
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def create_default_service_yaml(
|
|
20
|
+
init: InitContext,
|
|
21
|
+
self: DefaultService,
|
|
22
|
+
) -> YamlFile:
|
|
23
|
+
check_protocol_compliance(self, DefaultService)
|
|
24
|
+
deps = init.dependencies
|
|
25
|
+
deps["live.arkitekt.lok"].register_scopes(self.scopes)
|
|
26
|
+
|
|
27
|
+
gateway_access = deps["live.arkitekt.gateway"].expose(self.host, 80, self.host)
|
|
28
|
+
|
|
29
|
+
postgress_access = deps["live.arkitekt.postgres"].register_db(self.host)
|
|
30
|
+
redis_access = deps["live.arkitekt.redis"].register()
|
|
31
|
+
lok_access = deps["live.arkitekt.lok"].retrieve_credentials()
|
|
32
|
+
admin_access = deps["live.arkitekt.admin"].retrieve()
|
|
33
|
+
minio_access = deps["live.arkitekt.s3"].create_buckets(self.buckets)
|
|
34
|
+
lok_access = deps["live.arkitekt.lok"].retrieve_credentials()
|
|
35
|
+
lok_labels = deps["live.arkitekt.lok"].retrieve_labels(self.get_identifier())
|
|
36
|
+
|
|
37
|
+
configuration = YamlFile(
|
|
38
|
+
**{
|
|
39
|
+
"db": asdict(postgress_access),
|
|
40
|
+
"django": {
|
|
41
|
+
"admin": asdict(admin_access),
|
|
42
|
+
"debug": True,
|
|
43
|
+
"hosts": ["*"],
|
|
44
|
+
"secret_key": self.secret_key,
|
|
45
|
+
},
|
|
46
|
+
"redis": asdict(redis_access),
|
|
47
|
+
"lok": asdict(lok_access),
|
|
48
|
+
"s3": asdict(minio_access),
|
|
49
|
+
"scopes": self.scopes,
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
config_mount = deps["live.arkitekt.config"].register_config(
|
|
54
|
+
f"{self.host}.yaml", configuration
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
depends_on = []
|
|
58
|
+
|
|
59
|
+
if redis_access.dependency:
|
|
60
|
+
depends_on.append(redis_access.dependency)
|
|
61
|
+
|
|
62
|
+
if postgress_access.dependency:
|
|
63
|
+
depends_on.append(postgress_access.dependency)
|
|
64
|
+
|
|
65
|
+
if minio_access.dependency:
|
|
66
|
+
depends_on.append(minio_access.dependency)
|
|
67
|
+
|
|
68
|
+
service = {
|
|
69
|
+
"labels": lok_labels,
|
|
70
|
+
"volumes": [f"{config_mount}:/workspace/config.yaml"],
|
|
71
|
+
"depends_on": depends_on,
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if self.mount_repo:
|
|
75
|
+
mount = deps["live.arkitekt.mount"].register_mount(self.host, Repo(self.repo))
|
|
76
|
+
service["volumes"].extend([f"{mount}:/workspace"])
|
|
77
|
+
|
|
78
|
+
if self.build_repo:
|
|
79
|
+
mount = deps["live.arkitekt.mount"].register_mount(self.host, Repo(self.repo))
|
|
80
|
+
service["build"] = mount
|
|
81
|
+
else:
|
|
82
|
+
service["image"] = self.image
|
|
83
|
+
|
|
84
|
+
service["command"] = self.command
|
|
85
|
+
|
|
86
|
+
return service
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
from blok import blok, InitContext, ExecutionContext, Option
|
|
2
|
+
from blok.tree import YamlFile, Repo
|
|
3
|
+
from pydantic import BaseModel
|
|
4
|
+
from typing import Dict, Any
|
|
5
|
+
|
|
6
|
+
from blok import blok, InitContext
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
DEFAULT_PUBLIC_URLS = ["127.0.0.1"]
|
|
10
|
+
DEFAULT_PUBLIC_HOSTS = ["localhost"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ExposedHost(BaseModel):
|
|
14
|
+
host: str
|
|
15
|
+
port: int
|
|
16
|
+
stip_prefix: bool = True
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ExposedPort(BaseModel):
|
|
20
|
+
port: int
|
|
21
|
+
host: str
|
|
22
|
+
tls: bool = False
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@blok("live.arkitekt.gateway")
|
|
26
|
+
class GatewayBlok:
|
|
27
|
+
def __init__(self) -> None:
|
|
28
|
+
self.exposed_hosts = {}
|
|
29
|
+
self.http_expose_default = None
|
|
30
|
+
self.exposed_ports = {}
|
|
31
|
+
self.with_certer = True
|
|
32
|
+
self.with_tailscale = True
|
|
33
|
+
self.certer_image = "jhnnsrs/certer:next"
|
|
34
|
+
self.http_port = 80
|
|
35
|
+
self.https_port = 443
|
|
36
|
+
self.public_ips = DEFAULT_PUBLIC_URLS
|
|
37
|
+
self.public_hosts = DEFAULT_PUBLIC_HOSTS
|
|
38
|
+
|
|
39
|
+
def get_dependencies(self):
|
|
40
|
+
return []
|
|
41
|
+
|
|
42
|
+
def preflight(self, init: InitContext):
|
|
43
|
+
for key, value in init.kwargs.items():
|
|
44
|
+
setattr(self, key, value)
|
|
45
|
+
|
|
46
|
+
def build(self, context: ExecutionContext):
|
|
47
|
+
caddyfile = """
|
|
48
|
+
{
|
|
49
|
+
auto_https off
|
|
50
|
+
}
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
for key, port in self.exposed_ports.items():
|
|
54
|
+
if port.tls:
|
|
55
|
+
caddyfile += f"""
|
|
56
|
+
:{port.port} {{
|
|
57
|
+
tls /certs/caddy.crt /certs/caddy.key
|
|
58
|
+
reverse_proxy {port.host}:{port.port}
|
|
59
|
+
}}
|
|
60
|
+
"""
|
|
61
|
+
else:
|
|
62
|
+
caddyfile += f"""
|
|
63
|
+
:{port.port} {{
|
|
64
|
+
reverse_proxy {port.host}:{port.port}
|
|
65
|
+
}}
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
for protocol in ["http", "https"]:
|
|
69
|
+
caddyfile += f"""
|
|
70
|
+
{protocol}:// {{
|
|
71
|
+
"""
|
|
72
|
+
caddyfile += (
|
|
73
|
+
"""
|
|
74
|
+
tls /certs/caddy.crt /certs/caddy.key
|
|
75
|
+
"""
|
|
76
|
+
if protocol == "https"
|
|
77
|
+
else ""
|
|
78
|
+
)
|
|
79
|
+
caddyfile += """
|
|
80
|
+
header {
|
|
81
|
+
-Server
|
|
82
|
+
X-Forwarded-Proto {scheme}
|
|
83
|
+
X-Forwarded-For {remote}
|
|
84
|
+
X-Forwarded-Port {server_port}
|
|
85
|
+
X-Forwarded-Host {host}
|
|
86
|
+
}
|
|
87
|
+
"""
|
|
88
|
+
|
|
89
|
+
for path_name, exposed_host in self.exposed_hosts.items():
|
|
90
|
+
if exposed_host.stip_prefix:
|
|
91
|
+
caddyfile += f"""
|
|
92
|
+
@{path_name} path /{path_name}*
|
|
93
|
+
handle @{path_name} {{
|
|
94
|
+
uri strip_prefix /{path_name}
|
|
95
|
+
reverse_proxy {exposed_host.host}:{exposed_host.port}
|
|
96
|
+
}}
|
|
97
|
+
"""
|
|
98
|
+
else:
|
|
99
|
+
caddyfile += f"""
|
|
100
|
+
@{path_name} path /{path_name}*
|
|
101
|
+
handle @{path_name} {{
|
|
102
|
+
reverse_proxy {exposed_host.host}:{exposed_host.port}
|
|
103
|
+
}}
|
|
104
|
+
"""
|
|
105
|
+
|
|
106
|
+
if self.http_expose_default:
|
|
107
|
+
caddyfile += f"""
|
|
108
|
+
handle {{
|
|
109
|
+
reverse_proxy {self.http_expose_default.host}:{self.http_expose_default.port}
|
|
110
|
+
}}
|
|
111
|
+
"""
|
|
112
|
+
|
|
113
|
+
caddyfile += """
|
|
114
|
+
}
|
|
115
|
+
"""
|
|
116
|
+
|
|
117
|
+
context.file_tree.set_nested("configs", "Caddyfile", caddyfile)
|
|
118
|
+
|
|
119
|
+
caddy_depends_on = []
|
|
120
|
+
if self.with_certer:
|
|
121
|
+
caddy_depends_on.append("certer")
|
|
122
|
+
|
|
123
|
+
caddy_container = {
|
|
124
|
+
"image": "caddy:latest",
|
|
125
|
+
"volumes": ["./configs/Caddyfile:/etc/caddy/Caddyfile", "./certs:/certs"],
|
|
126
|
+
"ports": [f"{self.http_port}:80", f"{self.https_port}:443"],
|
|
127
|
+
"depends_on": caddy_depends_on,
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
context.docker_compose.set_nested("services", "caddy", caddy_container)
|
|
131
|
+
|
|
132
|
+
context.file_tree.set_nested("certs", {})
|
|
133
|
+
certer_container = {
|
|
134
|
+
"image": self.certer_image,
|
|
135
|
+
"volumes": ["./certs:/certs"],
|
|
136
|
+
"environment": {
|
|
137
|
+
"DOMAIN_NAMES": ",".join(self.public_hosts),
|
|
138
|
+
"IP_ADDRESSED": ",".join(self.public_ips),
|
|
139
|
+
},
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
context.docker_compose.set_nested("services", "certer", certer_container)
|
|
143
|
+
|
|
144
|
+
def expose(self, path_name: str, port: int, host: str, strip_prefix: bool = True):
|
|
145
|
+
self.exposed_hosts[path_name] = ExposedHost(
|
|
146
|
+
host=host, port=port, stip_prefix=strip_prefix
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
def expose_default(self, port: int, host: str):
|
|
150
|
+
self.http_expose_default = ExposedHost(host=host, port=port, stip_prefix=False)
|
|
151
|
+
|
|
152
|
+
def expose_port(self, port: int, host: str, tls: bool = False):
|
|
153
|
+
self.exposed_ports[port] = ExposedPort(port=port, host=host, tls=tls)
|
|
154
|
+
|
|
155
|
+
def get_options(self):
|
|
156
|
+
with_public_urls = Option(
|
|
157
|
+
subcommand="public_url",
|
|
158
|
+
help="Which public urls to use",
|
|
159
|
+
type=str,
|
|
160
|
+
multiple=True,
|
|
161
|
+
default=DEFAULT_PUBLIC_URLS,
|
|
162
|
+
show_default=True,
|
|
163
|
+
)
|
|
164
|
+
with_public_services = Option(
|
|
165
|
+
subcommand="public_hosts",
|
|
166
|
+
help="Which public hosts to use",
|
|
167
|
+
type=str,
|
|
168
|
+
multiple=True,
|
|
169
|
+
default=DEFAULT_PUBLIC_HOSTS,
|
|
170
|
+
show_default=True,
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
return [with_public_urls, with_public_services]
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
from typing import Dict, Any
|
|
2
|
+
import secrets
|
|
3
|
+
|
|
4
|
+
from blok import blok, InitContext, ExecutionContext, Option
|
|
5
|
+
from blok.tree import YamlFile, Repo
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@blok("live.arkitekt.internal_engine")
|
|
9
|
+
class InternalDockerBlok:
|
|
10
|
+
def __init__(self) -> None:
|
|
11
|
+
self.host = "internal_docker"
|
|
12
|
+
self.command = (
|
|
13
|
+
"arkitekt-next run prod --redeem-token=mylittletoken --url http://caddy:80"
|
|
14
|
+
)
|
|
15
|
+
self.image = "jhnnsrs/deployer:0.0.1-vanilla"
|
|
16
|
+
self.instance_id = "INTERNAL_DOCKER"
|
|
17
|
+
|
|
18
|
+
def get_dependencies(self):
|
|
19
|
+
return ["live.arkitekt.docker_socket"]
|
|
20
|
+
|
|
21
|
+
def preflight(self, init: InitContext):
|
|
22
|
+
for key, value in init.kwargs.items():
|
|
23
|
+
setattr(self, key, value)
|
|
24
|
+
|
|
25
|
+
deps = init.dependencies
|
|
26
|
+
|
|
27
|
+
if self.skip:
|
|
28
|
+
return
|
|
29
|
+
|
|
30
|
+
self._socket = deps["live.arkitekt.docker_socket"].register_socket(self.host)
|
|
31
|
+
|
|
32
|
+
self.initialized = True
|
|
33
|
+
|
|
34
|
+
def build(self, context: ExecutionContext):
|
|
35
|
+
if self.skip:
|
|
36
|
+
return
|
|
37
|
+
db_service = {
|
|
38
|
+
"labels": [
|
|
39
|
+
"fakts.service=io.livekit.livekit",
|
|
40
|
+
"fakts.builder=livekitio.livekit",
|
|
41
|
+
],
|
|
42
|
+
"image": self.image,
|
|
43
|
+
"command": self.command,
|
|
44
|
+
"volumes": [f"{self._socket}:/var/run/docker.sock"],
|
|
45
|
+
"environment": {
|
|
46
|
+
"INSTANCE_ID": self.instance_id,
|
|
47
|
+
},
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
context.docker_compose.set_nested("services", self.host, db_service)
|
|
51
|
+
|
|
52
|
+
def get_options(self):
|
|
53
|
+
with_command = Option(
|
|
54
|
+
subcommand="command",
|
|
55
|
+
help="The fakts url for connection",
|
|
56
|
+
default=self.command,
|
|
57
|
+
)
|
|
58
|
+
with_host = Option(
|
|
59
|
+
subcommand="host",
|
|
60
|
+
help="The fakts url for connection",
|
|
61
|
+
default=self.host,
|
|
62
|
+
)
|
|
63
|
+
with_skip = Option(
|
|
64
|
+
subcommand="skip",
|
|
65
|
+
help="The fakts url for connection",
|
|
66
|
+
default=False,
|
|
67
|
+
type=bool,
|
|
68
|
+
is_flag=True,
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
return [
|
|
72
|
+
with_host,
|
|
73
|
+
with_command,
|
|
74
|
+
with_skip,
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
def __str__(self) -> str:
|
|
78
|
+
return (
|
|
79
|
+
f"InterDocker(host={self.host}, command={self.command}, image={self.image})"
|
|
80
|
+
)
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
from typing import Dict, Any
|
|
2
|
+
import secrets
|
|
3
|
+
|
|
4
|
+
from arkitekt_next.bloks.funcs import create_default_service_yaml
|
|
5
|
+
from blok import blok, InitContext, ExecutionContext, Option
|
|
6
|
+
from blok.tree import Repo, YamlFile
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@blok("live.arkitekt.kabinet")
|
|
10
|
+
class KabinetBlok:
|
|
11
|
+
def __init__(self) -> None:
|
|
12
|
+
self.host = "kabinet"
|
|
13
|
+
self.command = "bash run-debug.sh"
|
|
14
|
+
self.repo = "https://github.com/jhnnsrs/kabinet-server"
|
|
15
|
+
self.scopes = {"read_image": "Read image from the database"}
|
|
16
|
+
self.mount_repo = False
|
|
17
|
+
self.build_repo = False
|
|
18
|
+
self.buckets = ["media"]
|
|
19
|
+
self.secret_key = secrets.token_hex(16)
|
|
20
|
+
self.ensured_repos = []
|
|
21
|
+
self.image = "jhnnsrs/kabinet:next"
|
|
22
|
+
|
|
23
|
+
def get_dependencies(self):
|
|
24
|
+
return [
|
|
25
|
+
"live.arkitekt.mount",
|
|
26
|
+
"live.arkitekt.config",
|
|
27
|
+
"live.arkitekt.gateway",
|
|
28
|
+
"live.arkitekt.postgres",
|
|
29
|
+
"live.arkitekt.lok",
|
|
30
|
+
"live.arkitekt.admin",
|
|
31
|
+
"live.arkitekt.redis",
|
|
32
|
+
"live.arkitekt.s3",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
def preflight(self, init: InitContext):
|
|
36
|
+
for key, value in init.kwargs.items():
|
|
37
|
+
setattr(self, key, value)
|
|
38
|
+
|
|
39
|
+
self.service = create_default_service_yaml(init, self)
|
|
40
|
+
|
|
41
|
+
self.initialized = True
|
|
42
|
+
|
|
43
|
+
def build(self, context: ExecutionContext):
|
|
44
|
+
context.docker_compose.set_nested("services", self.host, self.service)
|
|
45
|
+
|
|
46
|
+
def get_options(self):
|
|
47
|
+
with_repo = Option(
|
|
48
|
+
subcommand="with_repo",
|
|
49
|
+
help="Which repo should we use when building the service? Only active if build_repo or mount_repo is active",
|
|
50
|
+
default=self.repo,
|
|
51
|
+
)
|
|
52
|
+
with_command = Option(
|
|
53
|
+
subcommand="command",
|
|
54
|
+
help="Which command should be run when starting the service",
|
|
55
|
+
default=self.command,
|
|
56
|
+
)
|
|
57
|
+
mount_repo = Option(
|
|
58
|
+
subcommand="mount_repo",
|
|
59
|
+
help="Should we mount the repo into the container?",
|
|
60
|
+
is_flag=True,
|
|
61
|
+
default=self.mount_repo,
|
|
62
|
+
)
|
|
63
|
+
build_repo = Option(
|
|
64
|
+
subcommand="build_repo",
|
|
65
|
+
help="Should we build the container from the repo?",
|
|
66
|
+
is_flag=True,
|
|
67
|
+
default=self.build_repo,
|
|
68
|
+
)
|
|
69
|
+
with_host = Option(
|
|
70
|
+
subcommand="host",
|
|
71
|
+
help="How should the service be named inside the docker-compose file?",
|
|
72
|
+
default=self.host,
|
|
73
|
+
)
|
|
74
|
+
with_secret_key = Option(
|
|
75
|
+
subcommand="secret_key",
|
|
76
|
+
help="The secret key to use for the django service",
|
|
77
|
+
default=self.secret_key,
|
|
78
|
+
)
|
|
79
|
+
with_repos = Option(
|
|
80
|
+
subcommand="repos",
|
|
81
|
+
help="The default repos to enable for the service",
|
|
82
|
+
default=self.secret_key,
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
return [
|
|
86
|
+
with_repo,
|
|
87
|
+
mount_repo,
|
|
88
|
+
build_repo,
|
|
89
|
+
with_host,
|
|
90
|
+
with_command,
|
|
91
|
+
with_secret_key,
|
|
92
|
+
with_repos,
|
|
93
|
+
]
|