vellum-workflow-server 1.4.1.post1__tar.gz → 1.4.1.post2__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.4.1.post1 → vellum_workflow_server-1.4.1.post2}/PKG-INFO +1 -1
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/pyproject.toml +1 -1
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/src/workflow_server/api/tests/test_workflow_view_stream_workflow_route.py +49 -0
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/src/workflow_server/core/executor.py +10 -5
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/README.md +0 -0
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/src/workflow_server/__init__.py +0 -0
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/src/workflow_server/api/__init__.py +0 -0
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/src/workflow_server/api/auth_middleware.py +0 -0
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/src/workflow_server/api/healthz_view.py +0 -0
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/src/workflow_server/api/tests/__init__.py +0 -0
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/src/workflow_server/api/tests/test_input_display_mapping.py +0 -0
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/src/workflow_server/api/tests/test_workflow_view.py +0 -0
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/src/workflow_server/api/workflow_view.py +0 -0
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/src/workflow_server/code_exec_runner.py +0 -0
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/src/workflow_server/config.py +0 -0
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/src/workflow_server/core/__init__.py +0 -0
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/src/workflow_server/core/cancel_workflow.py +0 -0
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/src/workflow_server/core/events.py +0 -0
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/src/workflow_server/core/utils.py +0 -0
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/src/workflow_server/core/workflow_executor_context.py +0 -0
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/src/workflow_server/server.py +0 -0
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/src/workflow_server/start.py +0 -0
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/src/workflow_server/utils/__init__.py +0 -0
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/src/workflow_server/utils/exit_handler.py +0 -0
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/src/workflow_server/utils/log_proxy.py +0 -0
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/src/workflow_server/utils/oom_killer.py +0 -0
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/src/workflow_server/utils/sentry.py +0 -0
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/src/workflow_server/utils/system_utils.py +0 -0
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/src/workflow_server/utils/tests/__init__.py +0 -0
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/src/workflow_server/utils/tests/test_sentry_integration.py +0 -0
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/src/workflow_server/utils/tests/test_system_utils.py +0 -0
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/src/workflow_server/utils/tests/test_utils.py +0 -0
- {vellum_workflow_server-1.4.1.post1 → vellum_workflow_server-1.4.1.post2}/src/workflow_server/utils/utils.py +0 -0
|
@@ -10,6 +10,8 @@ from uuid import uuid4
|
|
|
10
10
|
|
|
11
11
|
import requests_mock
|
|
12
12
|
|
|
13
|
+
from vellum.workflows.emitters.base import WorkflowEvent
|
|
14
|
+
from vellum.workflows.emitters.vellum_emitter import VellumEmitter
|
|
13
15
|
from workflow_server.code_exec_runner import run_code_exec_stream
|
|
14
16
|
from workflow_server.server import create_app
|
|
15
17
|
from workflow_server.utils.system_utils import get_active_process_count
|
|
@@ -912,3 +914,50 @@ class Workflow(BaseWorkflow):
|
|
|
912
914
|
|
|
913
915
|
# AND we get the expected timeout error message
|
|
914
916
|
assert response_data == {"detail": "Request timed out trying to initiate the Workflow"}
|
|
917
|
+
|
|
918
|
+
|
|
919
|
+
@pytest.mark.parametrize("non_process_stream_types", [code_exec_stream, flask_stream_disable_process_wrapper])
|
|
920
|
+
def test_stream_workflow_route__vembda_emitting_calls_monitoring_api(non_process_stream_types):
|
|
921
|
+
"""
|
|
922
|
+
Tests that the monitoring API is called when vembda emitting is enabled.
|
|
923
|
+
"""
|
|
924
|
+
|
|
925
|
+
# GIVEN a valid request body with vembda emitting enabled
|
|
926
|
+
span_id = uuid4()
|
|
927
|
+
request_body = {
|
|
928
|
+
"execution_id": str(span_id),
|
|
929
|
+
"inputs": [],
|
|
930
|
+
"environment_api_key": "test",
|
|
931
|
+
"module": "workflow",
|
|
932
|
+
"timeout": 360,
|
|
933
|
+
"feature_flags": {"vembda-event-emitting-enabled": True},
|
|
934
|
+
"files": {
|
|
935
|
+
"__init__.py": "",
|
|
936
|
+
"workflow.py": """\
|
|
937
|
+
from vellum.workflows import BaseWorkflow
|
|
938
|
+
|
|
939
|
+
class Workflow(BaseWorkflow):
|
|
940
|
+
class Outputs(BaseWorkflow.Outputs):
|
|
941
|
+
foo = "hello"
|
|
942
|
+
""",
|
|
943
|
+
},
|
|
944
|
+
}
|
|
945
|
+
emitted_events = []
|
|
946
|
+
|
|
947
|
+
def send_events(self, events: list[WorkflowEvent]) -> None:
|
|
948
|
+
for event in events:
|
|
949
|
+
emitted_events.append(event)
|
|
950
|
+
|
|
951
|
+
VellumEmitter._send_events = send_events
|
|
952
|
+
|
|
953
|
+
# WHEN we call the stream route with mocked monitoring API
|
|
954
|
+
status_code, events = non_process_stream_types(request_body)
|
|
955
|
+
|
|
956
|
+
# THEN we get a 200 response
|
|
957
|
+
assert status_code == 200, events
|
|
958
|
+
|
|
959
|
+
# AND the expected workflow events were emitted
|
|
960
|
+
event_names = [event.name for event in emitted_events]
|
|
961
|
+
assert len(event_names) == 2, "Should include 2 events"
|
|
962
|
+
assert "workflow.execution.initiated" in event_names, "Should include workflow.execution.initiated event"
|
|
963
|
+
assert "workflow.execution.fulfilled" in event_names, "Should include workflow.execution.fulfilled event"
|
|
@@ -122,11 +122,6 @@ def _stream_workflow_wrapper(
|
|
|
122
122
|
logger.exception(e)
|
|
123
123
|
queue.put(serialize_vembda_rejected_event(executor_context, "Internal Server Error"))
|
|
124
124
|
|
|
125
|
-
emitter_thread = next(
|
|
126
|
-
(t for t in threading.enumerate() if t.name.endswith(".background_thread") and t.is_alive()), None
|
|
127
|
-
)
|
|
128
|
-
if emitter_thread:
|
|
129
|
-
emitter_thread.join()
|
|
130
125
|
queue.put(STREAM_FINISHED_EVENT)
|
|
131
126
|
|
|
132
127
|
exit(0)
|
|
@@ -243,6 +238,16 @@ def stream_workflow(
|
|
|
243
238
|
finally:
|
|
244
239
|
cancel_watcher_kill_switch.set()
|
|
245
240
|
|
|
241
|
+
emitter_thread = next(
|
|
242
|
+
(t for t in threading.enumerate() if t.name.endswith(".background_thread") and t.is_alive()), None
|
|
243
|
+
)
|
|
244
|
+
if emitter_thread:
|
|
245
|
+
emitter_thread.join()
|
|
246
|
+
|
|
247
|
+
timer_thread = next((t for t in threading.enumerate() if t.name.startswith("Thread-")), None)
|
|
248
|
+
if timer_thread:
|
|
249
|
+
timer_thread.join()
|
|
250
|
+
|
|
246
251
|
return (
|
|
247
252
|
_call_stream(
|
|
248
253
|
executor_context=executor_context,
|
|
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
|