vellum-workflow-server 0.14.73.post5__tar.gz → 0.14.73.post7__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-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/PKG-INFO +1 -1
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/pyproject.toml +1 -1
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/src/workflow_server/api/tests/test_workflow_view_stream_workflow_route.py +41 -0
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/src/workflow_server/api/workflow_view.py +12 -1
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/README.md +0 -0
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/src/workflow_server/__init__.py +0 -0
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/src/workflow_server/api/__init__.py +0 -0
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/src/workflow_server/api/auth_middleware.py +0 -0
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/src/workflow_server/api/healthz_view.py +0 -0
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/src/workflow_server/api/tests/__init__.py +0 -0
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/src/workflow_server/api/tests/test_input_display_mapping.py +0 -0
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/src/workflow_server/api/tests/test_workflow_view.py +0 -0
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/src/workflow_server/code_exec_runner.py +0 -0
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/src/workflow_server/config.py +0 -0
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/src/workflow_server/core/__init__.py +0 -0
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/src/workflow_server/core/cancel_workflow.py +0 -0
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/src/workflow_server/core/events.py +0 -0
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/src/workflow_server/core/executor.py +0 -0
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/src/workflow_server/core/utils.py +0 -0
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/src/workflow_server/core/workflow_executor_context.py +0 -0
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/src/workflow_server/server.py +0 -0
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/src/workflow_server/start.py +0 -0
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/src/workflow_server/utils/__init__.py +0 -0
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/src/workflow_server/utils/exit_handler.py +0 -0
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/src/workflow_server/utils/log_proxy.py +0 -0
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/src/workflow_server/utils/oom_killer.py +0 -0
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/src/workflow_server/utils/sentry.py +0 -0
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/src/workflow_server/utils/system_utils.py +0 -0
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/src/workflow_server/utils/tests/__init__.py +0 -0
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/src/workflow_server/utils/tests/test_sentry_integration.py +0 -0
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/src/workflow_server/utils/tests/test_system_utils.py +0 -0
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/src/workflow_server/utils/tests/test_utils.py +0 -0
- {vellum_workflow_server-0.14.73.post5 → vellum_workflow_server-0.14.73.post7}/src/workflow_server/utils/utils.py +0 -0
|
@@ -3,6 +3,7 @@ from contextlib import redirect_stdout
|
|
|
3
3
|
from importlib.metadata import version
|
|
4
4
|
import io
|
|
5
5
|
import json
|
|
6
|
+
from queue import Empty
|
|
6
7
|
from unittest import mock
|
|
7
8
|
from uuid import uuid4
|
|
8
9
|
|
|
@@ -825,3 +826,43 @@ class Workflow(BaseWorkflow):
|
|
|
825
826
|
outputs = events[2]["body"]["outputs"]
|
|
826
827
|
assert outputs["env_var_value"] == "test_value"
|
|
827
828
|
assert outputs["another_var_value"] == "another_value"
|
|
829
|
+
|
|
830
|
+
|
|
831
|
+
@mock.patch("workflow_server.api.workflow_view.Queue")
|
|
832
|
+
def test_stream_workflow_route__queue_get_timeout(mock_queue_class):
|
|
833
|
+
# GIVEN a valid request body
|
|
834
|
+
span_id = uuid4()
|
|
835
|
+
request_body = {
|
|
836
|
+
"execution_id": str(span_id),
|
|
837
|
+
"inputs": [],
|
|
838
|
+
"environment_api_key": "test",
|
|
839
|
+
"module": "workflow",
|
|
840
|
+
"timeout": 360,
|
|
841
|
+
"files": {
|
|
842
|
+
"__init__.py": "",
|
|
843
|
+
"workflow.py": """\
|
|
844
|
+
from vellum.workflows import BaseWorkflow
|
|
845
|
+
|
|
846
|
+
class Workflow(BaseWorkflow):
|
|
847
|
+
class Outputs(BaseWorkflow.Outputs):
|
|
848
|
+
foo = "hello"
|
|
849
|
+
""",
|
|
850
|
+
},
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
# AND the queue.get method raises Empty exception
|
|
854
|
+
mock_queue_instance = mock_queue_class.return_value
|
|
855
|
+
mock_queue_instance.get.side_effect = Empty()
|
|
856
|
+
|
|
857
|
+
# WHEN we call the stream route
|
|
858
|
+
flask_app = create_app()
|
|
859
|
+
with flask_app.test_client() as test_client:
|
|
860
|
+
response = test_client.post("/workflow/stream", json=request_body)
|
|
861
|
+
status_code = response.status_code
|
|
862
|
+
response_data = response.get_json()
|
|
863
|
+
|
|
864
|
+
# THEN we get a 408 response
|
|
865
|
+
assert status_code == 408
|
|
866
|
+
|
|
867
|
+
# AND we get the expected timeout error message
|
|
868
|
+
assert response_data == {"detail": "Request timed out trying to initiate the Workflow"}
|
|
@@ -52,6 +52,7 @@ set_start_method("fork", force=True)
|
|
|
52
52
|
logger = logging.getLogger(__name__)
|
|
53
53
|
|
|
54
54
|
CUSTOM_NODES_DIRECTORY = "vellum_custom_nodes"
|
|
55
|
+
WORKFLOW_INITIATION_TIMEOUT_SECONDS = 60
|
|
55
56
|
|
|
56
57
|
|
|
57
58
|
@bp.route("/stream", methods=["POST"])
|
|
@@ -118,7 +119,17 @@ def stream_workflow_route() -> Response:
|
|
|
118
119
|
|
|
119
120
|
process_output_queue.put(create_vembda_rejected_event(context, traceback.format_exc()))
|
|
120
121
|
|
|
121
|
-
|
|
122
|
+
try:
|
|
123
|
+
first_item = process_output_queue.get(timeout=WORKFLOW_INITIATION_TIMEOUT_SECONDS)
|
|
124
|
+
except Empty:
|
|
125
|
+
logger.error("Request timed out trying to initiate the Workflow")
|
|
126
|
+
return Response(
|
|
127
|
+
json.dumps({"detail": "Request timed out trying to initiate the Workflow"}),
|
|
128
|
+
status=408,
|
|
129
|
+
content_type="application/json",
|
|
130
|
+
headers=headers,
|
|
131
|
+
)
|
|
132
|
+
|
|
122
133
|
if isinstance(first_item, str) and first_item.startswith(SPAN_ID_EVENT):
|
|
123
134
|
span_id = first_item.split(":")[1]
|
|
124
135
|
headers["X-Vellum-Workflow-Span-Id"] = span_id
|
|
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
|