llama-deploy-appserver 0.3.19__py3-none-any.whl → 0.3.21__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.
- llama_deploy/appserver/app.py +96 -7
- {llama_deploy_appserver-0.3.19.dist-info → llama_deploy_appserver-0.3.21.dist-info}/METADATA +2 -2
- {llama_deploy_appserver-0.3.19.dist-info → llama_deploy_appserver-0.3.21.dist-info}/RECORD +4 -4
- {llama_deploy_appserver-0.3.19.dist-info → llama_deploy_appserver-0.3.21.dist-info}/WHEEL +0 -0
llama_deploy/appserver/app.py
CHANGED
|
@@ -165,6 +165,7 @@ def prepare_server(
|
|
|
165
165
|
deployment_file: Path | None = None,
|
|
166
166
|
install: bool = False,
|
|
167
167
|
build: bool = False,
|
|
168
|
+
install_ui_deps: bool = True,
|
|
168
169
|
) -> None:
|
|
169
170
|
configure_settings(
|
|
170
171
|
deployment_file_path=deployment_file or Path(DEFAULT_DEPLOYMENT_FILE_PATH)
|
|
@@ -175,7 +176,8 @@ def prepare_server(
|
|
|
175
176
|
if install:
|
|
176
177
|
config = get_deployment_config()
|
|
177
178
|
inject_appserver_into_target(config, settings.resolved_config_parent)
|
|
178
|
-
|
|
179
|
+
if install_ui_deps:
|
|
180
|
+
install_ui(config, settings.resolved_config_parent)
|
|
179
181
|
if build:
|
|
180
182
|
build_ui(settings.resolved_config_parent, get_deployment_config(), settings)
|
|
181
183
|
|
|
@@ -289,17 +291,104 @@ def start_server_in_target_venv(
|
|
|
289
291
|
raise SystemExit(ret)
|
|
290
292
|
|
|
291
293
|
|
|
294
|
+
def start_preflight_in_target_venv(
|
|
295
|
+
cwd: Path | None = None,
|
|
296
|
+
deployment_file: Path | None = None,
|
|
297
|
+
) -> None:
|
|
298
|
+
"""
|
|
299
|
+
Run preflight validation inside the target project's virtual environment using uv.
|
|
300
|
+
Mirrors the venv targetting and invocation strategy used by start_server_in_target_venv.
|
|
301
|
+
"""
|
|
302
|
+
configure_settings(
|
|
303
|
+
app_root=cwd,
|
|
304
|
+
deployment_file_path=deployment_file or Path(DEFAULT_DEPLOYMENT_FILE_PATH),
|
|
305
|
+
)
|
|
306
|
+
base_dir = cwd or Path.cwd()
|
|
307
|
+
path = settings.resolved_config_parent.relative_to(base_dir)
|
|
308
|
+
args = [
|
|
309
|
+
"uv",
|
|
310
|
+
"run",
|
|
311
|
+
"--no-progress",
|
|
312
|
+
"python",
|
|
313
|
+
"-m",
|
|
314
|
+
"llama_deploy.appserver.app",
|
|
315
|
+
"--preflight",
|
|
316
|
+
]
|
|
317
|
+
if deployment_file:
|
|
318
|
+
args.extend(["--deployment-file", str(deployment_file)])
|
|
319
|
+
|
|
320
|
+
ret = run_process(
|
|
321
|
+
args,
|
|
322
|
+
cwd=path,
|
|
323
|
+
env=os.environ.copy(),
|
|
324
|
+
line_transform=_exclude_venv_warning,
|
|
325
|
+
)
|
|
326
|
+
if ret is not None and ret != 0:
|
|
327
|
+
raise SystemExit(ret)
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
class PreflightValidationError(Exception):
|
|
331
|
+
"""Raised when workflow validations fail during preflight.
|
|
332
|
+
|
|
333
|
+
Attributes:
|
|
334
|
+
errors: List of (workflow/service name, error message)
|
|
335
|
+
"""
|
|
336
|
+
|
|
337
|
+
def __init__(self, errors: list[tuple[str, str]]):
|
|
338
|
+
self.errors = errors
|
|
339
|
+
error_messages = [f"{name}: {msg}" for name, msg in errors]
|
|
340
|
+
message = "Workflow validation failed:\n" + "\n".join(error_messages)
|
|
341
|
+
super().__init__(message)
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
def preflight_validate(
|
|
345
|
+
cwd: Path | None = None,
|
|
346
|
+
deployment_file: Path | None = None,
|
|
347
|
+
configure_logging: bool = False,
|
|
348
|
+
) -> None:
|
|
349
|
+
"""
|
|
350
|
+
Perform the same initialization path as starting the server, without serving.
|
|
351
|
+
This catches import errors and runs workflow validations.
|
|
352
|
+
"""
|
|
353
|
+
configure_settings(
|
|
354
|
+
app_root=cwd,
|
|
355
|
+
deployment_file_path=deployment_file or Path(DEFAULT_DEPLOYMENT_FILE_PATH),
|
|
356
|
+
)
|
|
357
|
+
cfg = get_deployment_config()
|
|
358
|
+
load_environment_variables(cfg, settings.resolved_config_parent)
|
|
359
|
+
validate_required_env_vars(cfg)
|
|
360
|
+
|
|
361
|
+
workflows = load_workflows(cfg)
|
|
362
|
+
# Instantiate Deployment to ensure server wiring doesn't raise
|
|
363
|
+
_ = Deployment(workflows)
|
|
364
|
+
# Run workflow-level validations if present
|
|
365
|
+
errors: list[tuple[str, str]] = []
|
|
366
|
+
for service_name, workflow in workflows.items():
|
|
367
|
+
method = getattr(workflow, "_validate", None)
|
|
368
|
+
if callable(method):
|
|
369
|
+
try:
|
|
370
|
+
method()
|
|
371
|
+
except Exception as exc:
|
|
372
|
+
errors.append((service_name, str(exc)))
|
|
373
|
+
if errors:
|
|
374
|
+
raise PreflightValidationError(errors)
|
|
375
|
+
|
|
376
|
+
|
|
292
377
|
if __name__ == "__main__":
|
|
293
378
|
parser = argparse.ArgumentParser()
|
|
294
379
|
parser.add_argument("--proxy-ui", action="store_true")
|
|
295
380
|
parser.add_argument("--reload", action="store_true")
|
|
296
381
|
parser.add_argument("--deployment-file", type=Path)
|
|
297
382
|
parser.add_argument("--open-browser", action="store_true")
|
|
383
|
+
parser.add_argument("--preflight", action="store_true")
|
|
298
384
|
|
|
299
385
|
args = parser.parse_args()
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
386
|
+
if args.preflight:
|
|
387
|
+
preflight_validate(cwd=Path.cwd(), deployment_file=args.deployment_file)
|
|
388
|
+
else:
|
|
389
|
+
start_server(
|
|
390
|
+
proxy_ui=args.proxy_ui,
|
|
391
|
+
reload=args.reload,
|
|
392
|
+
deployment_file=args.deployment_file,
|
|
393
|
+
open_browser=args.open_browser,
|
|
394
|
+
)
|
{llama_deploy_appserver-0.3.19.dist-info → llama_deploy_appserver-0.3.21.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: llama-deploy-appserver
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.21
|
|
4
4
|
Summary: Application server components for LlamaDeploy
|
|
5
5
|
Author: Massimiliano Pippi, Adrian Lyjak
|
|
6
6
|
Author-email: Massimiliano Pippi <mpippi@gmail.com>, Adrian Lyjak <adrianlyjak@gmail.com>
|
|
@@ -9,7 +9,7 @@ Requires-Dist: llama-index-workflows[server]>=2.9.1
|
|
|
9
9
|
Requires-Dist: pydantic-settings>=2.10.1
|
|
10
10
|
Requires-Dist: fastapi>=0.100.0
|
|
11
11
|
Requires-Dist: websockets>=12.0
|
|
12
|
-
Requires-Dist: llama-deploy-core>=0.3.
|
|
12
|
+
Requires-Dist: llama-deploy-core>=0.3.21,<0.4.0
|
|
13
13
|
Requires-Dist: httpx>=0.24.0,<1.0.0
|
|
14
14
|
Requires-Dist: prometheus-fastapi-instrumentator>=7.1.0
|
|
15
15
|
Requires-Dist: packaging>=25.0
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
llama_deploy/appserver/__init__.py,sha256=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855,0
|
|
2
|
-
llama_deploy/appserver/app.py,sha256=
|
|
2
|
+
llama_deploy/appserver/app.py,sha256=64637dec1504d3a05f68ef2e91472754a8089a227f51948897121c5449bad1d4,12562
|
|
3
3
|
llama_deploy/appserver/bootstrap.py,sha256=d0c7b4ad5bd64aa5070d993b1439006694a639010ae757b1d897680318173743,2573
|
|
4
4
|
llama_deploy/appserver/configure_logging.py,sha256=194dd1ebed3c1d9065d9174f7828d557a577eaac8fb0443b3102430b1f578c19,6329
|
|
5
5
|
llama_deploy/appserver/correlation_id.py,sha256=8ac5bc6160c707b93a9fb818b64dd369a4ef7a53f9f91a6b3d90c4cf446f7327,572
|
|
@@ -19,6 +19,6 @@ llama_deploy/appserver/workflow_loader.py,sha256=03ef9d2d5eed6b0ec3e3520a6566163
|
|
|
19
19
|
llama_deploy/appserver/workflow_store/agent_data_store.py,sha256=c58d84ac658679cb9c9e4c7bc2f4096af8bb1aa8f6e3c24ff5a84be1125f4ab3,4221
|
|
20
20
|
llama_deploy/appserver/workflow_store/keyed_lock.py,sha256=bb1504d9de09d51a8f60721cc77b14d4051ac5a897ace6f9d9cba494f068465e,950
|
|
21
21
|
llama_deploy/appserver/workflow_store/lru_cache.py,sha256=bb05c573cf92532a3e673e5b3d5765c4165bf6f8d985744941580c06ceb3eb2d,1386
|
|
22
|
-
llama_deploy_appserver-0.3.
|
|
23
|
-
llama_deploy_appserver-0.3.
|
|
24
|
-
llama_deploy_appserver-0.3.
|
|
22
|
+
llama_deploy_appserver-0.3.21.dist-info/WHEEL,sha256=66530aef82d5020ef5af27ae0123c71abb9261377c5bc519376c671346b12918,79
|
|
23
|
+
llama_deploy_appserver-0.3.21.dist-info/METADATA,sha256=43196c5c20863487af9d638daa6f9465e736fc92da4237804b81006223eef9e4,1082
|
|
24
|
+
llama_deploy_appserver-0.3.21.dist-info/RECORD,,
|
|
File without changes
|