vellum-workflow-server 1.8.6.post1__tar.gz → 1.8.6.post3__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.post1 → vellum_workflow_server-1.8.6.post3}/PKG-INFO +1 -1
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/pyproject.toml +1 -1
- vellum_workflow_server-1.8.6.post3/src/workflow_server/api/status_view.py +19 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/src/workflow_server/api/tests/test_workflow_view.py +51 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/src/workflow_server/api/workflow_view.py +9 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/src/workflow_server/server.py +2 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/README.md +0 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/src/workflow_server/__init__.py +0 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/src/workflow_server/api/__init__.py +0 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/src/workflow_server/api/auth_middleware.py +0 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/src/workflow_server/api/healthz_view.py +0 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/src/workflow_server/api/tests/__init__.py +0 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/src/workflow_server/api/tests/test_input_display_mapping.py +0 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/src/workflow_server/api/tests/test_workflow_view_stream_workflow_route.py +0 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/src/workflow_server/code_exec_runner.py +0 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/src/workflow_server/config.py +0 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/src/workflow_server/core/__init__.py +0 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/src/workflow_server/core/cancel_workflow.py +0 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/src/workflow_server/core/events.py +0 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/src/workflow_server/core/executor.py +0 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/src/workflow_server/core/utils.py +0 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/src/workflow_server/core/workflow_executor_context.py +0 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/src/workflow_server/logging_config.py +0 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/src/workflow_server/start.py +0 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/src/workflow_server/utils/__init__.py +0 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/src/workflow_server/utils/exit_handler.py +0 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/src/workflow_server/utils/log_proxy.py +0 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/src/workflow_server/utils/oom_killer.py +0 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/src/workflow_server/utils/sentry.py +0 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/src/workflow_server/utils/system_utils.py +0 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/src/workflow_server/utils/tests/__init__.py +0 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/src/workflow_server/utils/tests/test_sentry_integration.py +0 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/src/workflow_server/utils/tests/test_system_utils.py +0 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/src/workflow_server/utils/tests/test_utils.py +0 -0
- {vellum_workflow_server-1.8.6.post1 → vellum_workflow_server-1.8.6.post3}/src/workflow_server/utils/utils.py +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from typing import Tuple
|
|
2
|
+
|
|
3
|
+
from flask import Blueprint, Response, jsonify
|
|
4
|
+
|
|
5
|
+
from workflow_server.config import CONCURRENCY
|
|
6
|
+
from workflow_server.utils.system_utils import get_active_process_count
|
|
7
|
+
|
|
8
|
+
bp = Blueprint("status", __name__)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@bp.route("/is_available", methods=["GET"])
|
|
12
|
+
def is_available() -> Tuple[Response, int]:
|
|
13
|
+
resp = jsonify(
|
|
14
|
+
available=get_active_process_count() < CONCURRENCY,
|
|
15
|
+
process_count=get_active_process_count(),
|
|
16
|
+
max_concurrency=CONCURRENCY,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
return resp, 200
|
|
@@ -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:
|
|
@@ -5,6 +5,7 @@ from flask import Flask
|
|
|
5
5
|
|
|
6
6
|
from workflow_server.api.auth_middleware import AuthMiddleware
|
|
7
7
|
from workflow_server.api.healthz_view import bp as healthz_bp
|
|
8
|
+
from workflow_server.api.status_view import bp as status_bp
|
|
8
9
|
from workflow_server.api.workflow_view import bp as workflow_bp
|
|
9
10
|
from workflow_server.config import is_development
|
|
10
11
|
from workflow_server.logging_config import GCPJsonFormatter
|
|
@@ -48,6 +49,7 @@ def create_app() -> Flask:
|
|
|
48
49
|
|
|
49
50
|
# Register blueprints
|
|
50
51
|
app.register_blueprint(healthz_bp, url_prefix="/healthz")
|
|
52
|
+
app.register_blueprint(status_bp, url_prefix="/status")
|
|
51
53
|
app.register_blueprint(workflow_bp, url_prefix="/workflow")
|
|
52
54
|
|
|
53
55
|
logger.info(is_development())
|
|
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
|