model-compose 0.2.7__tar.gz → 0.2.9__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.
- {model_compose-0.2.7/src/model_compose.egg-info → model_compose-0.2.9}/PKG-INFO +1 -1
- {model_compose-0.2.7 → model_compose-0.2.9}/pyproject.toml +1 -1
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/component/base.py +2 -2
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/component/context.py +3 -3
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/component/services/workflow.py +1 -1
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/controller/base.py +5 -2
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/controller/webui/webui.py +1 -2
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/logger/services/console.py +2 -1
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/utils/time.py +10 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/workflow/job/impl/action.py +11 -2
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/workflow/job/impl/delay.py +14 -3
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/workflow/workflow.py +10 -4
- {model_compose-0.2.7 → model_compose-0.2.9/src/model_compose.egg-info}/PKG-INFO +1 -1
- {model_compose-0.2.7 → model_compose-0.2.9}/LICENSE +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/README.md +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/setup.cfg +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/cli/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/cli/compose.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/component/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/component/component.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/component/services/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/component/services/http_client.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/component/services/http_server.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/component/services/mcp_client.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/component/services/mcp_server.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/component/services/shell.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/compose/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/compose/compose.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/compose/manager.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/controller/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/controller/controller.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/controller/runner/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/controller/runner/client.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/controller/runner/http_client.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/controller/runner/mcp_client.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/controller/runner/runner.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/controller/services/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/controller/services/http_server.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/controller/services/mcp_server.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/controller/webui/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/controller/webui/gradio.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/gateway/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/gateway/base.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/gateway/gateway.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/gateway/services/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/gateway/services/http_tunnel.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/gateway/services/ssh_tunnel.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/listener/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/listener/base.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/listener/listener.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/listener/services/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/listener/services/http_callback.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/logger/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/logger/base.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/logger/logger.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/logger/logging.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/logger/services/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/logger/services/file.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/runtime/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/runtime/env.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/services/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/services/async_service.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/utils/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/utils/expiring.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/utils/http_client.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/utils/http_request.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/utils/http_status.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/utils/image.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/utils/mcp_client.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/utils/renderer.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/utils/ssh_client.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/utils/streaming.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/utils/workqueue.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/workflow/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/workflow/context.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/workflow/job/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/workflow/job/base.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/workflow/job/impl/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/workflow/job/job.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/workflow/schema.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/loader.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/action/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/action/action.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/action/impl/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/action/impl/common.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/action/impl/http_client.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/action/impl/http_server.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/action/impl/mcp_client.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/action/impl/mcp_server.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/action/impl/shell.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/action/impl/workflow.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/component/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/component/component.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/component/impl/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/component/impl/common.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/component/impl/http_client.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/component/impl/http_server.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/component/impl/mcp_client.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/component/impl/mcp_server.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/component/impl/shell.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/component/impl/types.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/component/impl/workflow.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/compose.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/controller/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/controller/controller.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/controller/impl/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/controller/impl/common.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/controller/impl/http_server.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/controller/impl/mcp_server.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/controller/impl/types.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/controller/impl/webui.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/gateway/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/gateway/gateway.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/gateway/impl/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/gateway/impl/common.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/gateway/impl/http_tunnel.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/gateway/impl/ssh_tunnel.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/gateway/impl/types.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/job/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/job/impl/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/job/impl/action.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/job/impl/common.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/job/impl/delay.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/job/impl/types.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/job/job.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/listener/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/listener/impl/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/listener/impl/common.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/listener/impl/http_callback.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/listener/impl/types.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/listener/listener.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/logger/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/logger/impl/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/logger/impl/common.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/logger/impl/console.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/logger/impl/file.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/logger/impl/types.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/logger/logger.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/runtime/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/runtime/impl/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/runtime/impl/common.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/runtime/impl/docker.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/runtime/impl/types.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/runtime/runtime.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/utils/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/utils/annotation.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/workflow.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/model_compose.egg-info/SOURCES.txt +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/model_compose.egg-info/dependency_links.txt +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/model_compose.egg-info/entry_points.txt +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/model_compose.egg-info/requires.txt +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/src/model_compose.egg-info/top_level.txt +0 -0
- {model_compose-0.2.7 → model_compose-0.2.9}/tests/test_cli.py +0 -0
|
@@ -57,9 +57,9 @@ class ComponentService(AsyncService):
|
|
|
57
57
|
if self.config.max_concurrent_count > 0:
|
|
58
58
|
self.queue = WorkQueue(self.config.max_concurrent_count, self._run)
|
|
59
59
|
|
|
60
|
-
async def run(self, action_id: Union[str, None],
|
|
60
|
+
async def run(self, action_id: Union[str, None], run_id: str, input: Dict[str, Any]) -> Dict[str, Any]:
|
|
61
61
|
_, action = ActionResolver(self.config.actions).resolve(action_id)
|
|
62
|
-
context = ComponentActionContext(
|
|
62
|
+
context = ComponentActionContext(run_id, input)
|
|
63
63
|
|
|
64
64
|
if self.queue:
|
|
65
65
|
return await (await self.queue.schedule(action, context))
|
|
@@ -3,10 +3,10 @@ from mindor.core.utils.renderer import VariableRenderer
|
|
|
3
3
|
from mindor.core.gateway import find_gateway_by_port
|
|
4
4
|
|
|
5
5
|
class ComponentActionContext:
|
|
6
|
-
def __init__(self,
|
|
7
|
-
self.
|
|
6
|
+
def __init__(self, run_id: str, input: Dict[str, Any]):
|
|
7
|
+
self.run_id: str = run_id
|
|
8
8
|
self.input: Dict[str, Any] = input
|
|
9
|
-
self.context: Dict[str, Any] = { "
|
|
9
|
+
self.context: Dict[str, Any] = { "run_id": run_id }
|
|
10
10
|
self.sources: Dict[str, Any] = {}
|
|
11
11
|
self.renderer: VariableRenderer = VariableRenderer(self._resolve_source)
|
|
12
12
|
|
|
@@ -17,7 +17,7 @@ class WorkflowAction:
|
|
|
17
17
|
input = await context.render_variable(self.config.input)
|
|
18
18
|
|
|
19
19
|
workflow = self._create_workflow(workflow_id)
|
|
20
|
-
output = await workflow.run(context.
|
|
20
|
+
output = await workflow.run(context.run_id, input)
|
|
21
21
|
context.register_source("output", output)
|
|
22
22
|
|
|
23
23
|
return (await context.render_variable(self.config.output, ignore_files=True)) if self.config.output else output
|
|
@@ -5,7 +5,7 @@ from mindor.dsl.schema.controller import ControllerConfig, ControllerType
|
|
|
5
5
|
from mindor.dsl.schema.component import ComponentConfig
|
|
6
6
|
from mindor.dsl.schema.listener import ListenerConfig
|
|
7
7
|
from mindor.dsl.schema.gateway import GatewayConfig
|
|
8
|
-
from mindor.dsl.schema.logger import LoggerConfig
|
|
8
|
+
from mindor.dsl.schema.logger import LoggerConfig, LoggerType, ConsoleLoggerConfig
|
|
9
9
|
from mindor.dsl.schema.workflow import WorkflowConfig
|
|
10
10
|
from mindor.core.services import AsyncService
|
|
11
11
|
from mindor.core.component import ComponentService, ComponentGlobalConfigs, create_component
|
|
@@ -166,7 +166,7 @@ class ControllerService(AsyncService):
|
|
|
166
166
|
return [ create_component(component_id, config, global_configs, self.daemon) for component_id, config in self.components.items() ]
|
|
167
167
|
|
|
168
168
|
def _create_loggers(self) -> List[LoggerService]:
|
|
169
|
-
return [ create_logger(f"logger-{index}", config, self.daemon) for index, config in enumerate(self.loggers) ]
|
|
169
|
+
return [ create_logger(f"logger-{index}", config, self.daemon) for index, config in enumerate(self.loggers or [ self._get_default_logger_config() ]) ]
|
|
170
170
|
|
|
171
171
|
def _create_webui(self) -> ControllerWebUI:
|
|
172
172
|
return ControllerWebUI(self.config.webui, self.config, self.components, self.workflows, self.daemon)
|
|
@@ -178,6 +178,9 @@ class ControllerService(AsyncService):
|
|
|
178
178
|
def _get_component_global_configs(self) -> ComponentGlobalConfigs:
|
|
179
179
|
return ComponentGlobalConfigs(self.components, self.listeners, self.gateways, self.workflows)
|
|
180
180
|
|
|
181
|
+
def _get_default_logger_config(self) -> LoggerConfig:
|
|
182
|
+
return ConsoleLoggerConfig(type=LoggerType.CONSOLE)
|
|
183
|
+
|
|
181
184
|
def register_controller(type: ControllerType):
|
|
182
185
|
def decorator(cls: Type[ControllerService]) -> Type[ControllerService]:
|
|
183
186
|
ControllerRegistry[type] = cls
|
|
@@ -6,9 +6,8 @@ from mindor.core.controller.runner import ControllerRunner
|
|
|
6
6
|
from mindor.core.workflow.schema import create_workflow_schema
|
|
7
7
|
from mindor.core.services import AsyncService
|
|
8
8
|
from .gradio import GradioWebUIBuilder
|
|
9
|
-
|
|
10
|
-
from fastapi import FastAPI
|
|
11
9
|
from gradio import mount_gradio_app
|
|
10
|
+
from fastapi import FastAPI
|
|
12
11
|
import uvicorn, gradio
|
|
13
12
|
|
|
14
13
|
class ControllerWebUI(AsyncService):
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Callable, Iterator, Any
|
|
2
2
|
from mindor.dsl.schema.logger import ConsoleLoggerConfig
|
|
3
3
|
from ..base import LoggerService, LoggerType, LoggingLevel, register_logger
|
|
4
|
+
from uvicorn.logging import ColourizedFormatter
|
|
4
5
|
import logging
|
|
5
6
|
|
|
6
7
|
_level_map = {
|
|
@@ -17,7 +18,7 @@ class ConsoleLogger(LoggerService):
|
|
|
17
18
|
super().__init__(id, config, daemon)
|
|
18
19
|
|
|
19
20
|
self.logger: logging.Logger = logging.getLogger(id)
|
|
20
|
-
self.formatter: logging.Formatter =
|
|
21
|
+
self.formatter: logging.Formatter = ColourizedFormatter("%(levelprefix)s %(message)s")
|
|
21
22
|
self.handler: logging.StreamHandler = None
|
|
22
23
|
|
|
23
24
|
self._configure_logger()
|
|
@@ -2,6 +2,16 @@ from typing import Union, Optional
|
|
|
2
2
|
from datetime import timedelta, datetime
|
|
3
3
|
import zoneinfo
|
|
4
4
|
|
|
5
|
+
class TimeTracker:
|
|
6
|
+
def __init__(self):
|
|
7
|
+
self._start = datetime.now()
|
|
8
|
+
|
|
9
|
+
def elapsed(self) -> float:
|
|
10
|
+
return (datetime.now() - self._start).total_seconds()
|
|
11
|
+
|
|
12
|
+
def reset(self) -> None:
|
|
13
|
+
self._start = datetime.now()
|
|
14
|
+
|
|
5
15
|
def parse_duration(value: Union[str, float, int]) -> timedelta:
|
|
6
16
|
if isinstance(value, (float, int)):
|
|
7
17
|
return timedelta(seconds=value)
|
|
@@ -2,7 +2,10 @@ from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annot
|
|
|
2
2
|
from mindor.dsl.schema.job import ActionJobConfig, JobType
|
|
3
3
|
from mindor.dsl.schema.component import ComponentConfig
|
|
4
4
|
from mindor.core.component import ComponentService, ComponentGlobalConfigs, ComponentResolver, create_component
|
|
5
|
+
from mindor.core.utils.time import TimeTracker
|
|
6
|
+
from mindor.core.logger import logging
|
|
5
7
|
from ..base import Job, JobType, WorkflowContext, register_job
|
|
8
|
+
from datetime import datetime
|
|
6
9
|
import asyncio, ulid
|
|
7
10
|
|
|
8
11
|
@register_job(JobType.ACTION)
|
|
@@ -20,10 +23,16 @@ class ActionJob(Job):
|
|
|
20
23
|
outputs = []
|
|
21
24
|
|
|
22
25
|
async def _run_once():
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
run_id: str = ulid.ulid()
|
|
27
|
+
|
|
28
|
+
job_time_tracker = TimeTracker()
|
|
29
|
+
logging.debug("[task-%s] Action 'run-%s' started for job '%s'", context.task_id, run_id, self.id)
|
|
30
|
+
|
|
31
|
+
output = await component.run(await context.render_variable(self.config.action), run_id, input)
|
|
25
32
|
context.register_source("output", output)
|
|
26
33
|
|
|
34
|
+
logging.debug("[task-%s] Action 'run-%s' completed in %.2f seconds.", context.task_id, run_id, job_time_tracker.elapsed())
|
|
35
|
+
|
|
27
36
|
output = (await context.render_variable(self.config.output, ignore_files=True)) if self.config.output else output
|
|
28
37
|
outputs.append(output)
|
|
29
38
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Callable, Any
|
|
2
2
|
from mindor.dsl.schema.job import DelayJobConfig, DelayJobMode
|
|
3
3
|
from mindor.dsl.schema.component import ComponentConfig
|
|
4
|
-
from mindor.core.utils.time import parse_duration, parse_datetime
|
|
4
|
+
from mindor.core.utils.time import parse_duration, parse_datetime, TimeTracker
|
|
5
|
+
from mindor.core.logger import logging
|
|
5
6
|
from ..base import Job, JobType, WorkflowContext, register_job
|
|
6
|
-
from datetime import datetime
|
|
7
|
+
from datetime import datetime, timedelta
|
|
7
8
|
import asyncio
|
|
8
9
|
|
|
9
10
|
@register_job(JobType.DELAY)
|
|
@@ -24,9 +25,14 @@ class DelayJob(Job):
|
|
|
24
25
|
duration = parse_duration((await context.render_variable(self.config.duration)) or 0.0)
|
|
25
26
|
duration = duration.total_seconds()
|
|
26
27
|
|
|
28
|
+
job_time_tracker = TimeTracker()
|
|
29
|
+
logging.debug("[task-%s] Delay started for time interval: %d seconds.", context.task_id, int(duration))
|
|
30
|
+
|
|
27
31
|
if duration > 0.0:
|
|
28
32
|
await asyncio.sleep(duration)
|
|
29
33
|
|
|
34
|
+
logging.debug("[task-%s] Delay completed in %.2f seconds.", context.task_id, job_time_tracker.elapsed())
|
|
35
|
+
|
|
30
36
|
return None
|
|
31
37
|
|
|
32
38
|
async def _delay_until_specific_time(self, context: WorkflowContext) -> Any:
|
|
@@ -34,9 +40,14 @@ class DelayJob(Job):
|
|
|
34
40
|
time = parse_datetime((await context.render_variable(self.config.time)) or datetime(2000, 1, 1, 0, 0, 0), timezone)
|
|
35
41
|
|
|
36
42
|
now = datetime.now(tz=time.tzinfo)
|
|
37
|
-
duration = (time - now).total_seconds()
|
|
43
|
+
duration = max((time - now).total_seconds(), 0.0)
|
|
44
|
+
|
|
45
|
+
job_time_tracker = TimeTracker()
|
|
46
|
+
logging.debug("[task-%s] Delay started, waiting until %s", context.task_id, time)
|
|
38
47
|
|
|
39
48
|
if duration > 0.0:
|
|
40
49
|
await asyncio.sleep(duration)
|
|
41
50
|
|
|
51
|
+
logging.debug("[task-%s] Delay completed in %.2f seconds.", context.task_id, job_time_tracker.elapsed())
|
|
52
|
+
|
|
42
53
|
return None
|
|
@@ -2,9 +2,11 @@ from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annot
|
|
|
2
2
|
from mindor.dsl.schema.workflow import WorkflowConfig, JobConfig
|
|
3
3
|
from mindor.dsl.schema.component import ComponentConfig
|
|
4
4
|
from mindor.core.component import ComponentGlobalConfigs
|
|
5
|
+
from mindor.core.utils.time import TimeTracker
|
|
5
6
|
from mindor.core.logger import logging
|
|
6
7
|
from .context import WorkflowContext
|
|
7
8
|
from .job import Job, create_job
|
|
9
|
+
from datetime import datetime
|
|
8
10
|
import asyncio
|
|
9
11
|
|
|
10
12
|
class JobGraphValidator:
|
|
@@ -85,19 +87,23 @@ class WorkflowRunner:
|
|
|
85
87
|
running_job_ids: Set[str] = set()
|
|
86
88
|
completed_job_ids: Set[str] = set()
|
|
87
89
|
scheduled_job_tasks: Dict[str, asyncio.Task] = {}
|
|
90
|
+
job_time_trackers: Dict[str, TimeTracker] = {}
|
|
88
91
|
output: Any = None
|
|
89
92
|
|
|
90
|
-
|
|
93
|
+
workflow_time_tracker = TimeTracker()
|
|
94
|
+
logging.info("[task-%s] Workflow '%s' started.", context.task_id, self.id)
|
|
91
95
|
|
|
92
96
|
while pending_jobs:
|
|
93
97
|
runnable_jobs = [ job for job in pending_jobs.values() if self._can_run_job(job, running_job_ids, completed_job_ids) ]
|
|
94
98
|
|
|
95
99
|
for job in runnable_jobs:
|
|
96
100
|
if job.id not in scheduled_job_tasks:
|
|
97
|
-
logging.debug("[task-%s] Scheduling job: '%s'", context.task_id, job.id)
|
|
98
101
|
scheduled_job_tasks[job.id] = asyncio.create_task(job.run(context))
|
|
99
102
|
running_job_ids.add(job.id)
|
|
100
103
|
|
|
104
|
+
job_time_trackers[job.id] = TimeTracker()
|
|
105
|
+
logging.info("[task-%s] Job '%s' started.", context.task_id, job.id)
|
|
106
|
+
|
|
101
107
|
if not scheduled_job_tasks:
|
|
102
108
|
raise RuntimeError("No runnable jobs but pending jobs remain.")
|
|
103
109
|
|
|
@@ -109,7 +115,7 @@ class WorkflowRunner:
|
|
|
109
115
|
completed_job_output = await completed_job_task
|
|
110
116
|
context.complete_job(completed_job_id, completed_job_output)
|
|
111
117
|
|
|
112
|
-
logging.
|
|
118
|
+
logging.info("[task-%s] Job '%s' completed in %.2f seconds.", context.task_id, completed_job_id, job_time_trackers[completed_job_id].elapsed())
|
|
113
119
|
|
|
114
120
|
if self._is_terminal_job(completed_job_id):
|
|
115
121
|
if isinstance(output, dict) and isinstance(completed_job_output, dict):
|
|
@@ -122,7 +128,7 @@ class WorkflowRunner:
|
|
|
122
128
|
del pending_jobs[completed_job_id]
|
|
123
129
|
del scheduled_job_tasks[completed_job_id]
|
|
124
130
|
|
|
125
|
-
logging.
|
|
131
|
+
logging.info("[task-%s] Workflow '%s' completed in %.2f seconds.", context.task_id, self.id, workflow_time_tracker.elapsed())
|
|
126
132
|
|
|
127
133
|
return output
|
|
128
134
|
|
|
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
|
{model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/component/services/http_client.py
RENAMED
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/component/services/http_server.py
RENAMED
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/component/services/mcp_client.py
RENAMED
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/component/services/mcp_server.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
|
{model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/controller/runner/http_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/controller/services/http_server.py
RENAMED
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/controller/services/mcp_server.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
|
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/core/listener/services/http_callback.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
|
|
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
|
{model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/action/impl/http_client.py
RENAMED
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/action/impl/http_server.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/component/impl/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/component/impl/http_client.py
RENAMED
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/component/impl/http_server.py
RENAMED
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/component/impl/mcp_client.py
RENAMED
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/component/impl/mcp_server.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/component/impl/workflow.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/controller/impl/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/controller/impl/http_server.py
RENAMED
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/controller/impl/mcp_server.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/gateway/impl/http_tunnel.py
RENAMED
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/gateway/impl/ssh_tunnel.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
|
{model_compose-0.2.7 → model_compose-0.2.9}/src/mindor/dsl/schema/listener/impl/http_callback.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
|
|
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
|