You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ariatosca.apache.org by mxmrlv <gi...@git.apache.org> on 2017/07/05 14:10:21 UTC

[GitHub] incubator-ariatosca pull request #176: wip

GitHub user mxmrlv opened a pull request:

    https://github.com/apache/incubator-ariatosca/pull/176

    wip

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/incubator-ariatosca ARIA-237-Support-for-resuming-failed-workflow-executions

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-ariatosca/pull/176.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #176
    
----
commit b7ad501cf57adbf4fb18b5cf35c3535cdef5efda
Author: max-orlov <ma...@gigaspaces.com>
Date:   2017-07-02T18:43:43Z

    wip

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #176: ARIA-237 Support for resuming failed ...

Posted by ran-z <gi...@git.apache.org>.
Github user ran-z commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/176#discussion_r126684158
  
    --- Diff: aria/orchestrator/workflow_runner.py ---
    @@ -38,7 +38,8 @@
     class WorkflowRunner(object):
     
         def __init__(self, model_storage, resource_storage, plugin_manager,
    -                 execution_id=None, service_id=None, workflow_name=None, inputs=None, executor=None,
    +                 execution_id=None, retry_failed=False,
    --- End diff --
    
    replace `retry_failed` with `retry_failed_tasks`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #176: ARIA-237 Support for resuming failed ...

Posted by ran-z <gi...@git.apache.org>.
Github user ran-z commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/176#discussion_r126684578
  
    --- Diff: tests/orchestrator/test_workflow_runner.py ---
    @@ -474,10 +483,62 @@ def test_resume_failed_task(self, workflow_context, thread_executor):
                 new_thread_executor.close()
     
             # Wait for it to finish and assert changes.
    +        node = workflow_context.model.node.refresh(node)
             assert node.attributes['invocations'].value == task.max_attempts - 1
             assert task.status == task.SUCCESS
             assert wf_runner.execution.status == wf_runner.execution.SUCCEEDED
     
    +    def test_resume_failed_task_and_successful_task(self, workflow_context, thread_executor):
    --- End diff --
    
    Add one more test which runs a workflow (`retry_failed` = `False`) where the first task fails, the second one depends on the first one, and on resume validate that the first task doesn't run again but the second one does and succeeds.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #176: ARIA-237 Support for resuming failed ...

Posted by ran-z <gi...@git.apache.org>.
Github user ran-z commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/176#discussion_r126684191
  
    --- Diff: aria/orchestrator/workflow_runner.py ---
    @@ -38,7 +38,8 @@
     class WorkflowRunner(object):
     
         def __init__(self, model_storage, resource_storage, plugin_manager,
    -                 execution_id=None, service_id=None, workflow_name=None, inputs=None, executor=None,
    +                 execution_id=None, retry_failed=False,
    --- End diff --
    
    expose `retry_failed` via CLI


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #176: ARIA-237 Support for resuming failed ...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-ariatosca/pull/176


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #176: ARIA-237 Support for resuming failed ...

Posted by mxmrlv <gi...@git.apache.org>.
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/176#discussion_r126731406
  
    --- Diff: tests/orchestrator/test_workflow_runner.py ---
    @@ -474,10 +483,62 @@ def test_resume_failed_task(self, workflow_context, thread_executor):
                 new_thread_executor.close()
     
             # Wait for it to finish and assert changes.
    +        node = workflow_context.model.node.refresh(node)
             assert node.attributes['invocations'].value == task.max_attempts - 1
             assert task.status == task.SUCCESS
             assert wf_runner.execution.status == wf_runner.execution.SUCCEEDED
     
    +    def test_resume_failed_task_and_successful_task(self, workflow_context, thread_executor):
    --- End diff --
    
    tests were added.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #176: ARIA-237 Support for resuming failed ...

Posted by ran-z <gi...@git.apache.org>.
Github user ran-z commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/176#discussion_r126684398
  
    --- Diff: tests/orchestrator/test_workflow_runner.py ---
    @@ -474,10 +483,62 @@ def test_resume_failed_task(self, workflow_context, thread_executor):
                 new_thread_executor.close()
     
             # Wait for it to finish and assert changes.
    +        node = workflow_context.model.node.refresh(node)
             assert node.attributes['invocations'].value == task.max_attempts - 1
             assert task.status == task.SUCCESS
             assert wf_runner.execution.status == wf_runner.execution.SUCCEEDED
     
    +    def test_resume_failed_task_and_successful_task(self, workflow_context, thread_executor):
    +        node = workflow_context.model.node.get_by_name(tests_mock.models.DEPENDENCY_NODE_NAME)
    +        node.attributes['invocations'] = models.Attribute.wrap('invocations', 0)
    +        self._create_interface(workflow_context, node, mock_failed_task)
    +
    +        wf_runner = self._create_initial_workflow_runner(
    +            workflow_context,
    +            mock_parallel_tasks_workflow,
    +            thread_executor,
    +            inputs={'retry_interval': 1, 'max_attempts': 1, 'number_of_tasks': 2}
    +        )
    +        wf_thread = Thread(target=wf_runner.execute)
    +        wf_thread.setDaemon(True)
    +        wf_thread.start()
    +
    +        if custom_events['execution_failed'].wait(60) is False:
    +            raise TimeoutError("Execution did not end")
    +
    +        tasks = workflow_context.model.task.list(filters={'_stub_type': None})
    +        node = workflow_context.model.node.refresh(node)
    +        assert node.attributes['invocations'].value == 2
    +
    +        # First task passes
    +        assert any(task.status == task.FAILED for task in tasks)
    +        # Second task fails
    +        assert any(task.status == task.SUCCESS for task in tasks)
    +        assert wf_runner.execution.status in wf_runner.execution.FAILED
    +
    +        custom_events['is_resumed'].set()
    +        new_thread_executor = thread.ThreadExecutor()
    +        try:
    +            new_wf_runner = WorkflowRunner(
    +                service_id=wf_runner.service.id,
    +                retry_failed=True,
    +                inputs={},
    +                model_storage=workflow_context.model,
    +                resource_storage=workflow_context.resource,
    +                plugin_manager=None,
    +                execution_id=wf_runner.execution.id,
    +                executor=new_thread_executor)
    +
    +            new_wf_runner.execute()
    +        finally:
    +            new_thread_executor.close()
    +
    +        # Wait for it to finish and assert changes.
    +        node = workflow_context.model.node.refresh(node)
    +        assert node.attributes['invocations'].value == 3
    --- End diff --
    
    Add an assert for validating the retry_count is reset back to 0 when using `retry_failed` = `True`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-ariatosca pull request #176: ARIA-237 Support for resuming failed ...

Posted by ran-z <gi...@git.apache.org>.
Github user ran-z commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/176#discussion_r126684007
  
    --- Diff: aria/orchestrator/workflows/core/engine.py ---
    @@ -68,8 +69,15 @@ def execute(self, ctx, resuming=False):
                 if cancel:
                     self._terminate_tasks(tasks_tracker.executing_tasks)
                     events.on_cancelled_workflow_signal.send(ctx)
    -            else:
    +            elif all(task.status == task.SUCCESS or task.ignore_failure
    --- End diff --
    
    Is this really necessary?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---