vellum-workflow-server 1.7.14__tar.gz → 1.7.15.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.7.14 → vellum_workflow_server-1.7.15.post1}/PKG-INFO +2 -2
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/pyproject.toml +2 -2
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/api/tests/test_workflow_view_stream_workflow_route.py +20 -2
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/core/executor.py +37 -1
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/README.md +0 -0
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/__init__.py +0 -0
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/api/__init__.py +0 -0
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/api/auth_middleware.py +0 -0
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/api/healthz_view.py +0 -0
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/api/tests/__init__.py +0 -0
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/api/tests/test_input_display_mapping.py +0 -0
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/api/tests/test_workflow_view.py +0 -0
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/api/workflow_view.py +0 -0
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/code_exec_runner.py +0 -0
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/config.py +0 -0
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/core/__init__.py +0 -0
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/core/cancel_workflow.py +0 -0
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/core/events.py +0 -0
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/core/utils.py +0 -0
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/core/workflow_executor_context.py +0 -0
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/logging_config.py +0 -0
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/server.py +0 -0
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/start.py +0 -0
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/utils/__init__.py +0 -0
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/utils/exit_handler.py +0 -0
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/utils/log_proxy.py +0 -0
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/utils/oom_killer.py +0 -0
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/utils/sentry.py +0 -0
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/utils/system_utils.py +0 -0
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/utils/tests/__init__.py +0 -0
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/utils/tests/test_sentry_integration.py +0 -0
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/utils/tests/test_system_utils.py +0 -0
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/utils/tests/test_utils.py +0 -0
- {vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/utils/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: vellum-workflow-server
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.15.post1
|
|
4
4
|
Summary:
|
|
5
5
|
License: AGPL
|
|
6
6
|
Requires-Python: >=3.9.0,<4
|
|
@@ -29,7 +29,7 @@ Requires-Dist: pyjwt (==2.10.0)
|
|
|
29
29
|
Requires-Dist: python-dotenv (==1.0.1)
|
|
30
30
|
Requires-Dist: retrying (==1.3.4)
|
|
31
31
|
Requires-Dist: sentry-sdk[flask] (==2.20.0)
|
|
32
|
-
Requires-Dist: vellum-ai (==1.7.
|
|
32
|
+
Requires-Dist: vellum-ai (==1.7.15)
|
|
33
33
|
Description-Content-Type: text/markdown
|
|
34
34
|
|
|
35
35
|
# Vellum Workflow Runner Server
|
|
@@ -3,7 +3,7 @@ name = "vellum-workflow-server"
|
|
|
3
3
|
|
|
4
4
|
[tool.poetry]
|
|
5
5
|
name = "vellum-workflow-server"
|
|
6
|
-
version = "1.7.
|
|
6
|
+
version = "1.7.15.post1"
|
|
7
7
|
description = ""
|
|
8
8
|
readme = "README.md"
|
|
9
9
|
authors = []
|
|
@@ -45,7 +45,7 @@ flask = "2.3.3"
|
|
|
45
45
|
orderly-set = "5.2.2"
|
|
46
46
|
pebble = "5.0.7"
|
|
47
47
|
gunicorn = "23.0.0"
|
|
48
|
-
vellum-ai = "1.7.
|
|
48
|
+
vellum-ai = "1.7.15"
|
|
49
49
|
python-dotenv = "1.0.1"
|
|
50
50
|
retrying = "1.3.4"
|
|
51
51
|
sentry-sdk = {extras = ["flask"], version = "2.20.0"}
|
|
@@ -131,8 +131,9 @@ class Workflow(BaseWorkflow):
|
|
|
131
131
|
},
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
with mock.patch("builtins.open", mock.mock_open(read_data="104857600")):
|
|
135
|
+
# WHEN we call the stream route
|
|
136
|
+
status_code, events = both_stream_types(request_body)
|
|
136
137
|
|
|
137
138
|
# THEN we get a 200 response
|
|
138
139
|
assert status_code == 200, events
|
|
@@ -164,9 +165,26 @@ class Workflow(BaseWorkflow):
|
|
|
164
165
|
assert isinstance(display_context["workflow_inputs"], dict)
|
|
165
166
|
assert isinstance(display_context["workflow_outputs"], dict)
|
|
166
167
|
assert "foo" in display_context["workflow_outputs"]
|
|
168
|
+
|
|
169
|
+
# AND the initiated event should have server_metadata with version info and memory usage
|
|
170
|
+
assert "server_metadata" in events[1]["body"], events[1]["body"]
|
|
171
|
+
server_metadata = events[1]["body"]["server_metadata"]
|
|
172
|
+
assert server_metadata is not None, "server_metadata should not be None"
|
|
173
|
+
assert "server_version" in server_metadata
|
|
174
|
+
assert "sdk_version" in server_metadata
|
|
175
|
+
assert "memory_usage_mb" in server_metadata
|
|
176
|
+
assert isinstance(server_metadata["memory_usage_mb"], (int, float))
|
|
177
|
+
|
|
167
178
|
assert events[2]["name"] == "workflow.execution.fulfilled", events[2]
|
|
168
179
|
assert events[2]["body"]["workflow_definition"]["module"] == ["test", "workflow"]
|
|
169
180
|
|
|
181
|
+
# AND the fulfilled event should have server_metadata with memory usage
|
|
182
|
+
assert "server_metadata" in events[2]["body"], events[2]["body"]
|
|
183
|
+
fulfilled_metadata = events[2]["body"]["server_metadata"]
|
|
184
|
+
assert fulfilled_metadata is not None, "fulfilled server_metadata should not be None"
|
|
185
|
+
assert "memory_usage_mb" in fulfilled_metadata
|
|
186
|
+
assert isinstance(fulfilled_metadata["memory_usage_mb"], (int, float))
|
|
187
|
+
|
|
170
188
|
assert events[3] == {
|
|
171
189
|
"id": mock.ANY,
|
|
172
190
|
"trace_id": events[0]["trace_id"],
|
|
@@ -22,6 +22,7 @@ from vellum.workflows.emitters.base import BaseWorkflowEmitter
|
|
|
22
22
|
from vellum.workflows.emitters.vellum_emitter import VellumEmitter
|
|
23
23
|
from vellum.workflows.events.exception_handling import stream_initialization_exception
|
|
24
24
|
from vellum.workflows.events.types import BaseEvent
|
|
25
|
+
from vellum.workflows.events.workflow import WorkflowEvent
|
|
25
26
|
from vellum.workflows.exceptions import WorkflowInitializationException
|
|
26
27
|
from vellum.workflows.inputs import BaseInputs
|
|
27
28
|
from vellum.workflows.nodes import BaseNode
|
|
@@ -51,6 +52,8 @@ from workflow_server.core.workflow_executor_context import (
|
|
|
51
52
|
WorkflowExecutorContext,
|
|
52
53
|
)
|
|
53
54
|
from workflow_server.utils.log_proxy import redirect_log
|
|
55
|
+
from workflow_server.utils.system_utils import get_memory_in_use_mb
|
|
56
|
+
from workflow_server.utils.utils import get_version
|
|
54
57
|
|
|
55
58
|
logger = logging.getLogger(__name__)
|
|
56
59
|
|
|
@@ -401,10 +404,43 @@ def get_random_namespace() -> str:
|
|
|
401
404
|
return "workflow_tmp_" + "".join(random.choice(string.ascii_letters + string.digits) for i in range(14))
|
|
402
405
|
|
|
403
406
|
|
|
407
|
+
def _enrich_event(event: WorkflowEvent, vellum_client: Optional[Any]) -> WorkflowEvent:
|
|
408
|
+
"""
|
|
409
|
+
Enrich an event with metadata based on the event type.
|
|
410
|
+
|
|
411
|
+
For initiated events, include server and SDK versions.
|
|
412
|
+
For fulfilled events with WORKFLOW_DEPLOYMENT parent, include memory usage.
|
|
413
|
+
"""
|
|
414
|
+
metadata: Optional[dict] = None
|
|
415
|
+
|
|
416
|
+
try:
|
|
417
|
+
is_deployment = event.parent and event.parent.type in ("WORKFLOW_DEPLOYMENT", "EXTERNAL")
|
|
418
|
+
|
|
419
|
+
if event.name == "workflow.execution.initiated" and is_deployment:
|
|
420
|
+
metadata = {
|
|
421
|
+
**get_version(),
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
memory_mb = get_memory_in_use_mb()
|
|
425
|
+
if memory_mb is not None:
|
|
426
|
+
metadata["memory_usage_mb"] = memory_mb
|
|
427
|
+
elif event.name == "workflow.execution.fulfilled" and is_deployment:
|
|
428
|
+
metadata = {}
|
|
429
|
+
memory_mb = get_memory_in_use_mb()
|
|
430
|
+
if memory_mb is not None:
|
|
431
|
+
metadata["memory_usage_mb"] = memory_mb
|
|
432
|
+
except Exception:
|
|
433
|
+
pass
|
|
434
|
+
|
|
435
|
+
return event_enricher(event, vellum_client, metadata=metadata)
|
|
436
|
+
|
|
437
|
+
|
|
404
438
|
def _dump_event(event: BaseEvent, executor_context: BaseExecutorContext) -> dict:
|
|
405
439
|
module_base = executor_context.module.split(".")
|
|
440
|
+
|
|
406
441
|
dump = event.model_dump(
|
|
407
|
-
mode="json",
|
|
442
|
+
mode="json",
|
|
443
|
+
context={"event_enricher": lambda event: _enrich_event(event, executor_context.vellum_client)},
|
|
408
444
|
)
|
|
409
445
|
if dump["name"] in {
|
|
410
446
|
"workflow.execution.initiated",
|
|
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
|
{vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.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
|
|
File without changes
|
{vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.post1}/src/workflow_server/server.py
RENAMED
|
File without changes
|
{vellum_workflow_server-1.7.14 → vellum_workflow_server-1.7.15.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
|