[GitHub] incubator-ariatosca pull request #165: Aria 291 aria cli ascii art

2017-06-25 Thread asfgit
Github user asfgit closed the pull request at:

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


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[incubator-ariatosca] Git Push Summary

2017-06-25 Thread ran
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-291-aria-cli-ascii-art [deleted] 807db3086


incubator-ariatosca git commit: ARIA-291 Add ASCII art in ARIA CLI version command

2017-06-25 Thread ran
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/master 668ddcb75 -> 807db3086


ARIA-291 Add ASCII art in ARIA CLI version command


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

Branch: refs/heads/master
Commit: 807db3086671959ef12fe539c3215fbbaa0286f8
Parents: 668ddcb
Author: Ran Ziv 
Authored: Sun Jun 25 17:04:43 2017 +0300
Committer: Ran Ziv 
Committed: Sun Jun 25 17:32:45 2017 +0300

--
 aria/cli/ascii_art.py | 24 
 aria/cli/core/aria.py |  4 ++--
 2 files changed, 26 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/807db308/aria/cli/ascii_art.py
--
diff --git a/aria/cli/ascii_art.py b/aria/cli/ascii_art.py
new file mode 100644
index 000..8a8b79f
--- /dev/null
+++ b/aria/cli/ascii_art.py
@@ -0,0 +1,24 @@
+# -*- coding: utf8 -*-
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+ARIA_ASCII_ART = r"""
+ █████╗ ██████╗ ██╗ █████╗ 
+
██╔══██╗██╔══██╗██║██╔══██╗
+
███████║██████╔╝██║███████║
+
██╔══██║██╔══██╗██║██╔══██║
+██║  ██║██║  ██║██║██║  ██║
+╚═╝  ╚═╝╚═╝  ╚═╝╚═╝╚═╝  ╚═╝"""

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/807db308/aria/cli/core/aria.py
--
diff --git a/aria/cli/core/aria.py b/aria/cli/core/aria.py
index 331caca..e5b3eb2 100644
--- a/aria/cli/core/aria.py
+++ b/aria/cli/core/aria.py
@@ -28,9 +28,9 @@ from ..env import (
 )
 from .. import defaults
 from .. import helptexts
+from ..ascii_art import ARIA_ASCII_ART
 from ..inputs import inputs_to_dict
 from ... import __version__
-from ... import aria_package_name
 from ...utils.exceptions import get_exception_as_string
 
 
@@ -97,7 +97,7 @@ def show_version(ctx, param, value):
 if not value:
 return
 
-logger.info('{0} {1}'.format(aria_package_name, __version__))
+logger.info('{0} v{1}'.format(ARIA_ASCII_ART, __version__))
 ctx.exit()
 
 



[incubator-ariatosca] Git Push Summary

2017-06-25 Thread ran
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-280-change-package-name [deleted] 668ddcb75


incubator-ariatosca git commit: ARIA-291 Add ASCII art in ARIA CLI version command [Forced Update!]

2017-06-25 Thread ran
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-291-aria-cli-ascii-art 2e92d3757 -> 807db3086 (forced update)


ARIA-291 Add ASCII art in ARIA CLI version command


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

Branch: refs/heads/ARIA-291-aria-cli-ascii-art
Commit: 807db3086671959ef12fe539c3215fbbaa0286f8
Parents: 668ddcb
Author: Ran Ziv 
Authored: Sun Jun 25 17:04:43 2017 +0300
Committer: Ran Ziv 
Committed: Sun Jun 25 17:32:45 2017 +0300

--
 aria/cli/ascii_art.py | 24 
 aria/cli/core/aria.py |  4 ++--
 2 files changed, 26 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/807db308/aria/cli/ascii_art.py
--
diff --git a/aria/cli/ascii_art.py b/aria/cli/ascii_art.py
new file mode 100644
index 000..8a8b79f
--- /dev/null
+++ b/aria/cli/ascii_art.py
@@ -0,0 +1,24 @@
+# -*- coding: utf8 -*-
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+ARIA_ASCII_ART = r"""
+ █████╗ ██████╗ ██╗ █████╗ 
+
██╔══██╗██╔══██╗██║██╔══██╗
+
███████║██████╔╝██║███████║
+
██╔══██║██╔══██╗██║██╔══██║
+██║  ██║██║  ██║██║██║  ██║
+╚═╝  ╚═╝╚═╝  ╚═╝╚═╝╚═╝  ╚═╝"""

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/807db308/aria/cli/core/aria.py
--
diff --git a/aria/cli/core/aria.py b/aria/cli/core/aria.py
index 331caca..e5b3eb2 100644
--- a/aria/cli/core/aria.py
+++ b/aria/cli/core/aria.py
@@ -28,9 +28,9 @@ from ..env import (
 )
 from .. import defaults
 from .. import helptexts
+from ..ascii_art import ARIA_ASCII_ART
 from ..inputs import inputs_to_dict
 from ... import __version__
-from ... import aria_package_name
 from ...utils.exceptions import get_exception_as_string
 
 
@@ -97,7 +97,7 @@ def show_version(ctx, param, value):
 if not value:
 return
 
-logger.info('{0} {1}'.format(aria_package_name, __version__))
+logger.info('{0} v{1}'.format(ARIA_ASCII_ART, __version__))
 ctx.exit()
 
 



[GitHub] incubator-ariatosca pull request #162: ARIA-280 Change package name

2017-06-25 Thread asfgit
Github user asfgit closed the pull request at:

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


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


incubator-ariatosca git commit: ARIA-280 Change package name

2017-06-25 Thread ran
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/master 51d0542c3 -> 668ddcb75


ARIA-280 Change package name

Changed package name from 'aria' to 'apache-ariatosca',
in accordance with Apache's standards.
The CLI '--version' command will now also show the correct
package name.

Additionally, fixed the download_url field in setup.py -
it now includes an '-incubating' suffix.


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

Branch: refs/heads/master
Commit: 668ddcb75a164ef8c119dff102a560e3f59daa7f
Parents: 51d0542
Author: Ran Ziv 
Authored: Thu Jun 22 15:39:28 2017 +0300
Committer: Ran Ziv 
Committed: Sun Jun 25 17:01:10 2017 +0300

--
 README.rst|  4 ++--
 aria/__init__.py  |  7 ---
 aria/cli/core/aria.py | 25 ++---
 setup.py  |  7 ---
 4 files changed, 12 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/668ddcb7/README.rst
--
diff --git a/README.rst b/README.rst
index dc53d47..d4740cd 100644
--- a/README.rst
+++ b/README.rst
@@ -36,10 +36,10 @@ To install ARIA directly from PyPI (using a ``wheel``), 
use::
 pip install apache-ariatosca
 
 To install ARIA from source, download the source tarball from
-`PyPI `__, extract it, and run::
+`PyPI `__, extract and ``cd`` 
into the extract dir, and run::
 
 pip install --upgrade pip setuptools
-pip install incubator-ariatosca
+pip install .
 
 | The source package comes along with relevant examples, documentation, 
``requirements.txt`` (for installing specifically the frozen dependencies' 
versions with which ARIA was tested) and more.
 |

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/668ddcb7/aria/__init__.py
--
diff --git a/aria/__init__.py b/aria/__init__.py
index 34db3a8..bed1dc6 100644
--- a/aria/__init__.py
+++ b/aria/__init__.py
@@ -20,10 +20,11 @@ ARIA top level package
 import sys
 
 import pkg_resources
-__version__ = pkg_resources.get_distribution('aria').version
+aria_package_name = 'apache-ariatosca'
+__version__ = pkg_resources.get_distribution(aria_package_name).version
 
-from .orchestrator.decorators import workflow, operation
-from . import (
+from .orchestrator.decorators import workflow, operation  # pylint: 
disable=wrong-import-position
+from . import (  # pylint: disable=wrong-import-position
 extension,
 utils,
 parser,

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/668ddcb7/aria/cli/core/aria.py
--
diff --git a/aria/cli/core/aria.py b/aria/cli/core/aria.py
index 56fe2f7..331caca 100644
--- a/aria/cli/core/aria.py
+++ b/aria/cli/core/aria.py
@@ -13,11 +13,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
 import os
 import sys
 import difflib
-import StringIO
 import traceback
 import inspect
 from functools import wraps
@@ -32,6 +30,7 @@ from .. import defaults
 from .. import helptexts
 from ..inputs import inputs_to_dict
 from ... import __version__
+from ... import aria_package_name
 from ...utils.exceptions import get_exception_as_string
 
 
@@ -94,31 +93,11 @@ def mutually_exclusive_option(*param_decls, **attrs):
 return decorator
 
 
-def _format_version_data(version,
- prefix=None,
- suffix=None,
- infix=None):
-all_data = dict(version=version)
-all_data['prefix'] = prefix or ''
-all_data['suffix'] = suffix or ''
-all_data['infix'] = infix or ''
-output = StringIO.StringIO()
-output.write('{prefix}{version}'.format(**all_data))
-output.write('{suffix}'.format(**all_data))
-return output.getvalue()
-
-
 def show_version(ctx, param, value):
 if not value:
 return
 
-cli_version = _format_version_data(
-__version__,
-prefix='ARIA CLI ',
-infix=' ' * 5,
-suffix='')
-
-logger.info(cli_version)
+logger.info('{0} {1}'.format(aria_package_name, __version__))
 ctx.exit()
 
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/668ddcb7/setup.py
--
diff --git a/setup.py b/setup.py
index d2a914c..340cce2 100644
--- 

incubator-ariatosca git commit: terminating by task_id [Forced Update!]

2017-06-25 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-285-Cancel-execution-may-leave-running-processes 9ff17e744 -> 
9d2059982 (forced update)


terminating by task_id


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

Branch: refs/heads/ARIA-285-Cancel-execution-may-leave-running-processes
Commit: 9d20599829e2c57063f578be97cc81366a049941
Parents: 27ede8b
Author: max-orlov 
Authored: Sun Jun 25 17:04:09 2017 +0300
Committer: max-orlov 
Committed: Sun Jun 25 17:29:24 2017 +0300

--
 aria/orchestrator/workflows/core/engine.py | 2 +-
 aria/orchestrator/workflows/executor/process.py| 5 ++---
 tests/orchestrator/workflows/executor/test_process_executor.py | 2 +-
 3 files changed, 4 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9d205998/aria/orchestrator/workflows/core/engine.py
--
diff --git a/aria/orchestrator/workflows/core/engine.py 
b/aria/orchestrator/workflows/core/engine.py
index 373abb8..5d6fcd7 100644
--- a/aria/orchestrator/workflows/core/engine.py
+++ b/aria/orchestrator/workflows/core/engine.py
@@ -80,7 +80,7 @@ class Engine(logger.LoggerMixin):
 
 def _terminate_tasks(self, tasks):
 for task in tasks:
-self._executors[task._executor].terminate(task)
+self._executors[task._executor].terminate(task.id)
 
 @staticmethod
 def cancel_execution(ctx):

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9d205998/aria/orchestrator/workflows/executor/process.py
--
diff --git a/aria/orchestrator/workflows/executor/process.py 
b/aria/orchestrator/workflows/executor/process.py
index 56241f6..0600b6a 100644
--- a/aria/orchestrator/workflows/executor/process.py
+++ b/aria/orchestrator/workflows/executor/process.py
@@ -120,9 +120,8 @@ class ProcessExecutor(base.BaseExecutor):
 self._server_socket.close()
 self._listener_thread.join(timeout=60)
 
-def terminate(self, task):
-# We need to retrieve the wrapped task (which includes the proc and 
the ctx)
-task = self._tasks.get(task.id)
+def terminate(self, task_id):
+task = self._tasks.get(task_id)
 # The process might have managed to finished so it would not be in the 
tasks list
 if task and os.getsid(os.getpid()) != os.getpgid(task.proc.pid):
 # If the above condition is false, the process group leader is the 
group leader

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9d205998/tests/orchestrator/workflows/executor/test_process_executor.py
--
diff --git a/tests/orchestrator/workflows/executor/test_process_executor.py 
b/tests/orchestrator/workflows/executor/test_process_executor.py
index 2303fa9..963b7a8 100644
--- a/tests/orchestrator/workflows/executor/test_process_executor.py
+++ b/tests/orchestrator/workflows/executor/test_process_executor.py
@@ -93,7 +93,7 @@ class TestProcessExecutor(object):
 time.sleep(1)
 pids = [executor._tasks[ctx.task.id].proc.pid, 
fs_test_holder['subproc']]
 assert any(p.pid == pid for p in psutil.process_iter() for pid in pids)
-executor.terminate(ctx)
+executor.terminate(ctx.task.id)
 assert not any(p.pid == pid and p.status() != psutil.STATUS_ZOMBIE
for p in psutil.process_iter()
for pid in pids)



incubator-ariatosca git commit: ARIA-291 Add ASCII art in ARIA CLI version command [Forced Update!]

2017-06-25 Thread ran
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-291-aria-cli-ascii-art 41910be5f -> 2e92d3757 (forced update)


ARIA-291 Add ASCII art in ARIA CLI version command


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

Branch: refs/heads/ARIA-291-aria-cli-ascii-art
Commit: 2e92d37575c22988b0d0c317e7cd19c348c9ac4f
Parents: 668ddcb
Author: Ran Ziv 
Authored: Sun Jun 25 17:04:43 2017 +0300
Committer: Ran Ziv 
Committed: Sun Jun 25 17:17:53 2017 +0300

--
 aria/cli/ascii_art.py | 26 ++
 aria/cli/core/aria.py |  3 ++-
 2 files changed, 28 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/2e92d375/aria/cli/ascii_art.py
--
diff --git a/aria/cli/ascii_art.py b/aria/cli/ascii_art.py
new file mode 100644
index 000..a590595
--- /dev/null
+++ b/aria/cli/ascii_art.py
@@ -0,0 +1,26 @@
+# -*- coding: utf8 -*-
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+ARIA_ASCII_ART = r"""
+ █████╗ ██████╗ ██╗ █████╗ 
+
██╔══██╗██╔══██╗██║██╔══██╗
+
███████║██████╔╝██║███████║
+
██╔══██║██╔══██╗██║██╔══██║
+██║  ██║██║  ██║██║██║  ██║
+╚═╝  ╚═╝╚═╝  ╚═╝╚═╝╚═╝  ╚═╝
+
+"""

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/2e92d375/aria/cli/core/aria.py
--
diff --git a/aria/cli/core/aria.py b/aria/cli/core/aria.py
index 331caca..b64425b 100644
--- a/aria/cli/core/aria.py
+++ b/aria/cli/core/aria.py
@@ -28,6 +28,7 @@ from ..env import (
 )
 from .. import defaults
 from .. import helptexts
+from ..ascii_art import ARIA_ASCII_ART
 from ..inputs import inputs_to_dict
 from ... import __version__
 from ... import aria_package_name
@@ -97,7 +98,7 @@ def show_version(ctx, param, value):
 if not value:
 return
 
-logger.info('{0} {1}'.format(aria_package_name, __version__))
+logger.info('{0}{1} {2}'.format(ARIA_ASCII_ART, aria_package_name, 
__version__))
 ctx.exit()
 
 



[GitHub] incubator-ariatosca pull request #165: Aria 291 aria cli ascii art

2017-06-25 Thread ran-z
GitHub user ran-z opened a pull request:

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

Aria 291 aria cli ascii art



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

$ git pull https://github.com/apache/incubator-ariatosca 
ARIA-291-aria-cli-ascii-art

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

https://github.com/apache/incubator-ariatosca/pull/165.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 #165


commit 668ddcb75a164ef8c119dff102a560e3f59daa7f
Author: Ran Ziv 
Date:   2017-06-22T12:39:28Z

ARIA-280 Change package name

Changed package name from 'aria' to 'apache-ariatosca',
in accordance with Apache's standards.
The CLI '--version' command will now also show the correct
package name.

Additionally, fixed the download_url field in setup.py -
it now includes an '-incubating' suffix.

commit 41910be5fcaec4fb5d1af28be56bc4ee82f512ab
Author: Ran Ziv 
Date:   2017-06-25T14:04:43Z

ARIA-291 Add ASCII art in ARIA CLI version command




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-ariatosca issue #165: Aria 291 aria cli ascii art

2017-06-25 Thread asfgit
Github user asfgit commented on the issue:

https://github.com/apache/incubator-ariatosca/pull/165
  
Can one of the admins verify this patch?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


incubator-ariatosca git commit: ARIA-291 Add ASCII art in ARIA CLI version command

2017-06-25 Thread ran
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-291-aria-cli-ascii-art [created] 41910be5f


ARIA-291 Add ASCII art in ARIA CLI version command


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

Branch: refs/heads/ARIA-291-aria-cli-ascii-art
Commit: 41910be5fcaec4fb5d1af28be56bc4ee82f512ab
Parents: 668ddcb
Author: Ran Ziv 
Authored: Sun Jun 25 17:04:43 2017 +0300
Committer: Ran Ziv 
Committed: Sun Jun 25 17:04:43 2017 +0300

--
 aria/cli/ascii_art.py | 26 ++
 aria/cli/core/aria.py |  3 ++-
 2 files changed, 28 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/41910be5/aria/cli/ascii_art.py
--
diff --git a/aria/cli/ascii_art.py b/aria/cli/ascii_art.py
new file mode 100644
index 000..f1c7b4a
--- /dev/null
+++ b/aria/cli/ascii_art.py
@@ -0,0 +1,26 @@
+# -*- coding: utf8 -*-
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+ARIA_ASCII_ART = r"""
+ █████╗ ██████╗ ██╗ █████╗ 
+
██╔══██╗██╔══██╗██║██╔══██╗
+
███████║██████╔╝██║███████║
+
██╔══██║██╔══██╗██║██╔══██║
+██║  ██║██║  ██║██║██║  ██║
+╚═╝  ╚═╝╚═╝  ╚═╝╚═╝╚═╝  ╚═╝
+
+"""
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/41910be5/aria/cli/core/aria.py
--
diff --git a/aria/cli/core/aria.py b/aria/cli/core/aria.py
index 331caca..b64425b 100644
--- a/aria/cli/core/aria.py
+++ b/aria/cli/core/aria.py
@@ -28,6 +28,7 @@ from ..env import (
 )
 from .. import defaults
 from .. import helptexts
+from ..ascii_art import ARIA_ASCII_ART
 from ..inputs import inputs_to_dict
 from ... import __version__
 from ... import aria_package_name
@@ -97,7 +98,7 @@ def show_version(ctx, param, value):
 if not value:
 return
 
-logger.info('{0} {1}'.format(aria_package_name, __version__))
+logger.info('{0}{1} {2}'.format(ARIA_ASCII_ART, aria_package_name, 
__version__))
 ctx.exit()
 
 



incubator-ariatosca git commit: terminating by task_id

2017-06-25 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-285-Cancel-execution-may-leave-running-processes 27ede8b13 -> 
9ff17e744


terminating by task_id


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

Branch: refs/heads/ARIA-285-Cancel-execution-may-leave-running-processes
Commit: 9ff17e7443c3c384d6afccad881eecd95b95561c
Parents: 27ede8b
Author: max-orlov 
Authored: Sun Jun 25 17:04:09 2017 +0300
Committer: max-orlov 
Committed: Sun Jun 25 17:04:09 2017 +0300

--
 aria/orchestrator/workflows/core/engine.py  | 2 +-
 aria/orchestrator/workflows/executor/process.py | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9ff17e74/aria/orchestrator/workflows/core/engine.py
--
diff --git a/aria/orchestrator/workflows/core/engine.py 
b/aria/orchestrator/workflows/core/engine.py
index 373abb8..5d6fcd7 100644
--- a/aria/orchestrator/workflows/core/engine.py
+++ b/aria/orchestrator/workflows/core/engine.py
@@ -80,7 +80,7 @@ class Engine(logger.LoggerMixin):
 
 def _terminate_tasks(self, tasks):
 for task in tasks:
-self._executors[task._executor].terminate(task)
+self._executors[task._executor].terminate(task.id)
 
 @staticmethod
 def cancel_execution(ctx):

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9ff17e74/aria/orchestrator/workflows/executor/process.py
--
diff --git a/aria/orchestrator/workflows/executor/process.py 
b/aria/orchestrator/workflows/executor/process.py
index 56241f6..0600b6a 100644
--- a/aria/orchestrator/workflows/executor/process.py
+++ b/aria/orchestrator/workflows/executor/process.py
@@ -120,9 +120,8 @@ class ProcessExecutor(base.BaseExecutor):
 self._server_socket.close()
 self._listener_thread.join(timeout=60)
 
-def terminate(self, task):
-# We need to retrieve the wrapped task (which includes the proc and 
the ctx)
-task = self._tasks.get(task.id)
+def terminate(self, task_id):
+task = self._tasks.get(task_id)
 # The process might have managed to finished so it would not be in the 
tasks list
 if task and os.getsid(os.getpid()) != os.getpgid(task.proc.pid):
 # If the above condition is false, the process group leader is the 
group leader



[1/3] incubator-ariatosca git commit: ARIA-284 Cleanup and optimize the task execution [Forced Update!]

2017-06-25 Thread ran
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-280-change-package-name fa3869826 -> 668ddcb75 (forced update)


ARIA-284 Cleanup and optimize the task execution


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

Branch: refs/heads/ARIA-280-change-package-name
Commit: a75a3dea06741b73b9949e920e28877633a8bc28
Parents: 75112ab
Author: max-orlov 
Authored: Wed Jun 21 12:41:33 2017 +0300
Committer: max-orlov 
Committed: Sun Jun 25 14:33:23 2017 +0300

--
 aria/modeling/orchestration.py  |   2 -
 aria/orchestrator/context/workflow.py   |  19 ---
 aria/orchestrator/workflow_runner.py|   7 +-
 aria/orchestrator/workflows/core/compile.py | 116 --
 aria/orchestrator/workflows/core/engine.py  | 110 ++---
 .../workflows/core/graph_compiler.py| 120 +++
 tests/orchestrator/context/__init__.py  |   4 +-
 tests/orchestrator/context/test_serialize.py|   4 +-
 .../orchestrator/execution_plugin/test_local.py |   4 +-
 tests/orchestrator/execution_plugin/test_ssh.py |   6 +-
 tests/orchestrator/test_workflow_runner.py  |   4 +-
 .../orchestrator/workflows/core/test_engine.py  |   4 +-
 .../orchestrator/workflows/core/test_events.py  |   9 +-
 .../test_task_graph_into_execution_graph.py |  21 +++-
 .../executor/test_process_executor_extension.py |   4 +-
 .../test_process_executor_tracked_changes.py|   4 +-
 16 files changed, 229 insertions(+), 209 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/a75a3dea/aria/modeling/orchestration.py
--
diff --git a/aria/modeling/orchestration.py b/aria/modeling/orchestration.py
index 276b68e..5b02d1b 100644
--- a/aria/modeling/orchestration.py
+++ b/aria/modeling/orchestration.py
@@ -306,7 +306,6 @@ class TaskBase(mixins.ModelMixin):
 ended_at = Column(DateTime, default=None)
 attempts_count = Column(Integer, default=1)
 
-_api_id = Column(String)
 _executor = Column(PickleType)
 _context_cls = Column(PickleType)
 _stub_type = Column(Enum(*STUB_TYPES))
@@ -442,7 +441,6 @@ class TaskBase(mixins.ModelMixin):
 'plugin': api_task.plugin,
 'function': api_task.function,
 'arguments': api_task.arguments,
-'_api_id': api_task.id,
 '_context_cls': api_task._context_cls,
 '_executor': executor,
 }

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/a75a3dea/aria/orchestrator/context/workflow.py
--
diff --git a/aria/orchestrator/context/workflow.py 
b/aria/orchestrator/context/workflow.py
index adcd635..18334f3 100644
--- a/aria/orchestrator/context/workflow.py
+++ b/aria/orchestrator/context/workflow.py
@@ -20,8 +20,6 @@ Workflow and operation contexts
 import threading
 from contextlib import contextmanager
 
-from networkx import DiGraph
-
 from .exceptions import ContextException
 from .common import BaseContext
 
@@ -96,23 +94,6 @@ class WorkflowContext(BaseContext):
 )
 
 @property
-def _graph(self):
-# Constructing a graph with only not ended nodes
-if self._execution_graph is None:
-graph = DiGraph()
-for task in self.execution.tasks:
-if task.has_ended():
-continue
-for dependency in task.dependencies:
-if dependency.has_ended():
-continue
-graph.add_edge(dependency, task)
-
-self._execution_graph = graph
-
-return self._execution_graph
-
-@property
 @contextmanager
 def persist_changes(self):
 yield

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/a75a3dea/aria/orchestrator/workflow_runner.py
--
diff --git a/aria/orchestrator/workflow_runner.py 
b/aria/orchestrator/workflow_runner.py
index 3ccb1ee..4a50fb2 100644
--- a/aria/orchestrator/workflow_runner.py
+++ b/aria/orchestrator/workflow_runner.py
@@ -24,7 +24,7 @@ from datetime import datetime
 from . import exceptions
 from .context.workflow import WorkflowContext
 from .workflows import builtin
-from .workflows.core import engine, compile
+from .workflows.core import engine, graph_compiler
 from .workflows.executor.process import ProcessExecutor
 from 

[3/3] incubator-ariatosca git commit: ARIA-280 Change package name

2017-06-25 Thread ran
ARIA-280 Change package name

Changed package name from 'aria' to 'apache-ariatosca',
in accordance with Apache's standards.
The CLI '--version' command will now also show the correct
package name.

Additionally, fixed the download_url field in setup.py -
it now includes an '-incubating' suffix.


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

Branch: refs/heads/ARIA-280-change-package-name
Commit: 668ddcb75a164ef8c119dff102a560e3f59daa7f
Parents: 51d0542
Author: Ran Ziv 
Authored: Thu Jun 22 15:39:28 2017 +0300
Committer: Ran Ziv 
Committed: Sun Jun 25 17:01:10 2017 +0300

--
 README.rst|  4 ++--
 aria/__init__.py  |  7 ---
 aria/cli/core/aria.py | 25 ++---
 setup.py  |  7 ---
 4 files changed, 12 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/668ddcb7/README.rst
--
diff --git a/README.rst b/README.rst
index dc53d47..d4740cd 100644
--- a/README.rst
+++ b/README.rst
@@ -36,10 +36,10 @@ To install ARIA directly from PyPI (using a ``wheel``), 
use::
 pip install apache-ariatosca
 
 To install ARIA from source, download the source tarball from
-`PyPI `__, extract it, and run::
+`PyPI `__, extract and ``cd`` 
into the extract dir, and run::
 
 pip install --upgrade pip setuptools
-pip install incubator-ariatosca
+pip install .
 
 | The source package comes along with relevant examples, documentation, 
``requirements.txt`` (for installing specifically the frozen dependencies' 
versions with which ARIA was tested) and more.
 |

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/668ddcb7/aria/__init__.py
--
diff --git a/aria/__init__.py b/aria/__init__.py
index 34db3a8..bed1dc6 100644
--- a/aria/__init__.py
+++ b/aria/__init__.py
@@ -20,10 +20,11 @@ ARIA top level package
 import sys
 
 import pkg_resources
-__version__ = pkg_resources.get_distribution('aria').version
+aria_package_name = 'apache-ariatosca'
+__version__ = pkg_resources.get_distribution(aria_package_name).version
 
-from .orchestrator.decorators import workflow, operation
-from . import (
+from .orchestrator.decorators import workflow, operation  # pylint: 
disable=wrong-import-position
+from . import (  # pylint: disable=wrong-import-position
 extension,
 utils,
 parser,

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/668ddcb7/aria/cli/core/aria.py
--
diff --git a/aria/cli/core/aria.py b/aria/cli/core/aria.py
index 56fe2f7..331caca 100644
--- a/aria/cli/core/aria.py
+++ b/aria/cli/core/aria.py
@@ -13,11 +13,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
 import os
 import sys
 import difflib
-import StringIO
 import traceback
 import inspect
 from functools import wraps
@@ -32,6 +30,7 @@ from .. import defaults
 from .. import helptexts
 from ..inputs import inputs_to_dict
 from ... import __version__
+from ... import aria_package_name
 from ...utils.exceptions import get_exception_as_string
 
 
@@ -94,31 +93,11 @@ def mutually_exclusive_option(*param_decls, **attrs):
 return decorator
 
 
-def _format_version_data(version,
- prefix=None,
- suffix=None,
- infix=None):
-all_data = dict(version=version)
-all_data['prefix'] = prefix or ''
-all_data['suffix'] = suffix or ''
-all_data['infix'] = infix or ''
-output = StringIO.StringIO()
-output.write('{prefix}{version}'.format(**all_data))
-output.write('{suffix}'.format(**all_data))
-return output.getvalue()
-
-
 def show_version(ctx, param, value):
 if not value:
 return
 
-cli_version = _format_version_data(
-__version__,
-prefix='ARIA CLI ',
-infix=' ' * 5,
-suffix='')
-
-logger.info(cli_version)
+logger.info('{0} {1}'.format(aria_package_name, __version__))
 ctx.exit()
 
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/668ddcb7/setup.py
--
diff --git a/setup.py b/setup.py
index d2a914c..340cce2 100644
--- a/setup.py
+++ b/setup.py
@@ -22,7 +22,7 @@ from setuptools.command.install import 

[GitHub] incubator-ariatosca pull request #164: ARIA-290 Update Makefile for binary d...

2017-06-25 Thread asfgit
Github user asfgit closed the pull request at:

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


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[1/2] incubator-ariatosca git commit: ARIA-284 Cleanup and optimize the task execution [Forced Update!]

2017-06-25 Thread ran
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-290-update-makefile 6cb0f7204 -> 51d0542c3 (forced update)


ARIA-284 Cleanup and optimize the task execution


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

Branch: refs/heads/ARIA-290-update-makefile
Commit: a75a3dea06741b73b9949e920e28877633a8bc28
Parents: 75112ab
Author: max-orlov 
Authored: Wed Jun 21 12:41:33 2017 +0300
Committer: max-orlov 
Committed: Sun Jun 25 14:33:23 2017 +0300

--
 aria/modeling/orchestration.py  |   2 -
 aria/orchestrator/context/workflow.py   |  19 ---
 aria/orchestrator/workflow_runner.py|   7 +-
 aria/orchestrator/workflows/core/compile.py | 116 --
 aria/orchestrator/workflows/core/engine.py  | 110 ++---
 .../workflows/core/graph_compiler.py| 120 +++
 tests/orchestrator/context/__init__.py  |   4 +-
 tests/orchestrator/context/test_serialize.py|   4 +-
 .../orchestrator/execution_plugin/test_local.py |   4 +-
 tests/orchestrator/execution_plugin/test_ssh.py |   6 +-
 tests/orchestrator/test_workflow_runner.py  |   4 +-
 .../orchestrator/workflows/core/test_engine.py  |   4 +-
 .../orchestrator/workflows/core/test_events.py  |   9 +-
 .../test_task_graph_into_execution_graph.py |  21 +++-
 .../executor/test_process_executor_extension.py |   4 +-
 .../test_process_executor_tracked_changes.py|   4 +-
 16 files changed, 229 insertions(+), 209 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/a75a3dea/aria/modeling/orchestration.py
--
diff --git a/aria/modeling/orchestration.py b/aria/modeling/orchestration.py
index 276b68e..5b02d1b 100644
--- a/aria/modeling/orchestration.py
+++ b/aria/modeling/orchestration.py
@@ -306,7 +306,6 @@ class TaskBase(mixins.ModelMixin):
 ended_at = Column(DateTime, default=None)
 attempts_count = Column(Integer, default=1)
 
-_api_id = Column(String)
 _executor = Column(PickleType)
 _context_cls = Column(PickleType)
 _stub_type = Column(Enum(*STUB_TYPES))
@@ -442,7 +441,6 @@ class TaskBase(mixins.ModelMixin):
 'plugin': api_task.plugin,
 'function': api_task.function,
 'arguments': api_task.arguments,
-'_api_id': api_task.id,
 '_context_cls': api_task._context_cls,
 '_executor': executor,
 }

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/a75a3dea/aria/orchestrator/context/workflow.py
--
diff --git a/aria/orchestrator/context/workflow.py 
b/aria/orchestrator/context/workflow.py
index adcd635..18334f3 100644
--- a/aria/orchestrator/context/workflow.py
+++ b/aria/orchestrator/context/workflow.py
@@ -20,8 +20,6 @@ Workflow and operation contexts
 import threading
 from contextlib import contextmanager
 
-from networkx import DiGraph
-
 from .exceptions import ContextException
 from .common import BaseContext
 
@@ -96,23 +94,6 @@ class WorkflowContext(BaseContext):
 )
 
 @property
-def _graph(self):
-# Constructing a graph with only not ended nodes
-if self._execution_graph is None:
-graph = DiGraph()
-for task in self.execution.tasks:
-if task.has_ended():
-continue
-for dependency in task.dependencies:
-if dependency.has_ended():
-continue
-graph.add_edge(dependency, task)
-
-self._execution_graph = graph
-
-return self._execution_graph
-
-@property
 @contextmanager
 def persist_changes(self):
 yield

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/a75a3dea/aria/orchestrator/workflow_runner.py
--
diff --git a/aria/orchestrator/workflow_runner.py 
b/aria/orchestrator/workflow_runner.py
index 3ccb1ee..4a50fb2 100644
--- a/aria/orchestrator/workflow_runner.py
+++ b/aria/orchestrator/workflow_runner.py
@@ -24,7 +24,7 @@ from datetime import datetime
 from . import exceptions
 from .context.workflow import WorkflowContext
 from .workflows import builtin
-from .workflows.core import engine, compile
+from .workflows.core import engine, graph_compiler
 from .workflows.executor.process import ProcessExecutor
 from ..modeling 

[2/2] incubator-ariatosca git commit: ARIA-290 Update Makefile for binary dist creation

2017-06-25 Thread ran
ARIA-290 Update Makefile for binary dist creation

Updated the Makefile to push required files for release
(LICENSE, NOTICE, DISCLAIMER) into the binary distribution
archive (wheel) automatically.


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

Branch: refs/heads/ARIA-290-update-makefile
Commit: 51d0542c32611b6711415e79b49056729abf47d5
Parents: a75a3de
Author: Ran Ziv 
Authored: Sun Jun 25 16:49:42 2017 +0300
Committer: Ran Ziv 
Committed: Sun Jun 25 16:54:19 2017 +0300

--
 Makefile | 2 ++
 1 file changed, 2 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/51d0542c/Makefile
--
diff --git a/Makefile b/Makefile
index f5f2e66..4884a65 100644
--- a/Makefile
+++ b/Makefile
@@ -59,6 +59,8 @@ test:
 
 dist: docs
python ./setup.py sdist bdist_wheel
+   # pushing LICENSE and additional files into the binary distribution 
archive
+   -find "$(DIST)" -type f -name '*.whl' -exec zip -u {} LICENSE NOTICE 
DISCLAIMER \;
 
 deploy:
pip install --upgrade "twine>=1.9.1"



[incubator-ariatosca] Git Push Summary

2017-06-25 Thread ran
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-290-update-makefile [deleted] 51d0542c3


incubator-ariatosca git commit: ARIA-290 Update Makefile for binary dist creation

2017-06-25 Thread ran
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/master a75a3dea0 -> 51d0542c3


ARIA-290 Update Makefile for binary dist creation

Updated the Makefile to push required files for release
(LICENSE, NOTICE, DISCLAIMER) into the binary distribution
archive (wheel) automatically.


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

Branch: refs/heads/master
Commit: 51d0542c32611b6711415e79b49056729abf47d5
Parents: a75a3de
Author: Ran Ziv 
Authored: Sun Jun 25 16:49:42 2017 +0300
Committer: Ran Ziv 
Committed: Sun Jun 25 16:54:19 2017 +0300

--
 Makefile | 2 ++
 1 file changed, 2 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/51d0542c/Makefile
--
diff --git a/Makefile b/Makefile
index f5f2e66..4884a65 100644
--- a/Makefile
+++ b/Makefile
@@ -59,6 +59,8 @@ test:
 
 dist: docs
python ./setup.py sdist bdist_wheel
+   # pushing LICENSE and additional files into the binary distribution 
archive
+   -find "$(DIST)" -type f -name '*.whl' -exec zip -u {} LICENSE NOTICE 
DISCLAIMER \;
 
 deploy:
pip install --upgrade "twine>=1.9.1"



[GitHub] incubator-ariatosca pull request #164: ARIA-290 Update Makefile for binary d...

2017-06-25 Thread ran-z
GitHub user ran-z opened a pull request:

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

ARIA-290 Update Makefile for binary dist creation

Updated the Makefile to push required files for release
(LICENSE, NOTICE, DISCLAIMER) into the binary distribution
archive (wheel) automatically.

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

$ git pull https://github.com/apache/incubator-ariatosca 
ARIA-290-update-makefile

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

https://github.com/apache/incubator-ariatosca/pull/164.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 #164


commit 6cb0f72046733a56f872cc00f3a2759b72b6e32c
Author: Ran Ziv 
Date:   2017-06-25T13:49:42Z

ARIA-290 Update Makefile for binary dist creation

Updated the Makefile to push required files for release
(LICENSE, NOTICE, DISCLAIMER) into the binary distribution
archive (wheel) automatically.




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-ariatosca issue #164: ARIA-290 Update Makefile for binary dist cre...

2017-06-25 Thread asfgit
Github user asfgit commented on the issue:

https://github.com/apache/incubator-ariatosca/pull/164
  
Can one of the admins verify this patch?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


incubator-ariatosca git commit: ARIA-280 Change package name [Forced Update!]

2017-06-25 Thread ran
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-280-change-package-name 8fe96406e -> fa3869826 (forced update)


ARIA-280 Change package name

Changed package name from 'aria' to 'apache-ariatosca',
in accordance with Apache's standards.
The CLI '--version' command will now also show the correct
package name.

Additionally, fixed the download_url field in setup.py -
it now includes an '-incubating' suffix.


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

Branch: refs/heads/ARIA-280-change-package-name
Commit: fa3869826da7988b2cd02454f3d1c5c4b78d6157
Parents: 75112ab
Author: Ran Ziv 
Authored: Thu Jun 22 15:39:28 2017 +0300
Committer: Ran Ziv 
Committed: Sun Jun 25 16:41:23 2017 +0300

--
 README.rst|  4 ++--
 aria/__init__.py  |  3 ++-
 aria/cli/core/aria.py | 25 ++---
 setup.py  |  7 ---
 4 files changed, 10 insertions(+), 29 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/fa386982/README.rst
--
diff --git a/README.rst b/README.rst
index dc53d47..d4740cd 100644
--- a/README.rst
+++ b/README.rst
@@ -36,10 +36,10 @@ To install ARIA directly from PyPI (using a ``wheel``), 
use::
 pip install apache-ariatosca
 
 To install ARIA from source, download the source tarball from
-`PyPI `__, extract it, and run::
+`PyPI `__, extract and ``cd`` 
into the extract dir, and run::
 
 pip install --upgrade pip setuptools
-pip install incubator-ariatosca
+pip install .
 
 | The source package comes along with relevant examples, documentation, 
``requirements.txt`` (for installing specifically the frozen dependencies' 
versions with which ARIA was tested) and more.
 |

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/fa386982/aria/__init__.py
--
diff --git a/aria/__init__.py b/aria/__init__.py
index 34db3a8..36adbda 100644
--- a/aria/__init__.py
+++ b/aria/__init__.py
@@ -20,7 +20,8 @@ ARIA top level package
 import sys
 
 import pkg_resources
-__version__ = pkg_resources.get_distribution('aria').version
+aria_package_name = 'apache-ariatosca'
+__version__ = pkg_resources.get_distribution(aria_package_name).version
 
 from .orchestrator.decorators import workflow, operation
 from . import (

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/fa386982/aria/cli/core/aria.py
--
diff --git a/aria/cli/core/aria.py b/aria/cli/core/aria.py
index 56fe2f7..331caca 100644
--- a/aria/cli/core/aria.py
+++ b/aria/cli/core/aria.py
@@ -13,11 +13,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
 import os
 import sys
 import difflib
-import StringIO
 import traceback
 import inspect
 from functools import wraps
@@ -32,6 +30,7 @@ from .. import defaults
 from .. import helptexts
 from ..inputs import inputs_to_dict
 from ... import __version__
+from ... import aria_package_name
 from ...utils.exceptions import get_exception_as_string
 
 
@@ -94,31 +93,11 @@ def mutually_exclusive_option(*param_decls, **attrs):
 return decorator
 
 
-def _format_version_data(version,
- prefix=None,
- suffix=None,
- infix=None):
-all_data = dict(version=version)
-all_data['prefix'] = prefix or ''
-all_data['suffix'] = suffix or ''
-all_data['infix'] = infix or ''
-output = StringIO.StringIO()
-output.write('{prefix}{version}'.format(**all_data))
-output.write('{suffix}'.format(**all_data))
-return output.getvalue()
-
-
 def show_version(ctx, param, value):
 if not value:
 return
 
-cli_version = _format_version_data(
-__version__,
-prefix='ARIA CLI ',
-infix=' ' * 5,
-suffix='')
-
-logger.info(cli_version)
+logger.info('{0} {1}'.format(aria_package_name, __version__))
 ctx.exit()
 
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/fa386982/setup.py
--
diff --git a/setup.py b/setup.py
index d2a914c..340cce2 100644
--- a/setup.py
+++ b/setup.py
@@ -22,7 +22,7 @@ from setuptools.command.install import install
 from setuptools.command.develop import develop
 
 

[GitHub] incubator-ariatosca pull request #163: introduced process grouping

2017-06-25 Thread mxmrlv
GitHub user mxmrlv opened a pull request:

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

introduced process grouping



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

$ git pull https://github.com/apache/incubator-ariatosca 
ARIA-285-Cancel-execution-may-leave-running-processes

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

https://github.com/apache/incubator-ariatosca/pull/163.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 #163


commit 4e20e999f6dc3a6db92e31980155506c56e19929
Author: max-orlov 
Date:   2017-06-25T09:19:02Z

introduced process grouping




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[2/2] incubator-ariatosca git commit: introduced process grouping

2017-06-25 Thread mxmrlv
introduced process grouping


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

Branch: refs/heads/ARIA-285-Cancel-execution-may-leave-running-processes
Commit: b1dd1c09f196703896a27d638c98b878599b
Parents: a75a3de
Author: max-orlov 
Authored: Sun Jun 25 12:19:02 2017 +0300
Committer: max-orlov 
Committed: Sun Jun 25 15:32:42 2017 +0300

--
 aria/orchestrator/workflows/core/engine.py  | 11 +-
 aria/orchestrator/workflows/executor/base.py|  7 
 aria/orchestrator/workflows/executor/process.py | 29 +++---
 .../orchestrator/workflows/executor/__init__.py |  7 
 .../workflows/executor/test_process_executor.py | 41 
 tests/requirements.txt  |  1 +
 6 files changed, 90 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b1dd1c09/aria/orchestrator/workflows/core/engine.py
--
diff --git a/aria/orchestrator/workflows/core/engine.py 
b/aria/orchestrator/workflows/core/engine.py
index d52ae85..373abb8 100644
--- a/aria/orchestrator/workflows/core/engine.py
+++ b/aria/orchestrator/workflows/core/engine.py
@@ -66,13 +66,22 @@ class Engine(logger.LoggerMixin):
 else:
 time.sleep(0.1)
 if cancel:
-events.on_cancelled_workflow_signal.send(ctx)
+try:
+self._terminate_tasks(tasks_tracker.executing_tasks)
+finally:
+events.on_cancelled_workflow_signal.send(ctx)
 else:
 events.on_success_workflow_signal.send(ctx)
 except BaseException as e:
+# Cleanup any remaining tasks
+self._terminate_tasks(tasks_tracker.executing_tasks)
 events.on_failure_workflow_signal.send(ctx, exception=e)
 raise
 
+def _terminate_tasks(self, tasks):
+for task in tasks:
+self._executors[task._executor].terminate(task)
+
 @staticmethod
 def cancel_execution(ctx):
 """

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b1dd1c09/aria/orchestrator/workflows/executor/base.py
--
diff --git a/aria/orchestrator/workflows/executor/base.py 
b/aria/orchestrator/workflows/executor/base.py
index 6a3c9d2..038a2e3 100644
--- a/aria/orchestrator/workflows/executor/base.py
+++ b/aria/orchestrator/workflows/executor/base.py
@@ -48,6 +48,13 @@ class BaseExecutor(logger.LoggerMixin):
 """
 pass
 
+def terminate(self, ctx):
+"""
+Terminate the executing task
+:return:
+"""
+pass
+
 @staticmethod
 def _task_started(ctx):
 events.start_task_signal.send(ctx)

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b1dd1c09/aria/orchestrator/workflows/executor/process.py
--
diff --git a/aria/orchestrator/workflows/executor/process.py 
b/aria/orchestrator/workflows/executor/process.py
index 8518b33..354210d 100644
--- a/aria/orchestrator/workflows/executor/process.py
+++ b/aria/orchestrator/workflows/executor/process.py
@@ -25,6 +25,10 @@ import sys
 # As part of the process executor implementation, subprocess are started with 
this module as their
 # entry point. We thus remove this module's directory from the python path if 
it happens to be
 # there
+from collections import namedtuple
+
+import signal
+
 script_dir = os.path.dirname(__file__)
 if script_dir in sys.path:
 sys.path.remove(script_dir)
@@ -57,6 +61,9 @@ UPDATE_TRACKED_CHANGES_FAILED_STR = \
 'Some changes failed writing to storage. For more info refer to the log.'
 
 
+_Task = namedtuple('_Task', 'proc, ctx')
+
+
 class ProcessExecutor(base.BaseExecutor):
 """
 Executor which runs tasks in a subprocess environment
@@ -113,9 +120,18 @@ class ProcessExecutor(base.BaseExecutor):
 self._server_socket.close()
 self._listener_thread.join(timeout=60)
 
+def terminate(self, ctx):
+task = self._tasks.get(ctx.task.id)
+# The process might have managed to finished so it would not be in the 
tasks list
+if task:
+if os.getsid(os.getpid()) != os.getpgid(task.proc.pid):
+# If the above condition is false, the process group leader is 
the group leader
+# for the current session of the system, and killing it will 

[incubator-ariatosca] Git Push Summary

2017-06-25 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-284-Cleanup-and-optimize-the-task-execution [deleted] 
a75a3dea0


[GitHub] incubator-ariatosca pull request #159: ARIA-284 Cleanup and optimize the tas...

2017-06-25 Thread asfgit
Github user asfgit closed the pull request at:

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


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


incubator-ariatosca git commit: ARIA-284 Cleanup and optimize the task execution

2017-06-25 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/master 75112ab05 -> a75a3dea0


ARIA-284 Cleanup and optimize the task execution


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

Branch: refs/heads/master
Commit: a75a3dea06741b73b9949e920e28877633a8bc28
Parents: 75112ab
Author: max-orlov 
Authored: Wed Jun 21 12:41:33 2017 +0300
Committer: max-orlov 
Committed: Sun Jun 25 14:33:23 2017 +0300

--
 aria/modeling/orchestration.py  |   2 -
 aria/orchestrator/context/workflow.py   |  19 ---
 aria/orchestrator/workflow_runner.py|   7 +-
 aria/orchestrator/workflows/core/compile.py | 116 --
 aria/orchestrator/workflows/core/engine.py  | 110 ++---
 .../workflows/core/graph_compiler.py| 120 +++
 tests/orchestrator/context/__init__.py  |   4 +-
 tests/orchestrator/context/test_serialize.py|   4 +-
 .../orchestrator/execution_plugin/test_local.py |   4 +-
 tests/orchestrator/execution_plugin/test_ssh.py |   6 +-
 tests/orchestrator/test_workflow_runner.py  |   4 +-
 .../orchestrator/workflows/core/test_engine.py  |   4 +-
 .../orchestrator/workflows/core/test_events.py  |   9 +-
 .../test_task_graph_into_execution_graph.py |  21 +++-
 .../executor/test_process_executor_extension.py |   4 +-
 .../test_process_executor_tracked_changes.py|   4 +-
 16 files changed, 229 insertions(+), 209 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/a75a3dea/aria/modeling/orchestration.py
--
diff --git a/aria/modeling/orchestration.py b/aria/modeling/orchestration.py
index 276b68e..5b02d1b 100644
--- a/aria/modeling/orchestration.py
+++ b/aria/modeling/orchestration.py
@@ -306,7 +306,6 @@ class TaskBase(mixins.ModelMixin):
 ended_at = Column(DateTime, default=None)
 attempts_count = Column(Integer, default=1)
 
-_api_id = Column(String)
 _executor = Column(PickleType)
 _context_cls = Column(PickleType)
 _stub_type = Column(Enum(*STUB_TYPES))
@@ -442,7 +441,6 @@ class TaskBase(mixins.ModelMixin):
 'plugin': api_task.plugin,
 'function': api_task.function,
 'arguments': api_task.arguments,
-'_api_id': api_task.id,
 '_context_cls': api_task._context_cls,
 '_executor': executor,
 }

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/a75a3dea/aria/orchestrator/context/workflow.py
--
diff --git a/aria/orchestrator/context/workflow.py 
b/aria/orchestrator/context/workflow.py
index adcd635..18334f3 100644
--- a/aria/orchestrator/context/workflow.py
+++ b/aria/orchestrator/context/workflow.py
@@ -20,8 +20,6 @@ Workflow and operation contexts
 import threading
 from contextlib import contextmanager
 
-from networkx import DiGraph
-
 from .exceptions import ContextException
 from .common import BaseContext
 
@@ -96,23 +94,6 @@ class WorkflowContext(BaseContext):
 )
 
 @property
-def _graph(self):
-# Constructing a graph with only not ended nodes
-if self._execution_graph is None:
-graph = DiGraph()
-for task in self.execution.tasks:
-if task.has_ended():
-continue
-for dependency in task.dependencies:
-if dependency.has_ended():
-continue
-graph.add_edge(dependency, task)
-
-self._execution_graph = graph
-
-return self._execution_graph
-
-@property
 @contextmanager
 def persist_changes(self):
 yield

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/a75a3dea/aria/orchestrator/workflow_runner.py
--
diff --git a/aria/orchestrator/workflow_runner.py 
b/aria/orchestrator/workflow_runner.py
index 3ccb1ee..4a50fb2 100644
--- a/aria/orchestrator/workflow_runner.py
+++ b/aria/orchestrator/workflow_runner.py
@@ -24,7 +24,7 @@ from datetime import datetime
 from . import exceptions
 from .context.workflow import WorkflowContext
 from .workflows import builtin
-from .workflows.core import engine, compile
+from .workflows.core import engine, graph_compiler
 from .workflows.executor.process import ProcessExecutor
 from ..modeling import models
 from ..modeling import utils as 

incubator-ariatosca git commit: ARIA-284 Cleanup and optimize the task execution [Forced Update!]

2017-06-25 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-284-Cleanup-and-optimize-the-task-execution d8651b75b -> 
a75a3dea0 (forced update)


ARIA-284 Cleanup and optimize the task execution


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

Branch: refs/heads/ARIA-284-Cleanup-and-optimize-the-task-execution
Commit: a75a3dea06741b73b9949e920e28877633a8bc28
Parents: 75112ab
Author: max-orlov 
Authored: Wed Jun 21 12:41:33 2017 +0300
Committer: max-orlov 
Committed: Sun Jun 25 14:33:23 2017 +0300

--
 aria/modeling/orchestration.py  |   2 -
 aria/orchestrator/context/workflow.py   |  19 ---
 aria/orchestrator/workflow_runner.py|   7 +-
 aria/orchestrator/workflows/core/compile.py | 116 --
 aria/orchestrator/workflows/core/engine.py  | 110 ++---
 .../workflows/core/graph_compiler.py| 120 +++
 tests/orchestrator/context/__init__.py  |   4 +-
 tests/orchestrator/context/test_serialize.py|   4 +-
 .../orchestrator/execution_plugin/test_local.py |   4 +-
 tests/orchestrator/execution_plugin/test_ssh.py |   6 +-
 tests/orchestrator/test_workflow_runner.py  |   4 +-
 .../orchestrator/workflows/core/test_engine.py  |   4 +-
 .../orchestrator/workflows/core/test_events.py  |   9 +-
 .../test_task_graph_into_execution_graph.py |  21 +++-
 .../executor/test_process_executor_extension.py |   4 +-
 .../test_process_executor_tracked_changes.py|   4 +-
 16 files changed, 229 insertions(+), 209 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/a75a3dea/aria/modeling/orchestration.py
--
diff --git a/aria/modeling/orchestration.py b/aria/modeling/orchestration.py
index 276b68e..5b02d1b 100644
--- a/aria/modeling/orchestration.py
+++ b/aria/modeling/orchestration.py
@@ -306,7 +306,6 @@ class TaskBase(mixins.ModelMixin):
 ended_at = Column(DateTime, default=None)
 attempts_count = Column(Integer, default=1)
 
-_api_id = Column(String)
 _executor = Column(PickleType)
 _context_cls = Column(PickleType)
 _stub_type = Column(Enum(*STUB_TYPES))
@@ -442,7 +441,6 @@ class TaskBase(mixins.ModelMixin):
 'plugin': api_task.plugin,
 'function': api_task.function,
 'arguments': api_task.arguments,
-'_api_id': api_task.id,
 '_context_cls': api_task._context_cls,
 '_executor': executor,
 }

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/a75a3dea/aria/orchestrator/context/workflow.py
--
diff --git a/aria/orchestrator/context/workflow.py 
b/aria/orchestrator/context/workflow.py
index adcd635..18334f3 100644
--- a/aria/orchestrator/context/workflow.py
+++ b/aria/orchestrator/context/workflow.py
@@ -20,8 +20,6 @@ Workflow and operation contexts
 import threading
 from contextlib import contextmanager
 
-from networkx import DiGraph
-
 from .exceptions import ContextException
 from .common import BaseContext
 
@@ -96,23 +94,6 @@ class WorkflowContext(BaseContext):
 )
 
 @property
-def _graph(self):
-# Constructing a graph with only not ended nodes
-if self._execution_graph is None:
-graph = DiGraph()
-for task in self.execution.tasks:
-if task.has_ended():
-continue
-for dependency in task.dependencies:
-if dependency.has_ended():
-continue
-graph.add_edge(dependency, task)
-
-self._execution_graph = graph
-
-return self._execution_graph
-
-@property
 @contextmanager
 def persist_changes(self):
 yield

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/a75a3dea/aria/orchestrator/workflow_runner.py
--
diff --git a/aria/orchestrator/workflow_runner.py 
b/aria/orchestrator/workflow_runner.py
index 3ccb1ee..4a50fb2 100644
--- a/aria/orchestrator/workflow_runner.py
+++ b/aria/orchestrator/workflow_runner.py
@@ -24,7 +24,7 @@ from datetime import datetime
 from . import exceptions
 from .context.workflow import WorkflowContext
 from .workflows import builtin
-from .workflows.core import engine, compile
+from .workflows.core import engine, graph_compiler
 from 

incubator-ariatosca git commit: review 1 [Forced Update!]

2017-06-25 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-284-Cleanup-and-optimize-the-task-execution 660139ed7 -> 
d8651b75b (forced update)


review 1


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

Branch: refs/heads/ARIA-284-Cleanup-and-optimize-the-task-execution
Commit: d8651b75bbfb5423199bae90a7fd9066fc179160
Parents: 827230d
Author: max-orlov 
Authored: Sun Jun 25 14:01:56 2017 +0300
Committer: max-orlov 
Committed: Sun Jun 25 14:12:06 2017 +0300

--
 aria/orchestrator/workflow_runner.py|   4 +-
 aria/orchestrator/workflows/core/compile.py | 122 ---
 aria/orchestrator/workflows/core/engine.py  |  18 +--
 .../workflows/core/graph_compiler.py| 120 ++
 tests/orchestrator/context/__init__.py  |   4 +-
 tests/orchestrator/context/test_serialize.py|   4 +-
 .../orchestrator/execution_plugin/test_local.py |   4 +-
 tests/orchestrator/execution_plugin/test_ssh.py |   5 +-
 tests/orchestrator/test_workflow_runner.py  |   4 +-
 .../orchestrator/workflows/core/test_engine.py  |   4 +-
 .../orchestrator/workflows/core/test_events.py  |   4 +-
 .../test_task_graph_into_execution_graph.py |   8 +-
 .../executor/test_process_executor_extension.py |   4 +-
 .../test_process_executor_tracked_changes.py|   4 +-
 14 files changed, 154 insertions(+), 155 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d8651b75/aria/orchestrator/workflow_runner.py
--
diff --git a/aria/orchestrator/workflow_runner.py 
b/aria/orchestrator/workflow_runner.py
index b3f100d..4a50fb2 100644
--- a/aria/orchestrator/workflow_runner.py
+++ b/aria/orchestrator/workflow_runner.py
@@ -24,7 +24,7 @@ from datetime import datetime
 from . import exceptions
 from .context.workflow import WorkflowContext
 from .workflows import builtin
-from .workflows.core import engine, compile
+from .workflows.core import engine, graph_compiler
 from .workflows.executor.process import ProcessExecutor
 from ..modeling import models
 from ..modeling import utils as modeling_utils
@@ -97,7 +97,7 @@ class WorkflowRunner(object):
 if not self._is_resume:
 workflow_fn = self._get_workflow_fn()
 self._tasks_graph = workflow_fn(ctx=self._workflow_context, 
**execution_inputs_dict)
-compile.GraphCompiler(self._workflow_context, 
executor.__class__).compile(
+graph_compiler.GraphCompiler(self._workflow_context, 
executor.__class__).compile(
 self._tasks_graph)
 
 self._engine = engine.Engine(executors={executor.__class__: executor})

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d8651b75/aria/orchestrator/workflows/core/compile.py
--
diff --git a/aria/orchestrator/workflows/core/compile.py 
b/aria/orchestrator/workflows/core/compile.py
deleted file mode 100644
index 83de22c..000
--- a/aria/orchestrator/workflows/core/compile.py
+++ /dev/null
@@ -1,122 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-from modeling import models
-from .. import executor, api
-
-
-# TODO: is class really needed?
-
-class GraphCompiler(object):
-def __init__(self, ctx, default_executor):
-self._ctx = ctx
-self._default_executor = default_executor
-self._stub_executor = executor.base.StubTaskExecutor
-self._model_to_api_id = {}
-
-def compile(self,
-task_graph,
-start_stub_type=models.Task.START_WORKFLOW,
-end_stub_type=models.Task.END_WORKFLOW,
-depends_on=()):
-"""
-Translates the user graph to the execution graph
-

incubator-ariatosca git commit: review 1 [Forced Update!]

2017-06-25 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-284-Cleanup-and-optimize-the-task-execution ae2bab3da -> 
660139ed7 (forced update)


review 1


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

Branch: refs/heads/ARIA-284-Cleanup-and-optimize-the-task-execution
Commit: 660139ed74405aafa7fa2f6fda6d9591789618aa
Parents: 827230d
Author: max-orlov 
Authored: Sun Jun 25 14:01:56 2017 +0300
Committer: max-orlov 
Committed: Sun Jun 25 14:06:42 2017 +0300

--
 aria/orchestrator/workflow_runner.py|   4 +-
 aria/orchestrator/workflows/core/compile.py | 122 ---
 aria/orchestrator/workflows/core/engine.py  |  18 +--
 .../workflows/core/graph_compiler.py| 120 ++
 tests/orchestrator/context/__init__.py  |   4 +-
 tests/orchestrator/context/test_serialize.py|   4 +-
 .../orchestrator/execution_plugin/test_local.py |   4 +-
 tests/orchestrator/execution_plugin/test_ssh.py |   5 +-
 .../orchestrator/workflows/core/test_engine.py  |   4 +-
 .../orchestrator/workflows/core/test_events.py  |   4 +-
 .../test_task_graph_into_execution_graph.py |   8 +-
 .../executor/test_process_executor_extension.py |   4 +-
 .../test_process_executor_tracked_changes.py|   4 +-
 13 files changed, 152 insertions(+), 153 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/660139ed/aria/orchestrator/workflow_runner.py
--
diff --git a/aria/orchestrator/workflow_runner.py 
b/aria/orchestrator/workflow_runner.py
index b3f100d..4a50fb2 100644
--- a/aria/orchestrator/workflow_runner.py
+++ b/aria/orchestrator/workflow_runner.py
@@ -24,7 +24,7 @@ from datetime import datetime
 from . import exceptions
 from .context.workflow import WorkflowContext
 from .workflows import builtin
-from .workflows.core import engine, compile
+from .workflows.core import engine, graph_compiler
 from .workflows.executor.process import ProcessExecutor
 from ..modeling import models
 from ..modeling import utils as modeling_utils
@@ -97,7 +97,7 @@ class WorkflowRunner(object):
 if not self._is_resume:
 workflow_fn = self._get_workflow_fn()
 self._tasks_graph = workflow_fn(ctx=self._workflow_context, 
**execution_inputs_dict)
-compile.GraphCompiler(self._workflow_context, 
executor.__class__).compile(
+graph_compiler.GraphCompiler(self._workflow_context, 
executor.__class__).compile(
 self._tasks_graph)
 
 self._engine = engine.Engine(executors={executor.__class__: executor})

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/660139ed/aria/orchestrator/workflows/core/compile.py
--
diff --git a/aria/orchestrator/workflows/core/compile.py 
b/aria/orchestrator/workflows/core/compile.py
deleted file mode 100644
index 83de22c..000
--- a/aria/orchestrator/workflows/core/compile.py
+++ /dev/null
@@ -1,122 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-from modeling import models
-from .. import executor, api
-
-
-# TODO: is class really needed?
-
-class GraphCompiler(object):
-def __init__(self, ctx, default_executor):
-self._ctx = ctx
-self._default_executor = default_executor
-self._stub_executor = executor.base.StubTaskExecutor
-self._model_to_api_id = {}
-
-def compile(self,
-task_graph,
-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 

incubator-ariatosca git commit: review 1

2017-06-25 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-284-Cleanup-and-optimize-the-task-execution 827230da2 -> 
ae2bab3da


review 1


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

Branch: refs/heads/ARIA-284-Cleanup-and-optimize-the-task-execution
Commit: ae2bab3dacd38bebf9b6bb3394ab6f9fc5471cfc
Parents: 827230d
Author: max-orlov 
Authored: Sun Jun 25 14:01:56 2017 +0300
Committer: max-orlov 
Committed: Sun Jun 25 14:01:56 2017 +0300

--
 aria/orchestrator/workflows/core/compile.py | 122 ---
 aria/orchestrator/workflows/core/engine.py  |  18 +--
 .../workflows/core/graph_compiler.py| 120 ++
 3 files changed, 129 insertions(+), 131 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/ae2bab3d/aria/orchestrator/workflows/core/compile.py
--
diff --git a/aria/orchestrator/workflows/core/compile.py 
b/aria/orchestrator/workflows/core/compile.py
deleted file mode 100644
index 83de22c..000
--- a/aria/orchestrator/workflows/core/compile.py
+++ /dev/null
@@ -1,122 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-from modeling import models
-from .. import executor, api
-
-
-# TODO: is class really needed?
-
-class GraphCompiler(object):
-def __init__(self, ctx, default_executor):
-self._ctx = ctx
-self._default_executor = default_executor
-self._stub_executor = executor.base.StubTaskExecutor
-self._model_to_api_id = {}
-
-def compile(self,
-task_graph,
-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
-"""
-task_graph = task_graph or self._task_graph
-depends_on = list(depends_on)
-
-# Insert start marker
-start_task = self._create_stub_task(
-start_stub_type, depends_on, 
self._start_graph_suffix(task_graph.id), task_graph.name,
-)
-
-for task in task_graph.topological_order(reverse=True):
-dependencies = \
-
(self._get_tasks_from_dependencies(task_graph.get_dependencies(task))
- or [start_task])
-
-if isinstance(task, api.task.OperationTask):
-self._create_operation_task(task, dependencies)
-
-elif isinstance(task, api.task.WorkflowTask):
-# Build the graph recursively while adding start and end 
markers
-self.compile(
-task, models.Task.START_SUBWROFKLOW, 
models.Task.END_SUBWORKFLOW, dependencies
-)
-elif isinstance(task, api.task.StubTask):
-self._create_stub_task(models.Task.STUB, dependencies, task.id)
-else:
-raise RuntimeError('Undefined state')
-
-# Insert end marker
-self._create_stub_task(
-end_stub_type,
-self._get_non_dependent_tasks(self._ctx.execution) or [start_task],
-self._end_graph_suffix(task_graph.id),
-task_graph.name
-)
-
-def _create_stub_task(self, stub_type, dependencies, api_id, name=None):
-model_task = models.Task(
-name=name,
-dependencies=dependencies,
-execution=self._ctx.execution,
-_executor=self._stub_executor,
-_stub_type=stub_type)
-self._ctx.model.task.put(model_task)
-

[GitHub] incubator-ariatosca pull request #159: ARIA-284 Cleanup and optimize the tas...

2017-06-25 Thread mxmrlv
Github user mxmrlv commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/159#discussion_r123895663
  
--- Diff: aria/orchestrator/workflow_runner.py ---
@@ -96,8 +96,9 @@ def __init__(self, model_storage, resource_storage, 
plugin_manager,
 
 if not self._is_resume:
 workflow_fn = self._get_workflow_fn()
-tasks_graph = workflow_fn(ctx=self._workflow_context, 
**execution_inputs_dict)
-compile.create_execution_tasks(self._workflow_context, 
tasks_graph, executor.__class__)
+self._tasks_graph = workflow_fn(ctx=self._workflow_context, 
**execution_inputs_dict)
+compile.GraphCompiler(self._workflow_context, 
executor.__class__).compile(
--- End diff --

graph_compiler


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-ariatosca pull request #159: ARIA-284 Cleanup and optimize the tas...

2017-06-25 Thread mxmrlv
Github user mxmrlv commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/159#discussion_r123895688
  
--- Diff: aria/orchestrator/workflows/core/compile.py ---
@@ -18,99 +18,105 @@
 from .. import executor, api
 
 
-def create_execution_tasks(ctx, task_graph, default_executor):
-execution = ctx.execution
-_construct_execution_tasks(execution, task_graph, default_executor)
-ctx.model.execution.update(execution)
-return execution.tasks
-
-
-def _construct_execution_tasks(execution,
-   task_graph,
-   default_executor,
-   
stub_executor=executor.base.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(execution=execution,
- dependencies=depends_on,
- _api_id=_start_graph_suffix(task_graph.id),
- _stub_type=start_stub_type,
- _executor=stub_executor)
-
-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(
-execution=execution,
-task_graph=task,
-default_executor=default_executor,
-stub_executor=stub_executor,
-start_stub_type=models.Task.START_SUBWROFKLOW,
-end_stub_type=models.Task.END_SUBWORKFLOW,
-depends_on=operation_dependencies
-)
-elif isinstance(task, api.task.StubTask):
-models.Task(execution=execution,
-dependencies=operation_dependencies,
-_api_id=task.id,
-_executor=stub_executor,
-_stub_type=models.Task.STUB,
-   )
-else:
-raise RuntimeError('Undefined state')
-
-# Insert end marker
-models.Task(dependencies=_get_non_dependent_tasks(execution) or 
[start_task],
-execution=execution,
-_api_id=_end_graph_suffix(task_graph.id),
-_executor=stub_executor,
-_stub_type=end_stub_type)
-
-
-def _start_graph_suffix(api_id):
-return '{0}-Start'.format(api_id)
-
-
-def _end_graph_suffix(api_id):
-return '{0}-End'.format(api_id)
-
-
-def _get_non_dependent_tasks(execution):
-tasks_with_dependencies = set()
-for task in execution.tasks:
-tasks_with_dependencies.update(task.dependencies)
-return list(set(execution.tasks) - set(tasks_with_dependencies))
-
-
-def _get_tasks_from_dependencies(execution, dependencies, default=()):
-"""
-Returns task list from dependencies.
-"""
-tasks = []
-for dependency in dependencies:
-if getattr(dependency, 'actor', False):
-# This is
-dependency_name = dependency.id
-else:
-dependency_name = _end_graph_suffix(dependency.id)
-tasks.extend(task for task in execution.tasks if task._api_id == 
dependency_name)
-return tasks or default
+# TODO: is class really needed?
--- End diff --

remove


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


incubator-ariatosca git commit: introduced process grouping [Forced Update!]

2017-06-25 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-285-Cancel-execution-may-leave-running-processes e9ed005df -> 
236f5e0d3 (forced update)


introduced process grouping


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

Branch: refs/heads/ARIA-285-Cancel-execution-may-leave-running-processes
Commit: 236f5e0d3f23092db2634597bc10e655b67831fb
Parents: 75112ab
Author: max-orlov 
Authored: Sun Jun 25 12:19:02 2017 +0300
Committer: max-orlov 
Committed: Sun Jun 25 13:07:47 2017 +0300

--
 aria/orchestrator/workflows/core/engine.py  | 12 +-
 aria/orchestrator/workflows/executor/base.py|  7 
 aria/orchestrator/workflows/executor/process.py | 29 +++---
 .../orchestrator/workflows/executor/__init__.py |  7 
 .../workflows/executor/test_process_executor.py | 41 
 tests/requirements.txt  |  1 +
 6 files changed, 90 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/236f5e0d/aria/orchestrator/workflows/core/engine.py
--
diff --git a/aria/orchestrator/workflows/core/engine.py 
b/aria/orchestrator/workflows/core/engine.py
index d5a6e70..02b1dee 100644
--- a/aria/orchestrator/workflows/core/engine.py
+++ b/aria/orchestrator/workflows/core/engine.py
@@ -49,7 +49,6 @@ class Engine(logger.LoggerMixin):
 
 if resuming:
 events.on_resume_workflow_signal.send(ctx)
-
 try:
 events.start_workflow_signal.send(ctx)
 while True:
@@ -65,13 +64,22 @@ class Engine(logger.LoggerMixin):
 else:
 time.sleep(0.1)
 if cancel:
-events.on_cancelled_workflow_signal.send(ctx)
+try:
+self._terminate_tasks(executing_tasks)
+finally:
+events.on_cancelled_workflow_signal.send(ctx)
 else:
 events.on_success_workflow_signal.send(ctx)
 except BaseException as e:
+# Cleanup any remaining tasks
+self._terminate_tasks(executing_tasks)
 events.on_failure_workflow_signal.send(ctx, exception=e)
 raise
 
+def _terminate_tasks(self, tasks):
+for task in tasks:
+self._executors[task._executor].terminate(task)
+
 @staticmethod
 def cancel_execution(ctx):
 """

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/236f5e0d/aria/orchestrator/workflows/executor/base.py
--
diff --git a/aria/orchestrator/workflows/executor/base.py 
b/aria/orchestrator/workflows/executor/base.py
index 6a3c9d2..038a2e3 100644
--- a/aria/orchestrator/workflows/executor/base.py
+++ b/aria/orchestrator/workflows/executor/base.py
@@ -48,6 +48,13 @@ class BaseExecutor(logger.LoggerMixin):
 """
 pass
 
+def terminate(self, ctx):
+"""
+Terminate the executing task
+:return:
+"""
+pass
+
 @staticmethod
 def _task_started(ctx):
 events.start_task_signal.send(ctx)

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/236f5e0d/aria/orchestrator/workflows/executor/process.py
--
diff --git a/aria/orchestrator/workflows/executor/process.py 
b/aria/orchestrator/workflows/executor/process.py
index 8518b33..354210d 100644
--- a/aria/orchestrator/workflows/executor/process.py
+++ b/aria/orchestrator/workflows/executor/process.py
@@ -25,6 +25,10 @@ import sys
 # As part of the process executor implementation, subprocess are started with 
this module as their
 # entry point. We thus remove this module's directory from the python path if 
it happens to be
 # there
+from collections import namedtuple
+
+import signal
+
 script_dir = os.path.dirname(__file__)
 if script_dir in sys.path:
 sys.path.remove(script_dir)
@@ -57,6 +61,9 @@ UPDATE_TRACKED_CHANGES_FAILED_STR = \
 'Some changes failed writing to storage. For more info refer to the log.'
 
 
+_Task = namedtuple('_Task', 'proc, ctx')
+
+
 class ProcessExecutor(base.BaseExecutor):
 """
 Executor which runs tasks in a subprocess environment
@@ -113,9 +120,18 @@ class ProcessExecutor(base.BaseExecutor):
 self._server_socket.close()
 self._listener_thread.join(timeout=60)
 
+def terminate(self, ctx):
+task = self._tasks.get(ctx.task.id)
+ 

incubator-ariatosca git commit: introduced process grouping

2017-06-25 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-285-Cancel-execution-may-leave-running-processes 75112ab05 -> 
e9ed005df


introduced process grouping


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

Branch: refs/heads/ARIA-285-Cancel-execution-may-leave-running-processes
Commit: e9ed005dff47bf4cf056a94969b1274b5b3b4abd
Parents: 75112ab
Author: max-orlov 
Authored: Sun Jun 25 12:19:02 2017 +0300
Committer: max-orlov 
Committed: Sun Jun 25 12:19:02 2017 +0300

--
 aria/orchestrator/workflows/core/engine.py  | 12 +-
 aria/orchestrator/workflows/executor/base.py|  7 
 aria/orchestrator/workflows/executor/process.py | 29 +++---
 .../orchestrator/workflows/executor/__init__.py |  7 
 .../workflows/executor/test_process_executor.py | 41 
 tests/requirements.txt  |  1 +
 6 files changed, 90 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/e9ed005d/aria/orchestrator/workflows/core/engine.py
--
diff --git a/aria/orchestrator/workflows/core/engine.py 
b/aria/orchestrator/workflows/core/engine.py
index d5a6e70..02b1dee 100644
--- a/aria/orchestrator/workflows/core/engine.py
+++ b/aria/orchestrator/workflows/core/engine.py
@@ -49,7 +49,6 @@ class Engine(logger.LoggerMixin):
 
 if resuming:
 events.on_resume_workflow_signal.send(ctx)
-
 try:
 events.start_workflow_signal.send(ctx)
 while True:
@@ -65,13 +64,22 @@ class Engine(logger.LoggerMixin):
 else:
 time.sleep(0.1)
 if cancel:
-events.on_cancelled_workflow_signal.send(ctx)
+try:
+self._terminate_tasks(executing_tasks)
+finally:
+events.on_cancelled_workflow_signal.send(ctx)
 else:
 events.on_success_workflow_signal.send(ctx)
 except BaseException as e:
+# Cleanup any remaining tasks
+self._terminate_tasks(executing_tasks)
 events.on_failure_workflow_signal.send(ctx, exception=e)
 raise
 
+def _terminate_tasks(self, tasks):
+for task in tasks:
+self._executors[task._executor].terminate(task)
+
 @staticmethod
 def cancel_execution(ctx):
 """

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/e9ed005d/aria/orchestrator/workflows/executor/base.py
--
diff --git a/aria/orchestrator/workflows/executor/base.py 
b/aria/orchestrator/workflows/executor/base.py
index 6a3c9d2..8975154 100644
--- a/aria/orchestrator/workflows/executor/base.py
+++ b/aria/orchestrator/workflows/executor/base.py
@@ -48,6 +48,13 @@ class BaseExecutor(logger.LoggerMixin):
 """
 pass
 
+def terminate(self):
+"""
+Terminate the executing task
+:return: 
+"""
+pass
+
 @staticmethod
 def _task_started(ctx):
 events.start_task_signal.send(ctx)

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/e9ed005d/aria/orchestrator/workflows/executor/process.py
--
diff --git a/aria/orchestrator/workflows/executor/process.py 
b/aria/orchestrator/workflows/executor/process.py
index 8518b33..8a10ebb 100644
--- a/aria/orchestrator/workflows/executor/process.py
+++ b/aria/orchestrator/workflows/executor/process.py
@@ -25,6 +25,10 @@ import sys
 # As part of the process executor implementation, subprocess are started with 
this module as their
 # entry point. We thus remove this module's directory from the python path if 
it happens to be
 # there
+from collections import namedtuple
+
+import signal
+
 script_dir = os.path.dirname(__file__)
 if script_dir in sys.path:
 sys.path.remove(script_dir)
@@ -57,6 +61,9 @@ UPDATE_TRACKED_CHANGES_FAILED_STR = \
 'Some changes failed writing to storage. For more info refer to the log.'
 
 
+_Task = namedtuple('_Task', 'proc, ctx')
+
+
 class ProcessExecutor(base.BaseExecutor):
 """
 Executor which runs tasks in a subprocess environment
@@ -113,9 +120,18 @@ class ProcessExecutor(base.BaseExecutor):
 self._server_socket.close()
 self._listener_thread.join(timeout=60)
 
+def terminate(self, ctx):
+task = self._tasks.get(ctx.task.id)
+# The