vellum-workflow-server 1.3.4__tar.gz → 1.3.4.post1__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.3.4 → vellum_workflow_server-1.3.4.post1}/PKG-INFO +1 -1
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/pyproject.toml +1 -1
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/api/tests/test_workflow_view_stream_workflow_route.py +25 -9
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/core/executor.py +14 -14
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/README.md +0 -0
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/__init__.py +0 -0
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/api/__init__.py +0 -0
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/api/auth_middleware.py +0 -0
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/api/healthz_view.py +0 -0
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/api/tests/__init__.py +0 -0
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/api/tests/test_input_display_mapping.py +0 -0
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/api/tests/test_workflow_view.py +0 -0
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/api/workflow_view.py +0 -0
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/code_exec_runner.py +0 -0
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/config.py +0 -0
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/core/__init__.py +0 -0
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/core/cancel_workflow.py +0 -0
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/core/events.py +0 -0
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/core/utils.py +0 -0
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/core/workflow_executor_context.py +0 -0
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/server.py +0 -0
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/start.py +0 -0
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/utils/__init__.py +0 -0
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/utils/exit_handler.py +0 -0
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/utils/log_proxy.py +0 -0
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/utils/oom_killer.py +0 -0
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/utils/sentry.py +0 -0
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/utils/system_utils.py +0 -0
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/utils/tests/__init__.py +0 -0
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/utils/tests/test_sentry_integration.py +0 -0
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/utils/tests/test_system_utils.py +0 -0
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/utils/tests/test_utils.py +0 -0
- {vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/utils/utils.py +0 -0
|
@@ -4,6 +4,7 @@ from importlib.metadata import version
|
|
|
4
4
|
import io
|
|
5
5
|
import json
|
|
6
6
|
from queue import Empty
|
|
7
|
+
import re
|
|
7
8
|
from unittest import mock
|
|
8
9
|
from uuid import uuid4
|
|
9
10
|
|
|
@@ -408,7 +409,16 @@ from vellum.workflows.inputs import BaseInputs
|
|
|
408
409
|
assert len(events) == 2
|
|
409
410
|
|
|
410
411
|
|
|
411
|
-
|
|
412
|
+
@pytest.mark.parametrize(
|
|
413
|
+
["execute_workflow_stream", "assert_last_request"],
|
|
414
|
+
[
|
|
415
|
+
(flask_stream, False), # Unfortunately, can't make assertions on requests made in a subprocess.
|
|
416
|
+
(code_exec_stream, True),
|
|
417
|
+
(flask_stream_disable_process_wrapper, True),
|
|
418
|
+
],
|
|
419
|
+
ids=["flask_stream", "code_exec_stream", "flask_stream_disable_process_wrapper"],
|
|
420
|
+
)
|
|
421
|
+
def test_stream_workflow_route__cancel(execute_workflow_stream, assert_last_request):
|
|
412
422
|
# GIVEN a valid request body
|
|
413
423
|
span_id = uuid4()
|
|
414
424
|
request_body = {
|
|
@@ -447,10 +457,10 @@ class BasicCancellableWorkflow(BaseWorkflow):
|
|
|
447
457
|
|
|
448
458
|
# WHEN we call the stream route with a mock cancelled return true
|
|
449
459
|
with requests_mock.Mocker() as mocker:
|
|
450
|
-
mocker.get(
|
|
451
|
-
|
|
460
|
+
response_mock = mocker.get(
|
|
461
|
+
re.compile("http://test.biz/vembda-public/cancel-workflow-execution-status"), json={"cancelled": True}
|
|
452
462
|
)
|
|
453
|
-
status_code, events =
|
|
463
|
+
status_code, events = execute_workflow_stream(request_body)
|
|
454
464
|
|
|
455
465
|
# THEN we get a 200 response
|
|
456
466
|
assert status_code == 200, events
|
|
@@ -473,14 +483,20 @@ class BasicCancellableWorkflow(BaseWorkflow):
|
|
|
473
483
|
|
|
474
484
|
assert events[1]["name"] == "workflow.execution.initiated", events[1]
|
|
475
485
|
assert "display_context" in events[1]["body"], events[1]["body"]
|
|
476
|
-
cancelled_event = None
|
|
477
|
-
for event in events:
|
|
478
|
-
if event["name"] == "workflow.execution.rejected":
|
|
479
|
-
cancelled_event = event
|
|
480
|
-
break
|
|
481
486
|
|
|
487
|
+
cancelled_event = events[-2]
|
|
488
|
+
assert cancelled_event["name"] == "workflow.execution.rejected"
|
|
482
489
|
assert cancelled_event["body"]["error"]["message"] == "Workflow run cancelled"
|
|
483
490
|
|
|
491
|
+
# AND we called the cancel endpoint with the correct execution id
|
|
492
|
+
workflow_span_id = events[1]["span_id"]
|
|
493
|
+
if assert_last_request:
|
|
494
|
+
assert response_mock.last_request
|
|
495
|
+
assert (
|
|
496
|
+
response_mock.last_request.url
|
|
497
|
+
== f"http://test.biz/vembda-public/cancel-workflow-execution-status/{workflow_span_id}"
|
|
498
|
+
)
|
|
499
|
+
|
|
484
500
|
|
|
485
501
|
def test_stream_workflow_route__very_large_events(both_stream_types):
|
|
486
502
|
# GIVEN a valid request body
|
|
@@ -192,19 +192,6 @@ def stream_workflow(
|
|
|
192
192
|
|
|
193
193
|
cancel_watcher_kill_switch = ThreadingEvent()
|
|
194
194
|
cancel_signal = cancel_signal or ThreadingEvent()
|
|
195
|
-
cancel_watcher = CancelWorkflowWatcherThread(
|
|
196
|
-
kill_switch=cancel_watcher_kill_switch,
|
|
197
|
-
execution_id=executor_context.execution_id,
|
|
198
|
-
timeout_seconds=executor_context.timeout,
|
|
199
|
-
vembda_public_url=executor_context.vembda_public_url,
|
|
200
|
-
cancel_signal=cancel_signal,
|
|
201
|
-
)
|
|
202
|
-
|
|
203
|
-
try:
|
|
204
|
-
if executor_context.vembda_public_url:
|
|
205
|
-
cancel_watcher.start()
|
|
206
|
-
except Exception:
|
|
207
|
-
logger.exception("Failed to start cancel watcher")
|
|
208
195
|
|
|
209
196
|
try:
|
|
210
197
|
stream = workflow.stream(
|
|
@@ -216,12 +203,25 @@ def stream_workflow(
|
|
|
216
203
|
entrypoint_nodes=[run_from_node] if run_from_node else None,
|
|
217
204
|
previous_execution_id=executor_context.previous_execution_id,
|
|
218
205
|
)
|
|
219
|
-
|
|
220
206
|
except Exception:
|
|
221
207
|
cancel_watcher_kill_switch.set()
|
|
222
208
|
logger.exception("Failed to generate Workflow Stream")
|
|
223
209
|
raise
|
|
224
210
|
|
|
211
|
+
cancel_watcher = CancelWorkflowWatcherThread(
|
|
212
|
+
kill_switch=cancel_watcher_kill_switch,
|
|
213
|
+
execution_id=stream.span_id,
|
|
214
|
+
timeout_seconds=executor_context.timeout,
|
|
215
|
+
vembda_public_url=executor_context.vembda_public_url,
|
|
216
|
+
cancel_signal=cancel_signal,
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
try:
|
|
220
|
+
if executor_context.vembda_public_url:
|
|
221
|
+
cancel_watcher.start()
|
|
222
|
+
except Exception:
|
|
223
|
+
logger.exception("Failed to start cancel watcher")
|
|
224
|
+
|
|
225
225
|
def call_workflow() -> Generator[dict[str, Any], Any, None]:
|
|
226
226
|
try:
|
|
227
227
|
first = True
|
|
File without changes
|
{vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/__init__.py
RENAMED
|
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
|
{vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/config.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/server.py
RENAMED
|
File without changes
|
{vellum_workflow_server-1.3.4 → vellum_workflow_server-1.3.4.post1}/src/workflow_server/start.py
RENAMED
|
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
|