You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ariatosca.apache.org by mx...@apache.org on 2017/11/20 14:55:23 UTC

[1/2] incubator-ariatosca git commit: docs and tests fixes

Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-408-Remove-execution-creation-from-WorkflowRunner 4cf88f3fa -> 3dbe5b3cf


docs and tests fixes


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/9e844fc5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/9e844fc5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/9e844fc5

Branch: refs/heads/ARIA-408-Remove-execution-creation-from-WorkflowRunner
Commit: 9e844fc5e09845fb1798af8c0001ef20cb404c21
Parents: 4cf88f3
Author: max-orlov <ma...@gigaspaces.com>
Authored: Mon Nov 20 16:51:31 2017 +0200
Committer: max-orlov <ma...@gigaspaces.com>
Committed: Mon Nov 20 16:51:31 2017 +0200

----------------------------------------------------------------------
 aria/cli/commands/executions.py | 7 ++++---
 docs/aria.orchestrator.rst      | 4 ++--
 2 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9e844fc5/aria/cli/commands/executions.py
----------------------------------------------------------------------
diff --git a/aria/cli/commands/executions.py b/aria/cli/commands/executions.py
index 61328a1..f2e9145 100644
--- a/aria/cli/commands/executions.py
+++ b/aria/cli/commands/executions.py
@@ -29,6 +29,7 @@ from ...orchestrator import execution_compiler
 from ...modeling.models import Execution
 from ...orchestrator.workflows.core.engine import Engine
 from ...orchestrator.workflows.executor.dry import DryExecutor
+from ...orchestrator.workflows.executor.process import ProcessExecutor
 from ...utils import formatting
 from ...utils import threading
 
@@ -142,7 +143,7 @@ def start(workflow_name,
     WORKFLOW_NAME is the unique name of the workflow within the service (e.g. "uninstall").
     """
     service = model_storage.service.get_by_name(service_name)
-    executor = DryExecutor() if dry else None  # use WorkflowRunner's default executor
+    executor = DryExecutor() if dry else ProcessExecutor(plugin_manager=plugin_manager)
 
     compiler = execution_compiler.ExecutionCompiler(
         model_storage, 
@@ -183,7 +184,7 @@ def resume(execution_id,
 
     EXECUTION_ID is the unique ID of the execution.
     """
-    executor = DryExecutor() if dry else None  # use WorkflowRunner's default executor
+    executor = DryExecutor() if dry else ProcessExecutor(plugin_manager=plugin_manager)
 
     execution_to_resume = model_storage.execution.get(execution_id)
     if execution_to_resume.status != execution_to_resume.CANCELLED:
@@ -223,7 +224,7 @@ def _run_execution(
                                              ctx.execution.workflow_name)
     execution_thread = threading.ExceptionThread(target=engine.execute,
                                                  name=execution_thread_name,
-                                                 **engine_kwargs)
+                                                 kwargs=engine_kwargs)
 
     execution_thread.start()
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9e844fc5/docs/aria.orchestrator.rst
----------------------------------------------------------------------
diff --git a/docs/aria.orchestrator.rst b/docs/aria.orchestrator.rst
index 33454e6..8c1c938 100644
--- a/docs/aria.orchestrator.rst
+++ b/docs/aria.orchestrator.rst
@@ -40,7 +40,7 @@
 
 .. automodule:: aria.orchestrator.plugin
 
-:mod:`aria.orchestrator.workflow_runner`
+:mod:`aria.orchestrator.execution_compiler`
 ----------------------------------------
 
-.. automodule:: aria.orchestrator.workflow_runner
+.. automodule:: aria.orchestrator.execution_compiler


[2/2] incubator-ariatosca git commit: linting

Posted by mx...@apache.org.
linting


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/3dbe5b3c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/3dbe5b3c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/3dbe5b3c

Branch: refs/heads/ARIA-408-Remove-execution-creation-from-WorkflowRunner
Commit: 3dbe5b3cf5900bf9e2ce3d4656762ac8c882043f
Parents: 9e844fc
Author: max-orlov <ma...@gigaspaces.com>
Authored: Mon Nov 20 16:55:14 2017 +0200
Committer: max-orlov <ma...@gigaspaces.com>
Committed: Mon Nov 20 16:55:14 2017 +0200

----------------------------------------------------------------------
 aria/cli/commands/executions.py                              | 8 ++++----
 aria/orchestrator/execution_compiler.py                      | 8 ++++----
 tests/orchestrator/execution/test_execution_compiler.py      | 3 ++-
 .../workflows/core/test_task_graph_into_execution_graph.py   | 2 +-
 4 files changed, 11 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/3dbe5b3c/aria/cli/commands/executions.py
----------------------------------------------------------------------
diff --git a/aria/cli/commands/executions.py b/aria/cli/commands/executions.py
index f2e9145..be5dab9 100644
--- a/aria/cli/commands/executions.py
+++ b/aria/cli/commands/executions.py
@@ -146,10 +146,10 @@ def start(workflow_name,
     executor = DryExecutor() if dry else ProcessExecutor(plugin_manager=plugin_manager)
 
     compiler = execution_compiler.ExecutionCompiler(
-        model_storage, 
-        resource_storage, 
-        plugin_manager, 
-        service, 
+        model_storage,
+        resource_storage,
+        plugin_manager,
+        service,
         workflow_name
     )
     workflow_ctx = compiler.compile(inputs, executor=executor)

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/3dbe5b3c/aria/orchestrator/execution_compiler.py
----------------------------------------------------------------------
diff --git a/aria/orchestrator/execution_compiler.py b/aria/orchestrator/execution_compiler.py
index 01e35c1..f86e6b3 100644
--- a/aria/orchestrator/execution_compiler.py
+++ b/aria/orchestrator/execution_compiler.py
@@ -92,9 +92,9 @@ class ExecutionCompiler(object):
 
         if len(self._execution.tasks) == 0:
             workflow_fn = self._get_workflow_fn(self._execution.workflow_name)
-            self._tasks_graph = workflow_fn(ctx=self.workflow_ctx, **execution_inputs_dict)
+            tasks_graph = workflow_fn(ctx=self.workflow_ctx, **execution_inputs_dict)
             compiler = graph_compiler.GraphCompiler(self.workflow_ctx, executor.__class__)
-            compiler.compile(self._tasks_graph)
+            compiler.compile(tasks_graph)
 
     def _create_execution_model(self, inputs=None):
         self._validate_workflow_exists_for_service()
@@ -126,14 +126,14 @@ class ExecutionCompiler(object):
         if active_executions:
             raise exceptions.ActiveExecutionsError(
                 "Can't start execution; Service {0} has an active execution with ID {1}"
-                    .format(self._service.name, active_executions[0].id))
+                .format(self._service.name, active_executions[0].id))
 
     def _validate_workflow_exists_for_service(self):
         if self._workflow_name not in self._service.workflows and \
                         self._workflow_name not in builtin.BUILTIN_WORKFLOWS:
             raise exceptions.UndeclaredWorkflowError(
                 'No workflow policy {0} declared in service {1}'
-                    .format(self._workflow_name, self._service.name))
+                .format(self._workflow_name, self._service.name))
 
     def _get_workflow_fn(self, workflow_name):
         if workflow_name in builtin.BUILTIN_WORKFLOWS:

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/3dbe5b3c/tests/orchestrator/execution/test_execution_compiler.py
----------------------------------------------------------------------
diff --git a/tests/orchestrator/execution/test_execution_compiler.py b/tests/orchestrator/execution/test_execution_compiler.py
index 14332db..6062686 100644
--- a/tests/orchestrator/execution/test_execution_compiler.py
+++ b/tests/orchestrator/execution/test_execution_compiler.py
@@ -91,7 +91,8 @@ def test_custom_workflow_instantiation(request):
     # (expecting no errors to be raised on undeclared workflow or missing workflow implementation)
     mock_workflow = _setup_mock_workflow_in_service(request)
     workflow_ctx = _get_compiler(request, mock_workflow).compile()
-    assert len(workflow_ctx.execution.tasks) == 2  # mock workflow creates only start workflow and end workflow task
+    assert len(workflow_ctx.execution.tasks) == 2   # mock workflow creates only start workflow
+                                                    # and end workflow task
 
 
 def test_existing_active_executions(request, service, model):

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/3dbe5b3c/tests/orchestrator/workflows/core/test_task_graph_into_execution_graph.py
----------------------------------------------------------------------
diff --git a/tests/orchestrator/workflows/core/test_task_graph_into_execution_graph.py b/tests/orchestrator/workflows/core/test_task_graph_into_execution_graph.py
index 7f2b7c6..9f072f6 100644
--- a/tests/orchestrator/workflows/core/test_task_graph_into_execution_graph.py
+++ b/tests/orchestrator/workflows/core/test_task_graph_into_execution_graph.py
@@ -99,7 +99,7 @@ def test_task_graph_into_execution_graph(tmpdir):
         '{0}-End'.format(test_task_graph.id)
     ]
 
-    # assert expected_tasks_names == [compiler._model_to_api_id[t.id] for t in execution_tasks]
+    assert expected_tasks_names == [compiler._model_to_api_id[t.id] for t in execution_tasks]
     assert all(isinstance(task, models.Task) for task in execution_tasks)
     execution_tasks = iter(execution_tasks)