incubator-ariatosca git commit: moved things around [Forced Update!]
Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-278-Remove-core-tasks e3977fd5d -> ee0ff3ac6 (forced update) moved things around Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/ee0ff3ac Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/ee0ff3ac Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/ee0ff3ac Branch: refs/heads/ARIA-278-Remove-core-tasks Commit: ee0ff3ac6053e26f3569a5295ec60db91e9f76a0 Parents: b314f38 Author: max-orlovAuthored: Sun Jun 18 17:25:25 2017 +0300 Committer: max-orlov Committed: Sun Jun 18 17:30:19 2017 +0300 -- aria/orchestrator/workflow_runner.py| 97 +-- aria/orchestrator/workflows/core/engine.py | 99 +++- tests/orchestrator/context/__init__.py | 2 +- tests/orchestrator/context/test_serialize.py| 4 +- .../orchestrator/execution_plugin/test_local.py | 4 +- tests/orchestrator/execution_plugin/test_ssh.py | 4 +- tests/orchestrator/test_workflow_runner.py | 21 +++-- .../orchestrator/workflows/core/test_engine.py | 5 +- .../orchestrator/workflows/core/test_events.py | 5 +- .../test_task_graph_into_execution_graph.py | 10 +- .../executor/test_process_executor_extension.py | 4 +- .../test_process_executor_tracked_changes.py| 4 +- 12 files changed, 128 insertions(+), 131 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/ee0ff3ac/aria/orchestrator/workflow_runner.py -- diff --git a/aria/orchestrator/workflow_runner.py b/aria/orchestrator/workflow_runner.py index c4d8666..c30ec4b 100644 --- a/aria/orchestrator/workflow_runner.py +++ b/aria/orchestrator/workflow_runner.py @@ -24,10 +24,8 @@ from datetime import datetime from . import exceptions from .context.workflow import WorkflowContext from .workflows import builtin -from .workflows.core.engine import Engine +from .workflows.core import engine from .workflows.executor.process import ProcessExecutor -from .workflows.executor.base import StubTaskExecutor -from .workflows.api import task as api_task from ..modeling import models from ..modeling import utils as modeling_utils from ..utils.imports import import_fullname @@ -89,12 +87,12 @@ class WorkflowRunner(object): execution_inputs_dict = dict(inp.unwrapped for inp in self.execution.inputs.values()) self._tasks_graph = workflow_fn(ctx=self._workflow_context, **execution_inputs_dict) -construct_execution_tasks(self.execution, self._tasks_graph, executor.__class__) +engine.construct_execution_tasks(self.execution, self._tasks_graph, executor.__class__) # Update the state self._model_storage.execution.update(execution) -self._engine = Engine(executor=executor) +self._engine = engine.Engine(default_executor=executor) @property def execution_id(self): @@ -172,92 +170,3 @@ class WorkflowRunner(object): self._workflow_name, workflow.function)) return workflow_fn - - -def construct_execution_tasks(execution, - task_graph, - default_executor, - stub_executor=StubTaskExecutor, - start_stub_type=models.Task.START_WORKFLOW, - end_stub_type=models.Task.END_WORKFLOW, - depends_on=()): -""" -Translates the user graph to the execution graph -:param task_graph: The user's graph -:param start_stub_type: internal use -:param end_stub_type: internal use -:param depends_on: internal use -""" -depends_on = list(depends_on) - -# Insert start marker -start_task = models.Task(api_id=_start_graph_suffix(task_graph.id), - _executor=stub_executor, - execution=execution, - stub_type=start_stub_type, - dependencies=depends_on) - -for task in task_graph.topological_order(reverse=True): -operation_dependencies = _get_tasks_from_dependencies( -execution, task_graph.get_dependencies(task), [start_task]) - -if isinstance(task, api_task.OperationTask): -models.Task.from_api_task(api_task=task, - executor=default_executor, - dependencies=operation_dependencies) - -elif isinstance(task, api_task.WorkflowTask): -# Build the graph recursively while adding start and end markers -
incubator-ariatosca git commit: moved things around
Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-278-Remove-core-tasks b314f388b -> e3977fd5d moved things around Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/e3977fd5 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/e3977fd5 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/e3977fd5 Branch: refs/heads/ARIA-278-Remove-core-tasks Commit: e3977fd5d8eae5e5dd9af1d3faa72560dc979f0e Parents: b314f38 Author: max-orlovAuthored: Sun Jun 18 17:25:25 2017 +0300 Committer: max-orlov Committed: Sun Jun 18 17:25:25 2017 +0300 -- aria/orchestrator/workflow_runner.py| 97 +-- aria/orchestrator/workflows/core/engine.py | 99 +++- tests/orchestrator/context/__init__.py | 2 +- tests/orchestrator/context/test_serialize.py| 4 +- .../orchestrator/execution_plugin/test_local.py | 4 +- tests/orchestrator/execution_plugin/test_ssh.py | 4 +- tests/orchestrator/test_workflow_runner.py | 18 ++-- .../orchestrator/workflows/core/test_engine.py | 5 +- .../orchestrator/workflows/core/test_events.py | 5 +- .../test_task_graph_into_execution_graph.py | 10 +- .../executor/test_process_executor_extension.py | 4 +- .../test_process_executor_tracked_changes.py| 4 +- 12 files changed, 126 insertions(+), 130 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/e3977fd5/aria/orchestrator/workflow_runner.py -- diff --git a/aria/orchestrator/workflow_runner.py b/aria/orchestrator/workflow_runner.py index c4d8666..c30ec4b 100644 --- a/aria/orchestrator/workflow_runner.py +++ b/aria/orchestrator/workflow_runner.py @@ -24,10 +24,8 @@ from datetime import datetime from . import exceptions from .context.workflow import WorkflowContext from .workflows import builtin -from .workflows.core.engine import Engine +from .workflows.core import engine from .workflows.executor.process import ProcessExecutor -from .workflows.executor.base import StubTaskExecutor -from .workflows.api import task as api_task from ..modeling import models from ..modeling import utils as modeling_utils from ..utils.imports import import_fullname @@ -89,12 +87,12 @@ class WorkflowRunner(object): execution_inputs_dict = dict(inp.unwrapped for inp in self.execution.inputs.values()) self._tasks_graph = workflow_fn(ctx=self._workflow_context, **execution_inputs_dict) -construct_execution_tasks(self.execution, self._tasks_graph, executor.__class__) +engine.construct_execution_tasks(self.execution, self._tasks_graph, executor.__class__) # Update the state self._model_storage.execution.update(execution) -self._engine = Engine(executor=executor) +self._engine = engine.Engine(default_executor=executor) @property def execution_id(self): @@ -172,92 +170,3 @@ class WorkflowRunner(object): self._workflow_name, workflow.function)) return workflow_fn - - -def construct_execution_tasks(execution, - task_graph, - default_executor, - stub_executor=StubTaskExecutor, - start_stub_type=models.Task.START_WORKFLOW, - end_stub_type=models.Task.END_WORKFLOW, - depends_on=()): -""" -Translates the user graph to the execution graph -:param task_graph: The user's graph -:param start_stub_type: internal use -:param end_stub_type: internal use -:param depends_on: internal use -""" -depends_on = list(depends_on) - -# Insert start marker -start_task = models.Task(api_id=_start_graph_suffix(task_graph.id), - _executor=stub_executor, - execution=execution, - stub_type=start_stub_type, - dependencies=depends_on) - -for task in task_graph.topological_order(reverse=True): -operation_dependencies = _get_tasks_from_dependencies( -execution, task_graph.get_dependencies(task), [start_task]) - -if isinstance(task, api_task.OperationTask): -models.Task.from_api_task(api_task=task, - executor=default_executor, - dependencies=operation_dependencies) - -elif isinstance(task, api_task.WorkflowTask): -# Build the graph recursively while adding start and end markers -construct_execution_tasks( -