[GitHub] incubator-ariatosca pull request #143: ARIA-254 Create of multiple nodes per...
Github user tliron commented on a diff in the pull request: https://github.com/apache/incubator-ariatosca/pull/143#discussion_r120455950 --- Diff: aria/modeling/service_template.py --- @@ -613,6 +597,56 @@ def dump(self): utils.dump_dict_values(self.capability_templates, 'Capability templates') utils.dump_list_values(self.requirement_templates, 'Requirement templates') +@property +def next_index(self): +""" +Next available node index. + +:returns: node index +:rtype: int +""" + +max_index = 0 +if self.nodes: +max_index = max(int(n.name.rsplit('_', 1)[-1]) for n in self.nodes) +return max_index + 1 + +@property +def next_name(self): +""" +Next available node name. + +:returns: node name +:rtype: basestring +""" + +return '{name}_{index}'.format(name=self.name, index=self.next_index) + +@property +def default_instances(self): +# TODO: currently finds the first matching policy; but we should emit a validation error +# if more than one policy applies to the same node +for policy_template in self.service_template.policy_templates.itervalues(): +if policy_template.type.role == 'scaling': +if policy_template.is_for_node_template(self.name): +default_instances = policy_template.properties.get('default_instances') +if (default_instances is not None) \ +and (default_instances.type_name == 'integer'): --- End diff -- We cannot expect anybody be to using the ARIA profile as is -- all we are relying here is that there is an attribute with that name. I am adding that extra validation of type to make sure that we don't cause breakage by somebody messing with the parameters. Note that we also do this validation in setting "default" attributes, like `tosca_name` and `tosca_id`. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] incubator-ariatosca pull request #143: ARIA-254 Create of multiple nodes per...
Github user tliron commented on a diff in the pull request: https://github.com/apache/incubator-ariatosca/pull/143#discussion_r120455451 --- Diff: extensions/aria_extension_tosca/simple_v1_0/types.py --- @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from aria.utils.collections import FrozenDict, FrozenList +from aria.utils.collections import (FrozenDict, FrozenList) --- End diff -- I thought we agreed that that kind of style is a recommendation but not a requirement. If we switch to that style here it would make a lot of the parser code extremely verbose and frankly unreadable. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] incubator-ariatosca pull request #143: ARIA-254 Create of multiple nodes per...
Github user tliron commented on a diff in the pull request: https://github.com/apache/incubator-ariatosca/pull/143#discussion_r120455265 --- Diff: tests/end2end/test_nodecellar.py --- @@ -39,4 +39,4 @@ def _verify_deployed_service_in_storage(service_name, model_storage): service = service_templates[0].services[service_name] assert service.name == service_name assert len(service.executions) == 0 # dry executions leave no traces -assert len(service.nodes) == 10 +assert len(service.nodes) == 13 --- End diff -- The policy is on the `node_cellar_group` which contains three 3 templates. So we get 3 extra nodes. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] incubator-ariatosca pull request #145: ARIA-260 Send interface inputs as arg...
Github user tliron commented on a diff in the pull request: https://github.com/apache/incubator-ariatosca/pull/145#discussion_r120454702 --- Diff: tests/end2end/test_nodecellar.py --- @@ -40,3 +40,21 @@ def _verify_deployed_service_in_storage(service_name, model_storage): assert service.name == service_name assert len(service.executions) == 0 # dry executions leave no traces assert len(service.nodes) == 10 +assert set(service.nodes['loadbalancer_host_1'].interfaces['Standard'].operations['create'] \ --- End diff -- I created a new tests/instantiation package and put them there for now. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
incubator-ariatosca-website git commit: Add file
Repository: incubator-ariatosca-website Updated Branches: refs/heads/master [created] 9b0b906b5 Add file Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca-website/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca-website/commit/9b0b906b Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca-website/tree/9b0b906b Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca-website/diff/9b0b906b Branch: refs/heads/master Commit: 9b0b906b595277a3df4114c5124d1b6e2f8bec00 Parents: Author: Avia Efrat Authored: Tue Jun 6 18:21:18 2017 +0300 Committer: Avia Efrat Committed: Tue Jun 6 18:21:18 2017 +0300 -- test.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca-website/blob/9b0b906b/test.txt -- diff --git a/test.txt b/test.txt new file mode 100644 index 000..e69de29
[GitHub] incubator-ariatosca pull request #146: ARIA-199 Add "services outputs" CLI c...
Github user tliron commented on a diff in the pull request: https://github.com/apache/incubator-ariatosca/pull/146#discussion_r120391233 --- Diff: tests/resources/service-templates/tosca-simple-1.0/node-cellar/node-cellar.yaml --- @@ -302,6 +306,14 @@ topology_template: capabilities: app_endpoint: [ loadbalancer, client ] + outputs: --- End diff -- Done. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] incubator-ariatosca pull request #141: ARIA-262 inconsistent node attributes...
Github user asfgit closed the pull request at: https://github.com/apache/incubator-ariatosca/pull/141 --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] incubator-ariatosca pull request #141: ARIA-262 inconsistent node attributes...
Github user mxmrlv commented on a diff in the pull request: https://github.com/apache/incubator-ariatosca/pull/141#discussion_r120323930 --- Diff: aria/storage/api.py --- @@ -45,7 +46,15 @@ def __init__(self, model_cls, name=None, **kwargs): super(ModelAPI, self).__init__(**kwargs) self._model_cls = model_cls self._name = name or model_cls.__modelname__ -self._instrumentation = [] +self._thread_local = threading.local() +self._thread_local._instrumentation = [] + +@property +def _instrumentation(self): +if getattr(self._thread_local, '_instrumentation', None) is None: --- End diff -- hasattr --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] incubator-ariatosca pull request #141: ARIA-262 inconsistent node attributes...
Github user mxmrlv commented on a diff in the pull request: https://github.com/apache/incubator-ariatosca/pull/141#discussion_r120324325 --- Diff: aria/storage/core.py --- @@ -169,14 +170,16 @@ def drop(self): @contextmanager def instrument(self, *instrumentation): +original_instrumentation = {} def _instrument(remove=False): --- End diff -- remove func --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] incubator-ariatosca pull request #144: ARIA-64 Remove PyYAML dependency
Github user asfgit closed the pull request at: https://github.com/apache/incubator-ariatosca/pull/144 --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---