[2/2] incubator-ariatosca git commit: ARIA-149 Enhance operation configuration

2017-05-22 Thread emblemparade
ARIA-149 Enhance operation configuration

* Parse special "dependencies" configuration parameters as YAML and
  treat as Parameter models, allowing them full use of intrinsic
  functions, type coersions, and validations
* Rename various functions that process "properties" to more generically
  process "parameters" (properties, inputs, attributes, arguments, etc.)
* The "configuration" field in OperationTemplate and Operation models
  is now now a dict of Parameter models
* Added "function" and "arguments" fields to Operation model to preserve
  user data (in "implementation" and "inputs") and to clearly demarcate
  orchestration data from user data
* Some cleanup of parser code touched by this commit


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

Branch: refs/heads/ARIA-149-functions-in-operation-configuration
Commit: 13888d24794458e818e01af75482feae6b6dded3
Parents: 3d22d36
Author: Tal Liron 
Authored: Thu Apr 20 17:54:47 2017 -0500
Committer: Tal Liron 
Committed: Mon May 22 18:41:39 2017 -0500

--
 aria/cli/commands/services.py   |   2 +-
 aria/core.py|  14 +-
 aria/modeling/constraints.py|  28 +++
 aria/modeling/contraints.py |  28 ---
 aria/modeling/exceptions.py |  16 +-
 aria/modeling/service_common.py |   4 +
 aria/modeling/service_instance.py   |  69 +++---
 aria/modeling/service_template.py   |  54 ++---
 aria/modeling/utils.py  | 105 -
 .../execution_plugin/instantiation.py   | 133 +++-
 aria/orchestrator/workflow_runner.py|   2 +-
 aria/orchestrator/workflows/api/task.py |   4 +-
 aria/orchestrator/workflows/core/task.py|   1 -
 .../profiles/aria-1.0/aria-1.0.yaml |  16 +-
 .../simple_v1_0/assignments.py  |   4 +-
 .../simple_v1_0/modeling/__init__.py|  65 --
 .../simple_v1_0/modeling/artifacts.py   |   2 +-
 .../simple_v1_0/modeling/capabilities.py|  24 ++-
 .../simple_v1_0/modeling/constraints.py |   2 +-
 .../simple_v1_0/modeling/data_types.py  |  16 ++
 .../simple_v1_0/modeling/interfaces.py  |  34 ++-
 .../simple_v1_0/modeling/parameters.py  | 211 +++
 .../simple_v1_0/modeling/policies.py|   2 +
 .../simple_v1_0/modeling/properties.py  | 202 --
 .../simple_v1_0/modeling/requirements.py|  20 +-
 .../modeling/substitution_mappings.py   |   4 +
 .../simple_v1_0/templates.py|  13 +-
 .../aria_extension_tosca/simple_v1_0/types.py   |  24 +--
 tests/cli/test_services.py  |  14 +-
 tests/mock/models.py|  10 +-
 tests/mock/topology.py  |  12 +-
 tests/orchestrator/context/test_operation.py|  53 +++--
 tests/orchestrator/context/test_serialize.py|   2 +-
 tests/orchestrator/context/test_toolbelt.py |  14 +-
 .../orchestrator/execution_plugin/test_local.py |  10 +-
 tests/orchestrator/execution_plugin/test_ssh.py |  12 +-
 tests/orchestrator/test_workflow_runner.py  |   8 +-
 tests/orchestrator/workflows/api/test_task.py   |  26 +--
 .../workflows/builtin/test_execute_operation.py |   2 +-
 .../orchestrator/workflows/core/test_engine.py  |   6 +-
 .../orchestrator/workflows/core/test_events.py  |   3 +-
 tests/orchestrator/workflows/core/test_task.py  |   6 +-
 .../test_task_graph_into_execution_graph.py |   2 +-
 ...process_executor_concurrent_modifications.py |  10 +-
 .../executor/test_process_executor_extension.py |  13 +-
 .../test_process_executor_tracked_changes.py|   8 +-
 .../node-cellar/node-cellar.yaml|  24 ++-
 47 files changed, 737 insertions(+), 597 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/13888d24/aria/cli/commands/services.py
--
diff --git a/aria/cli/commands/services.py b/aria/cli/commands/services.py
index 24de7c5..476387c 100644
--- a/aria/cli/commands/services.py
+++ b/aria/cli/commands/services.py
@@ -151,7 +151,7 @@ def create(service_template_name,
 except storage_exceptions.StorageError as e:
 utils.check_overriding_storage_exceptions(e, 'service', service_name)
 raise
-except modeling_exceptions.InputsException:
+except modeling_exceptions.ParameterException:
 service_templates.print_service_template_inputs(model_storage, 

[2/2] incubator-ariatosca git commit: ARIA-149 Enhance operation configuration

2017-05-22 Thread emblemparade
ARIA-149 Enhance operation configuration

* Parse special "dependencies" configuration parameters as YAML and
  treat as Parameter models, allowing them full use of intrinsic
  functions, type coersions, and validations
* Rename various functions that process "properties" to more generically
  process "parameters" (properties, inputs, attributes, arguments, etc.)
* The "configuration" field in OperationTemplate and Operation models
  is now now a dict of Parameter models
* Added "function" and "arguments" fields to Operation model to preserve
  user data (in "implementation" and "inputs") and to clearly demarcate
  orchestration data from user data
* Some cleanup of parser code touched by this commit


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

Branch: refs/heads/ARIA-149-functions-in-operation-configuration
Commit: 50646f6279d442869410e8597e2b6215fca28782
Parents: 3d22d36
Author: Tal Liron 
Authored: Thu Apr 20 17:54:47 2017 -0500
Committer: Tal Liron 
Committed: Mon May 22 18:39:19 2017 -0500

--
 aria/cli/commands/services.py   |   2 +-
 aria/core.py|  18 +-
 aria/modeling/constraints.py|  28 +++
 aria/modeling/contraints.py |  28 ---
 aria/modeling/exceptions.py |  16 +-
 aria/modeling/service_common.py |   4 +
 aria/modeling/service_instance.py   |  69 +++---
 aria/modeling/service_template.py   |  54 ++---
 aria/modeling/utils.py  | 105 -
 .../execution_plugin/instantiation.py   | 133 +++-
 aria/orchestrator/workflow_runner.py|   2 +-
 aria/orchestrator/workflows/api/task.py |   4 +-
 aria/orchestrator/workflows/core/task.py|   1 -
 .../profiles/aria-1.0/aria-1.0.yaml |  16 +-
 .../simple_v1_0/assignments.py  |   4 +-
 .../simple_v1_0/modeling/__init__.py|  65 --
 .../simple_v1_0/modeling/artifacts.py   |   2 +-
 .../simple_v1_0/modeling/capabilities.py|  24 ++-
 .../simple_v1_0/modeling/constraints.py |   2 +-
 .../simple_v1_0/modeling/data_types.py  |  16 ++
 .../simple_v1_0/modeling/interfaces.py  |  34 ++-
 .../simple_v1_0/modeling/parameters.py  | 211 +++
 .../simple_v1_0/modeling/policies.py|   2 +
 .../simple_v1_0/modeling/properties.py  | 202 --
 .../simple_v1_0/modeling/requirements.py|  20 +-
 .../modeling/substitution_mappings.py   |   4 +
 .../simple_v1_0/templates.py|  13 +-
 .../aria_extension_tosca/simple_v1_0/types.py   |  24 +--
 tests/cli/test_services.py  |  14 +-
 tests/mock/models.py|  10 +-
 tests/mock/topology.py  |  12 +-
 tests/orchestrator/context/test_operation.py|  53 +++--
 tests/orchestrator/context/test_serialize.py|   2 +-
 tests/orchestrator/context/test_toolbelt.py |  14 +-
 .../orchestrator/execution_plugin/test_local.py |  10 +-
 tests/orchestrator/execution_plugin/test_ssh.py |  12 +-
 tests/orchestrator/test_workflow_runner.py  |   8 +-
 tests/orchestrator/workflows/api/test_task.py   |  26 +--
 .../workflows/builtin/test_execute_operation.py |   2 +-
 .../orchestrator/workflows/core/test_engine.py  |   6 +-
 .../orchestrator/workflows/core/test_events.py  |   3 +-
 tests/orchestrator/workflows/core/test_task.py  |   6 +-
 .../test_task_graph_into_execution_graph.py |   2 +-
 ...process_executor_concurrent_modifications.py |  10 +-
 .../executor/test_process_executor_extension.py |  13 +-
 .../test_process_executor_tracked_changes.py|   8 +-
 .../node-cellar/node-cellar.yaml|  24 ++-
 47 files changed, 739 insertions(+), 599 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/50646f62/aria/cli/commands/services.py
--
diff --git a/aria/cli/commands/services.py b/aria/cli/commands/services.py
index 24de7c5..476387c 100644
--- a/aria/cli/commands/services.py
+++ b/aria/cli/commands/services.py
@@ -151,7 +151,7 @@ def create(service_template_name,
 except storage_exceptions.StorageError as e:
 utils.check_overriding_storage_exceptions(e, 'service', service_name)
 raise
-except modeling_exceptions.InputsException:
+except modeling_exceptions.ParameterException:
 service_templates.print_service_template_inputs(model_storage, 

[2/2] incubator-ariatosca git commit: ARIA-149 Enhance operation configuration

2017-05-18 Thread emblemparade
ARIA-149 Enhance operation configuration


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

Branch: refs/heads/ARIA-149-functions-in-operation-configuration
Commit: 88587f8280df12fb228cbed524ce95e652ba2441
Parents: 13bcb0e
Author: Tal Liron 
Authored: Wed Apr 19 20:07:33 2017 -0500
Committer: Tal Liron 
Committed: Thu May 18 13:18:27 2017 -0500

--
 aria/modeling/contraints.py |  18 ++
 aria/modeling/service_common.py |   6 +
 aria/modeling/service_instance.py   |   7 +-
 aria/modeling/service_template.py   |   2 +-
 .../execution_plugin/instantiation.py   |  20 +-
 .../simple_v1_0/assignments.py  |   4 +-
 .../simple_v1_0/modeling/__init__.py|  14 ++
 .../simple_v1_0/modeling/artifacts.py   |   2 +-
 .../simple_v1_0/modeling/capabilities.py|  22 +-
 .../simple_v1_0/modeling/data_types.py  |  16 ++
 .../simple_v1_0/modeling/interfaces.py  |  30 ++-
 .../simple_v1_0/modeling/parameters.py  | 211 +++
 .../simple_v1_0/modeling/policies.py|   2 +
 .../simple_v1_0/modeling/properties.py  | 202 --
 .../simple_v1_0/modeling/requirements.py|  18 +-
 .../modeling/substitution_mappings.py   |   4 +
 .../simple_v1_0/templates.py|  14 +-
 .../aria_extension_tosca/simple_v1_0/types.py   |  24 +--
 .../node-cellar/node-cellar.yaml|  20 +-
 19 files changed, 374 insertions(+), 262 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/88587f82/aria/modeling/contraints.py
--
diff --git a/aria/modeling/contraints.py b/aria/modeling/contraints.py
index 107b010..4f53fac 100644
--- a/aria/modeling/contraints.py
+++ b/aria/modeling/contraints.py
@@ -26,3 +26,21 @@ class NodeTemplateConstraint(object):
 Returns true is the target matches the constraint for the source.
 """
 raise NotImplementedError
+<<< HEAD
+===
+
+
+class NodeTemplateContainerHolder(object):
+"""
+Wrapper that allows using a :class:`aria.modeling.models.NodeTemplate` 
model directly as the
+``container_holder`` argument for :func:`evaluate`.
+"""
+
+def __init__(self, node_template):
+self.container = node_template
+self.service = None
+
+@property
+def service_template(self):
+return self.container.service_template
+>>> ARIA-139 Support attributes

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/88587f82/aria/modeling/service_common.py
--
diff --git a/aria/modeling/service_common.py b/aria/modeling/service_common.py
index e9c96a4..8504451 100644
--- a/aria/modeling/service_common.py
+++ b/aria/modeling/service_common.py
@@ -15,6 +15,8 @@
 
 # pylint: disable=no-self-argument, no-member, abstract-method
 
+import datetime
+
 from sqlalchemy import (
 Column,
 Text,
@@ -211,6 +213,10 @@ class ParameterBase(TemplateModelMixin, 
caching.HasCachedMethods):
 """
 Wraps an arbitrary value as a parameter. The type will be guessed via 
introspection.
 
+For primitive types, we will prefer their TOSCA aliases. See the 
`TOSCA Simple Profile v1.0
+cos01 specification 
`__
+
 :param name: Parameter name
 :type name: basestring
 :param value: Parameter value

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/88587f82/aria/modeling/service_instance.py
--
diff --git a/aria/modeling/service_instance.py 
b/aria/modeling/service_instance.py
index 41a388d..633023a 100644
--- a/aria/modeling/service_instance.py
+++ b/aria/modeling/service_instance.py
@@ -20,7 +20,8 @@ from sqlalchemy import (
 Text,
 Integer,
 Enum,
-Boolean
+Boolean,
+PickleType
 )
 from sqlalchemy import DateTime
 from sqlalchemy.ext.associationproxy import association_proxy
@@ -1733,7 +1734,7 @@ class OperationBase(InstanceModelMixin):
 description = Column(Text)
 relationship_edge = Column(Boolean)
 implementation = Column(Text)
-configuration = Column(modeling_types.StrictDict(key_cls=basestring))
+configuration = Column(PickleType)
 dependencies = Column(modeling_types.StrictList(item_cl