arkitekt-next 0.8.47__py3-none-any.whl → 0.8.49__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 +6 -2
- arkitekt_next/__init__.py +4 -0
- arkitekt_next/apps/service/fakts_next.py +10 -12
- arkitekt_next/apps/service/fakts_qt.py +14 -13
- arkitekt_next/apps/service/herre.py +3 -1
- arkitekt_next/apps/types.py +0 -1
- arkitekt_next/base_models.py +3 -8
- arkitekt_next/bloks/arkitekt.py +24 -22
- arkitekt_next/bloks/base.py +4 -2
- arkitekt_next/bloks/gateway.py +18 -7
- arkitekt_next/bloks/internal_docker.py +1 -5
- arkitekt_next/bloks/kraph.py +42 -0
- arkitekt_next/bloks/lok.py +4 -1
- arkitekt_next/bloks/ollama.py +92 -0
- arkitekt_next/bloks/orkestrator.py +57 -19
- arkitekt_next/bloks/self_signed.py +98 -0
- arkitekt_next/bloks/services/certer.py +14 -0
- arkitekt_next/bloks/services/ollama.py +16 -0
- arkitekt_next/builders.py +0 -1
- arkitekt_next/cli/commands/delegate/script.py +0 -4
- arkitekt_next/cli/commands/gen/compile.py +0 -8
- arkitekt_next/cli/commands/gen/init.py +7 -14
- arkitekt_next/cli/commands/inspect/requirements.py +1 -4
- arkitekt_next/cli/commands/inspect/templates.py +1 -1
- arkitekt_next/cli/commands/kabinet/build.py +13 -1
- arkitekt_next/cli/io.py +9 -10
- arkitekt_next/cli/texts.py +3 -1
- arkitekt_next/cli/types.py +9 -3
- arkitekt_next/qt/magic_bar.py +1 -5
- arkitekt_next/qt/types.py +1 -0
- arkitekt_next/service_registry.py +35 -39
- arkitekt_next/utils.py +3 -2
- {arkitekt_next-0.8.47.dist-info → arkitekt_next-0.8.49.dist-info}/METADATA +6 -6
- {arkitekt_next-0.8.47.dist-info → arkitekt_next-0.8.49.dist-info}/RECORD +37 -32
- {arkitekt_next-0.8.47.dist-info → arkitekt_next-0.8.49.dist-info}/LICENSE +0 -0
- {arkitekt_next-0.8.47.dist-info → arkitekt_next-0.8.49.dist-info}/WHEEL +0 -0
- {arkitekt_next-0.8.47.dist-info → arkitekt_next-0.8.49.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,98 @@
|
|
|
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(
|
|
36
|
+
"live.arkitekt.certer", description="A self-signed certificate generator"
|
|
37
|
+
)
|
|
38
|
+
class SelfSignedBlok:
|
|
39
|
+
def __init__(self) -> None:
|
|
40
|
+
self.host = "certer"
|
|
41
|
+
self.certer_image = "jhnnsrs/certer:next"
|
|
42
|
+
self.certs_mount = "./certs"
|
|
43
|
+
|
|
44
|
+
def retrieve_certs_mount(self):
|
|
45
|
+
return self.certs_mount
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def retrieve_depends_on(self):
|
|
49
|
+
return ["certer"]
|
|
50
|
+
|
|
51
|
+
def preflight(self, init: InitContext, dns: DnsService):
|
|
52
|
+
for key, value in init.kwargs.items():
|
|
53
|
+
setattr(self, key, value)
|
|
54
|
+
|
|
55
|
+
self.public_ips = dns.get_dns_result().ip_addresses
|
|
56
|
+
self.public_hosts = dns.get_dns_result().hostnames
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def build(
|
|
60
|
+
self,
|
|
61
|
+
context: ExecutionContext,
|
|
62
|
+
):
|
|
63
|
+
|
|
64
|
+
context.file_tree.set_nested("certs", {})
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
certer_container = {
|
|
68
|
+
"image": self.certer_image,
|
|
69
|
+
"volumes": ["./certs:/certs"],
|
|
70
|
+
"environment": {
|
|
71
|
+
"DOMAIN_NAMES": ",".join(self.public_hosts),
|
|
72
|
+
"IP_ADDRESSED": ",".join(self.public_ips),
|
|
73
|
+
},
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
context.docker_compose.set_nested("services", self.host, certer_container)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def get_options(self):
|
|
81
|
+
with_public_urls = Option(
|
|
82
|
+
subcommand="public_url",
|
|
83
|
+
help="Which public urls to use",
|
|
84
|
+
type=str,
|
|
85
|
+
multiple=True,
|
|
86
|
+
default=DEFAULT_PUBLIC_URLS,
|
|
87
|
+
show_default=True,
|
|
88
|
+
)
|
|
89
|
+
with_public_services = Option(
|
|
90
|
+
subcommand="public_hosts",
|
|
91
|
+
help="Which public hosts to use",
|
|
92
|
+
type=str,
|
|
93
|
+
multiple=True,
|
|
94
|
+
default=DEFAULT_PUBLIC_HOSTS,
|
|
95
|
+
show_default=True,
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
return [with_public_urls, with_public_services]
|
|
@@ -0,0 +1,14 @@
|
|
|
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]: ...
|
|
@@ -0,0 +1,16 @@
|
|
|
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 OllamaCredentials:
|
|
9
|
+
api_key: str
|
|
10
|
+
api_secret: str
|
|
11
|
+
api_url: str
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@service("io.ollama.ollama", description=" A self-hosted ollama LLM server")
|
|
15
|
+
class OllamaService(Protocol):
|
|
16
|
+
pass
|
arkitekt_next/builders.py
CHANGED
|
@@ -77,19 +77,15 @@ def script(
|
|
|
77
77
|
|
|
78
78
|
builder = import_builder(builder)
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
|
|
82
80
|
app = builder(
|
|
83
81
|
**manifest.to_builder_dict(),
|
|
84
82
|
**builder_kwargs,
|
|
85
83
|
)
|
|
86
84
|
|
|
87
|
-
|
|
88
85
|
rekuest: RekuestNext = app.services.get("rekuest")
|
|
89
86
|
|
|
90
87
|
rekuest.agent.register_extension("cli", CLIExtension(" ".join(script_name)))
|
|
91
88
|
|
|
92
|
-
|
|
93
89
|
panel = construct_run_panel(app)
|
|
94
90
|
console.print(panel)
|
|
95
91
|
|
|
@@ -55,7 +55,6 @@ def init(ctx, boring, services, config, documents, schemas, path, seperate_doc_d
|
|
|
55
55
|
|
|
56
56
|
chosen_services = registry.service_builders
|
|
57
57
|
|
|
58
|
-
|
|
59
58
|
if services:
|
|
60
59
|
chosen_services = {
|
|
61
60
|
key: service
|
|
@@ -70,21 +69,18 @@ def init(ctx, boring, services, config, documents, schemas, path, seperate_doc_d
|
|
|
70
69
|
|
|
71
70
|
chosen_services = {service: chosen_services[service]}
|
|
72
71
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
72
|
if os.path.exists(config):
|
|
77
73
|
if click.confirm(
|
|
78
74
|
f"GraphQL Config file already exists. Do you want to merge your choices?"
|
|
79
75
|
):
|
|
80
76
|
file = yaml.load(open(config, "r"), Loader=yaml.FullLoader)
|
|
81
77
|
projects = file.get("projects", {})
|
|
82
|
-
click.echo(
|
|
83
|
-
|
|
78
|
+
click.echo(
|
|
79
|
+
f"Merging {','.join(chosen_services.keys())} in {','.join(projects.keys())}..."
|
|
80
|
+
)
|
|
84
81
|
|
|
85
82
|
has_done_something = False
|
|
86
83
|
|
|
87
|
-
|
|
88
84
|
for key, service in chosen_services.items():
|
|
89
85
|
try:
|
|
90
86
|
|
|
@@ -118,8 +114,6 @@ def init(ctx, boring, services, config, documents, schemas, path, seperate_doc_d
|
|
|
118
114
|
out_path = os.path.join(app_schemas, key + ".schema.graphql")
|
|
119
115
|
with open(out_path, "w") as f:
|
|
120
116
|
f.write(schema)
|
|
121
|
-
|
|
122
|
-
|
|
123
117
|
|
|
124
118
|
if schemas:
|
|
125
119
|
project["schema"] = os.path.join(app_schemas, key + ".schema.graphql")
|
|
@@ -128,18 +122,17 @@ def init(ctx, boring, services, config, documents, schemas, path, seperate_doc_d
|
|
|
128
122
|
os.path.join(app_documents, key) + "/**/*.graphql"
|
|
129
123
|
)
|
|
130
124
|
|
|
131
|
-
|
|
132
|
-
|
|
133
125
|
project["extensions"]["turms"]["out_dir"] = path
|
|
134
126
|
project["extensions"]["turms"]["generated_name"] = f"{key}.py"
|
|
135
|
-
del project["extensions"]["turms"]["documents"]
|
|
127
|
+
del project["extensions"]["turms"]["documents"]
|
|
136
128
|
del project["schema_url"]
|
|
137
129
|
|
|
138
130
|
projects[key] = project
|
|
139
131
|
|
|
140
132
|
except Exception as e:
|
|
141
|
-
raise ClickException(
|
|
142
|
-
|
|
133
|
+
raise ClickException(
|
|
134
|
+
f"Failed to initialize project for {key}. Error: {e}"
|
|
135
|
+
) from e
|
|
143
136
|
|
|
144
137
|
if has_done_something:
|
|
145
138
|
graph_config_path = os.path.join(app_directory, config)
|
|
@@ -66,10 +66,7 @@ def requirements(
|
|
|
66
66
|
logo=manifest.logo,
|
|
67
67
|
)
|
|
68
68
|
|
|
69
|
-
x = [
|
|
70
|
-
item.model_dump(by_alias=True)
|
|
71
|
-
for item in app.manifest.requirements
|
|
72
|
-
]
|
|
69
|
+
x = [item.model_dump(by_alias=True) for item in app.manifest.requirements]
|
|
73
70
|
if machine_readable:
|
|
74
71
|
print("--START_REQUIREMENTS--" + json.dumps(x) + "--END_REQUIREMENTS--")
|
|
75
72
|
|
|
@@ -233,8 +233,16 @@ def get_flavours(ctx: Context, select: Optional[str] = None) -> Dict[str, Flavou
|
|
|
233
233
|
is_flag=True,
|
|
234
234
|
default=False,
|
|
235
235
|
)
|
|
236
|
+
@click.option(
|
|
237
|
+
"--tag",
|
|
238
|
+
"-t",
|
|
239
|
+
help="Tag the build with a specific tag",
|
|
240
|
+
type=str,
|
|
241
|
+
default=None,
|
|
242
|
+
required=False,
|
|
243
|
+
)
|
|
236
244
|
@click.pass_context
|
|
237
|
-
def build(ctx: Context, flavour: str, no_inspect: bool) -> None:
|
|
245
|
+
def build(ctx: Context, flavour: str, no_inspect: bool, tag: str = None) -> None:
|
|
238
246
|
"""Builds the arkitekt_next app to docker"""
|
|
239
247
|
|
|
240
248
|
manifest = get_manifest(ctx)
|
|
@@ -262,6 +270,10 @@ def build(ctx: Context, flavour: str, no_inspect: bool) -> None:
|
|
|
262
270
|
|
|
263
271
|
build_tag = build_flavour(key, flavour)
|
|
264
272
|
|
|
273
|
+
if tag:
|
|
274
|
+
subprocess.run(["docker", "tag", build_tag, tag], check=True)
|
|
275
|
+
|
|
276
|
+
|
|
265
277
|
inspection = None
|
|
266
278
|
if not no_inspect:
|
|
267
279
|
inspection = inspect_build(build_tag)
|
arkitekt_next/cli/io.py
CHANGED
|
@@ -10,7 +10,12 @@ from arkitekt_next.cli.types import (
|
|
|
10
10
|
Flavour,
|
|
11
11
|
DeploymentsConfigFile,
|
|
12
12
|
)
|
|
13
|
-
from kabinet.api.schema import
|
|
13
|
+
from kabinet.api.schema import (
|
|
14
|
+
InspectionInput,
|
|
15
|
+
AppImageInput,
|
|
16
|
+
DockerImageInput,
|
|
17
|
+
ManifestInput,
|
|
18
|
+
)
|
|
14
19
|
|
|
15
20
|
import yaml
|
|
16
21
|
import json
|
|
@@ -116,18 +121,11 @@ def get_builds(selected_run: Optional[str] = None) -> Dict[str, Build]:
|
|
|
116
121
|
)
|
|
117
122
|
|
|
118
123
|
|
|
119
|
-
|
|
120
|
-
|
|
121
124
|
def manifest_to_input(manifest: Manifest) -> ManifestInput:
|
|
122
125
|
|
|
123
126
|
return ManifestInput(**manifest.model_dump(by_alias=True))
|
|
124
127
|
|
|
125
128
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
129
|
def generate_build(
|
|
132
130
|
build_run: str,
|
|
133
131
|
build_id: str,
|
|
@@ -246,7 +244,6 @@ def generate_deployment(
|
|
|
246
244
|
selectors=build.selectors,
|
|
247
245
|
inspection=build.inspection,
|
|
248
246
|
image=DockerImageInput(imageString=image, buildAt=datetime.datetime.now()),
|
|
249
|
-
|
|
250
247
|
)
|
|
251
248
|
|
|
252
249
|
if os.path.exists(config_file):
|
|
@@ -255,7 +252,9 @@ def generate_deployment(
|
|
|
255
252
|
config.app_images.append(app_image)
|
|
256
253
|
config.latest_app_image = app_image.app_image_id
|
|
257
254
|
else:
|
|
258
|
-
config = DeploymentsConfigFile(
|
|
255
|
+
config = DeploymentsConfigFile(
|
|
256
|
+
app_images=[app_image], latest_app_image=app_image.app_image_id
|
|
257
|
+
)
|
|
259
258
|
|
|
260
259
|
with open(config_file, "w") as file:
|
|
261
260
|
yaml.safe_dump(
|
arkitekt_next/cli/texts.py
CHANGED
arkitekt_next/cli/types.py
CHANGED
|
@@ -9,7 +9,12 @@ from arkitekt_next.base_models import Requirement
|
|
|
9
9
|
from string import Formatter
|
|
10
10
|
import os
|
|
11
11
|
|
|
12
|
-
from kabinet.api.schema import
|
|
12
|
+
from kabinet.api.schema import (
|
|
13
|
+
AppImageInput,
|
|
14
|
+
InspectionInput,
|
|
15
|
+
SelectorInput,
|
|
16
|
+
ManifestInput,
|
|
17
|
+
)
|
|
13
18
|
from rekuest_next.api.schema import TemplateInput
|
|
14
19
|
|
|
15
20
|
ALLOWED_BUILDER_KEYS = [
|
|
@@ -94,7 +99,9 @@ class Flavour(BaseModel):
|
|
|
94
99
|
"""Checks that the build_command templates are valid"""
|
|
95
100
|
|
|
96
101
|
for v in value:
|
|
97
|
-
for literal_text, field_name, format_spec, conversion in Formatter().parse(
|
|
102
|
+
for literal_text, field_name, format_spec, conversion in Formatter().parse(
|
|
103
|
+
v
|
|
104
|
+
):
|
|
98
105
|
if field_name is not None:
|
|
99
106
|
assert (
|
|
100
107
|
field_name in ALLOWED_BUILDER_KEYS
|
|
@@ -120,7 +127,6 @@ class Flavour(BaseModel):
|
|
|
120
127
|
)
|
|
121
128
|
|
|
122
129
|
|
|
123
|
-
|
|
124
130
|
class DeploymentsConfigFile(BaseModel):
|
|
125
131
|
"""The ConfigFile is a pydantic model that represents the deployments.yaml file
|
|
126
132
|
|
arkitekt_next/qt/magic_bar.py
CHANGED
|
@@ -213,12 +213,8 @@ class Profile(QtWidgets.QDialog):
|
|
|
213
213
|
self.infobar.addWidget(QtWidgets.QLabel(self.app.manifest.identifier))
|
|
214
214
|
self.infobar.addWidget(QtWidgets.QLabel(self.app.manifest.version))
|
|
215
215
|
|
|
216
|
-
|
|
217
216
|
self.unkonfigure_button = QtWidgets.QPushButton("Reconnect")
|
|
218
|
-
self.unkonfigure_button.clicked.connect(
|
|
219
|
-
lambda: self.bar.refresh_task.run(
|
|
220
|
-
)
|
|
221
|
-
)
|
|
217
|
+
self.unkonfigure_button.clicked.connect(lambda: self.bar.refresh_task.run())
|
|
222
218
|
|
|
223
219
|
button_bar = QtWidgets.QHBoxLayout()
|
|
224
220
|
self.infobar.addLayout(button_bar)
|
arkitekt_next/qt/types.py
CHANGED
|
@@ -14,10 +14,6 @@ from typing import runtime_checkable
|
|
|
14
14
|
Params = Dict[str, str]
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
17
|
class Registration(BaseModel):
|
|
22
18
|
name: str
|
|
23
19
|
requirement: Requirement
|
|
@@ -28,19 +24,17 @@ class Registration(BaseModel):
|
|
|
28
24
|
@runtime_checkable
|
|
29
25
|
class ArkitektService(Protocol):
|
|
30
26
|
|
|
31
|
-
|
|
32
27
|
def get_service_name(self):
|
|
33
28
|
pass
|
|
34
29
|
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
def build_service(
|
|
31
|
+
self, fakts: Fakts, herre: Herre, params: Params, manifest: Manifest
|
|
32
|
+
):
|
|
37
33
|
pass
|
|
38
34
|
|
|
39
|
-
|
|
40
35
|
def get_requirements(self):
|
|
41
36
|
pass
|
|
42
37
|
|
|
43
|
-
|
|
44
38
|
def get_graphql_schema(self):
|
|
45
39
|
pass
|
|
46
40
|
|
|
@@ -48,32 +42,33 @@ class ArkitektService(Protocol):
|
|
|
48
42
|
pass
|
|
49
43
|
|
|
50
44
|
|
|
51
|
-
|
|
52
45
|
class BaseArkitektService:
|
|
53
46
|
|
|
54
|
-
|
|
55
47
|
def get_service_name(self):
|
|
56
48
|
raise NotImplementedError("get_service_name not implemented")
|
|
57
|
-
|
|
58
|
-
def build_service(
|
|
49
|
+
|
|
50
|
+
def build_service(
|
|
51
|
+
self, fakts: Fakts, herre: Herre, params: Params, manifest: Manifest
|
|
52
|
+
):
|
|
59
53
|
raise NotImplementedError("build_service not implemented")
|
|
60
|
-
|
|
54
|
+
|
|
61
55
|
def get_requirements(self):
|
|
62
56
|
raise NotImplementedError("get_requirements not implemented")
|
|
63
|
-
|
|
57
|
+
|
|
64
58
|
def get_graphql_schema(self):
|
|
65
59
|
return None
|
|
66
|
-
|
|
60
|
+
|
|
67
61
|
def get_turms_project(self):
|
|
68
62
|
return None
|
|
69
|
-
|
|
70
63
|
|
|
71
64
|
|
|
72
|
-
basic_requirements =
|
|
65
|
+
basic_requirements = [
|
|
66
|
+
Requirement(
|
|
73
67
|
key="lok",
|
|
74
68
|
service="live.arkitekt.lok",
|
|
75
69
|
description="An instance of ArkitektNext Lok to authenticate the user",
|
|
76
|
-
)
|
|
70
|
+
)
|
|
71
|
+
]
|
|
77
72
|
|
|
78
73
|
|
|
79
74
|
class ServiceBuilderRegistry:
|
|
@@ -84,14 +79,13 @@ class ServiceBuilderRegistry:
|
|
|
84
79
|
self,
|
|
85
80
|
service: ArkitektService,
|
|
86
81
|
):
|
|
87
|
-
|
|
82
|
+
|
|
88
83
|
name = service.get_service_name()
|
|
89
84
|
|
|
90
85
|
if name not in self.service_builders:
|
|
91
86
|
self.service_builders[name] = service
|
|
92
87
|
else:
|
|
93
88
|
raise ValueError(f"Service {name} already registered")
|
|
94
|
-
|
|
95
89
|
|
|
96
90
|
def get(self, name):
|
|
97
91
|
return self.services.get(name)
|
|
@@ -101,35 +95,32 @@ class ServiceBuilderRegistry:
|
|
|
101
95
|
):
|
|
102
96
|
potentially_needed_services = {
|
|
103
97
|
name: service.build_service(fakts, herre, params, manifest)
|
|
104
|
-
for name, service in self.service_builders.items()
|
|
98
|
+
for name, service in self.service_builders.items()
|
|
105
99
|
}
|
|
106
100
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
101
|
+
return {
|
|
102
|
+
key: value
|
|
103
|
+
for key, value in potentially_needed_services.items()
|
|
104
|
+
if value is not None
|
|
105
|
+
}
|
|
112
106
|
|
|
113
107
|
def get_requirements(self):
|
|
114
108
|
|
|
115
|
-
requirements = [
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
109
|
+
requirements = [
|
|
110
|
+
Requirement(
|
|
111
|
+
key="lok",
|
|
112
|
+
service="live.arkitekt.lok",
|
|
113
|
+
description="An instance of ArkitektNext Lok to authenticate the user",
|
|
114
|
+
)
|
|
115
|
+
]
|
|
120
116
|
taken_requirements = set()
|
|
121
117
|
|
|
122
|
-
|
|
123
118
|
for service in self.service_builders.values():
|
|
124
119
|
for requirement in service.get_requirements():
|
|
125
120
|
if requirement.key not in taken_requirements:
|
|
126
121
|
taken_requirements.add(requirement.key)
|
|
127
122
|
requirements.append(requirement)
|
|
128
123
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
124
|
sorted_requirements = sorted(requirements, key=lambda x: x.key)
|
|
134
125
|
|
|
135
126
|
return sorted_requirements
|
|
@@ -145,6 +136,7 @@ import pkgutil
|
|
|
145
136
|
import traceback
|
|
146
137
|
import logging
|
|
147
138
|
|
|
139
|
+
|
|
148
140
|
def check_and_import_services() -> ServiceBuilderRegistry:
|
|
149
141
|
service_builder_registry = ServiceBuilderRegistry()
|
|
150
142
|
processed_modules = set() # Track modules that have already been processed
|
|
@@ -164,10 +156,14 @@ def check_and_import_services() -> ServiceBuilderRegistry:
|
|
|
164
156
|
try:
|
|
165
157
|
service_builder_registry.register(service)
|
|
166
158
|
except ValueError as e:
|
|
167
|
-
print(
|
|
159
|
+
print(
|
|
160
|
+
f"Failed to register service {service}: Another service with the same name is already registered {service_builder_registry.service_builders}"
|
|
161
|
+
)
|
|
168
162
|
logging.info(f"Called build_services function from {module_name}")
|
|
169
163
|
else:
|
|
170
|
-
print(
|
|
164
|
+
print(
|
|
165
|
+
f"Discovered Arkitekt-like module (containing __arkitekt__) that doesn't conform with the __arkitekt__ spec. No build_services function in {module_name}.__arkitekt__"
|
|
166
|
+
)
|
|
171
167
|
processed_modules.add(module_name) # Mark this module as processed
|
|
172
168
|
except Exception as e:
|
|
173
169
|
print(f"Failed to call init_services for {module_name}: {e}")
|
arkitekt_next/utils.py
CHANGED
|
@@ -57,14 +57,15 @@ def create_devcontainer_file(
|
|
|
57
57
|
os.makedirs(devcontainer_path, exist_ok=True)
|
|
58
58
|
|
|
59
59
|
flavour_container = os.path.join(devcontainer_path, flavour)
|
|
60
|
-
os.makedirs(
|
|
60
|
+
os.makedirs(flavour_container, exist_ok=True)
|
|
61
61
|
|
|
62
62
|
devcontainer_file = os.path.join(flavour_container, "devcontainer.json")
|
|
63
63
|
|
|
64
|
+
|
|
64
65
|
devcontainer_content = {}
|
|
65
66
|
devcontainer_content["name"] = f"{manifest.identifier} {flavour} Devcontainer"
|
|
66
67
|
devcontainer_content["build"] = {}
|
|
67
|
-
devcontainer_content["build"]["dockerfile"] = os.path.
|
|
68
|
+
devcontainer_content["build"]["dockerfile"] = os.path.relpath(docker_file_path, flavour_container)
|
|
68
69
|
devcontainer_content["build"][
|
|
69
70
|
"context"
|
|
70
71
|
] = "../.." # This is the root of the project
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: arkitekt-next
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.49
|
|
4
4
|
Summary: client for the arkitekt_next platform
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: jhnnsrs
|
|
@@ -18,21 +18,21 @@ Provides-Extra: blok
|
|
|
18
18
|
Provides-Extra: cli
|
|
19
19
|
Provides-Extra: extended
|
|
20
20
|
Provides-Extra: stream
|
|
21
|
-
Requires-Dist: blok (>=0.0.
|
|
21
|
+
Requires-Dist: blok (>=0.0.20) ; (python_version >= "3.9" and python_version < "4.0") and (extra == "blok")
|
|
22
22
|
Requires-Dist: cryptography (>=40.0.8) ; (python_version >= "3.8" and python_version < "4.0") and (extra == "blok")
|
|
23
23
|
Requires-Dist: dokker (>=1.0.0)
|
|
24
|
-
Requires-Dist: fakts-next (>=1.0.
|
|
24
|
+
Requires-Dist: fakts-next (>=1.0.3)
|
|
25
25
|
Requires-Dist: fluss-next (>=0.1.95) ; extra == "all"
|
|
26
26
|
Requires-Dist: herre-next (>=1.0.2)
|
|
27
27
|
Requires-Dist: kabinet (>=0.1.45) ; (python_version >= "3.9" and python_version < "4.0") and (extra == "all")
|
|
28
28
|
Requires-Dist: koil (>=1.0.3)
|
|
29
29
|
Requires-Dist: kraph (>=0.1.100) ; (python_version >= "3.8" and python_version < "4.0") and (extra == "extended")
|
|
30
|
-
Requires-Dist: lovekit (>=0.1.
|
|
30
|
+
Requires-Dist: lovekit (>=0.1.18) ; (python_version >= "3.10" and python_version < "4.0") and (extra == "stream")
|
|
31
31
|
Requires-Dist: mikro-next (>=0.1.50) ; (python_version >= "3.10" and python_version < "4.0") and (extra == "all")
|
|
32
32
|
Requires-Dist: namegenerator (>=1.0.6) ; (python_version >= "3.8" and python_version < "4.0") and (extra == "blok")
|
|
33
33
|
Requires-Dist: netifaces (>=0.11.0) ; (python_version >= "3.8" and python_version < "4.0") and (extra == "blok")
|
|
34
|
-
Requires-Dist: reaktion-next (>=0.1.
|
|
35
|
-
Requires-Dist: rekuest-next (>=0.2.
|
|
34
|
+
Requires-Dist: reaktion-next (>=0.1.86) ; (python_version >= "3.8" and python_version < "4.0") and (extra == "all")
|
|
35
|
+
Requires-Dist: rekuest-next (>=0.2.54) ; (python_version >= "3.8" and python_version < "4.0") and (extra == "cli" or extra == "all")
|
|
36
36
|
Requires-Dist: rich-click (>=1.6.1) ; extra == "cli" or extra == "all"
|
|
37
37
|
Requires-Dist: semver (>=3.0.1) ; extra == "cli" or extra == "all"
|
|
38
38
|
Requires-Dist: turms (>=0.8.2) ; (python_version >= "3.9" and python_version < "4.0") and (extra == "cli" or extra == "all")
|