arkitekt-next 0.13.0__py3-none-any.whl → 0.14.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/__blok__.py +4 -0
- arkitekt_next/__init__.py +1 -1
- arkitekt_next/app/__init__.py +3 -0
- arkitekt_next/{apps/protocols.py → app/app.py} +8 -4
- arkitekt_next/{apps/service/fakts_next.py → app/fakts.py} +7 -5
- arkitekt_next/bloks/admin.py +1 -1
- arkitekt_next/bloks/alpaka.py +74 -42
- arkitekt_next/bloks/arkitekt.py +4 -1
- arkitekt_next/bloks/gateway.py +6 -0
- arkitekt_next/bloks/l.py +136 -0
- arkitekt_next/bloks/livekit.py +4 -3
- arkitekt_next/bloks/lovekit.py +199 -0
- arkitekt_next/bloks/ollama.py +12 -7
- arkitekt_next/bloks/services/admin.py +5 -6
- arkitekt_next/bloks/services/livekit.py +6 -3
- arkitekt_next/bloks/services/ollama.py +7 -2
- arkitekt_next/bloks/services/secret.py +1 -3
- arkitekt_next/builders.py +10 -17
- arkitekt_next/cli/commands/inspect/implementations.py +1 -1
- arkitekt_next/cli/commands/inspect/requirements.py +1 -1
- arkitekt_next/cli/commands/kabinet/build.py +0 -1
- arkitekt_next/cli/commands/kabinet/types.py +3 -5
- arkitekt_next/cli/commands/run/dev.py +6 -22
- arkitekt_next/cli/commands/run/utils.py +6 -6
- arkitekt_next/cli/types.py +1 -2
- arkitekt_next/cli/ui.py +2 -2
- arkitekt_next/cli/utils.py +1 -1
- arkitekt_next/init_registry.py +32 -27
- arkitekt_next/protocols.py +7 -24
- arkitekt_next/qt/__init__.py +2 -2
- arkitekt_next/qt/builders.py +11 -118
- arkitekt_next/qt/magic_bar.py +1 -1
- arkitekt_next/qt/types.py +1 -1
- arkitekt_next/service_registry.py +13 -29
- arkitekt_next/utils.py +1 -1
- {arkitekt_next-0.13.0.dist-info → arkitekt_next-0.14.0.dist-info}/METADATA +2 -3
- {arkitekt_next-0.13.0.dist-info → arkitekt_next-0.14.0.dist-info}/RECORD +40 -45
- arkitekt_next/apps/__init__.py +0 -3
- arkitekt_next/apps/service/__init__.py +0 -3
- arkitekt_next/apps/service/fakts_qt.py +0 -57
- arkitekt_next/apps/service/grant_registry.py +0 -27
- arkitekt_next/apps/service/herre.py +0 -26
- arkitekt_next/apps/service/herre_qt.py +0 -57
- arkitekt_next/apps/service/local_fakts.py +0 -95
- arkitekt_next/base_models.py +0 -104
- {arkitekt_next-0.13.0.dist-info → arkitekt_next-0.14.0.dist-info}/WHEEL +0 -0
- {arkitekt_next-0.13.0.dist-info → arkitekt_next-0.14.0.dist-info}/entry_points.txt +0 -0
- {arkitekt_next-0.13.0.dist-info → arkitekt_next-0.14.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
from dataclasses import asdict
|
|
2
|
+
from typing import Dict, Any
|
|
3
|
+
import secrets
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
from arkitekt_next.bloks.services.admin import AdminService
|
|
7
|
+
from arkitekt_next.bloks.services.channel import ChannelService
|
|
8
|
+
from arkitekt_next.bloks.services.config import ConfigService
|
|
9
|
+
from arkitekt_next.bloks.services.db import DBService
|
|
10
|
+
from arkitekt_next.bloks.services.gateway import GatewayService
|
|
11
|
+
from arkitekt_next.bloks.services.livekit import LivekitService
|
|
12
|
+
from arkitekt_next.bloks.services.lok import LokService
|
|
13
|
+
from arkitekt_next.bloks.services.mount import MountService
|
|
14
|
+
from arkitekt_next.bloks.services.ollama import OllamaService
|
|
15
|
+
from arkitekt_next.bloks.services.redis import RedisService
|
|
16
|
+
from arkitekt_next.bloks.services.s3 import S3Service
|
|
17
|
+
from arkitekt_next.bloks.services.secret import SecretService
|
|
18
|
+
from blok import blok, InitContext, ExecutionContext, Option
|
|
19
|
+
from blok.bloks.services.dns import DnsService
|
|
20
|
+
from blok.tree import Repo, YamlFile
|
|
21
|
+
from arkitekt_next.bloks.base import BaseArkitektService
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@blok("live.arkitekt.lovekit", description="Stream live video and audio with Arkitekt")
|
|
25
|
+
class LovekitBlok:
|
|
26
|
+
def __init__(self) -> None:
|
|
27
|
+
self.dev = False
|
|
28
|
+
self.host = "lovekit"
|
|
29
|
+
self.command = "bash run-debug.sh"
|
|
30
|
+
self.repo = "https://github.com/arkitektio/lovekit-server"
|
|
31
|
+
self.scopes = {
|
|
32
|
+
"alpaka_pull": "Pull new Models",
|
|
33
|
+
"alpaka_chat": "Add repositories to the database",
|
|
34
|
+
}
|
|
35
|
+
self.mount_repo = False
|
|
36
|
+
self.build_repo = False
|
|
37
|
+
self.buckets = ["media"]
|
|
38
|
+
self.secret_key = secrets.token_hex(16)
|
|
39
|
+
self.image = "jhnnsrs/lovekit:nightly"
|
|
40
|
+
|
|
41
|
+
def preflight(
|
|
42
|
+
self,
|
|
43
|
+
lok: LokService,
|
|
44
|
+
db: DBService,
|
|
45
|
+
redis: RedisService,
|
|
46
|
+
s3: S3Service,
|
|
47
|
+
config: ConfigService,
|
|
48
|
+
livekit: LivekitService,
|
|
49
|
+
mount: MountService,
|
|
50
|
+
admin: AdminService,
|
|
51
|
+
secret: SecretService,
|
|
52
|
+
gateway: GatewayService,
|
|
53
|
+
mount_repo: bool = False,
|
|
54
|
+
host: str = "",
|
|
55
|
+
image: str = "",
|
|
56
|
+
secret_key: str = "",
|
|
57
|
+
build_repo: bool = False,
|
|
58
|
+
command: str = "",
|
|
59
|
+
repo: str = "",
|
|
60
|
+
disable: bool = False,
|
|
61
|
+
dev: bool = False,
|
|
62
|
+
):
|
|
63
|
+
lok.register_scopes(self.scopes)
|
|
64
|
+
|
|
65
|
+
path_name = self.host
|
|
66
|
+
|
|
67
|
+
gateway.expose(path_name, 80, self.host)
|
|
68
|
+
|
|
69
|
+
postgress_access = db.register_db(self.host)
|
|
70
|
+
redis_access = redis.register()
|
|
71
|
+
lok_access = lok.retrieve_credentials()
|
|
72
|
+
admin_access = admin.retrieve()
|
|
73
|
+
minio_access = s3.create_buckets(self.buckets)
|
|
74
|
+
lok_labels = lok.retrieve_labels("live.arkitekt.alpaka", self.get_builder())
|
|
75
|
+
|
|
76
|
+
livekit_access = livekit.get_access()
|
|
77
|
+
|
|
78
|
+
django_secret = secret.retrieve_secret()
|
|
79
|
+
|
|
80
|
+
csrf_trusted_origins = []
|
|
81
|
+
|
|
82
|
+
configuration = YamlFile(
|
|
83
|
+
**{
|
|
84
|
+
"db": asdict(postgress_access),
|
|
85
|
+
"django": {
|
|
86
|
+
"admin": asdict(admin_access),
|
|
87
|
+
"debug": True,
|
|
88
|
+
"hosts": ["*"],
|
|
89
|
+
"secret_key": django_secret,
|
|
90
|
+
},
|
|
91
|
+
"redis": asdict(redis_access),
|
|
92
|
+
"lok": asdict(lok_access),
|
|
93
|
+
"s3": asdict(minio_access),
|
|
94
|
+
"scopes": self.scopes,
|
|
95
|
+
"force_script_name": path_name,
|
|
96
|
+
"csrf_trusted_origins": csrf_trusted_origins,
|
|
97
|
+
"livekit": {
|
|
98
|
+
"host": livekit_access.host,
|
|
99
|
+
"port": livekit_access.port,
|
|
100
|
+
"api_key": livekit_access.api_key,
|
|
101
|
+
"api_secret": livekit_access.api_secret,
|
|
102
|
+
},
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
config_mount = config.register_config(f"{self.host}.yaml", configuration)
|
|
107
|
+
|
|
108
|
+
depends_on = []
|
|
109
|
+
|
|
110
|
+
if redis_access.dependency:
|
|
111
|
+
depends_on.append(redis_access.dependency)
|
|
112
|
+
|
|
113
|
+
if postgress_access.dependency:
|
|
114
|
+
depends_on.append(postgress_access.dependency)
|
|
115
|
+
|
|
116
|
+
if minio_access.dependency:
|
|
117
|
+
depends_on.append(minio_access.dependency)
|
|
118
|
+
|
|
119
|
+
service = {
|
|
120
|
+
"labels": lok_labels,
|
|
121
|
+
"volumes": [f"{config_mount}:/workspace/config.yaml"],
|
|
122
|
+
"depends_on": depends_on,
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if mount_repo or dev:
|
|
126
|
+
mount = mount.register_mount(self.host, Repo(repo))
|
|
127
|
+
service["volumes"].extend([f"{mount}:/workspace"])
|
|
128
|
+
|
|
129
|
+
if build_repo or dev:
|
|
130
|
+
mount = mount.register_mount(self.host, Repo(repo))
|
|
131
|
+
service["build"] = mount
|
|
132
|
+
else:
|
|
133
|
+
service["image"] = image
|
|
134
|
+
|
|
135
|
+
service["command"] = command
|
|
136
|
+
|
|
137
|
+
self.service = service
|
|
138
|
+
|
|
139
|
+
def get_builder(self):
|
|
140
|
+
return "arkitekt.generic"
|
|
141
|
+
|
|
142
|
+
def build(self, context: ExecutionContext):
|
|
143
|
+
context.docker_compose.set_nested("services", self.host, self.service)
|
|
144
|
+
|
|
145
|
+
def get_options(self):
|
|
146
|
+
return [
|
|
147
|
+
Option(
|
|
148
|
+
subcommand="dev",
|
|
149
|
+
help="Shoud we run the service in development mode (includes withrepo, mountrepo)?",
|
|
150
|
+
default=self.dev,
|
|
151
|
+
),
|
|
152
|
+
Option(
|
|
153
|
+
subcommand="host",
|
|
154
|
+
help="The name we should use for the host?",
|
|
155
|
+
default=self.host,
|
|
156
|
+
),
|
|
157
|
+
Option(
|
|
158
|
+
subcommand="disable",
|
|
159
|
+
help="Shoud we disable the service?",
|
|
160
|
+
default=False,
|
|
161
|
+
),
|
|
162
|
+
Option(
|
|
163
|
+
subcommand="repo",
|
|
164
|
+
help="Which repo should we use when building the service? Only active if build_repo or mount_repo is active",
|
|
165
|
+
default=self.repo,
|
|
166
|
+
),
|
|
167
|
+
Option(
|
|
168
|
+
subcommand="command",
|
|
169
|
+
help="Which command should we use when building the service?",
|
|
170
|
+
default=self.command,
|
|
171
|
+
),
|
|
172
|
+
Option(
|
|
173
|
+
subcommand="mount_repo",
|
|
174
|
+
help="Should we mount the repo into the container?",
|
|
175
|
+
type=bool,
|
|
176
|
+
default=self.mount_repo,
|
|
177
|
+
),
|
|
178
|
+
Option(
|
|
179
|
+
subcommand="build_repo",
|
|
180
|
+
help="Should we build the container from the repo?",
|
|
181
|
+
type=bool,
|
|
182
|
+
default=self.build_repo,
|
|
183
|
+
),
|
|
184
|
+
Option(
|
|
185
|
+
subcommand="host",
|
|
186
|
+
help="How should the service be named inside the docker-compose file?",
|
|
187
|
+
default=self.host,
|
|
188
|
+
),
|
|
189
|
+
Option(
|
|
190
|
+
subcommand="secret_key",
|
|
191
|
+
help="The secret key to use for the django service",
|
|
192
|
+
default=self.secret_key,
|
|
193
|
+
),
|
|
194
|
+
Option(
|
|
195
|
+
subcommand="image",
|
|
196
|
+
help="The image to use for the service",
|
|
197
|
+
default=self.image,
|
|
198
|
+
),
|
|
199
|
+
]
|
arkitekt_next/bloks/ollama.py
CHANGED
|
@@ -2,7 +2,7 @@ from typing import Dict, Any
|
|
|
2
2
|
import secrets
|
|
3
3
|
|
|
4
4
|
from arkitekt_next.bloks.services.gateway import GatewayService
|
|
5
|
-
from arkitekt_next.bloks.services.ollama import OllamaService,
|
|
5
|
+
from arkitekt_next.bloks.services.ollama import OllamaService, OllamaAccess
|
|
6
6
|
from blok import blok, InitContext, ExecutionContext, Option
|
|
7
7
|
from blok.tree import YamlFile, Repo
|
|
8
8
|
|
|
@@ -16,15 +16,22 @@ class OllamaBlok:
|
|
|
16
16
|
self.skip = False
|
|
17
17
|
self.gpu = bool
|
|
18
18
|
|
|
19
|
-
def
|
|
19
|
+
def get_access(self) -> OllamaAccess:
|
|
20
|
+
"""Get the credentials for the Ollama service."""
|
|
21
|
+
return OllamaAccess(
|
|
22
|
+
api_key="",
|
|
23
|
+
api_secret="",
|
|
24
|
+
api_url=f"http://{self.host}:{self.port}",
|
|
25
|
+
dependency=self.host,
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
def preflight(self, init: InitContext):
|
|
20
29
|
for key, value in init.kwargs.items():
|
|
21
30
|
setattr(self, key, value)
|
|
22
31
|
|
|
23
32
|
if self.skip:
|
|
24
33
|
return
|
|
25
34
|
|
|
26
|
-
gateway.expose_port_to(self.port, self.host, 11434, False)
|
|
27
|
-
|
|
28
35
|
self.initialized = True
|
|
29
36
|
|
|
30
37
|
def build(self, context: ExecutionContext):
|
|
@@ -84,6 +91,4 @@ class OllamaBlok:
|
|
|
84
91
|
]
|
|
85
92
|
|
|
86
93
|
def __str__(self) -> str:
|
|
87
|
-
return (
|
|
88
|
-
f"Ollama(host={self.host}, command={self.command}, image={self.image})"
|
|
89
|
-
)
|
|
94
|
+
return f"Ollama(host={self.host}, command={self.command}, image={self.image})"
|
|
@@ -13,10 +13,9 @@ class AdminCredentials:
|
|
|
13
13
|
|
|
14
14
|
@service("live.arkitekt.admin")
|
|
15
15
|
class AdminService(Protocol):
|
|
16
|
+
def retrieve(self) -> AdminCredentials:
|
|
17
|
+
"""Retrieve the admin credentials.
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
username=self.username,
|
|
21
|
-
email=self.email,
|
|
22
|
-
)
|
|
19
|
+
Admin credentials should be used to access the admin interface of the application.
|
|
20
|
+
|
|
21
|
+
"""
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
from typing import Dict, Any, Protocol
|
|
2
|
+
|
|
3
|
+
from cv2 import HOUGH_STANDARD
|
|
2
4
|
from blok import blok, InitContext, Option
|
|
3
5
|
from blok import service
|
|
4
6
|
from dataclasses import dataclass
|
|
@@ -8,10 +10,11 @@ from dataclasses import dataclass
|
|
|
8
10
|
class LivekitCredentials:
|
|
9
11
|
api_key: str
|
|
10
12
|
api_secret: str
|
|
11
|
-
|
|
13
|
+
host: str
|
|
14
|
+
port: int
|
|
15
|
+
dependency: str | None = None
|
|
12
16
|
|
|
13
17
|
|
|
14
18
|
@service("io.livekit.livekit")
|
|
15
19
|
class LivekitService(Protocol):
|
|
16
|
-
|
|
17
|
-
def retrieve_access(self) -> LivekitCredentials: ...
|
|
20
|
+
def get_access(self) -> LivekitCredentials: ...
|
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
from typing import Dict, Any, Protocol
|
|
1
|
+
from typing import Dict, Any, Optional, Protocol
|
|
2
2
|
from blok import blok, InitContext, Option
|
|
3
3
|
from blok import service
|
|
4
4
|
from dataclasses import dataclass
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
@dataclass
|
|
8
|
-
class
|
|
8
|
+
class OllamaAccess:
|
|
9
9
|
api_key: str
|
|
10
10
|
api_secret: str
|
|
11
11
|
api_url: str
|
|
12
|
+
dependency: Optional[str] = None
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
@service("io.ollama.ollama", description=" A self-hosted ollama LLM server")
|
|
15
16
|
class OllamaService(Protocol):
|
|
16
17
|
pass
|
|
18
|
+
|
|
19
|
+
def get_access(self) -> OllamaAccess:
|
|
20
|
+
"""Get the credentials for the ollama service."""
|
|
21
|
+
...
|
arkitekt_next/builders.py
CHANGED
|
@@ -2,15 +2,14 @@ from typing import List, Optional
|
|
|
2
2
|
import logging
|
|
3
3
|
import os
|
|
4
4
|
|
|
5
|
-
from arkitekt_next.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
from arkitekt_next.app.fakts import (
|
|
6
|
+
build_device_code_fakts,
|
|
7
|
+
build_redeem_fakts,
|
|
8
|
+
build_token_fakts,
|
|
9
9
|
)
|
|
10
|
-
from arkitekt_next.apps.service.herre import build_arkitekt_next_herre_next
|
|
11
10
|
from .utils import create_arkitekt_next_folder
|
|
12
|
-
from .
|
|
13
|
-
from .
|
|
11
|
+
from fakts_next.models import Manifest
|
|
12
|
+
from .app import App
|
|
14
13
|
from .service_registry import ServiceBuilderRegistry, get_default_service_registry
|
|
15
14
|
from .init_registry import InitHookRegistry, get_default_init_hook_registry
|
|
16
15
|
from arkitekt_next.constants import DEFAULT_ARKITEKT_URL
|
|
@@ -115,28 +114,26 @@ def easy(
|
|
|
115
114
|
)
|
|
116
115
|
|
|
117
116
|
if token:
|
|
118
|
-
fakts_next =
|
|
117
|
+
fakts_next = build_token_fakts(
|
|
119
118
|
manifest=manifest,
|
|
120
119
|
token=token,
|
|
121
120
|
url=url,
|
|
122
121
|
)
|
|
123
122
|
|
|
124
123
|
elif redeem_token:
|
|
125
|
-
fakts_next =
|
|
124
|
+
fakts_next = build_redeem_fakts(
|
|
126
125
|
manifest=manifest,
|
|
127
126
|
redeem_token=redeem_token,
|
|
128
127
|
url=url,
|
|
129
128
|
)
|
|
130
129
|
else:
|
|
131
|
-
fakts_next =
|
|
130
|
+
fakts_next = build_device_code_fakts(
|
|
132
131
|
manifest=manifest,
|
|
133
132
|
url=url,
|
|
134
133
|
no_cache=no_cache,
|
|
135
134
|
headless=headless,
|
|
136
135
|
)
|
|
137
136
|
|
|
138
|
-
herre_next = build_arkitekt_next_herre_next(fakts_next=fakts_next)
|
|
139
|
-
|
|
140
137
|
params = {
|
|
141
138
|
"instance_id": instance_id,
|
|
142
139
|
}
|
|
@@ -152,11 +149,7 @@ def easy(
|
|
|
152
149
|
|
|
153
150
|
app = App(
|
|
154
151
|
fakts=fakts_next,
|
|
155
|
-
|
|
156
|
-
manifest=manifest,
|
|
157
|
-
services=service_registry.build_service_map(
|
|
158
|
-
fakts=fakts_next, herre=herre_next, params=params, manifest=manifest
|
|
159
|
-
),
|
|
152
|
+
services=service_registry.build_service_map(fakts=fakts_next, params=params),
|
|
160
153
|
)
|
|
161
154
|
|
|
162
155
|
init_hook_registry.run_all(app)
|
|
@@ -2,7 +2,7 @@ import asyncio
|
|
|
2
2
|
from pydantic import BaseModel
|
|
3
3
|
import rich_click as click
|
|
4
4
|
from importlib import import_module
|
|
5
|
-
from arkitekt_next.
|
|
5
|
+
from arkitekt_next.app.app import App
|
|
6
6
|
from arkitekt_next.cli.commands.run.utils import import_builder
|
|
7
7
|
from arkitekt_next.cli.vars import get_console, get_manifest
|
|
8
8
|
from arkitekt_next.cli.options import with_builder
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from arkitekt_next import get_default_service_registry
|
|
2
2
|
import rich_click as click
|
|
3
3
|
from importlib import import_module
|
|
4
|
-
from arkitekt_next.
|
|
4
|
+
from arkitekt_next.app.app import App
|
|
5
5
|
from arkitekt_next.cli.commands.run.utils import import_builder
|
|
6
6
|
from arkitekt_next.cli.vars import get_console, get_manifest
|
|
7
7
|
from arkitekt_next.cli.options import with_builder
|
|
@@ -13,7 +13,6 @@ from .types import Flavour, InspectionInput
|
|
|
13
13
|
import yaml
|
|
14
14
|
from typing import Dict, List, Optional
|
|
15
15
|
import json
|
|
16
|
-
from arkitekt_next.base_models import Requirement
|
|
17
16
|
from arkitekt_next.constants import DEFAULT_ARKITEKT_URL
|
|
18
17
|
from arkitekt_next.utils import create_arkitekt_next_folder
|
|
19
18
|
from rekuest_next.api.schema import ImplementationInput
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
from importlib.metadata import version
|
|
2
1
|
from pydantic import BaseModel, Field, field_validator
|
|
3
2
|
import datetime
|
|
4
|
-
from typing import List, Optional
|
|
3
|
+
from typing import List, Optional
|
|
5
4
|
from enum import Enum
|
|
6
|
-
|
|
7
|
-
import uuid
|
|
8
|
-
from arkitekt_next.base_models import Requirement
|
|
5
|
+
|
|
9
6
|
from string import Formatter
|
|
10
7
|
import os
|
|
11
8
|
|
|
@@ -31,6 +28,7 @@ class SelectorType(str, Enum):
|
|
|
31
28
|
|
|
32
29
|
|
|
33
30
|
class Flavour(BaseModel):
|
|
31
|
+
""" Flavour is a pydantic model that represents a flavour of an app image"""
|
|
34
32
|
selectors: List[SelectorInput]
|
|
35
33
|
description: str = Field(default="")
|
|
36
34
|
dockerfile: str = Field(default="Dockerfile")
|
|
@@ -17,7 +17,7 @@ from typing import MutableSet, Tuple, Any, Set
|
|
|
17
17
|
from arkitekt_next.cli.ui import construct_changes_group, construct_app_group
|
|
18
18
|
from arkitekt_next.cli.commands.run.utils import import_builder
|
|
19
19
|
from arkitekt_next.cli.types import Manifest
|
|
20
|
-
from arkitekt_next.
|
|
20
|
+
from arkitekt_next.app.app import App
|
|
21
21
|
import rich_click as click
|
|
22
22
|
from arkitekt_next.cli.options import (
|
|
23
23
|
with_fakts_next_url,
|
|
@@ -168,8 +168,6 @@ def is_entrypoint_change(
|
|
|
168
168
|
return False
|
|
169
169
|
|
|
170
170
|
|
|
171
|
-
|
|
172
|
-
|
|
173
171
|
def callback(console: Console, future: asyncio.Task[None]):
|
|
174
172
|
if future.cancelled():
|
|
175
173
|
return
|
|
@@ -186,22 +184,14 @@ def callback(console: Console, future: asyncio.Task[None]):
|
|
|
186
184
|
raise has_exception
|
|
187
185
|
except Exception:
|
|
188
186
|
console.print_exception()
|
|
189
|
-
panel = Panel(
|
|
190
|
-
"Error running App", style="bold red", border_style="red"
|
|
191
|
-
)
|
|
187
|
+
panel = Panel("Error running App", style="bold red", border_style="red")
|
|
192
188
|
console.print(panel)
|
|
193
189
|
|
|
194
190
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
191
|
async def run_dev(
|
|
202
192
|
console: Console,
|
|
203
193
|
manifest: Manifest,
|
|
204
|
-
version: str | None =None,
|
|
194
|
+
version: str | None = None,
|
|
205
195
|
builder: str = "arkitekt_next.builders.easy",
|
|
206
196
|
deep: bool = False,
|
|
207
197
|
**builder_kwargs,
|
|
@@ -242,10 +232,8 @@ async def run_dev(
|
|
|
242
232
|
console.print(panel)
|
|
243
233
|
module = None
|
|
244
234
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
current_run: asyncio.Future[None] | None = None
|
|
248
|
-
# This is the main task that is running the app
|
|
235
|
+
current_run: asyncio.Future[None] | None = None
|
|
236
|
+
# This is the main task that is running the app
|
|
249
237
|
|
|
250
238
|
try:
|
|
251
239
|
app: App = builder_func(
|
|
@@ -266,8 +254,6 @@ async def run_dev(
|
|
|
266
254
|
"Error building initial App", style="bold red", border_style="red"
|
|
267
255
|
)
|
|
268
256
|
console.print(panel)
|
|
269
|
-
|
|
270
|
-
|
|
271
257
|
|
|
272
258
|
async for changes in awatch(
|
|
273
259
|
".",
|
|
@@ -276,7 +262,7 @@ async def run_dev(
|
|
|
276
262
|
step=500,
|
|
277
263
|
):
|
|
278
264
|
if deep:
|
|
279
|
-
#
|
|
265
|
+
#
|
|
280
266
|
to_be_reloaded = check_deeps(changes)
|
|
281
267
|
if not to_be_reloaded:
|
|
282
268
|
continue
|
|
@@ -315,8 +301,6 @@ async def run_dev(
|
|
|
315
301
|
if deep:
|
|
316
302
|
reload_modules(to_be_reloaded)
|
|
317
303
|
else:
|
|
318
|
-
|
|
319
|
-
|
|
320
304
|
reload(module)
|
|
321
305
|
except Exception:
|
|
322
306
|
console.print_exception()
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
from importlib import import_module
|
|
2
2
|
from typing import Callable
|
|
3
|
-
from arkitekt_next.
|
|
3
|
+
from arkitekt_next.app.app import App
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
def import_builder(builder: str) -> Callable[..., App]:
|
|
7
|
-
"""
|
|
8
|
-
|
|
7
|
+
"""Import a builder function from a module.
|
|
8
|
+
|
|
9
9
|
Parameters
|
|
10
10
|
----------
|
|
11
11
|
builder : str
|
|
12
12
|
The builder function to import, in the format "module.function".
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
Returns
|
|
15
15
|
-------
|
|
16
16
|
Callable[..., App]
|
|
17
17
|
The imported builder function.
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
"""
|
|
20
|
-
|
|
20
|
+
|
|
21
21
|
module_path, function_name = builder.rsplit(".", 1)
|
|
22
22
|
module = import_module(module_path)
|
|
23
23
|
function = getattr(module, function_name)
|
arkitekt_next/cli/types.py
CHANGED
|
@@ -5,7 +5,7 @@ from typing import List, Optional, Union, Literal, Dict
|
|
|
5
5
|
from enum import Enum
|
|
6
6
|
import semver
|
|
7
7
|
import uuid
|
|
8
|
-
from
|
|
8
|
+
from fakts_next.models import Requirement
|
|
9
9
|
from string import Formatter
|
|
10
10
|
import os
|
|
11
11
|
|
|
@@ -39,4 +39,3 @@ class Manifest(BaseModel):
|
|
|
39
39
|
"logo": self.logo,
|
|
40
40
|
"scopes": self.scopes,
|
|
41
41
|
}
|
|
42
|
-
|
arkitekt_next/cli/ui.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from rich.console import Group
|
|
2
2
|
from rich.tree import Tree
|
|
3
3
|
from rich.panel import Panel
|
|
4
|
-
from arkitekt_next.
|
|
4
|
+
from arkitekt_next.app import App
|
|
5
5
|
from typing import MutableSet, Tuple, Any, Dict
|
|
6
6
|
import os
|
|
7
7
|
from .texts import LOGO, WELCOME_MESSAGE
|
|
@@ -59,7 +59,7 @@ def construct_app_group(app: App) -> Group:
|
|
|
59
59
|
Group
|
|
60
60
|
A rich panel group
|
|
61
61
|
"""
|
|
62
|
-
panel_header = f"Running App \n\n{app.manifest.identifier}:{app.manifest.version}\n"
|
|
62
|
+
panel_header = f"Running App \n\n{app.fakts.manifest.identifier}:{app.fakts.manifest.version}\n"
|
|
63
63
|
|
|
64
64
|
actor_tree = Tree("Registered Definitions", style="white not bold")
|
|
65
65
|
service_tree = Tree("Depends on services", style="white not bold")
|