vellum-workflow-server 1.8.2__tar.gz → 1.8.2.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.8.2 → vellum_workflow_server-1.8.2.post2}/PKG-INFO +1 -1
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/pyproject.toml +1 -1
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/api/tests/test_workflow_view_stream_workflow_route.py +19 -1
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/api/workflow_view.py +4 -2
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/core/executor.py +13 -3
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/README.md +0 -0
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/__init__.py +0 -0
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/api/__init__.py +0 -0
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/api/auth_middleware.py +0 -0
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/api/healthz_view.py +0 -0
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/api/tests/__init__.py +0 -0
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/api/tests/test_input_display_mapping.py +0 -0
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/api/tests/test_workflow_view.py +0 -0
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/code_exec_runner.py +0 -0
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/config.py +0 -0
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/core/__init__.py +0 -0
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/core/cancel_workflow.py +0 -0
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/core/events.py +0 -0
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/core/utils.py +0 -0
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/core/workflow_executor_context.py +0 -0
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/logging_config.py +0 -0
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/server.py +0 -0
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/start.py +0 -0
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/utils/__init__.py +0 -0
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/utils/exit_handler.py +0 -0
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/utils/log_proxy.py +0 -0
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/utils/oom_killer.py +0 -0
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/utils/sentry.py +0 -0
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/utils/system_utils.py +0 -0
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/utils/tests/__init__.py +0 -0
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/utils/tests/test_sentry_integration.py +0 -0
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/utils/tests/test_system_utils.py +0 -0
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/utils/tests/test_utils.py +0 -0
- {vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/utils/utils.py +0 -0
|
@@ -174,6 +174,8 @@ class Workflow(BaseWorkflow):
|
|
|
174
174
|
assert "sdk_version" in server_metadata
|
|
175
175
|
assert "memory_usage_mb" in server_metadata
|
|
176
176
|
assert isinstance(server_metadata["memory_usage_mb"], (int, float))
|
|
177
|
+
assert "is_new_server" in server_metadata
|
|
178
|
+
assert server_metadata["is_new_server"] is False
|
|
177
179
|
|
|
178
180
|
assert events[2]["name"] == "workflow.execution.fulfilled", events[2]
|
|
179
181
|
assert events[2]["body"]["workflow_definition"]["module"] == ["test", "workflow"]
|
|
@@ -384,9 +386,15 @@ class State(BaseState):
|
|
|
384
386
|
def test_stream_workflow_route__bad_indent_in_inputs_file(both_stream_types):
|
|
385
387
|
# GIVEN a valid request body
|
|
386
388
|
span_id = uuid4()
|
|
389
|
+
trace_id = uuid4()
|
|
390
|
+
parent_span_id = uuid4()
|
|
387
391
|
request_body = {
|
|
388
392
|
"timeout": 360,
|
|
389
393
|
"execution_id": str(span_id),
|
|
394
|
+
"execution_context": {
|
|
395
|
+
"trace_id": str(trace_id),
|
|
396
|
+
"parent_context": {"span_id": str(parent_span_id)},
|
|
397
|
+
},
|
|
390
398
|
"inputs": [
|
|
391
399
|
{"name": "foo", "type": "STRING", "value": "hello"},
|
|
392
400
|
],
|
|
@@ -423,7 +431,7 @@ from vellum.workflows.inputs import BaseInputs
|
|
|
423
431
|
|
|
424
432
|
assert events[0] == {
|
|
425
433
|
"id": mock.ANY,
|
|
426
|
-
"trace_id":
|
|
434
|
+
"trace_id": str(trace_id),
|
|
427
435
|
"span_id": str(span_id),
|
|
428
436
|
"timestamp": mock.ANY,
|
|
429
437
|
"api_version": "2024-10-25",
|
|
@@ -437,9 +445,19 @@ from vellum.workflows.inputs import BaseInputs
|
|
|
437
445
|
}
|
|
438
446
|
|
|
439
447
|
assert events[1]["name"] == "workflow.execution.initiated"
|
|
448
|
+
assert events[1]["trace_id"] == str(trace_id), "workflow initiated event should use request trace_id"
|
|
449
|
+
assert events[1]["parent"] is not None, "workflow initiated event should have parent context"
|
|
450
|
+
assert events[1]["parent"]["span_id"] == str(
|
|
451
|
+
parent_span_id
|
|
452
|
+
), "workflow initiated event parent should match request parent_context"
|
|
440
453
|
|
|
441
454
|
assert events[2]["name"] == "workflow.execution.rejected"
|
|
455
|
+
assert events[2]["trace_id"] == str(trace_id), "workflow rejected event should use request trace_id"
|
|
442
456
|
assert events[2]["span_id"] == events[1]["span_id"]
|
|
457
|
+
assert events[2]["parent"] is not None, "workflow rejected event should have parent context"
|
|
458
|
+
assert events[2]["parent"]["span_id"] == str(
|
|
459
|
+
parent_span_id
|
|
460
|
+
), "workflow rejected event parent should match request parent_context"
|
|
443
461
|
assert (
|
|
444
462
|
"Syntax Error raised while loading Workflow: "
|
|
445
463
|
"unexpected indent (inputs.py, line 3)" in events[2]["body"]["error"]["message"]
|
|
@@ -90,12 +90,13 @@ def stream_workflow_route() -> Response:
|
|
|
90
90
|
)
|
|
91
91
|
|
|
92
92
|
# Create this event up here so timestamps are fully from the start to account for any unknown overhead
|
|
93
|
+
version_data = get_version()
|
|
93
94
|
vembda_initiated_event = VembdaExecutionInitiatedEvent(
|
|
94
95
|
id=uuid4(),
|
|
95
96
|
timestamp=datetime.now(),
|
|
96
97
|
trace_id=context.trace_id,
|
|
97
98
|
span_id=context.execution_id,
|
|
98
|
-
body=VembdaExecutionInitiatedBody.model_validate(
|
|
99
|
+
body=VembdaExecutionInitiatedBody.model_validate(version_data),
|
|
99
100
|
parent=None,
|
|
100
101
|
)
|
|
101
102
|
|
|
@@ -374,12 +375,13 @@ def stream_node_route() -> Response:
|
|
|
374
375
|
)
|
|
375
376
|
|
|
376
377
|
# Create this event up here so timestamps are fully from the start to account for any unknown overhead
|
|
378
|
+
version_data = get_version()
|
|
377
379
|
vembda_initiated_event = VembdaExecutionInitiatedEvent(
|
|
378
380
|
id=uuid4(),
|
|
379
381
|
timestamp=datetime.now(),
|
|
380
382
|
trace_id=context.trace_id,
|
|
381
383
|
span_id=context.execution_id,
|
|
382
|
-
body=VembdaExecutionInitiatedBody.model_validate(
|
|
384
|
+
body=VembdaExecutionInitiatedBody.model_validate(version_data),
|
|
383
385
|
parent=None,
|
|
384
386
|
)
|
|
385
387
|
|
|
@@ -18,6 +18,7 @@ from vellum_ee.workflows.display.utils.events import event_enricher
|
|
|
18
18
|
from vellum_ee.workflows.server.virtual_file_loader import VirtualFileFinder
|
|
19
19
|
|
|
20
20
|
from vellum.workflows import BaseWorkflow
|
|
21
|
+
from vellum.workflows.context import execution_context
|
|
21
22
|
from vellum.workflows.emitters.base import BaseWorkflowEmitter
|
|
22
23
|
from vellum.workflows.emitters.vellum_emitter import VellumEmitter
|
|
23
24
|
from vellum.workflows.events.exception_handling import stream_initialization_exception
|
|
@@ -178,7 +179,12 @@ def stream_workflow(
|
|
|
178
179
|
)
|
|
179
180
|
except WorkflowInitializationException as e:
|
|
180
181
|
cancel_watcher_kill_switch.set()
|
|
181
|
-
|
|
182
|
+
|
|
183
|
+
with execution_context(
|
|
184
|
+
parent_context=executor_context.execution_context.parent_context,
|
|
185
|
+
trace_id=executor_context.execution_context.trace_id,
|
|
186
|
+
):
|
|
187
|
+
initialization_exception_stream = stream_initialization_exception(e)
|
|
182
188
|
|
|
183
189
|
def _stream_generator() -> Generator[dict[str, Any], Any, None]:
|
|
184
190
|
for event in initialization_exception_stream:
|
|
@@ -405,7 +411,7 @@ def get_random_namespace() -> str:
|
|
|
405
411
|
return "workflow_tmp_" + "".join(random.choice(string.ascii_letters + string.digits) for i in range(14))
|
|
406
412
|
|
|
407
413
|
|
|
408
|
-
def _enrich_event(event: WorkflowEvent,
|
|
414
|
+
def _enrich_event(event: WorkflowEvent, executor_context: Optional[BaseExecutorContext] = None) -> WorkflowEvent:
|
|
409
415
|
"""
|
|
410
416
|
Enrich an event with metadata based on the event type.
|
|
411
417
|
|
|
@@ -425,6 +431,9 @@ def _enrich_event(event: WorkflowEvent, vellum_client: Optional[Any]) -> Workflo
|
|
|
425
431
|
memory_mb = get_memory_in_use_mb()
|
|
426
432
|
if memory_mb is not None:
|
|
427
433
|
metadata["memory_usage_mb"] = memory_mb
|
|
434
|
+
|
|
435
|
+
if executor_context is not None:
|
|
436
|
+
metadata["is_new_server"] = executor_context.is_new_server
|
|
428
437
|
elif event.name == "workflow.execution.fulfilled" and is_deployment:
|
|
429
438
|
metadata = {}
|
|
430
439
|
memory_mb = get_memory_in_use_mb()
|
|
@@ -433,6 +442,7 @@ def _enrich_event(event: WorkflowEvent, vellum_client: Optional[Any]) -> Workflo
|
|
|
433
442
|
except Exception:
|
|
434
443
|
pass
|
|
435
444
|
|
|
445
|
+
vellum_client = executor_context.vellum_client if executor_context else None
|
|
436
446
|
return event_enricher(event, vellum_client, metadata=metadata)
|
|
437
447
|
|
|
438
448
|
|
|
@@ -441,7 +451,7 @@ def _dump_event(event: BaseEvent, executor_context: BaseExecutorContext) -> dict
|
|
|
441
451
|
|
|
442
452
|
dump = event.model_dump(
|
|
443
453
|
mode="json",
|
|
444
|
-
context={"event_enricher": lambda event: _enrich_event(event, executor_context
|
|
454
|
+
context={"event_enricher": lambda event: _enrich_event(event, executor_context)},
|
|
445
455
|
)
|
|
446
456
|
if dump["name"] in {
|
|
447
457
|
"workflow.execution.initiated",
|
|
File without changes
|
{vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/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
|
{vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/config.py
RENAMED
|
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.8.2 → vellum_workflow_server-1.8.2.post2}/src/workflow_server/server.py
RENAMED
|
File without changes
|
{vellum_workflow_server-1.8.2 → vellum_workflow_server-1.8.2.post2}/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
|