vellum-workflow-server 1.8.6.post2__tar.gz → 1.8.6.post4__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 vellum-workflow-server might be problematic. Click here for more details.
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/PKG-INFO +1 -1
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/pyproject.toml +1 -1
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/api/auth_middleware.py +2 -2
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/api/tests/test_workflow_view.py +51 -0
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/api/workflow_view.py +9 -0
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/config.py +2 -0
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/README.md +0 -0
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/__init__.py +0 -0
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/api/__init__.py +0 -0
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/api/healthz_view.py +0 -0
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/api/status_view.py +0 -0
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/api/tests/__init__.py +0 -0
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/api/tests/test_input_display_mapping.py +0 -0
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/api/tests/test_workflow_view_stream_workflow_route.py +0 -0
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/code_exec_runner.py +0 -0
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/core/__init__.py +0 -0
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/core/cancel_workflow.py +0 -0
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/core/events.py +0 -0
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/core/executor.py +0 -0
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/core/utils.py +0 -0
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/core/workflow_executor_context.py +0 -0
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/logging_config.py +0 -0
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/server.py +0 -0
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/start.py +0 -0
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/utils/__init__.py +0 -0
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/utils/exit_handler.py +0 -0
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/utils/log_proxy.py +0 -0
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/utils/oom_killer.py +0 -0
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/utils/sentry.py +0 -0
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/utils/system_utils.py +0 -0
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/utils/tests/__init__.py +0 -0
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/utils/tests/test_sentry_integration.py +0 -0
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/utils/tests/test_system_utils.py +0 -0
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/utils/tests/test_utils.py +0 -0
- {vellum_workflow_server-1.8.6.post2 → vellum_workflow_server-1.8.6.post4}/src/workflow_server/utils/utils.py +0 -0
|
@@ -5,7 +5,7 @@ from flask import Flask, Request, Response
|
|
|
5
5
|
import jwt
|
|
6
6
|
from jwt import ExpiredSignatureError
|
|
7
7
|
|
|
8
|
-
from workflow_server.config import IS_VPC, NAMESPACE, VEMBDA_PUBLIC_KEY, is_development
|
|
8
|
+
from workflow_server.config import IS_ASYNC_MODE, IS_VPC, NAMESPACE, VEMBDA_PUBLIC_KEY, is_development
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class AuthMiddleware:
|
|
@@ -15,7 +15,7 @@ class AuthMiddleware:
|
|
|
15
15
|
def __call__(self, environ: Dict[str, Any], start_response: Any) -> Any:
|
|
16
16
|
try:
|
|
17
17
|
request = Request(environ)
|
|
18
|
-
if not request.path.startswith("/healthz") and not is_development() and not IS_VPC:
|
|
18
|
+
if not request.path.startswith("/healthz") and not is_development() and not IS_VPC and not IS_ASYNC_MODE:
|
|
19
19
|
token = request.headers.get("X-Vembda-Signature")
|
|
20
20
|
if token:
|
|
21
21
|
decoded = jwt.decode(token, VEMBDA_PUBLIC_KEY, algorithms=["RS256"])
|
|
@@ -537,6 +537,57 @@ def test_serialize_route__with_invalid_workspace_api_key():
|
|
|
537
537
|
assert "exec_config" in response.json
|
|
538
538
|
|
|
539
539
|
|
|
540
|
+
def test_serialize_route__with_is_new_server_header():
|
|
541
|
+
"""
|
|
542
|
+
Tests that the serialize route returns the is_new_server header.
|
|
543
|
+
"""
|
|
544
|
+
# GIVEN a Flask application
|
|
545
|
+
flask_app = create_app()
|
|
546
|
+
|
|
547
|
+
workflow_files = {
|
|
548
|
+
"__init__.py": "",
|
|
549
|
+
"workflow.py": (
|
|
550
|
+
"from vellum.workflows import BaseWorkflow\n\n"
|
|
551
|
+
"class Workflow(BaseWorkflow):\n"
|
|
552
|
+
" class Outputs(BaseWorkflow.Outputs):\n"
|
|
553
|
+
" foo = 'hello'\n"
|
|
554
|
+
),
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
# WHEN we make a request with is_new_server=True
|
|
558
|
+
with flask_app.test_client() as test_client:
|
|
559
|
+
response = test_client.post("/workflow/serialize", json={"files": workflow_files, "is_new_server": True})
|
|
560
|
+
|
|
561
|
+
# THEN we should get a successful response
|
|
562
|
+
assert response.status_code == 200
|
|
563
|
+
|
|
564
|
+
# AND the response should contain the is_new_server header set to true
|
|
565
|
+
assert "X-Vellum-Is-New-Server" in response.headers
|
|
566
|
+
assert response.headers["X-Vellum-Is-New-Server"] == "true"
|
|
567
|
+
|
|
568
|
+
# WHEN we make a request with is_new_server=False
|
|
569
|
+
with flask_app.test_client() as test_client:
|
|
570
|
+
response = test_client.post("/workflow/serialize", json={"files": workflow_files, "is_new_server": False})
|
|
571
|
+
|
|
572
|
+
# THEN we should get a successful response
|
|
573
|
+
assert response.status_code == 200
|
|
574
|
+
|
|
575
|
+
# AND the response should contain the is_new_server header set to false
|
|
576
|
+
assert "X-Vellum-Is-New-Server" in response.headers
|
|
577
|
+
assert response.headers["X-Vellum-Is-New-Server"] == "false"
|
|
578
|
+
|
|
579
|
+
# WHEN we make a request without is_new_server
|
|
580
|
+
with flask_app.test_client() as test_client:
|
|
581
|
+
response = test_client.post("/workflow/serialize", json={"files": workflow_files})
|
|
582
|
+
|
|
583
|
+
# THEN we should get a successful response
|
|
584
|
+
assert response.status_code == 200
|
|
585
|
+
|
|
586
|
+
# AND the response should contain the is_new_server header set to false (default)
|
|
587
|
+
assert "X-Vellum-Is-New-Server" in response.headers
|
|
588
|
+
assert response.headers["X-Vellum-Is-New-Server"] == "false"
|
|
589
|
+
|
|
590
|
+
|
|
540
591
|
def test_stream_node_route__with_node_id():
|
|
541
592
|
"""
|
|
542
593
|
Tests that the stream-node endpoint works with node_id.
|
|
@@ -435,6 +435,7 @@ def serialize_route() -> Response:
|
|
|
435
435
|
|
|
436
436
|
files = data.get("files", {})
|
|
437
437
|
workspace_api_key = data.get("workspace_api_key")
|
|
438
|
+
is_new_server = data.get("is_new_server", False)
|
|
438
439
|
|
|
439
440
|
if not files:
|
|
440
441
|
return Response(
|
|
@@ -448,6 +449,11 @@ def serialize_route() -> Response:
|
|
|
448
449
|
# Generate a unique namespace for this serialization request
|
|
449
450
|
namespace = get_random_namespace()
|
|
450
451
|
virtual_finder = VirtualFileFinder(files, namespace)
|
|
452
|
+
|
|
453
|
+
headers = {
|
|
454
|
+
"X-Vellum-Is-New-Server": str(is_new_server).lower(),
|
|
455
|
+
}
|
|
456
|
+
|
|
451
457
|
try:
|
|
452
458
|
sys.meta_path.append(virtual_finder)
|
|
453
459
|
result = BaseWorkflowDisplay.serialize_module(namespace, client=client, dry_run=True)
|
|
@@ -456,6 +462,7 @@ def serialize_route() -> Response:
|
|
|
456
462
|
json.dumps(result.model_dump()),
|
|
457
463
|
status=200,
|
|
458
464
|
content_type="application/json",
|
|
465
|
+
headers=headers,
|
|
459
466
|
)
|
|
460
467
|
|
|
461
468
|
except WorkflowInitializationException as e:
|
|
@@ -465,6 +472,7 @@ def serialize_route() -> Response:
|
|
|
465
472
|
json.dumps({"detail": error_message}),
|
|
466
473
|
status=400,
|
|
467
474
|
content_type="application/json",
|
|
475
|
+
headers=headers,
|
|
468
476
|
)
|
|
469
477
|
|
|
470
478
|
except Exception as e:
|
|
@@ -473,6 +481,7 @@ def serialize_route() -> Response:
|
|
|
473
481
|
json.dumps({"detail": f"Serialization failed: {str(e)}"}),
|
|
474
482
|
status=500,
|
|
475
483
|
content_type="application/json",
|
|
484
|
+
headers=headers,
|
|
476
485
|
)
|
|
477
486
|
|
|
478
487
|
finally:
|
|
@@ -42,6 +42,8 @@ LOCAL_WORKFLOW_MODULE = os.getenv("LOCAL_WORKFLOW_MODULE")
|
|
|
42
42
|
# The deployment name to match against when using local mode so you can still run your normal workflow
|
|
43
43
|
LOCAL_DEPLOYMENT = os.getenv("LOCAL_DEPLOYMENT")
|
|
44
44
|
|
|
45
|
+
IS_ASYNC_MODE = os.getenv("IS_ASYNC_MODE", "false").lower() == "true"
|
|
46
|
+
|
|
45
47
|
|
|
46
48
|
def is_development() -> bool:
|
|
47
49
|
return os.getenv("FLASK_ENV", "local") == "local"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|