model-compose 0.2.7__tar.gz → 0.2.8__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.8}/PKG-INFO +1 -1
- {model_compose-0.2.7 → model_compose-0.2.8}/pyproject.toml +1 -1
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/component/base.py +2 -2
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/component/context.py +3 -3
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/component/services/workflow.py +1 -1
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/controller/base.py +5 -2
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/workflow/job/impl/action.py +11 -2
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/workflow/job/impl/delay.py +15 -2
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/workflow/workflow.py +6 -3
- {model_compose-0.2.7 → model_compose-0.2.8/src/model_compose.egg-info}/PKG-INFO +1 -1
- {model_compose-0.2.7 → model_compose-0.2.8}/LICENSE +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/README.md +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/setup.cfg +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/cli/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/cli/compose.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/component/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/component/component.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/component/services/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/component/services/http_client.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/component/services/http_server.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/component/services/mcp_client.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/component/services/mcp_server.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/component/services/shell.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/compose/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/compose/compose.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/compose/manager.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/controller/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/controller/controller.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/controller/runner/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/controller/runner/client.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/controller/runner/http_client.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/controller/runner/mcp_client.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/controller/runner/runner.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/controller/services/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/controller/services/http_server.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/controller/services/mcp_server.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/controller/webui/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/controller/webui/gradio.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/controller/webui/webui.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/gateway/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/gateway/base.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/gateway/gateway.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/gateway/services/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/gateway/services/http_tunnel.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/gateway/services/ssh_tunnel.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/listener/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/listener/base.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/listener/listener.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/listener/services/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/listener/services/http_callback.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/logger/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/logger/base.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/logger/logger.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/logger/logging.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/logger/services/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/logger/services/console.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/logger/services/file.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/runtime/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/runtime/env.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/services/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/services/async_service.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/utils/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/utils/expiring.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/utils/http_client.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/utils/http_request.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/utils/http_status.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/utils/image.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/utils/mcp_client.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/utils/renderer.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/utils/ssh_client.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/utils/streaming.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/utils/time.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/utils/workqueue.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/workflow/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/workflow/context.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/workflow/job/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/workflow/job/base.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/workflow/job/impl/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/workflow/job/job.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/workflow/schema.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/loader.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/action/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/action/action.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/action/impl/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/action/impl/common.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/action/impl/http_client.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/action/impl/http_server.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/action/impl/mcp_client.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/action/impl/mcp_server.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/action/impl/shell.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/action/impl/workflow.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/component/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/component/component.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/component/impl/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/component/impl/common.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/component/impl/http_client.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/component/impl/http_server.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/component/impl/mcp_client.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/component/impl/mcp_server.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/component/impl/shell.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/component/impl/types.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/component/impl/workflow.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/compose.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/controller/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/controller/controller.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/controller/impl/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/controller/impl/common.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/controller/impl/http_server.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/controller/impl/mcp_server.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/controller/impl/types.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/controller/impl/webui.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/gateway/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/gateway/gateway.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/gateway/impl/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/gateway/impl/common.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/gateway/impl/http_tunnel.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/gateway/impl/ssh_tunnel.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/gateway/impl/types.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/job/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/job/impl/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/job/impl/action.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/job/impl/common.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/job/impl/delay.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/job/impl/types.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/job/job.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/listener/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/listener/impl/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/listener/impl/common.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/listener/impl/http_callback.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/listener/impl/types.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/listener/listener.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/logger/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/logger/impl/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/logger/impl/common.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/logger/impl/console.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/logger/impl/file.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/logger/impl/types.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/logger/logger.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/runtime/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/runtime/impl/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/runtime/impl/common.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/runtime/impl/docker.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/runtime/impl/types.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/runtime/runtime.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/utils/__init__.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/utils/annotation.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/workflow.py +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/model_compose.egg-info/SOURCES.txt +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/model_compose.egg-info/dependency_links.txt +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/model_compose.egg-info/entry_points.txt +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/model_compose.egg-info/requires.txt +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/src/model_compose.egg-info/top_level.txt +0 -0
- {model_compose-0.2.7 → model_compose-0.2.8}/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
|
|
@@ -2,7 +2,9 @@ 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.logger import logging
|
|
5
6
|
from ..base import Job, JobType, WorkflowContext, register_job
|
|
7
|
+
from datetime import datetime
|
|
6
8
|
import asyncio, ulid
|
|
7
9
|
|
|
8
10
|
@register_job(JobType.ACTION)
|
|
@@ -20,10 +22,17 @@ class ActionJob(Job):
|
|
|
20
22
|
outputs = []
|
|
21
23
|
|
|
22
24
|
async def _run_once():
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
run_id: str = ulid.ulid()
|
|
26
|
+
|
|
27
|
+
started_at = datetime.now()
|
|
28
|
+
logging.debug("[task-%s] Action 'run-%s' started for job '%s'", context.task_id, run_id, self.id)
|
|
29
|
+
|
|
30
|
+
output = await component.run(await context.render_variable(self.config.action), run_id, input)
|
|
25
31
|
context.register_source("output", output)
|
|
26
32
|
|
|
33
|
+
elapsed = (datetime.now() - started_at).total_seconds()
|
|
34
|
+
logging.debug("[task-%s] Action 'run-%s' completed in %.2f seconds.", context.task_id, run_id, 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
|
|
|
@@ -2,8 +2,9 @@ from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annot
|
|
|
2
2
|
from mindor.dsl.schema.job import DelayJobConfig, DelayJobMode
|
|
3
3
|
from mindor.dsl.schema.component import ComponentConfig
|
|
4
4
|
from mindor.core.utils.time import parse_duration, parse_datetime
|
|
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,15 @@ 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
|
+
started_at = datetime.now()
|
|
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
|
+
elapsed = (datetime.now() - started_at).total_seconds()
|
|
35
|
+
logging.debug("[task-%s] Delay completed in %.2f seconds.", context.task_id, elapsed)
|
|
36
|
+
|
|
30
37
|
return None
|
|
31
38
|
|
|
32
39
|
async def _delay_until_specific_time(self, context: WorkflowContext) -> Any:
|
|
@@ -34,9 +41,15 @@ class DelayJob(Job):
|
|
|
34
41
|
time = parse_datetime((await context.render_variable(self.config.time)) or datetime(2000, 1, 1, 0, 0, 0), timezone)
|
|
35
42
|
|
|
36
43
|
now = datetime.now(tz=time.tzinfo)
|
|
37
|
-
duration = (time - now).total_seconds()
|
|
44
|
+
duration = max((time - now).total_seconds(), 0.0)
|
|
45
|
+
|
|
46
|
+
started_at = datetime.now()
|
|
47
|
+
logging.debug("[task-%s] Delay started, waiting until %s", context.task_id, time)
|
|
38
48
|
|
|
39
49
|
if duration > 0.0:
|
|
40
50
|
await asyncio.sleep(duration)
|
|
41
51
|
|
|
52
|
+
elapsed = (datetime.now() - started_at).total_seconds()
|
|
53
|
+
logging.debug("[task-%s] Delay completed in %.2f seconds.", context.task_id, elapsed)
|
|
54
|
+
|
|
42
55
|
return None
|
|
@@ -5,6 +5,7 @@ from mindor.core.component import ComponentGlobalConfigs
|
|
|
5
5
|
from mindor.core.logger import logging
|
|
6
6
|
from .context import WorkflowContext
|
|
7
7
|
from .job import Job, create_job
|
|
8
|
+
from datetime import datetime
|
|
8
9
|
import asyncio
|
|
9
10
|
|
|
10
11
|
class JobGraphValidator:
|
|
@@ -87,7 +88,8 @@ class WorkflowRunner:
|
|
|
87
88
|
scheduled_job_tasks: Dict[str, asyncio.Task] = {}
|
|
88
89
|
output: Any = None
|
|
89
90
|
|
|
90
|
-
|
|
91
|
+
started_at = datetime.now()
|
|
92
|
+
logging.info("[task-%s] Workflow '%s' started.", context.task_id, self.id)
|
|
91
93
|
|
|
92
94
|
while pending_jobs:
|
|
93
95
|
runnable_jobs = [ job for job in pending_jobs.values() if self._can_run_job(job, running_job_ids, completed_job_ids) ]
|
|
@@ -109,7 +111,7 @@ class WorkflowRunner:
|
|
|
109
111
|
completed_job_output = await completed_job_task
|
|
110
112
|
context.complete_job(completed_job_id, completed_job_output)
|
|
111
113
|
|
|
112
|
-
logging.
|
|
114
|
+
logging.info("[task-%s] Job '%s' completed.", context.task_id, completed_job_id)
|
|
113
115
|
|
|
114
116
|
if self._is_terminal_job(completed_job_id):
|
|
115
117
|
if isinstance(output, dict) and isinstance(completed_job_output, dict):
|
|
@@ -122,7 +124,8 @@ class WorkflowRunner:
|
|
|
122
124
|
del pending_jobs[completed_job_id]
|
|
123
125
|
del scheduled_job_tasks[completed_job_id]
|
|
124
126
|
|
|
125
|
-
|
|
127
|
+
elapsed = (datetime.now() - started_at).total_seconds()
|
|
128
|
+
logging.info("[task-%s] Workflow '%s' completed in %.2f seconds.", context.task_id, self.id, elapsed)
|
|
126
129
|
|
|
127
130
|
return output
|
|
128
131
|
|
|
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.8}/src/mindor/core/component/services/http_client.py
RENAMED
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/component/services/http_server.py
RENAMED
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/core/component/services/mcp_client.py
RENAMED
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.8}/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.8}/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.8}/src/mindor/core/controller/services/http_server.py
RENAMED
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.8}/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
|
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.8}/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
|
|
File without changes
|
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/action/impl/http_client.py
RENAMED
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.8}/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.8}/src/mindor/dsl/schema/component/impl/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/component/impl/http_client.py
RENAMED
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/component/impl/http_server.py
RENAMED
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/component/impl/mcp_client.py
RENAMED
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.8}/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.8}/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.8}/src/mindor/dsl/schema/controller/impl/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.8}/src/mindor/dsl/schema/controller/impl/http_server.py
RENAMED
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.8}/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.8}/src/mindor/dsl/schema/gateway/impl/http_tunnel.py
RENAMED
|
File without changes
|
{model_compose-0.2.7 → model_compose-0.2.8}/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.8}/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
|