[Slack] Notifications from the ASF team for June 2nd, 2017 at 8:17 AM

2017-06-01 Thread Slack
Hi ARIA TOSCA,

You have a new direct message from the ASF team
(https://the-asf.slack.com/x-185534614710-191565468947/).

---

@digestai
View in the archives:
https://the-asf.slack.com/x-185534614710-191565468947/archives/D5E4SCANM/p149637968049

Digest.AI (8:01 AM, June 2nd)
Hi ARIA,
*Here’s your digest for June 2nd 2017*
There are 16 messages yesterday, and the most active user is Tal Liron

*#ariatosca*
 @emblemparade: [UPDATE] i have a PR for ARIA-254, and started a more
open discussion in the mailing list about it. just a note for @ran -- i
included some other code cleanups here regarding to parts of the code i
touched. i know you don't like it when i change many files in a PR, but
i think the changes are very minimal and not worth creating a separate
JIRA for. my policy in general is to leave every file i touch in better
quality than before i touched it...



*Links shared by your team today:*



* * *

You can snooze these notifications for
an hour:
https://the-asf.slack.com/unsub/U5FFQJ2LW-5a1cb74d28-notify-mute-1h
eight hours:
https://the-asf.slack.com/unsub/U5FFQJ2LW-796e6535e1-notify-mute-8h
a day:
https://the-asf.slack.com/unsub/U5FFQJ2LW-4e6e073ada-notify-mute-1d
three days:
https://the-asf.slack.com/unsub/U5FFQJ2LW-806a2d8aa0-notify-mute-3d
or the next week:
https://the-asf.slack.com/unsub/U5FFQJ2LW-6adc840c34-notify-mute-7d.

You can also turn email notifications off:
https://the-asf.slack.com/unsub/U5FFQJ2LW-64de78982b-notify.

For more detailed preferences, see your account page:
https://the-asf.slack.com/account.


Podling Report Reminder - June 2017

2017-06-01 Thread johndament
Dear podling,

This email was sent by an automated system on behalf of the Apache
Incubator PMC. It is an initial reminder to give you plenty of time to
prepare your quarterly board report.

The board meeting is scheduled for Wed, 21 June 2017, 10:30 am PDT.
The report for your podling will form a part of the Incubator PMC
report. The Incubator PMC requires your report to be submitted 2 weeks
before the board meeting, to allow sufficient time for review and
submission (Wed, June 07).

Please submit your report with sufficient time to allow the Incubator
PMC, and subsequently board members to review and digest. Again, the
very latest you should submit your report is 2 weeks prior to the board
meeting.

Thanks,

The Apache Incubator PMC

Submitting your Report

--

Your report should contain the following:

*   Your project name
*   A brief description of your project, which assumes no knowledge of
the project or necessarily of its field
*   A list of the three most important issues to address in the move
towards graduation.
*   Any issues that the Incubator PMC or ASF Board might wish/need to be
aware of
*   How has the community developed since the last report
*   How has the project developed since the last report.
*   How does the podling rate their own maturity.

This should be appended to the Incubator Wiki page at:

https://wiki.apache.org/incubator/June2017

Note: This is manually populated. You may need to wait a little before
this page is created from a template.

Mentors
---

Mentors should review reports for their project(s) and sign them off on
the Incubator wiki page. Signing off reports shows that you are
following the project - projects that are not signed may raise alarms
for the Incubator PMC.

Incubator PMC


Let's talk about scaling (ARIA-254)

2017-06-01 Thread Tal Liron
The TOSCA spec says nothing about how multiple nodes per template would be
created, leaving it the orchestrator to decide. The provided scaling policy
in the Simple Profile is empty, just providing a base type for users to
extend.

What I'm proposing is to support basic policy-based scaling to ARIA. I have
a pull request that works and you can try out:

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

The way it works is that you can define a default_instances number for any
number of nodes (or nodes in the group) by applying the scaling policy to
it. min_instances and max_instances are also there, though ARIA doesn't
know what to do with them at the moment. They would be available for
plugins to implement their own scaling system, to make sure their workflows
are scaling with the user-defined bounds.

In terms of code, it meant removing the default_instances, min_instances,
and max_instances fields from the NodeTemplate model. Instead, there is a
default_instance property that will grab the value from applicable policies.

Works great! But I would be happy to hear feedback about this bold
approach. I think one negative is that if you want to give default scaling
parameters for different nodes you would have to define separate policies.
But I don't think this is so bad, and is actually the correct usage of
policies (and groups) in TOSCA.


incubator-ariatosca git commit: ARIA-254 Create of multiple nodes per template [Forced Update!]

2017-06-01 Thread emblemparade
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-254-multiple-nodes-per-template acfc7f461 -> eee540cbb 
(forced update)


ARIA-254 Create of multiple nodes per template

* New aria.Scaling policy (and "scaling" role)
* NodeTemplate model no longer stores scaling values (default_instances,
etc.) but instead fetches them from applicable scaling policies
* Some code cleanup


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

Branch: refs/heads/ARIA-254-multiple-nodes-per-template
Commit: eee540cbbed66b2ee3ea0c143ddc9bed0cbce29d
Parents: 9174f94
Author: Tal Liron 
Authored: Thu Jun 1 14:17:17 2017 -0500
Committer: Tal Liron 
Committed: Thu Jun 1 14:44:36 2017 -0500

--
 aria/cli/commands/workflows.py  |   4 +-
 aria/cli/execution_logging.py   |   4 +-
 aria/core.py|   2 +-
 aria/modeling/orchestration.py  |  12 +-
 aria/modeling/relationship.py   |   2 +-
 aria/modeling/service_changes.py|   8 +-
 aria/modeling/service_common.py |   2 +-
 aria/modeling/service_instance.py   |  59 +++
 aria/modeling/service_template.py   | 154 +--
 aria/modeling/types.py  |   4 +-
 aria/orchestrator/workflow_runner.py|   2 +-
 aria/orchestrator/workflows/executor/celery.py  |   2 +-
 aria/orchestrator/workflows/executor/process.py |   2 +-
 aria/orchestrator/workflows/executor/thread.py  |   2 +-
 aria/storage/core.py|   2 +-
 .../profiles/aria-1.0/aria-1.0.yaml |  25 ++-
 .../simple_v1_0/assignments.py  |   8 +
 .../simple_v1_0/data_types.py   |  22 ++-
 .../simple_v1_0/definitions.py  |   8 +
 .../aria_extension_tosca/simple_v1_0/filters.py |   2 +
 .../aria_extension_tosca/simple_v1_0/misc.py|  10 ++
 .../simple_v1_0/modeling/__init__.py|   3 -
 .../simple_v1_0/presentation/extensible.py  |   1 +
 .../presentation/field_validators.py|  20 +++
 .../simple_v1_0/presentation/types.py   |   2 +
 .../simple_v1_0/presenter.py|   3 +-
 .../simple_v1_0/templates.py|   8 +-
 .../aria_extension_tosca/simple_v1_0/types.py   |  10 +-
 tests/end2end/test_hello_world.py   |   2 +-
 tests/end2end/test_nodecellar.py|   2 +-
 tests/mock/models.py|   8 +-
 tests/modeling/test_mixins.py   |   3 -
 tests/modeling/test_models.py   |  20 +--
 tests/orchestrator/context/test_operation.py|   2 +-
 .../node-cellar/node-cellar.yaml|   1 +
 .../node-cellar/types/openstack.yaml|   3 +-
 36 files changed, 286 insertions(+), 138 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/eee540cb/aria/cli/commands/workflows.py
--
diff --git a/aria/cli/commands/workflows.py b/aria/cli/commands/workflows.py
index 221dbc4..baab973 100644
--- a/aria/cli/commands/workflows.py
+++ b/aria/cli/commands/workflows.py
@@ -42,7 +42,7 @@ def show(workflow_name, service_name, model_storage, logger):
 logger.info('Retrieving workflow {0} for service {1}'.format(
 workflow_name, service_name))
 service = model_storage.service.get_by_name(service_name)
-workflow = next((wf for wf in service.workflows.values() if
+workflow = next((wf for wf in service.workflows.itervalues() if
  wf.name == workflow_name), None)
 if not workflow:
 raise AriaCliError(
@@ -91,7 +91,7 @@ def list(service_name, model_storage, logger):
 """
 logger.info('Listing workflows for service {0}...'.format(service_name))
 service = model_storage.service.get_by_name(service_name)
-workflows_list = sorted(service.workflows.values(), key=lambda w: w.name)
+workflows_list = sorted(service.workflows.itervalues(), key=lambda w: 
w.name)
 
 defaults = {
 'service_template_name': service.service_template_name,

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/eee540cb/aria/cli/execution_logging.py
--
diff --git a/aria/cli/execution_logging.py b/aria/cli/execution_logging.py
index 248ff7c..467123c 100644
--- a/aria/cli/execution_logging.py
+++ b/aria/cli/execution_logging.py
@@ -106,11 +106,11 @@ def stylize_log(item, mark_pattern):
 if item.task:

[incubator-ariatosca] Git Push Summary

2017-06-01 Thread emblemparade
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-149-functions-in-operation-configuration [deleted] 25ce830b7


incubator-ariatosca git commit: ARIA-254 Create of multiple nodes per template

2017-06-01 Thread emblemparade
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-254-multiple-nodes-per-template [created] acfc7f461


ARIA-254 Create of multiple nodes per template

* New aria.Scaling policy (and "scaling" role)
* NodeTemplate model no longer stores scaling values (default_instances,
etc.) but instead fetches them from applicable scaling policies
* Some code cleanup


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

Branch: refs/heads/ARIA-254-multiple-nodes-per-template
Commit: acfc7f461b7ee6f01b6095d8eb4e28554df8928c
Parents: 9174f94
Author: Tal Liron 
Authored: Thu Jun 1 14:17:17 2017 -0500
Committer: Tal Liron 
Committed: Thu Jun 1 14:17:17 2017 -0500

--
 aria/cli/commands/workflows.py  |   4 +-
 aria/cli/execution_logging.py   |   4 +-
 aria/core.py|   2 +-
 aria/modeling/orchestration.py  |  12 +-
 aria/modeling/relationship.py   |   2 +-
 aria/modeling/service_changes.py|   8 +-
 aria/modeling/service_common.py |   2 +-
 aria/modeling/service_instance.py   |  59 +++
 aria/modeling/service_template.py   | 154 +--
 aria/modeling/types.py  |   4 +-
 aria/orchestrator/workflow_runner.py|   2 +-
 aria/orchestrator/workflows/executor/celery.py  |   2 +-
 aria/orchestrator/workflows/executor/process.py |   2 +-
 aria/orchestrator/workflows/executor/thread.py  |   2 +-
 aria/storage/core.py|   2 +-
 .../profiles/aria-1.0/aria-1.0.yaml |  25 ++-
 .../simple_v1_0/assignments.py  |   8 +
 .../simple_v1_0/data_types.py   |  22 ++-
 .../simple_v1_0/definitions.py  |   8 +
 .../aria_extension_tosca/simple_v1_0/filters.py |   2 +
 .../aria_extension_tosca/simple_v1_0/misc.py|  10 ++
 .../simple_v1_0/modeling/__init__.py|   3 -
 .../simple_v1_0/presentation/extensible.py  |   1 +
 .../presentation/field_validators.py|  20 +++
 .../simple_v1_0/presentation/types.py   |   2 +
 .../simple_v1_0/presenter.py|   3 +-
 .../simple_v1_0/templates.py|   8 +-
 .../aria_extension_tosca/simple_v1_0/types.py   |  10 +-
 tests/end2end/test_hello_world.py   |   2 +-
 tests/mock/models.py|   8 +-
 tests/modeling/test_mixins.py   |   3 -
 tests/modeling/test_models.py   |  20 +--
 tests/orchestrator/context/test_operation.py|   2 +-
 .../node-cellar/node-cellar.yaml|   1 +
 .../node-cellar/types/openstack.yaml|   3 +-
 35 files changed, 285 insertions(+), 137 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/acfc7f46/aria/cli/commands/workflows.py
--
diff --git a/aria/cli/commands/workflows.py b/aria/cli/commands/workflows.py
index 221dbc4..baab973 100644
--- a/aria/cli/commands/workflows.py
+++ b/aria/cli/commands/workflows.py
@@ -42,7 +42,7 @@ def show(workflow_name, service_name, model_storage, logger):
 logger.info('Retrieving workflow {0} for service {1}'.format(
 workflow_name, service_name))
 service = model_storage.service.get_by_name(service_name)
-workflow = next((wf for wf in service.workflows.values() if
+workflow = next((wf for wf in service.workflows.itervalues() if
  wf.name == workflow_name), None)
 if not workflow:
 raise AriaCliError(
@@ -91,7 +91,7 @@ def list(service_name, model_storage, logger):
 """
 logger.info('Listing workflows for service {0}...'.format(service_name))
 service = model_storage.service.get_by_name(service_name)
-workflows_list = sorted(service.workflows.values(), key=lambda w: w.name)
+workflows_list = sorted(service.workflows.itervalues(), key=lambda w: 
w.name)
 
 defaults = {
 'service_template_name': service.service_template_name,

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/acfc7f46/aria/cli/execution_logging.py
--
diff --git a/aria/cli/execution_logging.py b/aria/cli/execution_logging.py
index 248ff7c..467123c 100644
--- a/aria/cli/execution_logging.py
+++ b/aria/cli/execution_logging.py
@@ -106,11 +106,11 @@ def stylize_log(item, mark_pattern):
 if item.task:
 # operation task
 implementation = item.task.function
- 

Re: Query related to substitution mapping

2017-06-01 Thread Ran Ziv
i agree for the most part, although I don't see it as part of the
instantiation phase refactoring, but rather as a completely separate
feature which I'd like us to work on in the near future.

On Thu, Jun 1, 2017 at 7:27 PM, Tal Liron  wrote:

> Your expectations are reasonable: that ARIA would look at all of its
> current service instances and try to match reqs-and-caps with
> substitutions.
>
> However, we are a bit far from implementing this. Currently, ARIA only
> knows how to match reqs-and-caps within the service.
>
> Also, this feature has to be planned rather carefully: in some cases the
> user will not want such automatic matching to happen with services that
> just happen to exist in ARIA's db. I think this a great place to introduce
> a new Policy that would allow the user to configure exactly how matching
> would happen: should the matching prefer external substitutions over
> internal nodes? are there limited to how many could be matched? (like the
> "occurrences" definition in Capability) should matching only happen with
> services of a certain csar/template? etc.
>
> ​We are planning some work ahead to refactor the way we instantiate
> services, and I think at least some parts of this feature should be
> included in that.
>


Re: Query on operation inputs

2017-06-01 Thread Tal Liron
I'm still a bit confused by all this. DJ, could you possibly create a quick
git repo with your complete example to make sure we're all on the same page
here?

On Thu, Jun 1, 2017 at 7:10 AM, Ran Ziv  wrote:

> Right, it makes more sense now :) But now I simply have to say again that
> as far as I can tell this should in fact be the intended behavior.
>
> What would you rather happen? the "labels" parameter be assigned with
> "None" instead?
> We considered this but part of the problem here is that the information
> about whether an input is required or not is no longer available at this
> stage so it's impossible to know whether to use "None" or raise an error.
> Tal and I have talked about it in the past, and from what I remember, Tal
> said the "required" field information in fact should not be stored, and is
> only relevant for parsing phase. It is possible I'm getting this wrong
> though :)
>
> I'm open for changes here as it is a somewhat confusing behavior - although
> I think it does make sense after all.
>
>
>
> On Thu, Jun 1, 2017 at 3:04 PM, D Jayachandran <
> d.jayachand...@ericsson.com>
> wrote:
>
> > Hi Ran/Tal,
> >
> > I was wrong, Tal's branch still throws the validation error (I was
> loading
> > a different service template) :). So the issue which I told still exists
> >
> > [root@DJ-DEV tal-test]# python /root/tal-test/incubator-
> ariatosca/aria/cli/main.py
> > executions start install -s s2
> > Declared parameters "labels" have not been provided values
> >
> > Regards,
> > DJ
> >
> > -Original Message-
> > From: Ran Ziv [mailto:r...@gigaspaces.com]
> > Sent: Thursday, June 01, 2017 5:24 PM
> > To: dev@ariatosca.incubator.apache.org
> > Subject: Re: Query on operation inputs
> >
> > Again, there's a difference between the "required" validation and the
> > actual runtime validation. the runtime one cannot be done during
> > instantiation phase, which is why there are two separate validations.
> >
> > I do not know how come Tal's branch (which by now has been merged to
> > master) helped fixing your issue, so I might have misunderstood something
> > about your problem :)
> >
> > Ran
> >
> > On Thu, Jun 1, 2017 at 2:11 PM, D Jayachandran <
> > d.jayachand...@ericsson.com>
> > wrote:
> >
> > > Hi Tal,
> > >
> > > I did test your branch  https://github.com/apache/
> > > incubator-ariatosca/tree/ARIA-149-functions-in-operation-configuration
> > > and it seems to have the fix for operation/interface inputs.
> > >
> > > Regards,
> > > DJ
> > > -Original Message-
> > > From: D Jayachandran
> > > Sent: Thursday, June 01, 2017 4:40 PM
> > > To: dev@ariatosca.incubator.apache.org
> > > Subject: RE: Query on operation inputs
> > >
> > > Hi Ran,
> > >
> > > The validation of operation inputs is also done during instantiation.
> > > Please find below.
> > >
> > > [root@DJ-DEV tal-test]# python
> > > /root/tal-test/incubator-ariatosca/aria/cli/main.py
> > > service-templates store /root/tosca_simple_yaml_
> > > plugin/kubernetes-deployment.yaml st-3 Storing service template
> st-3...
> > > Validation issues:
> > >   4: interface definition "Standard" does not assign a value to a
> > > required operation input "create.name" in "web_app"
> > >
> > > @"/root/tosca_simple_yaml_plugin/kubernetes-deployment.yaml":64:25
> > > Failed to parse service template
> > >
> > >
> > > I think the branch Tal provided  https://github.com/apache/
> > > incubator-ariatosca/tree/ARIA-149-functions-in-operation-configuration
> > > has fixed the issue on operation inputs.
> > >
> > > Regards,
> > > DJ
> > >
> > > -Original Message-
> > > From: Ran Ziv [mailto:r...@gigaspaces.com]
> > > Sent: Thursday, June 01, 2017 2:27 PM
> > > To: dev@ariatosca.incubator.apache.org
> > > Subject: Re: Query on operation inputs
> > >
> > > I think there's some confusion about different types of inputs. The
> > > validation on inputs that is done during parsing (actually
> > > "instantiation") stage is for the service's inputs, not operations.
> > > Execution and operation inputs (or more broadly, arguments) are
> > > validated before an execution is run.
> > >
> > >
> > > On Tue, May 30, 2017 at 8:48 AM, D Jayachandran <
> > > d.jayachand...@ericsson.com
> > > > wrote:
> > >
> > > > Hi Ran,
> > > >
> > > > I think Tal as updated, it might be possibly a bug here. May be we
> > > > all should come to common understanding.
> > > >
> > > > As I updated earlier, since the inputs validation are completing
> > > > during parsing stage, I don’t feel why the validation is required
> > > > again during orchestration time ?
> > > > Does the TOSCA spec actually refers the 2nd points of yours ? (The
> > > > operation inputs must either have a default value in the type
> > > > definition or be supplied with a value in the actual operation
> > > > definition)
> > > >
> > > >
> > > > Regards,
> > > > DJ
> > > >
> > > > -Original Message-
> > > > From: Ran Ziv [mailto:r...@gigaspaces.com]
> > > > Sent: Sunday, May 28, 2017 6:14

incubator-ariatosca git commit: Add Argument and Configuration models [Forced Update!]

2017-06-01 Thread avia
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-180-convert-parameter-to-one-to-many b7d2df00e -> 133976eae 
(forced update)


Add Argument and Configuration models


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

Branch: refs/heads/ARIA-180-convert-parameter-to-one-to-many
Commit: 133976eae1492ef8767362ddaef6ab94b48d9b2e
Parents: fdda757
Author: Avia Efrat 
Authored: Thu Jun 1 17:09:22 2017 +0300
Committer: Avia Efrat 
Committed: Thu Jun 1 19:29:03 2017 +0300

--
 aria/modeling/mixins.py | 216 -
 aria/modeling/models.py |  17 +-
 aria/modeling/orchestration.py  |  35 ++-
 aria/modeling/service_common.py | 243 +++
 aria/modeling/service_instance.py   |  44 ++--
 aria/modeling/service_template.py   |  28 +--
 aria/modeling/utils.py  |   6 +-
 .../context/collection_instrumentation.py   |  10 +-
 .../execution_plugin/instantiation.py   |  26 +-
 aria/orchestrator/workflow_runner.py|   4 +-
 aria/orchestrator/workflows/api/task.py |   6 +-
 examples/hello-world/helloworld.yaml|   7 +-
 .../simple_v1_0/modeling/__init__.py|   6 +-
 tests/mock/models.py|   4 +-
 tests/mock/topology.py  |   8 +-
 tests/modeling/test_models.py   |   3 +-
 .../context/test_collection_instrumentation.py  |  64 ++---
 tests/orchestrator/context/test_toolbelt.py |   2 +-
 tests/orchestrator/test_workflow_runner.py  |   6 +-
 .../workflows/executor/test_executor.py |   2 +-
 20 files changed, 411 insertions(+), 326 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/133976ea/aria/modeling/mixins.py
--
diff --git a/aria/modeling/mixins.py b/aria/modeling/mixins.py
index 38c812d..9a88f81 100644
--- a/aria/modeling/mixins.py
+++ b/aria/modeling/mixins.py
@@ -23,10 +23,14 @@ from sqlalchemy.ext import associationproxy
 from sqlalchemy import (
 Column,
 Integer,
-Text
+Text,
+PickleType
 )
 
-from . import utils
+from ..parser.consumption import ConsumptionContext
+from ..utils import console, collections, caching, formatting
+from ..utils.type import canonical_type_name, full_type_name
+from . import utils, functions
 
 
 class ModelMixin(object):
@@ -140,3 +144,211 @@ class TemplateModelMixin(InstanceModelMixin):
 
 def instantiate(self, container):
 raise NotImplementedError
+
+
+class ParameterMixin(TemplateModelMixin, caching.HasCachedMethods):
+"""
+Represents a typed value. The value can contain nested intrinsic functions.
+
+This model can be used as the ``container_holder`` argument for 
:func:`functions.evaluate`.
+
+:ivar name: Name
+:vartype name: basestring
+:ivar type_name: Type name
+:vartype type_name: basestring
+:ivar value: Value
+:ivar description: Description
+:vartype description: basestring
+"""
+
+__tablename__ = 'parameter'
+
+name = Column(Text)
+type_name = Column(Text)
+description = Column(Text)
+_value = Column(PickleType)
+
+@property
+def value(self):
+value = self._value
+if value is not None:
+evaluation = functions.evaluate(value, self)
+if evaluation is not None:
+value = evaluation.value
+return value
+
+@value.setter
+def value(self, value):
+self._value = value
+
+@property
+@caching.cachedmethod
+def owner(self):
+"""
+The sole owner of this parameter, which is another model that relates 
to it.
+
+*All* parameters should have an owner model. In case this property 
method fails to find
+it, it will raise a ValueError, which should signify an abnormal, 
orphaned parameter.
+"""
+
+# Find first non-null relationship
+for the_relationship in self.__mapper__.relationships:
+v = getattr(self, the_relationship.key)
+if v:
+return v
+
+raise ValueError('orphaned {class_name}: does not have an owner: 
{name}'.format(
+class_name=type(self).__name__, name=self.name))
+
+@property
+@caching.cachedmethod
+def container(self): # pylint: 
disable=too-many-return-statements,too-many-branches
+"""
+The logical container for this parameter, which would be another 
model: ser

Re: Query related to substitution mapping

2017-06-01 Thread Tal Liron
Your expectations are reasonable: that ARIA would look at all of its
current service instances and try to match reqs-and-caps with substitutions.

However, we are a bit far from implementing this. Currently, ARIA only
knows how to match reqs-and-caps within the service.

Also, this feature has to be planned rather carefully: in some cases the
user will not want such automatic matching to happen with services that
just happen to exist in ARIA's db. I think this a great place to introduce
a new Policy that would allow the user to configure exactly how matching
would happen: should the matching prefer external substitutions over
internal nodes? are there limited to how many could be matched? (like the
"occurrences" definition in Capability) should matching only happen with
services of a certain csar/template? etc.

​We are planning some work ahead to refactor the way we instantiate
services, and I think at least some parts of this feature should be
included in that.


incubator-ariatosca git commit: Add Argument and Configuration models [Forced Update!]

2017-06-01 Thread avia
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-180-convert-parameter-to-one-to-many 5038c65df -> b7d2df00e 
(forced update)


Add Argument and Configuration models


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

Branch: refs/heads/ARIA-180-convert-parameter-to-one-to-many
Commit: b7d2df00e27b911f8bda89af3af05ce2cc2b446d
Parents: fdda757
Author: Avia Efrat 
Authored: Thu Jun 1 17:09:22 2017 +0300
Committer: Avia Efrat 
Committed: Thu Jun 1 19:22:10 2017 +0300

--
 aria/modeling/mixins.py | 216 -
 aria/modeling/models.py |  17 +-
 aria/modeling/orchestration.py  |  35 ++-
 aria/modeling/service_common.py | 243 +++
 aria/modeling/service_instance.py   |  44 ++--
 aria/modeling/service_template.py   |  28 +--
 aria/modeling/utils.py  |   6 +-
 .../context/collection_instrumentation.py   |  10 +-
 .../execution_plugin/instantiation.py   |  26 +-
 aria/orchestrator/workflow_runner.py|   4 +-
 aria/orchestrator/workflows/api/task.py |   6 +-
 examples/hello-world/helloworld.yaml|   7 +-
 .../simple_v1_0/modeling/__init__.py|   6 +-
 tests/mock/models.py|   4 +-
 tests/mock/topology.py  |   8 +-
 tests/modeling/test_models.py   |   3 +-
 .../context/test_collection_instrumentation.py  |  64 ++---
 tests/orchestrator/context/test_toolbelt.py |   2 +-
 tests/orchestrator/test_workflow_runner.py  |   6 +-
 .../workflows/executor/test_executor.py |   2 +-
 20 files changed, 411 insertions(+), 326 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b7d2df00/aria/modeling/mixins.py
--
diff --git a/aria/modeling/mixins.py b/aria/modeling/mixins.py
index 38c812d..9a88f81 100644
--- a/aria/modeling/mixins.py
+++ b/aria/modeling/mixins.py
@@ -23,10 +23,14 @@ from sqlalchemy.ext import associationproxy
 from sqlalchemy import (
 Column,
 Integer,
-Text
+Text,
+PickleType
 )
 
-from . import utils
+from ..parser.consumption import ConsumptionContext
+from ..utils import console, collections, caching, formatting
+from ..utils.type import canonical_type_name, full_type_name
+from . import utils, functions
 
 
 class ModelMixin(object):
@@ -140,3 +144,211 @@ class TemplateModelMixin(InstanceModelMixin):
 
 def instantiate(self, container):
 raise NotImplementedError
+
+
+class ParameterMixin(TemplateModelMixin, caching.HasCachedMethods):
+"""
+Represents a typed value. The value can contain nested intrinsic functions.
+
+This model can be used as the ``container_holder`` argument for 
:func:`functions.evaluate`.
+
+:ivar name: Name
+:vartype name: basestring
+:ivar type_name: Type name
+:vartype type_name: basestring
+:ivar value: Value
+:ivar description: Description
+:vartype description: basestring
+"""
+
+__tablename__ = 'parameter'
+
+name = Column(Text)
+type_name = Column(Text)
+description = Column(Text)
+_value = Column(PickleType)
+
+@property
+def value(self):
+value = self._value
+if value is not None:
+evaluation = functions.evaluate(value, self)
+if evaluation is not None:
+value = evaluation.value
+return value
+
+@value.setter
+def value(self, value):
+self._value = value
+
+@property
+@caching.cachedmethod
+def owner(self):
+"""
+The sole owner of this parameter, which is another model that relates 
to it.
+
+*All* parameters should have an owner model. In case this property 
method fails to find
+it, it will raise a ValueError, which should signify an abnormal, 
orphaned parameter.
+"""
+
+# Find first non-null relationship
+for the_relationship in self.__mapper__.relationships:
+v = getattr(self, the_relationship.key)
+if v:
+return v
+
+raise ValueError('orphaned {class_name}: does not have an owner: 
{name}'.format(
+class_name=type(self).__name__, name=self.name))
+
+@property
+@caching.cachedmethod
+def container(self): # pylint: 
disable=too-many-return-statements,too-many-branches
+"""
+The logical container for this parameter, which would be another 
model: ser

Re: Support for TOSCA Simple Profile NFV 1.0

2017-06-01 Thread Tal Liron
Thanks DJ, I opened a new JIRA issue for this if you want to track it:

https://issues.apache.org/jira/browse/ARIA-275

It shouldn't be too hard to do, just some busy work in YAML. Anyone on the
mailing list want to tackle this?

On Thu, Jun 1, 2017 at 4:53 AM, D Jayachandran 
wrote:

> Hi,
>
> I hope ARIA currently supports , TOSCA Simple Profile NFV 1.0 draft 03.
> The Latest available TOSCA NFV profile is Simple profile NFV 1.0 draft 04,
> released on 11 May 2017.
>
> Could you kindly confirm the current level of support from ARIA for NFV
> profiles and do you have any timelines to support draft 04 ?
>
>
> Regards,
> DJ
>



-- 
Tal Liron
Senior Engineer
t...@gigaspaces.com | +1 (773) 828-9339
Cloudify | http://getcloudify.org




   
[image: Azure Webinar]



incubator-ariatosca git commit: another test fix

2017-06-01 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-262-Inconsistent-node-attributes-behavior 695a709a5 -> 
963e9b3a9


another test fix


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

Branch: refs/heads/ARIA-262-Inconsistent-node-attributes-behavior
Commit: 963e9b3a9c56f97b65b6d75d587443b2973bd95a
Parents: 695a709
Author: max-orlov 
Authored: Thu Jun 1 18:29:06 2017 +0300
Committer: max-orlov 
Committed: Thu Jun 1 18:29:06 2017 +0300

--
 .../workflows/executor/test_process_executor_extension.py   | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/963e9b3a/tests/orchestrator/workflows/executor/test_process_executor_extension.py
--
diff --git 
a/tests/orchestrator/workflows/executor/test_process_executor_extension.py 
b/tests/orchestrator/workflows/executor/test_process_executor_extension.py
index e4944df..f3e40b6 100644
--- a/tests/orchestrator/workflows/executor/test_process_executor_extension.py
+++ b/tests/orchestrator/workflows/executor/test_process_executor_extension.py
@@ -66,8 +66,9 @@ class MockProcessExecutorExtension(object):
 def decorate(self):
 def decorator(function):
 def wrapper(ctx, **operation_arguments):
-ctx.node.attributes['out'] = {'wrapper_arguments': 
operation_arguments}
-function(ctx=ctx, **operation_arguments)
+with ctx.model.instrument({ctx.model.node.model_cls: 
['attributes']}):
+ctx.node.attributes['out'] = {'wrapper_arguments': 
operation_arguments}
+function(ctx=ctx, **operation_arguments)
 return wrapper
 return decorator
 



incubator-ariatosca git commit: added mocking to ssh Ctx

2017-06-01 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-262-Inconsistent-node-attributes-behavior 1a4066524 -> 
695a709a5


added mocking to ssh Ctx


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

Branch: refs/heads/ARIA-262-Inconsistent-node-attributes-behavior
Commit: 695a709a51233d5dcea7dcdc73a76a61c58a6781
Parents: 1a40665
Author: max-orlov 
Authored: Thu Jun 1 18:25:56 2017 +0300
Committer: max-orlov 
Committed: Thu Jun 1 18:25:56 2017 +0300

--
 tests/orchestrator/execution_plugin/test_ssh.py | 5 +
 1 file changed, 5 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/695a709a/tests/orchestrator/execution_plugin/test_ssh.py
--
diff --git a/tests/orchestrator/execution_plugin/test_ssh.py 
b/tests/orchestrator/execution_plugin/test_ssh.py
index 899a007..8056649 100644
--- a/tests/orchestrator/execution_plugin/test_ssh.py
+++ b/tests/orchestrator/execution_plugin/test_ssh.py
@@ -429,8 +429,13 @@ class TestFabricEnvHideGroupsAndRunCommands(object):
 actor = None
 class Actor(object):
 host = None
+class Model(object):
+@contextlib.contextmanager
+def instrument(*args, **kwargs):
+yield
 task = Task
 task.actor = Actor
+model = Model()
 logger = logging.getLogger()
 
 @staticmethod



incubator-ariatosca git commit: added try/finally and fixes some tests

2017-06-01 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-262-Inconsistent-node-attributes-behavior a48f8158d -> 
1a4066524


added try/finally and fixes some tests


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

Branch: refs/heads/ARIA-262-Inconsistent-node-attributes-behavior
Commit: 1a40665243f35dfaaf8f8350ca335ad7bc253f9c
Parents: a48f815
Author: max-orlov 
Authored: Thu Jun 1 18:10:25 2017 +0300
Committer: max-orlov 
Committed: Thu Jun 1 18:10:25 2017 +0300

--
 aria/storage/core.py  | 10 ++
 .../context/test_collection_instrumentation.py| 14 +-
 2 files changed, 15 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/1a406652/aria/storage/core.py
--
diff --git a/aria/storage/core.py b/aria/storage/core.py
index 65ca8e7..b752505 100644
--- a/aria/storage/core.py
+++ b/aria/storage/core.py
@@ -170,7 +170,6 @@ class ModelStorage(Storage):
 
 @contextmanager
 def instrument(self, instrumentation):
-original_instrumentation = {}
 
 def _instrument(source_inst, target_inst=None):
 for mapi in self.registered.values():
@@ -182,6 +181,9 @@ class ModelStorage(Storage):
 else:
 del mapi._instrumentation[cls]
 
-_instrument(instrumentation, original_instrumentation)
-yield self
-_instrument(original_instrumentation)
+original_instrumentation = {}
+try:
+_instrument(instrumentation, original_instrumentation)
+yield self
+finally:
+_instrument(original_instrumentation)

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/1a406652/tests/orchestrator/context/test_collection_instrumentation.py
--
diff --git a/tests/orchestrator/context/test_collection_instrumentation.py 
b/tests/orchestrator/context/test_collection_instrumentation.py
index b8b3295..066cc33 100644
--- a/tests/orchestrator/context/test_collection_instrumentation.py
+++ b/tests/orchestrator/context/test_collection_instrumentation.py
@@ -25,12 +25,16 @@ class MockActor(object):
 self.list_ = []
 
 
-class MockModel(object):
+class MockMAPI(object):
 
 def __init__(self):
-self.parameter = type('MockModel', (object, ), {'model_cls': Parameter,
-'put': lambda *args, 
**kwargs: None,
-'update': lambda 
*args, **kwargs: None})()
+pass
+
+def put(self, *args, **kwargs):
+pass
+
+def update(self, *args, **kwargs):
+pass
 
 
 class CollectionInstrumentation(object):
@@ -41,7 +45,7 @@ class CollectionInstrumentation(object):
 
 @pytest.fixture
 def model(self):
-return MockModel()
+return MockMAPI()
 
 @pytest.fixture
 def dict_(self, actor, model):



incubator-ariatosca git commit: tiny fix for several instrumenetation fields [Forced Update!]

2017-06-01 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-262-Inconsistent-node-attributes-behavior 558e162a9 -> 
a48f8158d (forced update)


tiny fix for several instrumenetation fields


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

Branch: refs/heads/ARIA-262-Inconsistent-node-attributes-behavior
Commit: a48f8158d4f21d11c53641191c32dfa079314704
Parents: bd7a438
Author: max-orlov 
Authored: Thu Jun 1 17:30:39 2017 +0300
Committer: max-orlov 
Committed: Thu Jun 1 17:43:55 2017 +0300

--
 aria/storage/collection_instrumentation.py   | 21 +
 aria/utils/imports.py|  2 +-
 tests/orchestrator/context/test_operation.py |  2 +-
 3 files changed, 15 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/a48f8158/aria/storage/collection_instrumentation.py
--
diff --git a/aria/storage/collection_instrumentation.py 
b/aria/storage/collection_instrumentation.py
index 792f76c..680103e 100644
--- a/aria/storage/collection_instrumentation.py
+++ b/aria/storage/collection_instrumentation.py
@@ -13,7 +13,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-from aria.modeling import models
+from ..modeling import models
+from . import exceptions
 
 
 class _InstrumentedCollection(object):
@@ -110,7 +111,8 @@ class _InstrumentedCollection(object):
 if self._is_top_level:
 # We are at the top level
 field = getattr(self._parent, self._field_name)
-self._set_field(field, key, value if key in field else 
self._encapsulate_value(key, value))
+self._set_field(
+field, key, value if key in field else 
self._encapsulate_value(key, value))
 self._mapi.update(self._parent)
 else:
 # We are not at the top level
@@ -201,7 +203,7 @@ class _InstrumentedModel(object):
 
 def __init__(self, original_model, mapi, instrumentation):
 """
-The original model 
+The original model
 :param original_model: the model to be instrumented
 :param mapi: the mapi for that model
 """
@@ -209,7 +211,7 @@ class _InstrumentedModel(object):
 self._original_model = original_model
 self._mapi = mapi
 self._instrumentation = instrumentation
-self._instrumentation_cls = self._apply_instrumentation()
+self._apply_instrumentation()
 
 def __getattr__(self, item):
 return_value = getattr(self._original_model, item)
@@ -232,14 +234,18 @@ class _InstrumentedModel(object):
 instrumentation_cls = _InstrumentedList
 else:
 # TODO: raise proper error
-raise
+raise exceptions.StorageError(
+"ARIA supports instrumentation for dict and list. Field 
{field} of the "
+"class {model} is of {type} type.".format(
+field=field,
+model=self._original_model,
+type=type(field)))
 
 instrumented_class = instrumentation_cls(seq=field,
  
parent=self._original_model,
  mapi=self._mapi,
  field_name=field_name)
 setattr(self, field_name, instrumented_class)
-return instrumentation_cls
 
 
 class _WrappedModel(object):
@@ -247,7 +253,7 @@ class _WrappedModel(object):
 def __init__(self, wrapped, instrumentation, **kwargs):
 """
 
-:param instrumented_cls: The class to be instrumented 
+:param instrumented_cls: The class to be instrumented
 :param instrumentation_cls: the instrumentation cls
 :param wrapped: the currently wrapped instance
 :param kwargs: and kwargs to te passed to the instrumented class.
@@ -279,4 +285,3 @@ def instrument(instrumentation, original_model, mapi):
 return _InstrumentedModel(original_model, mapi, instrumentation)
 
 return _WrappedModel(original_model, instrumentation, mapi=mapi)
-

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/a48f8158/aria/utils/imports.py
--
diff --git a/aria/utils/imports.py b/aria/utils/imports.py
index 64a48cf..35aa0fc 100644
--- a/aria/utils/imports.py
+++ b/aria/utils/imports.py
@@ -17

[incubator-ariatosca] Git Push Summary

2017-06-01 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-213-Sporadic-tests-failures-over-locked-database-issue 
[deleted] 2ee06b8a6


[incubator-ariatosca] Git Push Summary

2017-06-01 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/runtime_props_to_attr [deleted] 725b7f040


incubator-ariatosca git commit: tiny fix for several instrumenetation fields [Forced Update!]

2017-06-01 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-262-Inconsistent-node-attributes-behavior 77866ab1e -> 
558e162a9 (forced update)


tiny fix for several instrumenetation fields


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

Branch: refs/heads/ARIA-262-Inconsistent-node-attributes-behavior
Commit: 558e162a96900a2583cb4d1d7c7aac8289ec4a2b
Parents: bd7a438
Author: max-orlov 
Authored: Thu Jun 1 17:30:39 2017 +0300
Committer: max-orlov 
Committed: Thu Jun 1 17:33:29 2017 +0300

--
 aria/storage/collection_instrumentation.py   | 3 +--
 tests/orchestrator/context/test_operation.py | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/558e162a/aria/storage/collection_instrumentation.py
--
diff --git a/aria/storage/collection_instrumentation.py 
b/aria/storage/collection_instrumentation.py
index 792f76c..4c93543 100644
--- a/aria/storage/collection_instrumentation.py
+++ b/aria/storage/collection_instrumentation.py
@@ -209,7 +209,7 @@ class _InstrumentedModel(object):
 self._original_model = original_model
 self._mapi = mapi
 self._instrumentation = instrumentation
-self._instrumentation_cls = self._apply_instrumentation()
+self._apply_instrumentation()
 
 def __getattr__(self, item):
 return_value = getattr(self._original_model, item)
@@ -239,7 +239,6 @@ class _InstrumentedModel(object):
  mapi=self._mapi,
  field_name=field_name)
 setattr(self, field_name, instrumented_class)
-return instrumentation_cls
 
 
 class _WrappedModel(object):

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/558e162a/tests/orchestrator/context/test_operation.py
--
diff --git a/tests/orchestrator/context/test_operation.py 
b/tests/orchestrator/context/test_operation.py
index c50f2e3..59df059 100644
--- a/tests/orchestrator/context/test_operation.py
+++ b/tests/orchestrator/context/test_operation.py
@@ -263,7 +263,7 @@ def test_plugin_workdir(ctx, thread_executor, tmpdir):
 
 @pytest.fixture(params=[
 (thread.ThreadExecutor, {}),
-# (process.ProcessExecutor, {'python_path': [tests.ROOT_DIR]}),
+(process.ProcessExecutor, {'python_path': [tests.ROOT_DIR]}),
 ])
 def executor(request):
 executor_cls, executor_kwargs = request.param



incubator-ariatosca git commit: tiny fix for several instrumenetation fields

2017-06-01 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-262-Inconsistent-node-attributes-behavior bd7a43898 -> 
77866ab1e


tiny fix for several instrumenetation fields


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

Branch: refs/heads/ARIA-262-Inconsistent-node-attributes-behavior
Commit: 77866ab1e770c03504b8b5c2f6f8836d7a991e42
Parents: bd7a438
Author: max-orlov 
Authored: Thu Jun 1 17:30:39 2017 +0300
Committer: max-orlov 
Committed: Thu Jun 1 17:30:39 2017 +0300

--
 aria/storage/collection_instrumentation.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/77866ab1/aria/storage/collection_instrumentation.py
--
diff --git a/aria/storage/collection_instrumentation.py 
b/aria/storage/collection_instrumentation.py
index 792f76c..4c93543 100644
--- a/aria/storage/collection_instrumentation.py
+++ b/aria/storage/collection_instrumentation.py
@@ -209,7 +209,7 @@ class _InstrumentedModel(object):
 self._original_model = original_model
 self._mapi = mapi
 self._instrumentation = instrumentation
-self._instrumentation_cls = self._apply_instrumentation()
+self._apply_instrumentation()
 
 def __getattr__(self, item):
 return_value = getattr(self._original_model, item)
@@ -239,7 +239,6 @@ class _InstrumentedModel(object):
  mapi=self._mapi,
  field_name=field_name)
 setattr(self, field_name, instrumented_class)
-return instrumentation_cls
 
 
 class _WrappedModel(object):



[14/16] incubator-ariatosca git commit: Add property many-to-one relationships

2017-06-01 Thread avia
Add property many-to-one relationships

To:
node template, node,
group template, group,
policy template, policy,
relationship template, relationship,
capability template, capability,
artifact template, artifact.


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

Branch: refs/heads/ARIA-180-convert-parameter-to-one-to-many
Commit: 3e562785ce389d2f9d748729a96115cad7f19def
Parents: b0d251f
Author: Avia Efrat 
Authored: Wed May 24 17:59:27 2017 +0300
Committer: Avia Efrat 
Committed: Thu Jun 1 12:05:17 2017 +0300

--
 aria/modeling/service_common.py   | 178 +++--
 aria/modeling/service_instance.py |  58 +--
 aria/modeling/service_template.py |  56 +--
 3 files changed, 194 insertions(+), 98 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/3e562785/aria/modeling/service_common.py
--
diff --git a/aria/modeling/service_common.py b/aria/modeling/service_common.py
index 1606e78..11f9d01 100644
--- a/aria/modeling/service_common.py
+++ b/aria/modeling/service_common.py
@@ -85,7 +85,6 @@ class ParameterBase(TemplateModelMixin, 
caching.HasCachedMethods):
 
 raise ValueError('orphaned parameter: does not have an owner: 
{0}'.format(self.name))
 
-
 @property
 @caching.cachedmethod
 def container(self): # pylint: 
disable=too-many-return-statements,too-many-branches
@@ -875,6 +874,121 @@ class PropertyBase(TemplateModelMixin, 
caching.HasCachedMethods):
 def value(self, value):
 self._value = value
 
+# region foreign keys
+
+@declared_attr
+def node_template_fk(cls):
+"""For Property many-to-one to NodeTemplate"""
+return relationship.foreign_key('node_template', nullable=True)
+
+@declared_attr
+def group_template_fk(cls):
+"""For Property many-to-one to GroupTemplate"""
+return relationship.foreign_key('group_template', nullable=True)
+
+@declared_attr
+def policy_template_fk(cls):
+"""For Property many-to-one to PolicyTemplate"""
+return relationship.foreign_key('policy_template', nullable=True)
+
+@declared_attr
+def relationship_template_fk(cls):
+"""For Property many-to-one to RelationshipTemplate"""
+return relationship.foreign_key('relationship_template', nullable=True)
+
+@declared_attr
+def capability_template_fk(cls):
+"""For Property many-to-one to CapabilityTemplate"""
+return relationship.foreign_key('capability_template', nullable=True)
+
+@declared_attr
+def artifact_template_fk(cls):
+"""For Property many-to-one to ArtifactTemplate"""
+return relationship.foreign_key('artifact_template', nullable=True)
+
+@declared_attr
+def node_fk(cls):
+"""For Property many-to-one to Node"""
+return relationship.foreign_key('node', nullable=True)
+
+@declared_attr
+def group_fk(cls):
+"""For Property many-to-one to Group"""
+return relationship.foreign_key('group', nullable=True)
+
+@declared_attr
+def policy_fk(cls):
+"""For Property many-to-one to Policy"""
+return relationship.foreign_key('policy', nullable=True)
+
+@declared_attr
+def relationship_fk(cls):
+"""For Property many-to-one to Relationship"""
+return relationship.foreign_key('relationship', nullable=True)
+
+@declared_attr
+def capability_fk(cls):
+"""For Property many-to-one to Capability"""
+return relationship.foreign_key('capability', nullable=True)
+
+@declared_attr
+def artifact_fk(cls):
+"""For Property many-to-one to Artifact"""
+return relationship.foreign_key('artifact', nullable=True)
+# endregion
+
+# region many_to_one relationships
+
+@declared_attr
+def node_template(cls):
+return relationship.many_to_one(cls, 'node_template')
+
+@declared_attr
+def group_template(cls):
+return relationship.many_to_one(cls, 'group_template')
+
+@declared_attr
+def policy_template(cls):
+return relationship.many_to_one(cls, 'policy_template')
+
+@declared_attr
+def relationship_template(cls):
+return relationship.many_to_one(cls, 'relationship_template')
+
+@declared_attr
+def capability_template(cls):
+return relationship.many_to_one(cls, 'capability_template')
+
+@declared_attr
+def artifact_template(cls):
+return relationship.many_to_one(cls, 'artifact_template')
+
+@declared_attr
+def

[16/16] incubator-ariatosca git commit: Add Argument and Configuration models

2017-06-01 Thread avia
Add Argument and Configuration models


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

Branch: refs/heads/ARIA-180-convert-parameter-to-one-to-many
Commit: 5038c65df6bd6c8f77582d23ea3d4d381d8ab30b
Parents: fdda757
Author: Avia Efrat 
Authored: Thu Jun 1 17:09:22 2017 +0300
Committer: Avia Efrat 
Committed: Thu Jun 1 17:10:06 2017 +0300

--
 aria/modeling/mixins.py | 207 +++-
 aria/modeling/models.py |  17 +-
 aria/modeling/orchestration.py  |  35 ++-
 aria/modeling/service_common.py | 243 +++
 aria/modeling/service_instance.py   |  34 +--
 aria/modeling/service_template.py   |  28 +--
 aria/modeling/utils.py  |   6 +-
 .../context/collection_instrumentation.py   |  10 +-
 .../execution_plugin/instantiation.py   |  26 +-
 aria/orchestrator/workflow_runner.py|   4 +-
 aria/orchestrator/workflows/api/task.py |   6 +-
 examples/hello-world/helloworld.yaml|   7 +-
 .../simple_v1_0/modeling/__init__.py|   6 +-
 tests/mock/models.py|   4 +-
 tests/mock/topology.py  |   8 +-
 tests/modeling/test_models.py   |   3 +-
 .../context/test_collection_instrumentation.py  |  64 ++---
 tests/orchestrator/context/test_toolbelt.py |   2 +-
 .../workflows/executor/test_executor.py |   2 +-
 19 files changed, 388 insertions(+), 324 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/5038c65d/aria/modeling/mixins.py
--
diff --git a/aria/modeling/mixins.py b/aria/modeling/mixins.py
index 38c812d..4b307ab 100644
--- a/aria/modeling/mixins.py
+++ b/aria/modeling/mixins.py
@@ -23,10 +23,14 @@ from sqlalchemy.ext import associationproxy
 from sqlalchemy import (
 Column,
 Integer,
-Text
+Text,
+PickleType
 )
 
-from . import utils
+from ..parser.consumption import ConsumptionContext
+from ..utils import console, collections, caching, formatting
+from ..utils.type import canonical_type_name, full_type_name
+from . import utils, functions
 
 
 class ModelMixin(object):
@@ -140,3 +144,202 @@ class TemplateModelMixin(InstanceModelMixin):
 
 def instantiate(self, container):
 raise NotImplementedError
+
+
+class ParameterMixin(TemplateModelMixin, caching.HasCachedMethods):
+"""
+Represents a typed value. The value can contain nested intrinsic functions.
+
+This model can be used as the ``container_holder`` argument for 
:func:`functions.evaluate`.
+
+:ivar name: Name
+:vartype name: basestring
+:ivar type_name: Type name
+:vartype type_name: basestring
+:ivar value: Value
+:ivar description: Description
+:vartype description: basestring
+"""
+
+__tablename__ = 'parameter'
+
+name = Column(Text)
+type_name = Column(Text)
+description = Column(Text)
+_value = Column(PickleType)
+
+@property
+def value(self):
+value = self._value
+if value is not None:
+evaluation = functions.evaluate(value, self)
+if evaluation is not None:
+value = evaluation.value
+return value
+
+@value.setter
+def value(self, value):
+self._value = value
+
+@property
+@caching.cachedmethod
+def owner(self):
+"""
+The sole owner of this parameter, which is another model that relates 
to it.
+
+*All* parameters should have an owner model. In case this property 
method fails to find
+it, it will raise a ValueError, which should signify an abnormal, 
orphaned parameter.
+"""
+
+# Find first non-null relationship
+for the_relationship in self.__mapper__.relationships:
+v = getattr(self, the_relationship.key)
+if v:
+return v
+
+raise ValueError('orphaned {class_name}: does not have an owner: 
{name}'.format(
+class_name=type(self).__name__, name=self.name))
+
+@property
+@caching.cachedmethod
+def container(self): # pylint: 
disable=too-many-return-statements,too-many-branches
+"""
+The logical container for this parameter, which would be another 
model: service, node,
+group, or policy (or their templates).
+
+The logical container is equivalent to the ``SELF`` keyword used by 
intrinsic functions in
+TOSCA.
+
+*All* parameters 

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

2017-06-01 Thread avia
ARIA-149 Enhance operation configuration

* Also fixes ARIA-121, ARIA-190
* 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
* Add "function" and "arguments" fields to Operation model to preserve
  user data (in "implementation" and "inputs") and to clearly demarcate
  orchestration data from user data; update task API accordingly
* Some cleanup of parser code touched by this commit
* Rename "create_parameters" to "merge_parameter_values" and improve


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

Branch: refs/heads/ARIA-180-convert-parameter-to-one-to-many
Commit: 9174f9469922c57f9a979c6161bd17a9f3f90c97
Parents: 07d7951
Author: Tal Liron 
Authored: Thu Apr 20 17:54:47 2017 -0500
Committer: Tal Liron 
Committed: Wed May 31 16:42:02 2017 -0500

--
 aria/cli/commands/services.py   |   2 +-
 aria/cli/execution_logging.py   |   6 +-
 aria/core.py|  14 +-
 aria/modeling/constraints.py|  28 +++
 aria/modeling/contraints.py |  28 ---
 aria/modeling/exceptions.py |  16 +-
 aria/modeling/orchestration.py  |  14 +-
 aria/modeling/service_common.py |   7 +-
 aria/modeling/service_instance.py   |  89 +---
 aria/modeling/service_template.py   |  67 +++---
 aria/modeling/utils.py  | 114 +-
 aria/orchestrator/__init__.py   |   7 +-
 aria/orchestrator/context/operation.py  |   4 +-
 aria/orchestrator/decorators.py |   3 +-
 .../execution_plugin/instantiation.py   | 139 +++-
 aria/orchestrator/workflow_runner.py|  17 +-
 aria/orchestrator/workflows/api/task.py |  89 +---
 .../workflows/builtin/execute_operation.py  |   2 +-
 aria/orchestrator/workflows/core/task.py|   5 +-
 aria/orchestrator/workflows/events_logging.py   |   6 +-
 aria/orchestrator/workflows/executor/base.py|   4 +-
 aria/orchestrator/workflows/executor/celery.py  |   6 +-
 aria/orchestrator/workflows/executor/dry.py |   6 +-
 aria/orchestrator/workflows/executor/process.py |  12 +-
 aria/orchestrator/workflows/executor/thread.py  |   6 +-
 aria/utils/formatting.py|   4 +-
 aria/utils/validation.py|   8 +-
 .../profiles/aria-1.0/aria-1.0.yaml |   8 -
 .../simple_v1_0/assignments.py  |   4 +-
 .../simple_v1_0/modeling/__init__.py|  72 +--
 .../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/functions.py   |   4 +-
 .../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/modeling/test_models.py   |  12 +-
 tests/orchestrator/context/test_operation.py|  86 
 tests/orchestrator/context/test_serialize.py|   6 +-
 tests/orchestrator/context/test_toolbelt.py |  14 +-
 .../orchestrator/execution_plugin/test_local.py |  14 +-
 tests/orchestrator/execution_plugin/test_ssh.py |  16 +-
 tests/orchestrator/test_workflow_runner.py  |  16 +-
 tests/orchestrator/workflows/api/test_task.py   |  40 ++--
 .../workflows/builtin/test_execute_operation.py |   2 +-
 .../orchestrator/workflows/core/test_engine.py  |  44 ++--
 .../orchestrator/workflows/core/test_events.py  |   3 +-
 tests/orchestrator/workflows/core/test_task.py  |  10 +-
 .../test_task_graph_into_execution_graph.py |   6 +-
 .../orchestra

[01/16] incubator-ariatosca git commit: ARIA-258 Convert runtime_properties to attributes [Forced Update!]

2017-06-01 Thread avia
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-180-convert-parameter-to-one-to-many 42f924f58 -> 5038c65df 
(forced update)


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/50b997e3/tests/orchestrator/workflows/executor/test_process_executor_tracked_changes.py
--
diff --git 
a/tests/orchestrator/workflows/executor/test_process_executor_tracked_changes.py
 
b/tests/orchestrator/workflows/executor/test_process_executor_tracked_changes.py
index 4fbe9c1..2b628a0 100644
--- 
a/tests/orchestrator/workflows/executor/test_process_executor_tracked_changes.py
+++ 
b/tests/orchestrator/workflows/executor/test_process_executor_tracked_changes.py
@@ -28,7 +28,7 @@ from tests import mock
 from tests import storage
 
 
-_TEST_RUNTIME_PROPERTIES = {
+_TEST_ATTRIBUTES = {
 'some': 'values', 'that': 'are', 'most': 'likely', 'only': 'set', 'here': 
'yo'
 }
 
@@ -46,17 +46,18 @@ def test_track_changes_of_failed_operation(context, 
executor):
 
 def _assert_tracked_changes_are_applied(context):
 instance = context.model.node.get_by_name(mock.models.DEPENDENCY_NODE_NAME)
-assert instance.runtime_properties == _TEST_RUNTIME_PROPERTIES
+assert all(instance.attributes[key].value == value
+   for key, value in _TEST_ATTRIBUTES.items())
 
 
-def _update_runtime_properties(context):
-context.node.runtime_properties.clear()
-context.node.runtime_properties.update(_TEST_RUNTIME_PROPERTIES)
+def _update_attributes(context):
+context.node.attributes.clear()
+context.node.attributes.update(_TEST_ATTRIBUTES)
 
 
 def test_refresh_state_of_tracked_attributes(context, executor):
 out = _run_workflow(context=context, executor=executor, 
op_func=_mock_refreshing_operation)
-assert out['initial'] == out['after_refresh']
+assert out['after_refresh'] == out['after_change']
 assert out['initial'] != out['after_change']
 
 
@@ -66,22 +67,19 @@ def test_apply_tracked_changes_during_an_operation(context, 
executor):
 'changed_but_refreshed': {'some': 'newer', 'properties': 'right there'}
 }
 
-expected_initial = context.model.node.get_by_name(
-mock.models.DEPENDENCY_NODE_NAME).runtime_properties
-
-out = _run_workflow(context=context, executor=executor, 
op_func=_mock_updating_operation,
-inputs=inputs)
+expected_initial = 
context.model.node.get_by_name(mock.models.DEPENDENCY_NODE_NAME).attributes
+out = _run_workflow(
+context=context, executor=executor, op_func=_mock_updating_operation, 
inputs=inputs)
 
 expected_after_update = expected_initial.copy()
 expected_after_update.update(inputs['committed']) # pylint: 
disable=no-member
 expected_after_change = expected_after_update.copy()
 expected_after_change.update(inputs['changed_but_refreshed']) # pylint: 
disable=no-member
-expected_after_refresh = expected_after_update
 
 assert out['initial'] == expected_initial
 assert out['after_update'] == expected_after_update
 assert out['after_change'] == expected_after_change
-assert out['after_refresh'] == expected_after_refresh
+assert out['after_refresh'] == expected_after_change
 
 
 def _run_workflow(context, executor, op_func, inputs=None):
@@ -109,42 +107,42 @@ def _run_workflow(context, executor, op_func, 
inputs=None):
 graph = mock_workflow(ctx=context)  # pylint: 
disable=no-value-for-parameter
 eng = engine.Engine(executor=executor, workflow_context=context, 
tasks_graph=graph)
 eng.execute()
-return context.model.node.get_by_name(
-mock.models.DEPENDENCY_NODE_NAME).runtime_properties.get('out')
+out = 
context.model.node.get_by_name(mock.models.DEPENDENCY_NODE_NAME).attributes.get('out')
+return out.value if out else None
 
 
 @operation
 def _mock_success_operation(ctx):
-_update_runtime_properties(ctx)
+_update_attributes(ctx)
 
 
 @operation
 def _mock_fail_operation(ctx):
-_update_runtime_properties(ctx)
+_update_attributes(ctx)
 raise RuntimeError
 
 
 @operation
 def _mock_refreshing_operation(ctx):
-out = {'initial': copy.deepcopy(ctx.node.runtime_properties)}
-ctx.node.runtime_properties.update({'some': 'new', 'properties': 'right 
here'})
-out['after_change'] = copy.deepcopy(ctx.node.runtime_properties)
+out = {'initial': copy.deepcopy(ctx.node.attributes)}
+ctx.node.attributes.update({'some': 'new', 'properties': 'right here'})
+out['after_change'] = copy.deepcopy(ctx.node.attributes)
 ctx.model.node.refresh(ctx.node)
-out['after_refresh'] = copy.deepcopy(ctx.node.runtime_properties)
-ctx.node.runtime_properties['out'] = out
+out['after_refresh'] = copy.deepcopy(ctx.node.attributes)
+ctx.node.attributes['out'] = out
 
 
 @operation
 def _mock_updating_operation(ctx, committed, changed_but_refreshed):
-out = {'initial': copy.deepcopy(ctx.node.runtime_properties)}
-

[09/16] incubator-ariatosca git commit: Add property model

2017-06-01 Thread avia
Add property model


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

Branch: refs/heads/ARIA-180-convert-parameter-to-one-to-many
Commit: fceceb7dfcb7466d7f150dd7c3962bef73758cdf
Parents: 3943ad0
Author: Avia Efrat 
Authored: Mon May 22 12:05:30 2017 +0300
Committer: Avia Efrat 
Committed: Thu Jun 1 11:51:02 2017 +0300

--
 aria/modeling/models.py |  16 +-
 aria/modeling/service_common.py | 200 ++-
 aria/modeling/service_instance.py   |  24 +--
 aria/modeling/service_template.py   |  24 +--
 .../simple_v1_0/modeling/__init__.py|  22 +-
 tests/cli/test_service_templates.py |   2 +-
 tests/mock/models.py|  13 +-
 tests/modeling/test_models.py   |   4 +-
 8 files changed, 259 insertions(+), 46 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/fceceb7d/aria/modeling/models.py
--
diff --git a/aria/modeling/models.py b/aria/modeling/models.py
index d7b417b..6d43327 100644
--- a/aria/modeling/models.py
+++ b/aria/modeling/models.py
@@ -73,8 +73,9 @@ __all__ = (
 
 # Common service models
 'Parameter',
-'Input'
-'Output'
+'Input',
+'Output',
+'Property',
 'Type',
 'Metadata',
 
@@ -214,13 +215,19 @@ class Parameter(aria_declarative_base, 
service_common.ParameterBase):
 
 class Input(aria_declarative_base, service_common.InputBase):
 # Temporarily, until we will separate the Parameter model into Input, 
Output, Property and
-# Attribute, Parameter will represent only Property and Attribute.
+# Attribute, Parameter will represent only Attribute.
 pass
 
 
 class Output(aria_declarative_base, service_common.OutputBase):
 # Temporarily, until we will separate the Parameter model into Input, 
Output, Property and
-# Attribute, Parameter will represent only Property and Attribute.
+# Attribute, Parameter will represent only Attribute.
+pass
+
+
+class Property(aria_declarative_base, service_common.PropertyBase):
+# Temporarily, until we will separate the Parameter model into Input, 
Output, Property and
+# Attribute, Parameter will represent only Attribute.
 pass
 
 
@@ -293,6 +300,7 @@ models_to_register = [
 Parameter,
 Input,
 Output,
+Property,
 Type,
 Metadata,
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/fceceb7d/aria/modeling/service_common.py
--
diff --git a/aria/modeling/service_common.py b/aria/modeling/service_common.py
index 0571ec9..f85b2b5 100644
--- a/aria/modeling/service_common.py
+++ b/aria/modeling/service_common.py
@@ -232,7 +232,7 @@ class ParameterBase(TemplateModelMixin, 
caching.HasCachedMethods):
description=description)
 
 
-# TODO dry this code. currently it is a copy of ParameterBase
+# TODO dry this code. currently it is almost a copy of ParameterBase
 class OutputBase(TemplateModelMixin, caching.HasCachedMethods):
 """
 Represents a typed value. The value can contain nested intrinsic functions.
@@ -536,7 +536,7 @@ class TypeBase(InstanceModelMixin):
 return [self] + (self.parent.hierarchy if self.parent else [])
 
 
-# TODO dry this code. currently it is a copy of ParameterBase
+# TODO dry this code. currently it is almost a copy of ParameterBase
 class InputBase(TemplateModelMixin, caching.HasCachedMethods):
 """
 Represents a typed value. The value can contain nested intrinsic functions.
@@ -733,6 +733,202 @@ class InputBase(TemplateModelMixin, 
caching.HasCachedMethods):
 description=description)
 
 
+# TODO dry this code. currently it is almost a copy of ParameterBase
+class PropertyBase(TemplateModelMixin, caching.HasCachedMethods):
+"""
+Represents a typed value. The value can contain nested intrinsic functions.
+
+This model can be used as the ``container_holder`` argument for 
:func:`functions.evaluate`.
+
+:ivar name: Name
+:vartype name: basestring
+:ivar type_name: Type name
+:vartype type_name: basestring
+:ivar value: Value
+:ivar description: Description
+:vartype description: basestring
+"""
+
+__tablename__ = 'property'
+
+name = Column(Text)
+type_name = Column(Text)
+description = Column(Text)
+_value = Column(PickleType)
+
+@property
+def value(self):
+value = self._value
+if value is

[11/16] incubator-ariatosca git commit: Add input model

2017-06-01 Thread avia
Add input model


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

Branch: refs/heads/ARIA-180-convert-parameter-to-one-to-many
Commit: 3943ad0b921001ff8f7110618975f16264e1cff0
Parents: 74cc94e
Author: Avia Efrat 
Authored: Sun May 21 20:10:50 2017 +0300
Committer: Avia Efrat 
Committed: Thu Jun 1 11:51:02 2017 +0300

--
 aria/modeling/models.py |  11 +-
 aria/modeling/orchestration.py  |   2 +-
 aria/modeling/relationship.py   |   6 +-
 aria/modeling/service_common.py | 202 ++-
 aria/modeling/service_instance.py   |  14 +-
 aria/modeling/service_template.py   |  14 +-
 .../simple_v1_0/modeling/__init__.py|  29 +--
 tests/modeling/test_models.py   |   4 +-
 tests/orchestrator/test_workflow_runner.py  |   8 +-
 9 files changed, 249 insertions(+), 41 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/3943ad0b/aria/modeling/models.py
--
diff --git a/aria/modeling/models.py b/aria/modeling/models.py
index f3acca6..d7b417b 100644
--- a/aria/modeling/models.py
+++ b/aria/modeling/models.py
@@ -73,6 +73,7 @@ __all__ = (
 
 # Common service models
 'Parameter',
+'Input'
 'Output'
 'Type',
 'Metadata',
@@ -211,10 +212,15 @@ class Parameter(aria_declarative_base, 
service_common.ParameterBase):
 pass
 
 
+class Input(aria_declarative_base, service_common.InputBase):
+# Temporarily, until we will separate the Parameter model into Input, 
Output, Property and
+# Attribute, Parameter will represent only Property and Attribute.
+pass
+
+
 class Output(aria_declarative_base, service_common.OutputBase):
 # Temporarily, until we will separate the Parameter model into Input, 
Output, Property and
-# Attribute, Parameter will represent Input, Property and Attribute, and 
Output will represent
-# the outputs.
+# Attribute, Parameter will represent only Property and Attribute.
 pass
 
 
@@ -285,6 +291,7 @@ models_to_register = [
 
 # Common service models
 Parameter,
+Input,
 Output,
 Type,
 Metadata,

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/3943ad0b/aria/modeling/orchestration.py
--
diff --git a/aria/modeling/orchestration.py b/aria/modeling/orchestration.py
index 97de552..3753090 100644
--- a/aria/modeling/orchestration.py
+++ b/aria/modeling/orchestration.py
@@ -115,7 +115,7 @@ class ExecutionBase(ModelMixin):
 
 @declared_attr
 def inputs(cls):
-return relationship.many_to_many(cls, 'parameter', prefix='inputs', 
dict_key='name')
+return relationship.many_to_many(cls, 'input', dict_key='name')
 
 # region foreign keys
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/3943ad0b/aria/modeling/relationship.py
--
diff --git a/aria/modeling/relationship.py b/aria/modeling/relationship.py
index c4f4cf3..8644d42 100644
--- a/aria/modeling/relationship.py
+++ b/aria/modeling/relationship.py
@@ -287,8 +287,10 @@ def many_to_many(model_class,
 
 if prefix is not None:
 secondary_table_name = '{0}_{1}'.format(prefix, secondary_table_name)
-if other_property is None:
-other_property = '{0}_{1}'.format(prefix, 
formatting.pluralize(this_table))
+if other_property is None:
+other_property = '{0}_{1}'.format(prefix, 
formatting.pluralize(this_table))
+elif other_property is None:
+other_property = '{0}_{1}'.format(other_table, 
formatting.pluralize(this_table))
 
 secondary_table = _get_secondary_table(
 model_class.metadata,

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/3943ad0b/aria/modeling/service_common.py
--
diff --git a/aria/modeling/service_common.py b/aria/modeling/service_common.py
index 0f22dfb..0571ec9 100644
--- a/aria/modeling/service_common.py
+++ b/aria/modeling/service_common.py
@@ -412,9 +412,9 @@ class OutputBase(TemplateModelMixin, 
caching.HasCachedMethods):
 """
 Wraps an arbitrary value as a parameter. The type will be guessed via 
introspection.
 
-:param name: Parameter name
+:param name: Output name
 :type name: basestring
-:param value: Parameter value
+:param value: Output value

[10/16] incubator-ariatosca git commit: Add output many-to-one relationships

2017-06-01 Thread avia
Add output many-to-one relationships

To service template and service.


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

Branch: refs/heads/ARIA-180-convert-parameter-to-one-to-many
Commit: 05d2b2a0b162076228db334ce33e57b91790e048
Parents: fceceb7
Author: Avia Efrat 
Authored: Wed May 24 14:53:20 2017 +0300
Committer: Avia Efrat 
Committed: Thu Jun 1 11:51:02 2017 +0300

--
 aria/modeling/service_common.py   | 80 ++
 aria/modeling/service_instance.py |  8 ++--
 aria/modeling/service_template.py |  8 ++--
 3 files changed, 61 insertions(+), 35 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/05d2b2a0/aria/modeling/service_common.py
--
diff --git a/aria/modeling/service_common.py b/aria/modeling/service_common.py
index f85b2b5..2e981a3 100644
--- a/aria/modeling/service_common.py
+++ b/aria/modeling/service_common.py
@@ -336,36 +336,62 @@ class OutputBase(TemplateModelMixin, 
caching.HasCachedMethods):
 
 raise ValueError('orphaned output: does not have a container: 
{0}'.format(self.name))
 
-@property
-@caching.cachedmethod
-def service(self):
-"""
-The :class:`Service` containing this parameter, or None if not 
contained in a service.
-"""
+# @property
+# @caching.cachedmethod
+# def service(self):
+# """
+# The :class:`Service` containing this parameter, or None if not 
contained in a service.
+# """
+#
+# from . import models
+# container = self.container
+# if isinstance(container, models.Service):
+# return container
+# elif hasattr(container, 'service'):
+# return container.service
+# return None
+
+# @property
+# @caching.cachedmethod
+# def service_template(self):
+# """
+# The :class:`ServiceTemplate` containing this parameter, or None if 
not contained in a
+# service template.
+# """
+#
+# from . import models
+# container = self.container
+# if isinstance(container, models.ServiceTemplate):
+# return container
+# elif hasattr(container, 'service_template'):
+# return container.service_template
+# return None
 
-from . import models
-container = self.container
-if isinstance(container, models.Service):
-return container
-elif hasattr(container, 'service'):
-return container.service
-return None
+# region foreign keys
 
-@property
-@caching.cachedmethod
-def service_template(self):
-"""
-The :class:`ServiceTemplate` containing this parameter, or None if not 
contained in a
-service template.
-"""
+@declared_attr
+def service_template_fk(cls):
+"""For Output many-to-one to ServiceTemplate"""
+return relationship.foreign_key('service_template', nullable=True)
 
-from . import models
-container = self.container
-if isinstance(container, models.ServiceTemplate):
-return container
-elif hasattr(container, 'service_template'):
-return container.service_template
-return None
+@declared_attr
+def service_fk(cls):
+"""For Output many-to-one to Service"""
+return relationship.foreign_key('service', nullable=True)
+
+# endregion
+
+# region many_to_one relationships
+
+@declared_attr
+def service_template(cls):
+return relationship.many_to_one(cls, 'service_template')
+
+@declared_attr
+def service(cls):
+return relationship.many_to_one(cls, 'service')
+
+# endregion
 
 @property
 def as_raw(self):

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/05d2b2a0/aria/modeling/service_instance.py
--
diff --git a/aria/modeling/service_instance.py 
b/aria/modeling/service_instance.py
index 97ae5b7..1a162d2 100644
--- a/aria/modeling/service_instance.py
+++ b/aria/modeling/service_instance.py
@@ -125,6 +125,10 @@ class ServiceBase(InstanceModelMixin):
 # region one_to_many relationships
 
 @declared_attr
+def outputs(cls):
+return relationship.one_to_many(cls, 'output', dict_key='name')
+
+@declared_attr
 def updates(cls):
 return relationship.one_to_many(cls, 'service_update')
 
@@ -174,10 +178,6 @@ class ServiceBase(InstanceModelMixin):
 

[04/16] incubator-ariatosca git commit: ARIA-268 Add NOTICE file

2017-06-01 Thread avia
ARIA-268 Add NOTICE file


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

Branch: refs/heads/ARIA-180-convert-parameter-to-one-to-many
Commit: 07d79513a4ac41ba66d84f2922a17fd0ab7ec39c
Parents: adf7607
Author: Ran Ziv 
Authored: Mon May 29 17:11:04 2017 +0300
Committer: Ran Ziv 
Committed: Mon May 29 17:11:04 2017 +0300

--
 NOTICE | 5 +
 1 file changed, 5 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/07d79513/NOTICE
--
diff --git a/NOTICE b/NOTICE
new file mode 100644
index 000..bf03ab5
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,5 @@
+Apache AriaTosca
+Copyright 2016-2017 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
\ No newline at end of file



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

2017-06-01 Thread avia
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9174f946/extensions/aria_extension_tosca/simple_v1_0/modeling/capabilities.py
--
diff --git 
a/extensions/aria_extension_tosca/simple_v1_0/modeling/capabilities.py 
b/extensions/aria_extension_tosca/simple_v1_0/modeling/capabilities.py
index 6df7177..a90a9fc 100644
--- a/extensions/aria_extension_tosca/simple_v1_0/modeling/capabilities.py
+++ b/extensions/aria_extension_tosca/simple_v1_0/modeling/capabilities.py
@@ -16,8 +16,9 @@
 from aria.utils.collections import deepcopy_with_locators, OrderedDict
 from aria.parser.validation import Issue
 
-from .properties import (convert_property_definitions_to_values, 
merge_raw_property_definitions,
- get_assigned_and_defined_property_values)
+from .parameters import (convert_parameter_definitions_to_values, 
merge_raw_parameter_definitions,
+ get_assigned_and_defined_parameter_values)
+
 
 #
 # CapabilityType
@@ -38,6 +39,7 @@ def get_inherited_valid_source_types(context, presentation):
 
 return valid_source_types
 
+
 #
 # NodeType
 #
@@ -92,6 +94,7 @@ def get_inherited_capability_definitions(context, 
presentation, for_presentation
 
 return capability_definitions
 
+
 #
 # NodeTemplate
 #
@@ -127,8 +130,9 @@ def get_template_capabilities(context, presentation):
 capability_assignment = capability_assignments[capability_name]
 
 # Assign properties
-values = get_assigned_and_defined_property_values(context,
-  
our_capability_assignment)
+values = get_assigned_and_defined_parameter_values(context,
+   
our_capability_assignment,
+   'property')
 if values:
 capability_assignment._raw['properties'] = values
 else:
@@ -139,6 +143,7 @@ def get_template_capabilities(context, presentation):
 
 return capability_assignments
 
+
 #
 # Utils
 #
@@ -150,24 +155,25 @@ def 
convert_capability_from_definition_to_assignment(context, presentation, cont
 
 properties = presentation.properties
 if properties is not None:
-raw['properties'] = convert_property_definitions_to_values(context, 
properties)
+raw['properties'] = convert_parameter_definitions_to_values(context, 
properties)
 
 # TODO attributes
 
 return CapabilityAssignment(name=presentation._name, raw=raw, 
container=container)
 
+
 def merge_capability_definition_from_type(context, presentation, 
capability_definition):
 raw_properties = OrderedDict()
 
 # Merge properties from type
 the_type = capability_definition._get_type(context)
 type_property_defintions = the_type._get_properties(context)
-merge_raw_property_definitions(context, presentation, raw_properties, 
type_property_defintions,
-   'properties')
+merge_raw_parameter_definitions(context, presentation, raw_properties, 
type_property_defintions,
+'properties')
 
 # Merge our properties
-merge_raw_property_definitions(context, presentation, raw_properties,
-   capability_definition.properties, 
'properties')
+merge_raw_parameter_definitions(context, presentation, raw_properties,
+capability_definition.properties, 
'properties')
 
 if raw_properties:
 capability_definition._raw['properties'] = raw_properties

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9174f946/extensions/aria_extension_tosca/simple_v1_0/modeling/constraints.py
--
diff --git 
a/extensions/aria_extension_tosca/simple_v1_0/modeling/constraints.py 
b/extensions/aria_extension_tosca/simple_v1_0/modeling/constraints.py
index 7c99eab..9a30cc1 100644
--- a/extensions/aria_extension_tosca/simple_v1_0/modeling/constraints.py
+++ b/extensions/aria_extension_tosca/simple_v1_0/modeling/constraints.py
@@ -15,7 +15,7 @@
 
 import re
 
-from aria.modeling.contraints import NodeTemplateConstraint
+from aria.modeling.constraints import NodeTemplateConstraint
 from aria.modeling.utils import NodeTemplateContainerHolder
 from aria.modeling.functions import evaluate
 from aria.parser import implements_specification

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9174f946/extensions/aria_extension_tosca/simple_v1_0/modeling/data_types.py
--
diff --git a/extensions/aria_extension_tosca/simple_v1_0/modeling/data_types.py 
b/extensions/aria_extension_tosca/simple_v1_0/modeling/data_types.py
index 3952785..c0d79e5 100644
--- a/extensions/aria_ext

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

2017-06-01 Thread avia
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9174f946/tests/orchestrator/workflows/api/test_task.py
--
diff --git a/tests/orchestrator/workflows/api/test_task.py 
b/tests/orchestrator/workflows/api/test_task.py
index 642c785..9d91b6b 100644
--- a/tests/orchestrator/workflows/api/test_task.py
+++ b/tests/orchestrator/workflows/api/test_task.py
@@ -44,15 +44,15 @@ class TestOperationTask(object):
 plugin = mock.models.create_plugin('test_plugin', '0.1')
 ctx.model.node.update(plugin)
 
-inputs = {'test_input': True}
+arguments = {'test_input': True}
 
 interface = mock.models.create_interface(
 ctx.service,
 interface_name,
 operation_name,
 operation_kwargs=dict(plugin=plugin,
-  implementation='op_path',
-  inputs=inputs),)
+  function='op_path',
+  arguments=arguments),)
 
 node = ctx.model.node.get_by_name(mock.models.DEPENDENT_NODE_NAME)
 node.interfaces[interface_name] = interface
@@ -66,7 +66,7 @@ class TestOperationTask(object):
 node,
 interface_name=interface_name,
 operation_name=operation_name,
-inputs=inputs,
+arguments=arguments,
 max_attempts=max_attempts,
 retry_interval=retry_interval,
 ignore_failure=ignore_failure)
@@ -77,9 +77,9 @@ class TestOperationTask(object):
 interface=interface_name,
 operation=operation_name
 )
-assert api_task.implementation == 'op_path'
+assert api_task.function == 'op_path'
 assert api_task.actor == node
-assert api_task.inputs['test_input'].value is True
+assert api_task.arguments['test_input'].value is True
 assert api_task.retry_interval == retry_interval
 assert api_task.max_attempts == max_attempts
 assert api_task.ignore_failure == ignore_failure
@@ -92,15 +92,15 @@ class TestOperationTask(object):
 plugin = mock.models.create_plugin('test_plugin', '0.1')
 ctx.model.plugin.update(plugin)
 
-inputs = {'test_input': True}
+arguments = {'test_input': True}
 
 interface = mock.models.create_interface(
 ctx.service,
 interface_name,
 operation_name,
 operation_kwargs=dict(plugin=plugin,
-  implementation='op_path',
-  inputs=inputs)
+  function='op_path',
+  arguments=arguments)
 )
 
 relationship = ctx.model.relationship.list()[0]
@@ -113,7 +113,7 @@ class TestOperationTask(object):
 relationship,
 interface_name=interface_name,
 operation_name=operation_name,
-inputs=inputs,
+arguments=arguments,
 max_attempts=max_attempts,
 retry_interval=retry_interval)
 
@@ -123,9 +123,9 @@ class TestOperationTask(object):
 interface=interface_name,
 operation=operation_name
 )
-assert api_task.implementation == 'op_path'
+assert api_task.function == 'op_path'
 assert api_task.actor == relationship
-assert api_task.inputs['test_input'].value is True
+assert api_task.arguments['test_input'].value is True
 assert api_task.retry_interval == retry_interval
 assert api_task.max_attempts == max_attempts
 assert api_task.plugin.name == 'test_plugin'
@@ -137,15 +137,15 @@ class TestOperationTask(object):
 plugin = mock.models.create_plugin('test_plugin', '0.1')
 ctx.model.node.update(plugin)
 
-inputs = {'test_input': True}
+arguments = {'test_input': True}
 
 interface = mock.models.create_interface(
 ctx.service,
 interface_name,
 operation_name,
 operation_kwargs=dict(plugin=plugin,
-  implementation='op_path',
-  inputs=inputs)
+  function='op_path',
+  arguments=arguments)
 )
 
 relationship = ctx.model.relationship.list()[0]
@@ -158,7 +158,7 @@ class TestOperationTask(object):
 relationship,
 interface_name=interface_name,
 operation_name=operation_name,
-inputs=inputs,
+arguments=arguments,
 max_attempts=max_attempts,
 retry_interval=retry_interval)
 
@@ -168,9 +168,9 @@ class TestOperationTask(object):
 interface=interface_name,
 operation=operati

[03/16] incubator-ariatosca git commit: ARIA-261 Single-source ARIA version

2017-06-01 Thread avia
ARIA-261 Single-source ARIA version


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

Branch: refs/heads/ARIA-180-convert-parameter-to-one-to-many
Commit: adf76079568b6ccaf89871907b9b98c22ef6681e
Parents: 50b997e
Author: Ran Ziv 
Authored: Thu May 25 12:18:58 2017 +0300
Committer: Ran Ziv 
Committed: Thu May 25 18:49:49 2017 +0300

--
 MANIFEST.in  |  2 ++
 VERSION  |  1 +
 aria/VERSION.py  | 21 -
 aria/__init__.py | 13 -
 aria/parser/reading/jinja.py |  2 +-
 requirements.in  |  3 ++-
 requirements.txt |  8 ++--
 setup.py | 14 +-
 8 files changed, 25 insertions(+), 39 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/adf76079/MANIFEST.in
--
diff --git a/MANIFEST.in b/MANIFEST.in
index d934e18..6c79a3a 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,2 +1,4 @@
 include requirements.txt
+include VERSION
+include LICENSE
 recursive-include examples *

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/adf76079/VERSION
--
diff --git a/VERSION b/VERSION
new file mode 100644
index 000..6c6aa7c
--- /dev/null
+++ b/VERSION
@@ -0,0 +1 @@
+0.1.0
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/adf76079/aria/VERSION.py
--
diff --git a/aria/VERSION.py b/aria/VERSION.py
deleted file mode 100644
index 9ce332c..000
--- a/aria/VERSION.py
+++ /dev/null
@@ -1,21 +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.
-
-"""
-ARIA Version module:
-* version: ARIA Package version
-"""
-
-version = '0.1.0'  # pylint: disable=C0103

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/adf76079/aria/__init__.py
--
diff --git a/aria/__init__.py b/aria/__init__.py
index df75b1e..34db3a8 100644
--- a/aria/__init__.py
+++ b/aria/__init__.py
@@ -19,7 +19,8 @@ ARIA top level package
 
 import sys
 
-from .VERSION import version as __version__
+import pkg_resources
+__version__ = pkg_resources.get_distribution('aria').version
 
 from .orchestrator.decorators import workflow, operation
 from . import (
@@ -39,11 +40,6 @@ if sys.version_info < (2, 7):
 else:
 from pkgutil import iter_modules
 
-try:
-import pkg_resources
-except ImportError:
-pkg_resources = None
-
 __all__ = (
 '__version__',
 'workflow',
@@ -60,9 +56,8 @@ def install_aria_extensions():
 for loader, module_name, _ in iter_modules():
 if module_name.startswith('aria_extension_'):
 loader.find_module(module_name).load_module(module_name)
-if pkg_resources:
-for entry_point in 
pkg_resources.iter_entry_points(group='aria_extension'):
-entry_point.load()
+for entry_point in pkg_resources.iter_entry_points(group='aria_extension'):
+entry_point.load()
 extension.init()
 
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/adf76079/aria/parser/reading/jinja.py
--
diff --git a/aria/parser/reading/jinja.py b/aria/parser/reading/jinja.py
index 17bf49e..687317a 100644
--- a/aria/parser/reading/jinja.py
+++ b/aria/parser/reading/jinja.py
@@ -14,7 +14,7 @@ import os
 
 from jinja2 import Template
 
-from ...VERSION import version
+from ... import __version__ as version
 from ..loading import LiteralLocation, LiteralLoader
 from .reader import Reader
 from .exceptions import ReaderSyntaxError

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/adf76079

[12/16] incubator-ariatosca git commit: Clean up the code

2017-06-01 Thread avia
Clean up the code


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

Branch: refs/heads/ARIA-180-convert-parameter-to-one-to-many
Commit: fdda7573bd82154c621860826523031afa70e9f1
Parents: 93c01b9
Author: Avia Efrat 
Authored: Thu May 25 19:40:35 2017 +0300
Committer: Avia Efrat 
Committed: Thu Jun 1 12:05:17 2017 +0300

--
 aria/modeling/models.py |5 -
 aria/modeling/relationship.py   |2 -
 aria/modeling/service_common.py | 1206 +++---
 .../simple_v1_0/modeling/__init__.py|2 +-
 tests/mock/models.py|   13 +-
 tests/storage/test_model_storage.py |6 +-
 6 files changed, 223 insertions(+), 1011 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/fdda7573/aria/modeling/models.py
--
diff --git a/aria/modeling/models.py b/aria/modeling/models.py
index 9b7e776..bfa0ece 100644
--- a/aria/modeling/models.py
+++ b/aria/modeling/models.py
@@ -72,7 +72,6 @@ __all__ = (
 'ServiceModification',
 
 # Common service models
-'Parameter',
 'Input',
 'Output',
 'Property',
@@ -210,9 +209,6 @@ class ServiceModification(aria_declarative_base, 
service_changes.ServiceModifica
 
 # region common service models
 
-class Parameter(aria_declarative_base, service_common.ParameterBase):
-pass
-
 
 class Input(aria_declarative_base, service_common.InputBase):
 pass
@@ -296,7 +292,6 @@ models_to_register = [
 ServiceModification,
 
 # Common service models
-Parameter,
 Input,
 Output,
 Property,

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/fdda7573/aria/modeling/relationship.py
--
diff --git a/aria/modeling/relationship.py b/aria/modeling/relationship.py
index 8644d42..40be5b2 100644
--- a/aria/modeling/relationship.py
+++ b/aria/modeling/relationship.py
@@ -289,8 +289,6 @@ def many_to_many(model_class,
 secondary_table_name = '{0}_{1}'.format(prefix, secondary_table_name)
 if other_property is None:
 other_property = '{0}_{1}'.format(prefix, 
formatting.pluralize(this_table))
-elif other_property is None:
-other_property = '{0}_{1}'.format(other_table, 
formatting.pluralize(this_table))
 
 secondary_table = _get_secondary_table(
 model_class.metadata,

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/fdda7573/aria/modeling/service_common.py
--
diff --git a/aria/modeling/service_common.py b/aria/modeling/service_common.py
index 0a452dc..07b45a4 100644
--- a/aria/modeling/service_common.py
+++ b/aria/modeling/service_common.py
@@ -32,7 +32,7 @@ from . import (
 )
 
 
-class ParameterBase(TemplateModelMixin, caching.HasCachedMethods):
+class ParameterMixin(TemplateModelMixin, caching.HasCachedMethods):
 """
 Represents a typed value. The value can contain nested intrinsic functions.
 
@@ -81,9 +81,10 @@ class ParameterBase(TemplateModelMixin, 
caching.HasCachedMethods):
 for the_relationship in self.__mapper__.relationships:
 v = getattr(self, the_relationship.key)
 if v:
-return v[0] # because we are many-to-many, the back reference 
will be a list
+return v
 
-raise ValueError('orphaned parameter: does not have an owner: 
{0}'.format(self.name))
+raise ValueError('orphaned {class_name}: does not have an owner: 
{name}'.format(
+class_name=type(self).__name__, name=self.name))
 
 @property
 @caching.cachedmethod
@@ -118,7 +119,7 @@ class ParameterBase(TemplateModelMixin, 
caching.HasCachedMethods):
 elif isinstance(container, models.Capability) or isinstance(container, 
models.Artifact):
 container = container.node
 elif isinstance(container, models.CapabilityTemplate) \
-or isinstance(container, models.ArtifactTemplate):
+or isinstance(container, models.ArtifactTemplate):
 container = container.node_template
 elif isinstance(container, models.Task):
 container = container.actor
@@ -174,11 +175,10 @@ class ParameterBase(TemplateModelMixin, 
caching.HasCachedMethods):
 ('description', self.description)))
 
 def instantiate(self, container):
-from . import models
-return models.Parameter(name=self.name, # pylint: 
di

[15/16] incubator-ariatosca git commit: Add input many-to-one relationships

2017-06-01 Thread avia
Add input many-to-one relationships

To service template, service, interface template, interface, operation
template, operation, execution, task.


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

Branch: refs/heads/ARIA-180-convert-parameter-to-one-to-many
Commit: b0d251f43aed556db505fbc552c94ba105345482
Parents: 05d2b2a
Author: Avia Efrat 
Authored: Wed May 24 16:16:37 2017 +0300
Committer: Avia Efrat 
Committed: Thu Jun 1 12:05:17 2017 +0300

--
 aria/modeling/orchestration.py|   2 +-
 aria/modeling/service_changes.py  |  12 --
 aria/modeling/service_common.py   | 202 +++--
 aria/modeling/service_instance.py |  37 +++---
 aria/modeling/service_template.py |  38 ++-
 5 files changed, 167 insertions(+), 124 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b0d251f4/aria/modeling/orchestration.py
--
diff --git a/aria/modeling/orchestration.py b/aria/modeling/orchestration.py
index 3753090..0cee682 100644
--- a/aria/modeling/orchestration.py
+++ b/aria/modeling/orchestration.py
@@ -115,7 +115,7 @@ class ExecutionBase(ModelMixin):
 
 @declared_attr
 def inputs(cls):
-return relationship.many_to_many(cls, 'input', dict_key='name')
+return relationship.one_to_many(cls, 'input', dict_key='name')
 
 # region foreign keys
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b0d251f4/aria/modeling/service_changes.py
--
diff --git a/aria/modeling/service_changes.py b/aria/modeling/service_changes.py
index 1974424..f632fef 100644
--- a/aria/modeling/service_changes.py
+++ b/aria/modeling/service_changes.py
@@ -105,10 +105,6 @@ class ServiceUpdateBase(ModelMixin):
 
 # endregion
 
-# region many_to_many relationships
-
-# endregion
-
 def to_dict(self, suppress_error=False, **kwargs):
 dep_update_dict = super(ServiceUpdateBase, 
self).to_dict(suppress_error) #pylint: disable=no-member
 # Taking care of the fact the DeploymentSteps are _BaseModels
@@ -180,10 +176,6 @@ class ServiceUpdateStepBase(ModelMixin):
 
 # endregion
 
-# region many_to_many relationships
-
-# endregion
-
 def __hash__(self):
 return hash((getattr(self, self.id_column_name()), self.entity_id))
 
@@ -266,7 +258,3 @@ class ServiceModificationBase(ModelMixin):
 return relationship.many_to_one(cls, 'service', 
back_populates='modifications')
 
 # endregion
-
-# region many_to_many relationships
-
-# endregion

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b0d251f4/aria/modeling/service_common.py
--
diff --git a/aria/modeling/service_common.py b/aria/modeling/service_common.py
index 2e981a3..1606e78 100644
--- a/aria/modeling/service_common.py
+++ b/aria/modeling/service_common.py
@@ -598,6 +598,86 @@ class InputBase(TemplateModelMixin, 
caching.HasCachedMethods):
 def value(self, value):
 self._value = value
 
+# region foreign keys
+
+@declared_attr
+def service_template_fk(cls):
+"""For Input many-to-one to ServiceTemplate"""
+return relationship.foreign_key('service_template', nullable=True)
+
+@declared_attr
+def service_fk(cls):
+"""For Input many-to-one to Service"""
+return relationship.foreign_key('service', nullable=True)
+
+@declared_attr
+def interface_fk(cls):
+"""For Input many-to-one to Interface"""
+return relationship.foreign_key('interface', nullable=True)
+
+@declared_attr
+def operation_fk(cls):
+"""For Input many-to-one to Operation"""
+return relationship.foreign_key('operation', nullable=True)
+
+@declared_attr
+def interface_template_fk(cls):
+"""For Input many-to-one to InterfaceTemplate"""
+return relationship.foreign_key('interface_template', nullable=True)
+
+@declared_attr
+def operation_template_fk(cls):
+"""For Input many-to-one to OperationTemplate"""
+return relationship.foreign_key('operation_template', nullable=True)
+
+@declared_attr
+def execution_fk(cls):
+"""For Input many-to-one to Execution"""
+return relationship.foreign_key('execution', nullable=True)
+
+@declared_attr
+def task_fk(cls):
+"""For Input many-to-one to Task"""
+return relationship.foreign_key('task', nullable=True)
+
+# endregion
+
+

[02/16] incubator-ariatosca git commit: ARIA-258 Convert runtime_properties to attributes

2017-06-01 Thread avia
ARIA-258 Convert runtime_properties to attributes


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

Branch: refs/heads/ARIA-180-convert-parameter-to-one-to-many
Commit: 50b997e3bfbaf26df5e66327d30fe8a015b92dd7
Parents: 0c98684
Author: max-orlov 
Authored: Sun May 14 22:38:39 2017 +0300
Committer: max-orlov 
Committed: Thu May 25 18:30:21 2017 +0300

--
 aria/cli/commands/nodes.py  |   6 +-
 aria/modeling/service_common.py |   9 +-
 aria/modeling/service_instance.py   |   8 +-
 aria/modeling/service_template.py   |   1 -
 aria/modeling/types.py  |  20 -
 .../context/collection_instrumentation.py   | 242 
 aria/orchestrator/context/operation.py  |  13 +-
 aria/orchestrator/context/toolbelt.py   |   5 +-
 .../execution_plugin/ctx_proxy/server.py|   1 -
 aria/orchestrator/workflows/core/engine.py  |   1 -
 aria/orchestrator/workflows/executor/process.py | 125 +-
 aria/storage/instrumentation.py | 282 -
 tests/helpers.py|  10 +
 tests/mock/models.py|   7 +-
 tests/modeling/test_mixins.py   |   1 -
 tests/modeling/test_models.py   |  28 +-
 .../context/test_collection_instrumentation.py  | 253 
 tests/orchestrator/context/test_operation.py|  90 -
 tests/orchestrator/context/test_toolbelt.py |   5 +-
 .../orchestrator/execution_plugin/test_local.py |  66 ++--
 tests/orchestrator/execution_plugin/test_ssh.py |  36 +-
 tests/orchestrator/workflows/core/test_task.py  |   2 +-
 .../orchestrator/workflows/executor/__init__.py |   4 +
 ...process_executor_concurrent_modifications.py |  67 ++--
 .../executor/test_process_executor_extension.py |   6 +-
 .../test_process_executor_tracked_changes.py|  56 ++-
 tests/resources/scripts/test_ssh.sh |  30 +-
 tests/storage/test_instrumentation.py   | 396 ---
 28 files changed, 786 insertions(+), 984 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/50b997e3/aria/cli/commands/nodes.py
--
diff --git a/aria/cli/commands/nodes.py b/aria/cli/commands/nodes.py
index e43493f..1bbefe6 100644
--- a/aria/cli/commands/nodes.py
+++ b/aria/cli/commands/nodes.py
@@ -47,9 +47,9 @@ def show(node_id, model_storage, logger):
 
 # print node attributes
 logger.info('Node attributes:')
-if node.runtime_properties:
-for prop_name, prop_value in node.runtime_properties.iteritems():
-logger.info('\t{0}: {1}'.format(prop_name, prop_value))
+if node.attributes:
+for param_name, param in node.attributes.iteritems():
+logger.info('\t{0}: {1}'.format(param_name, param.value))
 else:
 logger.info('\tNo attributes')
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/50b997e3/aria/modeling/service_common.py
--
diff --git a/aria/modeling/service_common.py b/aria/modeling/service_common.py
index e9c96a4..ef19c8e 100644
--- a/aria/modeling/service_common.py
+++ b/aria/modeling/service_common.py
@@ -218,14 +218,13 @@ class ParameterBase(TemplateModelMixin, 
caching.HasCachedMethods):
 :type description: basestring
 """
 
-from . import models
 type_name = canonical_type_name(value)
 if type_name is None:
 type_name = full_type_name(value)
-return models.Parameter(name=name, # pylint: 
disable=unexpected-keyword-arg
-type_name=type_name,
-value=value,
-description=description)
+return cls(name=name, # pylint: disable=unexpected-keyword-arg
+   type_name=type_name,
+   value=value,
+   description=description)
 
 
 class TypeBase(InstanceModelMixin):

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/50b997e3/aria/modeling/service_instance.py
--
diff --git a/aria/modeling/service_instance.py 
b/aria/modeling/service_instance.py
index 41a388d..7058969 100644
--- a/aria/modeling/service_instance.py
+++ b/aria/modeling/service_instance.py
@@ -333,8 +333,6 @@ class NodeBase(InstanceModelMixin):
 :vartype inbound_relationships: [:class:`Relationship`]
 :ivar host: Host 

[13/16] incubator-ariatosca git commit: Add attribute model and attribute many-to-one relationships

2017-06-01 Thread avia
Add attribute model and attribute many-to-one relationships

To node template and node.


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

Branch: refs/heads/ARIA-180-convert-parameter-to-one-to-many
Commit: 93c01b9e672f5588b0a5dfeca0e060086d19df2d
Parents: 3e56278
Author: Avia Efrat 
Authored: Thu May 25 01:04:11 2017 +0300
Committer: Avia Efrat 
Committed: Thu Jun 1 12:05:17 2017 +0300

--
 aria/modeling/models.py |  12 +-
 aria/modeling/service_common.py | 221 +++
 aria/modeling/service_instance.py   |  14 +-
 aria/modeling/service_template.py   |  12 +-
 .../simple_v1_0/modeling/__init__.py|  10 +-
 5 files changed, 240 insertions(+), 29 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/93c01b9e/aria/modeling/models.py
--
diff --git a/aria/modeling/models.py b/aria/modeling/models.py
index 6d43327..9b7e776 100644
--- a/aria/modeling/models.py
+++ b/aria/modeling/models.py
@@ -76,6 +76,7 @@ __all__ = (
 'Input',
 'Output',
 'Property',
+'Attribute',
 'Type',
 'Metadata',
 
@@ -214,20 +215,18 @@ class Parameter(aria_declarative_base, 
service_common.ParameterBase):
 
 
 class Input(aria_declarative_base, service_common.InputBase):
-# Temporarily, until we will separate the Parameter model into Input, 
Output, Property and
-# Attribute, Parameter will represent only Attribute.
 pass
 
 
 class Output(aria_declarative_base, service_common.OutputBase):
-# Temporarily, until we will separate the Parameter model into Input, 
Output, Property and
-# Attribute, Parameter will represent only Attribute.
 pass
 
 
 class Property(aria_declarative_base, service_common.PropertyBase):
-# Temporarily, until we will separate the Parameter model into Input, 
Output, Property and
-# Attribute, Parameter will represent only Attribute.
+pass
+
+
+class Attribute(aria_declarative_base, service_common.AttributeBase):
 pass
 
 
@@ -301,6 +300,7 @@ models_to_register = [
 Input,
 Output,
 Property,
+Attribute,
 Type,
 Metadata,
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/93c01b9e/aria/modeling/service_common.py
--
diff --git a/aria/modeling/service_common.py b/aria/modeling/service_common.py
index 11f9d01..0a452dc 100644
--- a/aria/modeling/service_common.py
+++ b/aria/modeling/service_common.py
@@ -1150,6 +1150,227 @@ class PropertyBase(TemplateModelMixin, 
caching.HasCachedMethods):
description=description)
 
 
+class AttributeBase(TemplateModelMixin, caching.HasCachedMethods):
+"""
+Represents a typed value. The value can contain nested intrinsic functions.
+
+This model can be used as the ``container_holder`` argument for 
:func:`functions.evaluate`.
+
+:ivar name: Name
+:vartype name: basestring
+:ivar type_name: Type name
+:vartype type_name: basestring
+:ivar value: Value
+:ivar description: Description
+:vartype description: basestring
+"""
+
+__tablename__ = 'attribute'
+
+name = Column(Text)
+type_name = Column(Text)
+description = Column(Text)
+_value = Column(PickleType)
+
+@property
+def value(self):
+value = self._value
+if value is not None:
+evaluation = functions.evaluate(value, self)
+if evaluation is not None:
+value = evaluation.value
+return value
+
+@value.setter
+def value(self, value):
+self._value = value
+
+# region foreign keys
+
+@declared_attr
+def node_template_fk(cls):
+"""For Attribute many-to-one to NodeTemplate"""
+return relationship.foreign_key('node_template', nullable=True)
+
+@declared_attr
+def node_fk(cls):
+"""For Attribute many-to-one to Node"""
+return relationship.foreign_key('node', nullable=True)
+
+# endregion
+
+# region many_to_one relationships
+
+@declared_attr
+def node_template(cls):
+return relationship.many_to_one(cls, 'node_template')
+
+@declared_attr
+def node(cls):
+return relationship.many_to_one(cls, 'node')
+
+# endregion
+
+@property
+@caching.cachedmethod
+def owner(self):
+"""
+The sole owner of this attribute, which is another model that relates 
to it.
+
+*All* parameters should have an owne

[08/16] incubator-ariatosca git commit: add output model

2017-06-01 Thread avia
add output model


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

Branch: refs/heads/ARIA-180-convert-parameter-to-one-to-many
Commit: 74cc94eeeb8d113994e7104477d4a7bcd78fc3d6
Parents: 9174f94
Author: Avia Efrat 
Authored: Sun May 21 16:28:30 2017 +0300
Committer: Avia Efrat 
Committed: Thu Jun 1 11:39:13 2017 +0300

--
 aria/modeling/models.py |   9 +
 aria/modeling/relationship.py   |   4 +-
 aria/modeling/service_common.py | 197 +++
 aria/modeling/service_instance.py   |   4 +-
 aria/modeling/service_template.py   |   4 +-
 examples/hello-world/helloworld.yaml|   5 +
 .../simple_v1_0/modeling/__init__.py|  20 +-
 7 files changed, 230 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/74cc94ee/aria/modeling/models.py
--
diff --git a/aria/modeling/models.py b/aria/modeling/models.py
index 584b877..f3acca6 100644
--- a/aria/modeling/models.py
+++ b/aria/modeling/models.py
@@ -73,6 +73,7 @@ __all__ = (
 
 # Common service models
 'Parameter',
+'Output'
 'Type',
 'Metadata',
 
@@ -210,6 +211,13 @@ class Parameter(aria_declarative_base, 
service_common.ParameterBase):
 pass
 
 
+class Output(aria_declarative_base, service_common.OutputBase):
+# Temporarily, until we will separate the Parameter model into Input, 
Output, Property and
+# Attribute, Parameter will represent Input, Property and Attribute, and 
Output will represent
+# the outputs.
+pass
+
+
 class Type(aria_declarative_base, service_common.TypeBase):
 pass
 
@@ -277,6 +285,7 @@ models_to_register = [
 
 # Common service models
 Parameter,
+Output,
 Type,
 Metadata,
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/74cc94ee/aria/modeling/relationship.py
--
diff --git a/aria/modeling/relationship.py b/aria/modeling/relationship.py
index 40be5b2..c4f4cf3 100644
--- a/aria/modeling/relationship.py
+++ b/aria/modeling/relationship.py
@@ -287,8 +287,8 @@ def many_to_many(model_class,
 
 if prefix is not None:
 secondary_table_name = '{0}_{1}'.format(prefix, secondary_table_name)
-if other_property is None:
-other_property = '{0}_{1}'.format(prefix, 
formatting.pluralize(this_table))
+if other_property is None:
+other_property = '{0}_{1}'.format(prefix, 
formatting.pluralize(this_table))
 
 secondary_table = _get_secondary_table(
 model_class.metadata,

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/74cc94ee/aria/modeling/service_common.py
--
diff --git a/aria/modeling/service_common.py b/aria/modeling/service_common.py
index 8f844a2..0f22dfb 100644
--- a/aria/modeling/service_common.py
+++ b/aria/modeling/service_common.py
@@ -232,6 +232,203 @@ class ParameterBase(TemplateModelMixin, 
caching.HasCachedMethods):
description=description)
 
 
+# TODO dry this code. currently it is a copy of ParameterBase
+class OutputBase(TemplateModelMixin, caching.HasCachedMethods):
+"""
+Represents a typed value. The value can contain nested intrinsic functions.
+
+This model can be used as the ``container_holder`` argument for 
:func:`functions.evaluate`.
+
+:ivar name: Name
+:vartype name: basestring
+:ivar type_name: Type name
+:vartype type_name: basestring
+:ivar value: Value
+:ivar description: Description
+:vartype description: basestring
+"""
+
+__tablename__ = 'output'
+
+name = Column(Text)
+type_name = Column(Text)
+description = Column(Text)
+_value = Column(PickleType)
+
+@property
+def value(self):
+value = self._value
+if value is not None:
+evaluation = functions.evaluate(value, self)
+if evaluation is not None:
+value = evaluation.value
+return value
+
+@value.setter
+def value(self, value):
+self._value = value
+
+@property
+@caching.cachedmethod
+def owner(self):
+"""
+The sole owner of this parameter, which is another model that relates 
to it.
+
+*All* parameters should have an owner model. In case this property 
method fails to find
+it, it will raise a ValueError, which should signify an abnormal, 
orphaned parameter.
+ 

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

2017-06-01 Thread mxmrlv
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9174f946/tests/orchestrator/workflows/api/test_task.py
--
diff --git a/tests/orchestrator/workflows/api/test_task.py 
b/tests/orchestrator/workflows/api/test_task.py
index 642c785..9d91b6b 100644
--- a/tests/orchestrator/workflows/api/test_task.py
+++ b/tests/orchestrator/workflows/api/test_task.py
@@ -44,15 +44,15 @@ class TestOperationTask(object):
 plugin = mock.models.create_plugin('test_plugin', '0.1')
 ctx.model.node.update(plugin)
 
-inputs = {'test_input': True}
+arguments = {'test_input': True}
 
 interface = mock.models.create_interface(
 ctx.service,
 interface_name,
 operation_name,
 operation_kwargs=dict(plugin=plugin,
-  implementation='op_path',
-  inputs=inputs),)
+  function='op_path',
+  arguments=arguments),)
 
 node = ctx.model.node.get_by_name(mock.models.DEPENDENT_NODE_NAME)
 node.interfaces[interface_name] = interface
@@ -66,7 +66,7 @@ class TestOperationTask(object):
 node,
 interface_name=interface_name,
 operation_name=operation_name,
-inputs=inputs,
+arguments=arguments,
 max_attempts=max_attempts,
 retry_interval=retry_interval,
 ignore_failure=ignore_failure)
@@ -77,9 +77,9 @@ class TestOperationTask(object):
 interface=interface_name,
 operation=operation_name
 )
-assert api_task.implementation == 'op_path'
+assert api_task.function == 'op_path'
 assert api_task.actor == node
-assert api_task.inputs['test_input'].value is True
+assert api_task.arguments['test_input'].value is True
 assert api_task.retry_interval == retry_interval
 assert api_task.max_attempts == max_attempts
 assert api_task.ignore_failure == ignore_failure
@@ -92,15 +92,15 @@ class TestOperationTask(object):
 plugin = mock.models.create_plugin('test_plugin', '0.1')
 ctx.model.plugin.update(plugin)
 
-inputs = {'test_input': True}
+arguments = {'test_input': True}
 
 interface = mock.models.create_interface(
 ctx.service,
 interface_name,
 operation_name,
 operation_kwargs=dict(plugin=plugin,
-  implementation='op_path',
-  inputs=inputs)
+  function='op_path',
+  arguments=arguments)
 )
 
 relationship = ctx.model.relationship.list()[0]
@@ -113,7 +113,7 @@ class TestOperationTask(object):
 relationship,
 interface_name=interface_name,
 operation_name=operation_name,
-inputs=inputs,
+arguments=arguments,
 max_attempts=max_attempts,
 retry_interval=retry_interval)
 
@@ -123,9 +123,9 @@ class TestOperationTask(object):
 interface=interface_name,
 operation=operation_name
 )
-assert api_task.implementation == 'op_path'
+assert api_task.function == 'op_path'
 assert api_task.actor == relationship
-assert api_task.inputs['test_input'].value is True
+assert api_task.arguments['test_input'].value is True
 assert api_task.retry_interval == retry_interval
 assert api_task.max_attempts == max_attempts
 assert api_task.plugin.name == 'test_plugin'
@@ -137,15 +137,15 @@ class TestOperationTask(object):
 plugin = mock.models.create_plugin('test_plugin', '0.1')
 ctx.model.node.update(plugin)
 
-inputs = {'test_input': True}
+arguments = {'test_input': True}
 
 interface = mock.models.create_interface(
 ctx.service,
 interface_name,
 operation_name,
 operation_kwargs=dict(plugin=plugin,
-  implementation='op_path',
-  inputs=inputs)
+  function='op_path',
+  arguments=arguments)
 )
 
 relationship = ctx.model.relationship.list()[0]
@@ -158,7 +158,7 @@ class TestOperationTask(object):
 relationship,
 interface_name=interface_name,
 operation_name=operation_name,
-inputs=inputs,
+arguments=arguments,
 max_attempts=max_attempts,
 retry_interval=retry_interval)
 
@@ -168,9 +168,9 @@ class TestOperationTask(object):
 interface=interface_name,
 operation=operati

[5/7] incubator-ariatosca git commit: wip

2017-06-01 Thread mxmrlv
wip


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

Branch: refs/heads/ARIA-262-Inconsistent-node-attributes-behavior
Commit: dffcb9883a4c045430b853581a14f1a4d370e882
Parents: 9174f94
Author: max-orlov 
Authored: Wed May 31 21:07:49 2017 +0300
Committer: max-orlov 
Committed: Thu Jun 1 11:26:08 2017 +0300

--
 .../context/collection_instrumentation.py   | 92 +---
 aria/orchestrator/context/common.py |  5 ++
 aria/orchestrator/context/operation.py  | 22 ++---
 3 files changed, 74 insertions(+), 45 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/dffcb988/aria/orchestrator/context/collection_instrumentation.py
--
diff --git a/aria/orchestrator/context/collection_instrumentation.py 
b/aria/orchestrator/context/collection_instrumentation.py
index 91cfd35..00a9227 100644
--- a/aria/orchestrator/context/collection_instrumentation.py
+++ b/aria/orchestrator/context/collection_instrumentation.py
@@ -18,6 +18,30 @@ from functools import partial
 from aria.modeling import models
 
 
+class _Wrapper(object):
+
+def __init__(self, instrumented_cls, instrumentation_cls, wrapped, 
**kwargs):
+self._instrumented_cls = instrumented_cls
+self._instrumentation_cls = instrumentation_cls
+self._wrapped = wrapped
+self._kwargs = kwargs
+
+def _wrap(self, value):
+from aria.modeling.models import aria_declarative_base
+if isinstance(value, self._instrumented_cls):
+return Instrument(**self._kwargs)
+elif isinstance(value, aria_declarative_base):
+return _Wrapper(
+self._instrumented_cls, self._instrumentation_cls, value, 
**self._kwargs)
+return value
+
+def __getattr__(self, item):
+return self._wrap(getattr(self._wrapped, item))
+
+def __getitem__(self, item):
+return self._wrap(self._wrapped[item])
+
+
 class _InstrumentedCollection(object):
 
 def __init__(self,
@@ -202,41 +226,47 @@ class _InstrumentedList(_InstrumentedCollection, list):
 return list(self)
 
 
-class _InstrumentedModel(object):
+class Instrument(object):
 
-def __init__(self, field_name, original_model, model_storage):
-super(_InstrumentedModel, self).__init__()
-self._field_name = field_name
+def __init__(self, original_model, model_storage, field_names):
+super(Instrument, self).__init__()
+self._field_names = field_names
 self._model_storage = model_storage
 self._original_model = original_model
-self._apply_instrumentation()
+self._instrumentation_cls = self._apply_instrumentation()
 
 def __getattr__(self, item):
-return getattr(self._original_model, item)
+return_value = getattr(self._original_model, item)
+if isinstance(return_value, (list, dict)):
+return _Wrapper(self._original_model.__class__,
+self._instrumentation_cls,
+return_value,
+field_name=self._field_names,
+original_model=self._original_model,
+model_storage=self._model_storage,
+)
+return return_value
 
 def _apply_instrumentation(self):
-
-field = getattr(self._original_model, self._field_name)
-
-# Preserve the original value. e.g. original attributes would be 
located under
-# _attributes
-setattr(self, '_{0}'.format(self._field_name), field)
-
-# set instrumented value
-setattr(self, self._field_name, _InstrumentedDict(self._model_storage,
-  self._original_model,
-  self._field_name,
-  field))
-
-
-def instrument_collection(field_name, func=None):
-if func is None:
-return partial(instrument_collection, field_name)
-
-def _wrapper(*args, **kwargs):
-original_model = func(*args, **kwargs)
-return 
type('Instrumented{0}'.format(original_model.__class__.__name__),
-(_InstrumentedModel, ),
-{})(field_name, original_model, args[0].model)
-
-return _wrapper
+for field_name in self._field_names:
+field = getattr(self._original_model, field_name)
+
+# Preserve the original value. e.g. original attribut

[1/7] incubator-ariatosca git commit: ARIA-268 Add NOTICE file [Forced Update!]

2017-06-01 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-262-Inconsistent-node-attributes-behavior 512dddf14 -> 
bd7a43898 (forced update)


ARIA-268 Add NOTICE file


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

Branch: refs/heads/ARIA-262-Inconsistent-node-attributes-behavior
Commit: 07d79513a4ac41ba66d84f2922a17fd0ab7ec39c
Parents: adf7607
Author: Ran Ziv 
Authored: Mon May 29 17:11:04 2017 +0300
Committer: Ran Ziv 
Committed: Mon May 29 17:11:04 2017 +0300

--
 NOTICE | 5 +
 1 file changed, 5 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/07d79513/NOTICE
--
diff --git a/NOTICE b/NOTICE
new file mode 100644
index 000..bf03ab5
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,5 @@
+Apache AriaTosca
+Copyright 2016-2017 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
\ No newline at end of file



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

2017-06-01 Thread mxmrlv
ARIA-149 Enhance operation configuration

* Also fixes ARIA-121, ARIA-190
* 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
* Add "function" and "arguments" fields to Operation model to preserve
  user data (in "implementation" and "inputs") and to clearly demarcate
  orchestration data from user data; update task API accordingly
* Some cleanup of parser code touched by this commit
* Rename "create_parameters" to "merge_parameter_values" and improve


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

Branch: refs/heads/ARIA-262-Inconsistent-node-attributes-behavior
Commit: 9174f9469922c57f9a979c6161bd17a9f3f90c97
Parents: 07d7951
Author: Tal Liron 
Authored: Thu Apr 20 17:54:47 2017 -0500
Committer: Tal Liron 
Committed: Wed May 31 16:42:02 2017 -0500

--
 aria/cli/commands/services.py   |   2 +-
 aria/cli/execution_logging.py   |   6 +-
 aria/core.py|  14 +-
 aria/modeling/constraints.py|  28 +++
 aria/modeling/contraints.py |  28 ---
 aria/modeling/exceptions.py |  16 +-
 aria/modeling/orchestration.py  |  14 +-
 aria/modeling/service_common.py |   7 +-
 aria/modeling/service_instance.py   |  89 +---
 aria/modeling/service_template.py   |  67 +++---
 aria/modeling/utils.py  | 114 +-
 aria/orchestrator/__init__.py   |   7 +-
 aria/orchestrator/context/operation.py  |   4 +-
 aria/orchestrator/decorators.py |   3 +-
 .../execution_plugin/instantiation.py   | 139 +++-
 aria/orchestrator/workflow_runner.py|  17 +-
 aria/orchestrator/workflows/api/task.py |  89 +---
 .../workflows/builtin/execute_operation.py  |   2 +-
 aria/orchestrator/workflows/core/task.py|   5 +-
 aria/orchestrator/workflows/events_logging.py   |   6 +-
 aria/orchestrator/workflows/executor/base.py|   4 +-
 aria/orchestrator/workflows/executor/celery.py  |   6 +-
 aria/orchestrator/workflows/executor/dry.py |   6 +-
 aria/orchestrator/workflows/executor/process.py |  12 +-
 aria/orchestrator/workflows/executor/thread.py  |   6 +-
 aria/utils/formatting.py|   4 +-
 aria/utils/validation.py|   8 +-
 .../profiles/aria-1.0/aria-1.0.yaml |   8 -
 .../simple_v1_0/assignments.py  |   4 +-
 .../simple_v1_0/modeling/__init__.py|  72 +--
 .../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/functions.py   |   4 +-
 .../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/modeling/test_models.py   |  12 +-
 tests/orchestrator/context/test_operation.py|  86 
 tests/orchestrator/context/test_serialize.py|   6 +-
 tests/orchestrator/context/test_toolbelt.py |  14 +-
 .../orchestrator/execution_plugin/test_local.py |  14 +-
 tests/orchestrator/execution_plugin/test_ssh.py |  16 +-
 tests/orchestrator/test_workflow_runner.py  |  16 +-
 tests/orchestrator/workflows/api/test_task.py   |  40 ++--
 .../workflows/builtin/test_execute_operation.py |   2 +-
 .../orchestrator/workflows/core/test_engine.py  |  44 ++--
 .../orchestrator/workflows/core/test_events.py  |   3 +-
 tests/orchestrator/workflows/core/test_task.py  |  10 +-
 .../test_task_graph_into_execution_graph.py |   6 +-
 .../orch

[7/7] incubator-ariatosca git commit: moved instrumentation into mapi level

2017-06-01 Thread mxmrlv
moved instrumentation into mapi level


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

Branch: refs/heads/ARIA-262-Inconsistent-node-attributes-behavior
Commit: bd7a43898cf686c29b13abb2e8b06c730dbe5ddb
Parents: e67a58f
Author: max-orlov 
Authored: Thu Jun 1 16:34:52 2017 +0300
Committer: max-orlov 
Committed: Thu Jun 1 16:35:07 2017 +0300

--
 .../context/collection_instrumentation.py   | 279 --
 aria/orchestrator/context/common.py |   5 -
 aria/orchestrator/context/operation.py  |  12 +-
 aria/orchestrator/decorators.py |  14 +-
 aria/storage/api.py |   1 +
 aria/storage/collection_instrumentation.py  | 282 +++
 aria/storage/core.py|  20 ++
 aria/storage/sql_mapi.py|  12 +-
 aria/utils/validation.py|   2 +-
 .../context/test_collection_instrumentation.py  |   2 +-
 tests/orchestrator/context/test_operation.py|   3 +-
 11 files changed, 332 insertions(+), 300 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/bd7a4389/aria/orchestrator/context/collection_instrumentation.py
--
diff --git a/aria/orchestrator/context/collection_instrumentation.py 
b/aria/orchestrator/context/collection_instrumentation.py
deleted file mode 100644
index 57547ea..000
--- a/aria/orchestrator/context/collection_instrumentation.py
+++ /dev/null
@@ -1,279 +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 aria.modeling import models
-
-
-class _Wrapper(object):
-
-def __init__(self, instrumented_cls, instrumentation_cls, wrapped, 
original_model, **kwargs):
-self._instrumented_cls = instrumented_cls
-self._instrumentation_cls = instrumentation_cls
-self._wrapped = wrapped
-self._original_model = original_model
-self._kwargs = kwargs
-
-def _wrap(self, value):
-from aria.modeling.models import aria_declarative_base
-if isinstance(value, self._instrumented_cls):
-return Instrument(original_model=value, **self._kwargs)
-elif isinstance(value, aria_declarative_base):
-return _Wrapper(self._instrumented_cls,
-self._instrumentation_cls,
-value,
-self._original_model,
-**self._kwargs)
-return value
-
-def __getattr__(self, item):
-return self._wrap(getattr(self._wrapped, item))
-
-def __getitem__(self, item):
-return self._wrap(self._wrapped[item])
-
-
-class _InstrumentedCollection(object):
-
-def __init__(self,
- model,
- parent,
- field_name,
- seq=None,
- is_top_level=True,
- **kwargs):
-self._model = model
-self._parent = parent
-self._field_name = field_name
-self._is_top_level = is_top_level
-self._load(seq, **kwargs)
-
-@property
-def _raw(self):
-raise NotImplementedError
-
-def _load(self, seq, **kwargs):
-"""
-Instantiates the object from existing seq.
-
-:param seq: the original sequence to load from
-:return:
-"""
-raise NotImplementedError
-
-def _set(self, key, value):
-"""
-set the changes for the current object (not in the db)
-
-:param key:
-:param value:
-:return:
-"""
-raise NotImplementedError
-
-def _del(self, collection, key):
-raise NotImplementedError
-
-def _instrument(self, key, value):
-"""
-Instruments any collection to track changes (and ease of access)
-  

[6/7] incubator-ariatosca git commit: wip2

2017-06-01 Thread mxmrlv
wip2


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

Branch: refs/heads/ARIA-262-Inconsistent-node-attributes-behavior
Commit: e67a58fda607b1934ddc3088ffbe7b01038d10aa
Parents: dffcb98
Author: max-orlov 
Authored: Thu Jun 1 11:25:49 2017 +0300
Committer: max-orlov 
Committed: Thu Jun 1 11:45:39 2017 +0300

--
 .../context/collection_instrumentation.py   | 27 
 aria/orchestrator/context/operation.py  | 10 +++-
 2 files changed, 20 insertions(+), 17 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/e67a58fd/aria/orchestrator/context/collection_instrumentation.py
--
diff --git a/aria/orchestrator/context/collection_instrumentation.py 
b/aria/orchestrator/context/collection_instrumentation.py
index 00a9227..57547ea 100644
--- a/aria/orchestrator/context/collection_instrumentation.py
+++ b/aria/orchestrator/context/collection_instrumentation.py
@@ -13,26 +13,28 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-from functools import partial
-
 from aria.modeling import models
 
 
 class _Wrapper(object):
 
-def __init__(self, instrumented_cls, instrumentation_cls, wrapped, 
**kwargs):
+def __init__(self, instrumented_cls, instrumentation_cls, wrapped, 
original_model, **kwargs):
 self._instrumented_cls = instrumented_cls
 self._instrumentation_cls = instrumentation_cls
 self._wrapped = wrapped
+self._original_model = original_model
 self._kwargs = kwargs
 
 def _wrap(self, value):
 from aria.modeling.models import aria_declarative_base
 if isinstance(value, self._instrumented_cls):
-return Instrument(**self._kwargs)
+return Instrument(original_model=value, **self._kwargs)
 elif isinstance(value, aria_declarative_base):
-return _Wrapper(
-self._instrumented_cls, self._instrumentation_cls, value, 
**self._kwargs)
+return _Wrapper(self._instrumented_cls,
+self._instrumentation_cls,
+value,
+self._original_model,
+**self._kwargs)
 return value
 
 def __getattr__(self, item):
@@ -228,21 +230,26 @@ class _InstrumentedList(_InstrumentedCollection, list):
 
 class Instrument(object):
 
-def __init__(self, original_model, model_storage, field_names):
+def __init__(self, original_model, model_storage, field_names, 
apply_to_downstream=True):
 super(Instrument, self).__init__()
 self._field_names = field_names
 self._model_storage = model_storage
 self._original_model = original_model
 self._instrumentation_cls = self._apply_instrumentation()
+self._apply_to_downstream = apply_to_downstream
 
 def __getattr__(self, item):
 return_value = getattr(self._original_model, item)
-if isinstance(return_value, (list, dict)):
+if self._apply_to_downstream and isinstance(return_value, (list, 
dict)):
+if isinstance(return_value, self._original_model.__class__):
+tracking_instance = return_value
+else:
+tracking_instance = self._original_model
 return _Wrapper(self._original_model.__class__,
 self._instrumentation_cls,
 return_value,
-field_name=self._field_names,
-original_model=self._original_model,
+field_names=self._field_names,
+original_model=tracking_instance,
 model_storage=self._model_storage,
 )
 return return_value

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/e67a58fd/aria/orchestrator/context/operation.py
--
diff --git a/aria/orchestrator/context/operation.py 
b/aria/orchestrator/context/operation.py
index 07ff3cb..86ed538 100644
--- a/aria/orchestrator/context/operation.py
+++ b/aria/orchestrator/context/operation.py
@@ -21,11 +21,7 @@ import threading
 
 import aria
 from aria.utils import file
-from aria.modeling import models
-from . import (
-common,
-collection_instrumentation
-)
+from . import common
 
 
 class BaseOperationContext(common.BaseContext):
@@ -122,7 +118,7 @@ class NodeOperationCont

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

2017-06-01 Thread mxmrlv
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9174f946/extensions/aria_extension_tosca/simple_v1_0/modeling/capabilities.py
--
diff --git 
a/extensions/aria_extension_tosca/simple_v1_0/modeling/capabilities.py 
b/extensions/aria_extension_tosca/simple_v1_0/modeling/capabilities.py
index 6df7177..a90a9fc 100644
--- a/extensions/aria_extension_tosca/simple_v1_0/modeling/capabilities.py
+++ b/extensions/aria_extension_tosca/simple_v1_0/modeling/capabilities.py
@@ -16,8 +16,9 @@
 from aria.utils.collections import deepcopy_with_locators, OrderedDict
 from aria.parser.validation import Issue
 
-from .properties import (convert_property_definitions_to_values, 
merge_raw_property_definitions,
- get_assigned_and_defined_property_values)
+from .parameters import (convert_parameter_definitions_to_values, 
merge_raw_parameter_definitions,
+ get_assigned_and_defined_parameter_values)
+
 
 #
 # CapabilityType
@@ -38,6 +39,7 @@ def get_inherited_valid_source_types(context, presentation):
 
 return valid_source_types
 
+
 #
 # NodeType
 #
@@ -92,6 +94,7 @@ def get_inherited_capability_definitions(context, 
presentation, for_presentation
 
 return capability_definitions
 
+
 #
 # NodeTemplate
 #
@@ -127,8 +130,9 @@ def get_template_capabilities(context, presentation):
 capability_assignment = capability_assignments[capability_name]
 
 # Assign properties
-values = get_assigned_and_defined_property_values(context,
-  
our_capability_assignment)
+values = get_assigned_and_defined_parameter_values(context,
+   
our_capability_assignment,
+   'property')
 if values:
 capability_assignment._raw['properties'] = values
 else:
@@ -139,6 +143,7 @@ def get_template_capabilities(context, presentation):
 
 return capability_assignments
 
+
 #
 # Utils
 #
@@ -150,24 +155,25 @@ def 
convert_capability_from_definition_to_assignment(context, presentation, cont
 
 properties = presentation.properties
 if properties is not None:
-raw['properties'] = convert_property_definitions_to_values(context, 
properties)
+raw['properties'] = convert_parameter_definitions_to_values(context, 
properties)
 
 # TODO attributes
 
 return CapabilityAssignment(name=presentation._name, raw=raw, 
container=container)
 
+
 def merge_capability_definition_from_type(context, presentation, 
capability_definition):
 raw_properties = OrderedDict()
 
 # Merge properties from type
 the_type = capability_definition._get_type(context)
 type_property_defintions = the_type._get_properties(context)
-merge_raw_property_definitions(context, presentation, raw_properties, 
type_property_defintions,
-   'properties')
+merge_raw_parameter_definitions(context, presentation, raw_properties, 
type_property_defintions,
+'properties')
 
 # Merge our properties
-merge_raw_property_definitions(context, presentation, raw_properties,
-   capability_definition.properties, 
'properties')
+merge_raw_parameter_definitions(context, presentation, raw_properties,
+capability_definition.properties, 
'properties')
 
 if raw_properties:
 capability_definition._raw['properties'] = raw_properties

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9174f946/extensions/aria_extension_tosca/simple_v1_0/modeling/constraints.py
--
diff --git 
a/extensions/aria_extension_tosca/simple_v1_0/modeling/constraints.py 
b/extensions/aria_extension_tosca/simple_v1_0/modeling/constraints.py
index 7c99eab..9a30cc1 100644
--- a/extensions/aria_extension_tosca/simple_v1_0/modeling/constraints.py
+++ b/extensions/aria_extension_tosca/simple_v1_0/modeling/constraints.py
@@ -15,7 +15,7 @@
 
 import re
 
-from aria.modeling.contraints import NodeTemplateConstraint
+from aria.modeling.constraints import NodeTemplateConstraint
 from aria.modeling.utils import NodeTemplateContainerHolder
 from aria.modeling.functions import evaluate
 from aria.parser import implements_specification

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/9174f946/extensions/aria_extension_tosca/simple_v1_0/modeling/data_types.py
--
diff --git a/extensions/aria_extension_tosca/simple_v1_0/modeling/data_types.py 
b/extensions/aria_extension_tosca/simple_v1_0/modeling/data_types.py
index 3952785..c0d79e5 100644
--- a/extensions/aria_ext

Re: Query on operation inputs

2017-06-01 Thread Ran Ziv
Right, it makes more sense now :) But now I simply have to say again that
as far as I can tell this should in fact be the intended behavior.

What would you rather happen? the "labels" parameter be assigned with
"None" instead?
We considered this but part of the problem here is that the information
about whether an input is required or not is no longer available at this
stage so it's impossible to know whether to use "None" or raise an error.
Tal and I have talked about it in the past, and from what I remember, Tal
said the "required" field information in fact should not be stored, and is
only relevant for parsing phase. It is possible I'm getting this wrong
though :)

I'm open for changes here as it is a somewhat confusing behavior - although
I think it does make sense after all.



On Thu, Jun 1, 2017 at 3:04 PM, D Jayachandran 
wrote:

> Hi Ran/Tal,
>
> I was wrong, Tal's branch still throws the validation error (I was loading
> a different service template) :). So the issue which I told still exists
>
> [root@DJ-DEV tal-test]# python 
> /root/tal-test/incubator-ariatosca/aria/cli/main.py
> executions start install -s s2
> Declared parameters "labels" have not been provided values
>
> Regards,
> DJ
>
> -Original Message-
> From: Ran Ziv [mailto:r...@gigaspaces.com]
> Sent: Thursday, June 01, 2017 5:24 PM
> To: dev@ariatosca.incubator.apache.org
> Subject: Re: Query on operation inputs
>
> Again, there's a difference between the "required" validation and the
> actual runtime validation. the runtime one cannot be done during
> instantiation phase, which is why there are two separate validations.
>
> I do not know how come Tal's branch (which by now has been merged to
> master) helped fixing your issue, so I might have misunderstood something
> about your problem :)
>
> Ran
>
> On Thu, Jun 1, 2017 at 2:11 PM, D Jayachandran <
> d.jayachand...@ericsson.com>
> wrote:
>
> > Hi Tal,
> >
> > I did test your branch  https://github.com/apache/
> > incubator-ariatosca/tree/ARIA-149-functions-in-operation-configuration
> > and it seems to have the fix for operation/interface inputs.
> >
> > Regards,
> > DJ
> > -Original Message-
> > From: D Jayachandran
> > Sent: Thursday, June 01, 2017 4:40 PM
> > To: dev@ariatosca.incubator.apache.org
> > Subject: RE: Query on operation inputs
> >
> > Hi Ran,
> >
> > The validation of operation inputs is also done during instantiation.
> > Please find below.
> >
> > [root@DJ-DEV tal-test]# python
> > /root/tal-test/incubator-ariatosca/aria/cli/main.py
> > service-templates store /root/tosca_simple_yaml_
> > plugin/kubernetes-deployment.yaml st-3 Storing service template st-3...
> > Validation issues:
> >   4: interface definition "Standard" does not assign a value to a
> > required operation input "create.name" in "web_app"
> >
> > @"/root/tosca_simple_yaml_plugin/kubernetes-deployment.yaml":64:25
> > Failed to parse service template
> >
> >
> > I think the branch Tal provided  https://github.com/apache/
> > incubator-ariatosca/tree/ARIA-149-functions-in-operation-configuration
> > has fixed the issue on operation inputs.
> >
> > Regards,
> > DJ
> >
> > -Original Message-
> > From: Ran Ziv [mailto:r...@gigaspaces.com]
> > Sent: Thursday, June 01, 2017 2:27 PM
> > To: dev@ariatosca.incubator.apache.org
> > Subject: Re: Query on operation inputs
> >
> > I think there's some confusion about different types of inputs. The
> > validation on inputs that is done during parsing (actually
> > "instantiation") stage is for the service's inputs, not operations.
> > Execution and operation inputs (or more broadly, arguments) are
> > validated before an execution is run.
> >
> >
> > On Tue, May 30, 2017 at 8:48 AM, D Jayachandran <
> > d.jayachand...@ericsson.com
> > > wrote:
> >
> > > Hi Ran,
> > >
> > > I think Tal as updated, it might be possibly a bug here. May be we
> > > all should come to common understanding.
> > >
> > > As I updated earlier, since the inputs validation are completing
> > > during parsing stage, I don’t feel why the validation is required
> > > again during orchestration time ?
> > > Does the TOSCA spec actually refers the 2nd points of yours ? (The
> > > operation inputs must either have a default value in the type
> > > definition or be supplied with a value in the actual operation
> > > definition)
> > >
> > >
> > > Regards,
> > > DJ
> > >
> > > -Original Message-
> > > From: Ran Ziv [mailto:r...@gigaspaces.com]
> > > Sent: Sunday, May 28, 2017 6:14 PM
> > > To: dev@ariatosca.incubator.apache.org
> > > Subject: Re: Query on operation inputs
> > >
> > > I've reviewed your example, and I think either I'm missing something
> > > or my original explanation still applies:
> > >
> > >   1. The validation at orchestration time for whether required
> > > inputs have been specified does not deal with the "required" flag at
> > > all (actually, the flag never makes it past the parsing stage and
> > > into the
> > storage models).
> > >
> > >  

RE: Query on operation inputs

2017-06-01 Thread D Jayachandran
Hi Ran/Tal,

I was wrong, Tal's branch still throws the validation error (I was loading a 
different service template) :). So the issue which I told still exists

[root@DJ-DEV tal-test]# python 
/root/tal-test/incubator-ariatosca/aria/cli/main.py executions start install -s 
s2
Declared parameters "labels" have not been provided values

Regards,
DJ

-Original Message-
From: Ran Ziv [mailto:r...@gigaspaces.com] 
Sent: Thursday, June 01, 2017 5:24 PM
To: dev@ariatosca.incubator.apache.org
Subject: Re: Query on operation inputs

Again, there's a difference between the "required" validation and the actual 
runtime validation. the runtime one cannot be done during instantiation phase, 
which is why there are two separate validations.

I do not know how come Tal's branch (which by now has been merged to
master) helped fixing your issue, so I might have misunderstood something about 
your problem :)

Ran

On Thu, Jun 1, 2017 at 2:11 PM, D Jayachandran 
wrote:

> Hi Tal,
>
> I did test your branch  https://github.com/apache/ 
> incubator-ariatosca/tree/ARIA-149-functions-in-operation-configuration
> and it seems to have the fix for operation/interface inputs.
>
> Regards,
> DJ
> -Original Message-
> From: D Jayachandran
> Sent: Thursday, June 01, 2017 4:40 PM
> To: dev@ariatosca.incubator.apache.org
> Subject: RE: Query on operation inputs
>
> Hi Ran,
>
> The validation of operation inputs is also done during instantiation.
> Please find below.
>
> [root@DJ-DEV tal-test]# python 
> /root/tal-test/incubator-ariatosca/aria/cli/main.py
> service-templates store /root/tosca_simple_yaml_ 
> plugin/kubernetes-deployment.yaml st-3 Storing service template st-3...
> Validation issues:
>   4: interface definition "Standard" does not assign a value to a 
> required operation input "create.name" in "web_app"
>  
> @"/root/tosca_simple_yaml_plugin/kubernetes-deployment.yaml":64:25
> Failed to parse service template
>
>
> I think the branch Tal provided  https://github.com/apache/ 
> incubator-ariatosca/tree/ARIA-149-functions-in-operation-configuration
> has fixed the issue on operation inputs.
>
> Regards,
> DJ
>
> -Original Message-
> From: Ran Ziv [mailto:r...@gigaspaces.com]
> Sent: Thursday, June 01, 2017 2:27 PM
> To: dev@ariatosca.incubator.apache.org
> Subject: Re: Query on operation inputs
>
> I think there's some confusion about different types of inputs. The 
> validation on inputs that is done during parsing (actually 
> "instantiation") stage is for the service's inputs, not operations.
> Execution and operation inputs (or more broadly, arguments) are 
> validated before an execution is run.
>
>
> On Tue, May 30, 2017 at 8:48 AM, D Jayachandran < 
> d.jayachand...@ericsson.com
> > wrote:
>
> > Hi Ran,
> >
> > I think Tal as updated, it might be possibly a bug here. May be we 
> > all should come to common understanding.
> >
> > As I updated earlier, since the inputs validation are completing 
> > during parsing stage, I don’t feel why the validation is required 
> > again during orchestration time ?
> > Does the TOSCA spec actually refers the 2nd points of yours ? (The 
> > operation inputs must either have a default value in the type 
> > definition or be supplied with a value in the actual operation
> > definition)
> >
> >
> > Regards,
> > DJ
> >
> > -Original Message-
> > From: Ran Ziv [mailto:r...@gigaspaces.com]
> > Sent: Sunday, May 28, 2017 6:14 PM
> > To: dev@ariatosca.incubator.apache.org
> > Subject: Re: Query on operation inputs
> >
> > I've reviewed your example, and I think either I'm missing something 
> > or my original explanation still applies:
> >
> >   1. The validation at orchestration time for whether required 
> > inputs have been specified does not deal with the "required" flag at 
> > all (actually, the flag never makes it past the parsing stage and 
> > into the
> storage models).
> >
> >   2. For operation inputs to validate successfully, each input must 
> > either have a default value in the type definition or be supplied 
> > with a value in the actual operation definition. In your case, both 
> > "labels" and "isService" for example didn't have a default value set 
> > in the type definition (as opposed to "target_host" for example) -
> However, "isService"
> > was set to "true" in the actual operation definition, while "labels"
> > wasn't assigned with any such value - Which is why you received the 
> > validation error for a missing required input over the "labels"
> > operation input.
> >
> >
> > Does this make sense?
> >
> >
> > On Fri, May 26, 2017 at 7:26 PM, Tal Liron  wrote:
> >
> > > OK, I see now -- the error you are getting is about the operation 
> > > inputs, not the topology inputs which are different.
> > >
> > > You may have discovered a bug here. It seems like you're doing the 
> > > right thing and giving values to all these inputs, so it should 
> > > not be complaining.
> > >
> > > I am actually working on a PR right now that ma

Re: Query on operation inputs

2017-06-01 Thread Ran Ziv
Again, there's a difference between the "required" validation and the
actual runtime validation. the runtime one cannot be done during
instantiation phase, which is why there are two separate validations.

I do not know how come Tal's branch (which by now has been merged to
master) helped fixing your issue, so I might have misunderstood something
about your problem :)

Ran

On Thu, Jun 1, 2017 at 2:11 PM, D Jayachandran 
wrote:

> Hi Tal,
>
> I did test your branch  https://github.com/apache/
> incubator-ariatosca/tree/ARIA-149-functions-in-operation-configuration
> and it seems to have the fix for operation/interface inputs.
>
> Regards,
> DJ
> -Original Message-
> From: D Jayachandran
> Sent: Thursday, June 01, 2017 4:40 PM
> To: dev@ariatosca.incubator.apache.org
> Subject: RE: Query on operation inputs
>
> Hi Ran,
>
> The validation of operation inputs is also done during instantiation.
> Please find below.
>
> [root@DJ-DEV tal-test]# python 
> /root/tal-test/incubator-ariatosca/aria/cli/main.py
> service-templates store /root/tosca_simple_yaml_
> plugin/kubernetes-deployment.yaml st-3 Storing service template st-3...
> Validation issues:
>   4: interface definition "Standard" does not assign a value to a required
> operation input "create.name" in "web_app"
>  @"/root/tosca_simple_yaml_plugin/kubernetes-deployment.yaml":64:25
> Failed to parse service template
>
>
> I think the branch Tal provided  https://github.com/apache/
> incubator-ariatosca/tree/ARIA-149-functions-in-operation-configuration
> has fixed the issue on operation inputs.
>
> Regards,
> DJ
>
> -Original Message-
> From: Ran Ziv [mailto:r...@gigaspaces.com]
> Sent: Thursday, June 01, 2017 2:27 PM
> To: dev@ariatosca.incubator.apache.org
> Subject: Re: Query on operation inputs
>
> I think there's some confusion about different types of inputs. The
> validation on inputs that is done during parsing (actually "instantiation")
> stage is for the service's inputs, not operations.
> Execution and operation inputs (or more broadly, arguments) are validated
> before an execution is run.
>
>
> On Tue, May 30, 2017 at 8:48 AM, D Jayachandran <
> d.jayachand...@ericsson.com
> > wrote:
>
> > Hi Ran,
> >
> > I think Tal as updated, it might be possibly a bug here. May be we all
> > should come to common understanding.
> >
> > As I updated earlier, since the inputs validation are completing
> > during parsing stage, I don’t feel why the validation is required
> > again during orchestration time ?
> > Does the TOSCA spec actually refers the 2nd points of yours ? (The
> > operation inputs must either have a default value in the type
> > definition or be supplied with a value in the actual operation
> > definition)
> >
> >
> > Regards,
> > DJ
> >
> > -Original Message-
> > From: Ran Ziv [mailto:r...@gigaspaces.com]
> > Sent: Sunday, May 28, 2017 6:14 PM
> > To: dev@ariatosca.incubator.apache.org
> > Subject: Re: Query on operation inputs
> >
> > I've reviewed your example, and I think either I'm missing something
> > or my original explanation still applies:
> >
> >   1. The validation at orchestration time for whether required inputs
> > have been specified does not deal with the "required" flag at all
> > (actually, the flag never makes it past the parsing stage and into the
> storage models).
> >
> >   2. For operation inputs to validate successfully, each input must
> > either have a default value in the type definition or be supplied with
> > a value in the actual operation definition. In your case, both
> > "labels" and "isService" for example didn't have a default value set
> > in the type definition (as opposed to "target_host" for example) -
> However, "isService"
> > was set to "true" in the actual operation definition, while "labels"
> > wasn't assigned with any such value - Which is why you received the
> > validation error for a missing required input over the "labels"
> > operation input.
> >
> >
> > Does this make sense?
> >
> >
> > On Fri, May 26, 2017 at 7:26 PM, Tal Liron  wrote:
> >
> > > OK, I see now -- the error you are getting is about the operation
> > > inputs, not the topology inputs which are different.
> > >
> > > You may have discovered a bug here. It seems like you're doing the
> > > right thing and giving values to all these inputs, so it should not
> > > be complaining.
> > >
> > > I am actually working on a PR right now that makes some significant
> > > changes to this mechanism, but it's not merged yet. I don't mean to
> > > waste your time, but I would appreciate if you could test it out for
> > > me in your environment. Here is the branch to use:
> > >
> > > https://github.com/apache/incubator-ariatosca/tree/ARIA-
> > > 149-functions-in-operation-configuration
> > >
> > >
> > > On Fri, May 26, 2017 at 4:53 AM, D Jayachandran <
> > > d.jayachand...@ericsson.com
> > > > wrote:
> > >
> > > > Hi Tal,
> > > >
> > > > Thanks for your email.
> > > >
> > > > With the same example you took with my

Podling Report Reminder - June 2017

2017-06-01 Thread johndament
Dear podling,

This email was sent by an automated system on behalf of the Apache
Incubator PMC. It is an initial reminder to give you plenty of time to
prepare your quarterly board report.

The board meeting is scheduled for Wed, 21 June 2017, 10:30 am PDT.
The report for your podling will form a part of the Incubator PMC
report. The Incubator PMC requires your report to be submitted 2 weeks
before the board meeting, to allow sufficient time for review and
submission (Wed, June 07).

Please submit your report with sufficient time to allow the Incubator
PMC, and subsequently board members to review and digest. Again, the
very latest you should submit your report is 2 weeks prior to the board
meeting.

Thanks,

The Apache Incubator PMC

Submitting your Report

--

Your report should contain the following:

*   Your project name
*   A brief description of your project, which assumes no knowledge of
the project or necessarily of its field
*   A list of the three most important issues to address in the move
towards graduation.
*   Any issues that the Incubator PMC or ASF Board might wish/need to be
aware of
*   How has the community developed since the last report
*   How has the project developed since the last report.
*   How does the podling rate their own maturity.

This should be appended to the Incubator Wiki page at:

https://wiki.apache.org/incubator/June2017

Note: This is manually populated. You may need to wait a little before
this page is created from a template.

Mentors
---

Mentors should review reports for their project(s) and sign them off on
the Incubator wiki page. Signing off reports shows that you are
following the project - projects that are not signed may raise alarms
for the Incubator PMC.

Incubator PMC


RE: Query on operation inputs

2017-06-01 Thread D Jayachandran
Hi Tal,

I did test your branch  
https://github.com/apache/incubator-ariatosca/tree/ARIA-149-functions-in-operation-configuration
 and it seems to have the fix for operation/interface inputs.

Regards,
DJ
-Original Message-
From: D Jayachandran 
Sent: Thursday, June 01, 2017 4:40 PM
To: dev@ariatosca.incubator.apache.org
Subject: RE: Query on operation inputs

Hi Ran,

The validation of operation inputs is also done during instantiation. Please 
find below.

[root@DJ-DEV tal-test]# python 
/root/tal-test/incubator-ariatosca/aria/cli/main.py service-templates store 
/root/tosca_simple_yaml_plugin/kubernetes-deployment.yaml st-3 Storing service 
template st-3...
Validation issues:
  4: interface definition "Standard" does not assign a value to a required 
operation input "create.name" in "web_app"
 @"/root/tosca_simple_yaml_plugin/kubernetes-deployment.yaml":64:25
Failed to parse service template


I think the branch Tal provided  
https://github.com/apache/incubator-ariatosca/tree/ARIA-149-functions-in-operation-configuration
 has fixed the issue on operation inputs.

Regards,
DJ

-Original Message-
From: Ran Ziv [mailto:r...@gigaspaces.com]
Sent: Thursday, June 01, 2017 2:27 PM
To: dev@ariatosca.incubator.apache.org
Subject: Re: Query on operation inputs

I think there's some confusion about different types of inputs. The validation 
on inputs that is done during parsing (actually "instantiation") stage is for 
the service's inputs, not operations.
Execution and operation inputs (or more broadly, arguments) are validated 
before an execution is run.


On Tue, May 30, 2017 at 8:48 AM, D Jayachandran  wrote:

> Hi Ran,
>
> I think Tal as updated, it might be possibly a bug here. May be we all 
> should come to common understanding.
>
> As I updated earlier, since the inputs validation are completing 
> during parsing stage, I don’t feel why the validation is required 
> again during orchestration time ?
> Does the TOSCA spec actually refers the 2nd points of yours ? (The 
> operation inputs must either have a default value in the type 
> definition or be supplied with a value in the actual operation
> definition)
>
>
> Regards,
> DJ
>
> -Original Message-
> From: Ran Ziv [mailto:r...@gigaspaces.com]
> Sent: Sunday, May 28, 2017 6:14 PM
> To: dev@ariatosca.incubator.apache.org
> Subject: Re: Query on operation inputs
>
> I've reviewed your example, and I think either I'm missing something 
> or my original explanation still applies:
>
>   1. The validation at orchestration time for whether required inputs 
> have been specified does not deal with the "required" flag at all 
> (actually, the flag never makes it past the parsing stage and into the 
> storage models).
>
>   2. For operation inputs to validate successfully, each input must 
> either have a default value in the type definition or be supplied with 
> a value in the actual operation definition. In your case, both 
> "labels" and "isService" for example didn't have a default value set 
> in the type definition (as opposed to "target_host" for example) - However, 
> "isService"
> was set to "true" in the actual operation definition, while "labels"
> wasn't assigned with any such value - Which is why you received the 
> validation error for a missing required input over the "labels"
> operation input.
>
>
> Does this make sense?
>
>
> On Fri, May 26, 2017 at 7:26 PM, Tal Liron  wrote:
>
> > OK, I see now -- the error you are getting is about the operation 
> > inputs, not the topology inputs which are different.
> >
> > You may have discovered a bug here. It seems like you're doing the 
> > right thing and giving values to all these inputs, so it should not 
> > be complaining.
> >
> > I am actually working on a PR right now that makes some significant 
> > changes to this mechanism, but it's not merged yet. I don't mean to 
> > waste your time, but I would appreciate if you could test it out for 
> > me in your environment. Here is the branch to use:
> >
> > https://github.com/apache/incubator-ariatosca/tree/ARIA-
> > 149-functions-in-operation-configuration
> >
> >
> > On Fri, May 26, 2017 at 4:53 AM, D Jayachandran < 
> > d.jayachand...@ericsson.com
> > > wrote:
> >
> > > Hi Tal,
> > >
> > > Thanks for your email.
> > >
> > > With the same example you took with my inputs "isService" & "image".
> > > ARIA has a problem when I don’t specify "isService" which is 
> > > defined as
> > > required: false.
> > >
> > > Please find just the different inputs used in my example ( 
> > > topology, node type  and node template)
> > >
> > > TOPOLOGY INPUTS
> > >
> > > inputs:
> > > web_app_name:
> > > type: string
> > > value: tosca-webapp
> > >
> > > web_app_image:
> > > type: string
> > > value: kuber-master:5000/webwithdbinput
> > >
> > > web_app_port:
> > > type: integer
> > > value: 80
> > >
> > > db_name:
> > >

RE: Query on operation inputs

2017-06-01 Thread D Jayachandran
Hi Ran,

The validation of operation inputs is also done during instantiation. Please 
find below.

[root@DJ-DEV tal-test]# python 
/root/tal-test/incubator-ariatosca/aria/cli/main.py service-templates store 
/root/tosca_simple_yaml_plugin/kubernetes-deployment.yaml st-3
Storing service template st-3...
Validation issues:
  4: interface definition "Standard" does not assign a value to a required 
operation input "create.name" in "web_app"
 @"/root/tosca_simple_yaml_plugin/kubernetes-deployment.yaml":64:25
Failed to parse service template


I think the branch Tal provided  
https://github.com/apache/incubator-ariatosca/tree/ARIA-149-functions-in-operation-configuration
 has fixed the issue on operation inputs.

Regards,
DJ

-Original Message-
From: Ran Ziv [mailto:r...@gigaspaces.com] 
Sent: Thursday, June 01, 2017 2:27 PM
To: dev@ariatosca.incubator.apache.org
Subject: Re: Query on operation inputs

I think there's some confusion about different types of inputs. The validation 
on inputs that is done during parsing (actually "instantiation") stage is for 
the service's inputs, not operations.
Execution and operation inputs (or more broadly, arguments) are validated 
before an execution is run.


On Tue, May 30, 2017 at 8:48 AM, D Jayachandran  wrote:

> Hi Ran,
>
> I think Tal as updated, it might be possibly a bug here. May be we all 
> should come to common understanding.
>
> As I updated earlier, since the inputs validation are completing 
> during parsing stage, I don’t feel why the validation is required 
> again during orchestration time ?
> Does the TOSCA spec actually refers the 2nd points of yours ? (The 
> operation inputs must either have a default value in the type 
> definition or be supplied with a value in the actual operation 
> definition)
>
>
> Regards,
> DJ
>
> -Original Message-
> From: Ran Ziv [mailto:r...@gigaspaces.com]
> Sent: Sunday, May 28, 2017 6:14 PM
> To: dev@ariatosca.incubator.apache.org
> Subject: Re: Query on operation inputs
>
> I've reviewed your example, and I think either I'm missing something 
> or my original explanation still applies:
>
>   1. The validation at orchestration time for whether required inputs 
> have been specified does not deal with the "required" flag at all 
> (actually, the flag never makes it past the parsing stage and into the 
> storage models).
>
>   2. For operation inputs to validate successfully, each input must 
> either have a default value in the type definition or be supplied with 
> a value in the actual operation definition. In your case, both 
> "labels" and "isService" for example didn't have a default value set 
> in the type definition (as opposed to "target_host" for example) - However, 
> "isService"
> was set to "true" in the actual operation definition, while "labels"
> wasn't assigned with any such value - Which is why you received the 
> validation error for a missing required input over the "labels" 
> operation input.
>
>
> Does this make sense?
>
>
> On Fri, May 26, 2017 at 7:26 PM, Tal Liron  wrote:
>
> > OK, I see now -- the error you are getting is about the operation 
> > inputs, not the topology inputs which are different.
> >
> > You may have discovered a bug here. It seems like you're doing the 
> > right thing and giving values to all these inputs, so it should not 
> > be complaining.
> >
> > I am actually working on a PR right now that makes some significant 
> > changes to this mechanism, but it's not merged yet. I don't mean to 
> > waste your time, but I would appreciate if you could test it out for 
> > me in your environment. Here is the branch to use:
> >
> > https://github.com/apache/incubator-ariatosca/tree/ARIA-
> > 149-functions-in-operation-configuration
> >
> >
> > On Fri, May 26, 2017 at 4:53 AM, D Jayachandran < 
> > d.jayachand...@ericsson.com
> > > wrote:
> >
> > > Hi Tal,
> > >
> > > Thanks for your email.
> > >
> > > With the same example you took with my inputs "isService" & "image".
> > > ARIA has a problem when I don’t specify "isService" which is 
> > > defined as
> > > required: false.
> > >
> > > Please find just the different inputs used in my example ( 
> > > topology, node type  and node template)
> > >
> > > TOPOLOGY INPUTS
> > >
> > > inputs:
> > > web_app_name:
> > > type: string
> > > value: tosca-webapp
> > >
> > > web_app_image:
> > > type: string
> > > value: kuber-master:5000/webwithdbinput
> > >
> > > web_app_port:
> > > type: integer
> > > value: 80
> > >
> > > db_name:
> > > type: string
> > > value: tosca-database
> > >
> > > db_image:
> > > type: string
> > > value: kuber-master:5000/dbforweb
> > >
> > > db_port:
> > > type: integer
> > > value: 3306
> > >
> > >
> > > NODE-TYPE INPUTS
> > >
> > > create:
> > > inputs:
> >

Support for TOSCA Simple Profile NFV 1.0

2017-06-01 Thread D Jayachandran
Hi,

I hope ARIA currently supports , TOSCA Simple Profile NFV 1.0 draft 03.
The Latest available TOSCA NFV profile is Simple profile NFV 1.0 draft 04, 
released on 11 May 2017.

Could you kindly confirm the current level of support from ARIA for NFV 
profiles and do you have any timelines to support draft 04 ?


Regards,
DJ


[incubator-ariatosca] Git Push Summary

2017-06-01 Thread ran
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/osx-travis [deleted] 49342360e


Re: Query on operation inputs

2017-06-01 Thread Ran Ziv
I think there's some confusion about different types of inputs. The
validation on inputs that is done during parsing (actually "instantiation")
stage is for the service's inputs, not operations.
Execution and operation inputs (or more broadly, arguments) are validated
before an execution is run.


On Tue, May 30, 2017 at 8:48 AM, D Jayachandran  wrote:

> Hi Ran,
>
> I think Tal as updated, it might be possibly a bug here. May be we all
> should come to common understanding.
>
> As I updated earlier, since the inputs validation are completing during
> parsing stage, I don’t feel why the validation is required again during
> orchestration time ?
> Does the TOSCA spec actually refers the 2nd points of yours ? (The
> operation inputs must either have a default value in the type definition or
> be supplied with a value in the actual operation definition)
>
>
> Regards,
> DJ
>
> -Original Message-
> From: Ran Ziv [mailto:r...@gigaspaces.com]
> Sent: Sunday, May 28, 2017 6:14 PM
> To: dev@ariatosca.incubator.apache.org
> Subject: Re: Query on operation inputs
>
> I've reviewed your example, and I think either I'm missing something or my
> original explanation still applies:
>
>   1. The validation at orchestration time for whether required inputs have
> been specified does not deal with the "required" flag at all (actually, the
> flag never makes it past the parsing stage and into the storage models).
>
>   2. For operation inputs to validate successfully, each input must either
> have a default value in the type definition or be supplied with a value in
> the actual operation definition. In your case, both "labels" and
> "isService" for example didn't have a default value set in the type
> definition (as opposed to "target_host" for example) - However, "isService"
> was set to "true" in the actual operation definition, while "labels"
> wasn't assigned with any such value - Which is why you received the
> validation error for a missing required input over the "labels" operation
> input.
>
>
> Does this make sense?
>
>
> On Fri, May 26, 2017 at 7:26 PM, Tal Liron  wrote:
>
> > OK, I see now -- the error you are getting is about the operation
> > inputs, not the topology inputs which are different.
> >
> > You may have discovered a bug here. It seems like you're doing the
> > right thing and giving values to all these inputs, so it should not be
> > complaining.
> >
> > I am actually working on a PR right now that makes some significant
> > changes to this mechanism, but it's not merged yet. I don't mean to
> > waste your time, but I would appreciate if you could test it out for
> > me in your environment. Here is the branch to use:
> >
> > https://github.com/apache/incubator-ariatosca/tree/ARIA-
> > 149-functions-in-operation-configuration
> >
> >
> > On Fri, May 26, 2017 at 4:53 AM, D Jayachandran <
> > d.jayachand...@ericsson.com
> > > wrote:
> >
> > > Hi Tal,
> > >
> > > Thanks for your email.
> > >
> > > With the same example you took with my inputs "isService" & "image".
> > > ARIA has a problem when I don’t specify "isService" which is defined
> > > as
> > > required: false.
> > >
> > > Please find just the different inputs used in my example ( topology,
> > > node type  and node template)
> > >
> > > TOPOLOGY INPUTS
> > >
> > > inputs:
> > > web_app_name:
> > > type: string
> > > value: tosca-webapp
> > >
> > > web_app_image:
> > > type: string
> > > value: kuber-master:5000/webwithdbinput
> > >
> > > web_app_port:
> > > type: integer
> > > value: 80
> > >
> > > db_name:
> > > type: string
> > > value: tosca-database
> > >
> > > db_image:
> > > type: string
> > > value: kuber-master:5000/dbforweb
> > >
> > > db_port:
> > > type: integer
> > > value: 3306
> > >
> > >
> > > NODE-TYPE INPUTS
> > >
> > > create:
> > > inputs:
> > > name:
> > > type: string
> > > required: true
> > > image:
> > > type: string
> > > required: true
> > > exposed_port:
> > > type: integer
> > > required: false
> > > target_port:
> > > type: integer
> > > required: false
> > > default: 8080
> > > target_host:
> > > type: string
> > > required: false
> > > default: test
> > > labels:
> > > type: string
> > > 

incubator-ariatosca git commit: osx-travis

2017-06-01 Thread ran
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/osx-travis [created] 49342360e


osx-travis


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

Branch: refs/heads/osx-travis
Commit: 49342360eb8da61d20a0dd23d0b90a17d81445e1
Parents: 9174f94
Author: Ran Ziv 
Authored: Thu Jun 1 11:43:38 2017 +0300
Committer: Ran Ziv 
Committed: Thu Jun 1 11:43:38 2017 +0300

--
 .travis.yml | 15 +--
 aria/orchestrator/workflows/executor/dry.py |  2 +-
 tox.ini |  2 --
 3 files changed, 10 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/49342360/.travis.yml
--
diff --git a/.travis.yml b/.travis.yml
index b11ed62..379cb5d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -14,13 +14,16 @@ sudo: false
 language: python
 python:
   - "2.7"
+os:
+  - linux
+  - osx
 env:
-- TOX_ENV=pylint_code
-- TOX_ENV=pylint_tests
-- TOX_ENV=py27
-- TOX_ENV=py26
-- TOX_ENV=py27e2e
-- TOX_ENV=py26e2e
+  - TOX_ENV=pylint_code
+  - TOX_ENV=pylint_tests
+  - TOX_ENV=py27
+  - TOX_ENV=py26
+  - TOX_ENV=py27e2e
+  - TOX_ENV=py26e2e
 install:
   - pip install --upgrade pip
   - pip install --upgrade setuptools

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/49342360/aria/orchestrator/workflows/executor/dry.py
--
diff --git a/aria/orchestrator/workflows/executor/dry.py 
b/aria/orchestrator/workflows/executor/dry.py
index 8848df8..72080b4 100644
--- a/aria/orchestrator/workflows/executor/dry.py
+++ b/aria/orchestrator/workflows/executor/dry.py
@@ -45,7 +45,7 @@ class DryExecutor(BaseExecutor):
 logger(dry_msg.format(name=name, task=task, suffix='started...'))
 logger(dry_msg.format(name=name, task=task, suffix='successful'))
 else:
-logger(dry_msg.format(name=name, task=task, suffix='has no 
function'))
+logger(dry_msg.format(name=name, task=task, suffix='has no 
implementation'))
 
 # updating the task manually instead of calling 
self._task_succeeded(task),
 # to avoid any side effects raising that event might cause

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/49342360/tox.ini
--
diff --git a/tox.ini b/tox.ini
index 6ab97cb..58e62c3 100644
--- a/tox.ini
+++ b/tox.ini
@@ -19,8 +19,6 @@ passenv =
 PYTHON
 PYTHON_VERSION
 PYTHON_ARCH
-setenv =
-INSTALL_CTX=1
 deps =
 -rrequirements.txt
 -rtests/requirements.txt