[2/3] incubator-ariatosca git commit: ARIA-321 Provide Clearwater IMS example
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/a638acdf/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/data.yaml -- diff --git a/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/data.yaml b/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/data.yaml index 771a969..61d4186 100644 --- a/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/data.yaml +++ b/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/data.yaml @@ -18,7 +18,7 @@ data_types: # # Primitive # - + timestamp: _extensions: coerce_value: aria_extension_tosca.simple_v1_0.data_types.coerce_timestamp @@ -60,7 +60,7 @@ data_types: specification: tosca-simple-1.0 specification_section: 3.2.5 specification_url: 'http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.0/cos01/TOSCA-Simple-Profile-YAML-v1.0-cos01.html#TYPE_TOSCA_MAP' - + # # Scalar # @@ -142,7 +142,7 @@ data_types: The optional user (name or ID) used for non-token based credentials. type: string required: false - + tosca.datatypes.network.NetworkInfo: _extensions: shorthand_name: NetworkInfo @@ -171,7 +171,7 @@ data_types: entry_schema: type: string required: false - + tosca.datatypes.network.PortInfo: _extensions: shorthand_name: PortInfo @@ -210,7 +210,7 @@ data_types: entry_schema: type: string required: false - + tosca.datatypes.network.PortDef: _extensions: shorthand_name: PortDef http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/a638acdf/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/interfaces.yaml -- diff --git a/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/interfaces.yaml b/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/interfaces.yaml index 473bd98..29cc8dd 100644 --- a/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/interfaces.yaml +++ b/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/interfaces.yaml @@ -24,7 +24,7 @@ interface_types: specification_url: 'http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.0/cos01/TOSCA-Simple-Profile-YAML-v1.0-cos01.html#_Ref384391055' description: >- This is the default (root) TOSCA Interface Type definition that all other TOSCA Interface Types derive from. - + tosca.interfaces.node.lifecycle.Standard: _extensions: shorthand_name: Standard http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/a638acdf/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/nodes.yaml -- diff --git a/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/nodes.yaml b/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/nodes.yaml index 1d2fe90..05963b7 100644 --- a/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/nodes.yaml +++ b/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/nodes.yaml @@ -45,14 +45,14 @@ node_types: type: tosca.interfaces.node.lifecycle.Standard capabilities: feature: -type: tosca.capabilities.Node +type: tosca.capabilities.Node requirements: - dependency: capability: tosca.capabilities.Node node: tosca.nodes.Root relationship: tosca.relationships.DependsOn occurrences: [ 0, UNBOUNDED ] - + tosca.nodes.Compute: _extensions: shorthand_name: Compute @@ -133,11 +133,11 @@ node_types: capability: tosca.capabilities.Endpoint relationship: tosca.relationships.RoutesTo occurrences: [ 0, UNBOUNDED ] - + # # Software # - + tosca.nodes.SoftwareComponent: _extensions: shorthand_name: SoftwareComponent @@ -211,7 +211,7 @@ node_types: capability: tosca.capabilities.Container node: tosca.nodes.WebServer relationship: tosca.relationships.HostedOn - + tosca.nodes.DBMS: _extensions: shorthand_name: DBMS # ARIA NOTE: omitted in the spec @@ -276,7 +276,7 @@ node_types: capability: tosca.capabilities.Container node: tosca.nodes.DBMS relationship: tosca.relationships.HostedOn - + # # Container # @@ -351,7 +351,7 @@ node_types: capabilities: storage_endpoint: type: tosca.capabilities.Endpoint - + tosca.nodes.BlockStorage: _extensions: shorthand_name: BlockStorage @@ -463,7 +463,7 @@ node_types: capabilities: link: type: tosca.capabilities.network.Linkable - + tosca.nodes.network.Port: _extensions: shorthand_name: Port @@ -472,7 +472,7 @@ node_types: specification_section: 7.5.2 description: >-
[1/3] incubator-ariatosca git commit: ARIA-324 Refactor ctx proxy access [Forced Update!]
Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-321-clearwater 80bae440b -> a638acdf1 (forced update) ARIA-324 Refactor ctx proxy access Our previous use of "." to delimit nested dict keys was wrong (keys could have a ".") and inflexible. The new implementation uses subsequent args to move into the dict. The same format can now be used to access object attributes. This commit also changes how to support setting values: we must now use "=" as the penultimate argument with the new value following. Also fixed: callables will now "grab" the number of args they need instead of all remaining args, making it possible to do further inspection on the returned value from the callable. To allow for this, kwargs are now expected as the first arg rather than the last. Relatedly, this commit instruments all parameter fields from all models and fixes related bugs in the instrumentation implementation. Furthmore, this commit fixes a bad null check in the ctx client, and also allows it to retrieve Unicode data. Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/ddb85e24 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/ddb85e24 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/ddb85e24 Branch: refs/heads/ARIA-321-clearwater Commit: ddb85e240de400ef81b140240f8bc2036cd24b80 Parents: c2b8e65 Author: Tal Liron Authored: Thu Jul 27 17:58:17 2017 -0500 Committer: Tal Liron Committed: Thu Jul 27 21:50:50 2017 -0500 -- aria/orchestrator/context/common.py | 19 ++- aria/orchestrator/context/operation.py | 46 +++--- .../execution_plugin/ctx_proxy/client.py| 7 +- .../execution_plugin/ctx_proxy/server.py| 144 +-- aria/orchestrator/workflows/api/task.py | 13 +- aria/storage/collection_instrumentation.py | 88 ++-- aria/storage/core.py| 6 +- .../execution_plugin/test_ctx_proxy_server.py | 96 ++--- .../orchestrator/execution_plugin/test_local.py | 34 ++--- 9 files changed, 193 insertions(+), 260 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/ddb85e24/aria/orchestrator/context/common.py -- diff --git a/aria/orchestrator/context/common.py b/aria/orchestrator/context/common.py index f400142..3c5f618 100644 --- a/aria/orchestrator/context/common.py +++ b/aria/orchestrator/context/common.py @@ -38,10 +38,27 @@ class BaseContext(object): """ INSTRUMENTATION_FIELDS = ( +modeling.models.Service.inputs, +modeling.models.ServiceTemplate.inputs, +modeling.models.Policy.properties, +modeling.models.PolicyTemplate.properties, modeling.models.Node.attributes, modeling.models.Node.properties, modeling.models.NodeTemplate.attributes, -modeling.models.NodeTemplate.properties +modeling.models.NodeTemplate.properties, +modeling.models.Group.properties, +modeling.models.GroupTemplate.properties, +modeling.models.Capability.properties, +# TODO ARIA-279: modeling.models.Capability.attributes, +modeling.models.CapabilityTemplate.properties, +# TODO ARIA-279: modeling.models.CapabilityTemplate.attributes +modeling.models.Relationship.properties, +modeling.models.Artifact.properties, +modeling.models.ArtifactTemplate.properties, +modeling.models.Interface.inputs, +modeling.models.InterfaceTemplate.inputs, +modeling.models.Operation.inputs, +modeling.models.OperationTemplate.inputs ) class PrefixedLogger(object): http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/ddb85e24/aria/orchestrator/context/operation.py -- diff --git a/aria/orchestrator/context/operation.py b/aria/orchestrator/context/operation.py index 7d5f40c..8613ec3 100644 --- a/aria/orchestrator/context/operation.py +++ b/aria/orchestrator/context/operation.py @@ -48,8 +48,7 @@ class BaseOperationContext(common.BaseContext): @property def task(self): """ -The task in the model storage -:return: Task model +The task in the model storage. """ # SQLAlchemy prevents from accessing an object which was created on a different thread. # So we retrieve the object from the storage if the current thread isn't the same as the @@ -62,7 +61,7 @@ class BaseOperationContext(common.BaseContext): @property def plugin_workdir(self): """ -A work directory that is unique to the plugin and the deployment id +
[3/3] incubator-ariatosca git commit: ARIA-321 Provide Clearwater IMS example
ARIA-321 Provide Clearwater IMS example * Allows capabilities, interfaces, and properties to override parent definition types only if the new type is a descendant of the overridden type * Fix bugs in model instrumentation (to allow ctx access to capability properties and complex values) * Fix to get_property intrinsic function * Don't let scalar values be negative * Doc fixes related to ARIA-277 Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/a638acdf Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/a638acdf Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/a638acdf Branch: refs/heads/ARIA-321-clearwater Commit: a638acdf1ff46bbe8b6ddfd9a619fa13b8b263f3 Parents: ddb85e2 Author: Tal Liron Authored: Tue Jul 18 17:25:27 2017 -0500 Committer: Tal Liron Committed: Thu Jul 27 22:09:20 2017 -0500 -- README.rst | 2 +- aria/modeling/functions.py | 4 +- aria/modeling/service_common.py | 4 +- aria/modeling/service_instance.py | 43 +- .../clearwater/clearwater-single-static.yaml| 111 +++ examples/clearwater/scripts/bono/create.sh | 4 + examples/clearwater/scripts/bono/delete.sh | 0 examples/clearwater/scripts/dime/create.sh | 5 + examples/clearwater/scripts/dime/delete.sh | 0 examples/clearwater/scripts/ellis/configure.sh | 14 + examples/clearwater/scripts/ellis/create.sh | 4 + examples/clearwater/scripts/ellis/delete.sh | 0 examples/clearwater/scripts/homer/create.sh | 12 + examples/clearwater/scripts/homer/delete.sh | 0 examples/clearwater/scripts/homestead/create.sh | 10 + examples/clearwater/scripts/homestead/delete.sh | 0 examples/clearwater/scripts/host/configure.sh | 157 + examples/clearwater/scripts/memento/create.sh | 4 + examples/clearwater/scripts/memento/delete.sh | 0 examples/clearwater/scripts/ralf/create.sh | 0 examples/clearwater/scripts/ralf/delete.sh | 0 examples/clearwater/scripts/sprout/create.sh| 4 + examples/clearwater/scripts/sprout/delete.sh| 0 examples/clearwater/scripts/vellum/create.sh| 8 + examples/clearwater/scripts/vellum/delete.sh| 0 examples/clearwater/types/cassandra.yaml| 16 + examples/clearwater/types/clearwater.yaml | 683 +++ examples/clearwater/types/ims.yaml | 431 examples/clearwater/types/smtp.yaml | 21 + examples/hello-world/hello-world.yaml | 38 ++ examples/hello-world/helloworld.yaml| 38 -- .../block-storage-1/block-storage-1.yaml| 6 +- .../block-storage-2/block-storage-2.yaml| 6 +- .../block-storage-3/block-storage-3.yaml| 4 +- .../block-storage-4/block-storage-4.yaml| 2 +- .../use-cases/non-normative-types.yaml | 6 +- .../webserver-dbms-1/webserver-dbms-1.yaml | 10 +- .../profiles/tosca-simple-1.0/artifacts.yaml| 18 +- .../profiles/tosca-simple-1.0/capabilities.yaml | 8 +- .../profiles/tosca-simple-1.0/data.yaml | 10 +- .../profiles/tosca-simple-1.0/interfaces.yaml | 2 +- .../profiles/tosca-simple-1.0/nodes.yaml| 18 +- .../profiles/tosca-simple-1.0/policies.yaml | 8 +- .../tosca-simple-1.0/relationships.yaml | 16 +- .../profiles/tosca-simple-nfv-1.0/nodes.yaml| 4 +- .../simple_v1_0/data_types.py | 15 +- .../simple_v1_0/modeling/capabilities.py| 14 +- .../simple_v1_0/modeling/data_types.py | 4 - .../simple_v1_0/modeling/functions.py | 18 +- .../simple_v1_0/modeling/interfaces.py | 14 +- .../simple_v1_0/modeling/parameters.py | 27 +- .../simple_v1_0/presentation/types.py | 8 +- .../aria_extension_tosca/simple_v1_0/types.py | 19 + tests/end2end/test_hello_world.py | 2 +- .../node-cellar/node-cellar.yaml| 18 +- .../node-cellar/types/mongodb.yaml | 2 +- .../node-cellar/types/nodejs.yaml | 2 +- .../node-cellar/types/openstack.yaml| 4 +- .../types/shorthand-1/shorthand-1.yaml | 6 +- .../types/typequalified-1/typequalified-1.yaml | 6 +- 60 files changed, 1722 insertions(+), 168 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/a638acdf/README.rst -- diff --git a/README.rst b/README.rst index b9a8213..1284808 100644 --- a/README.rst +++ b/README.rst @@ -91,7 +91,7 @@ This section will describe how to run a simple "Hello World" example. First, provide ARIA with the ARIA "he
[2/2] incubator-ariatosca git commit: ARIA-321 Provide Clearwater IMS example
ARIA-321 Provide Clearwater IMS example * Allows capabilities, interfaces, and properties to override parent definition types only if the new type is a descendant of the overridden type * Fix bugs in model instrumentation (to allow ctx access to capability properties and complex values) * Fix to get_property intrinsic function * Don't let scalar values be negative * Doc fixes related to ARIA-277 Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/80bae440 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/80bae440 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/80bae440 Branch: refs/heads/ARIA-321-clearwater Commit: 80bae440b96935b4c7967675db37c39cac5eb1c7 Parents: c2b8e65 Author: Tal Liron Authored: Tue Jul 18 17:25:27 2017 -0500 Committer: Tal Liron Committed: Thu Jul 27 22:07:42 2017 -0500 -- README.rst | 2 +- aria/modeling/functions.py | 4 +- aria/modeling/service_common.py | 4 +- aria/modeling/service_instance.py | 43 +- .../clearwater/clearwater-single-static.yaml| 111 +++ examples/clearwater/scripts/bono/create.sh | 4 + examples/clearwater/scripts/bono/delete.sh | 0 examples/clearwater/scripts/dime/create.sh | 5 + examples/clearwater/scripts/dime/delete.sh | 0 examples/clearwater/scripts/ellis/configure.sh | 14 + examples/clearwater/scripts/ellis/create.sh | 4 + examples/clearwater/scripts/ellis/delete.sh | 0 examples/clearwater/scripts/homer/create.sh | 12 + examples/clearwater/scripts/homer/delete.sh | 0 examples/clearwater/scripts/homestead/create.sh | 10 + examples/clearwater/scripts/homestead/delete.sh | 0 examples/clearwater/scripts/host/configure.sh | 157 + examples/clearwater/scripts/memento/create.sh | 4 + examples/clearwater/scripts/memento/delete.sh | 0 examples/clearwater/scripts/ralf/create.sh | 0 examples/clearwater/scripts/ralf/delete.sh | 0 examples/clearwater/scripts/sprout/create.sh| 4 + examples/clearwater/scripts/sprout/delete.sh| 0 examples/clearwater/scripts/vellum/create.sh| 8 + examples/clearwater/scripts/vellum/delete.sh| 0 examples/clearwater/types/cassandra.yaml| 16 + examples/clearwater/types/clearwater.yaml | 683 +++ examples/clearwater/types/ims.yaml | 431 examples/clearwater/types/smtp.yaml | 21 + examples/hello-world/hello-world.yaml | 38 ++ examples/hello-world/helloworld.yaml| 38 -- .../block-storage-1/block-storage-1.yaml| 6 +- .../block-storage-2/block-storage-2.yaml| 6 +- .../block-storage-3/block-storage-3.yaml| 4 +- .../block-storage-4/block-storage-4.yaml| 2 +- .../use-cases/non-normative-types.yaml | 6 +- .../webserver-dbms-1/webserver-dbms-1.yaml | 10 +- .../profiles/tosca-simple-1.0/artifacts.yaml| 18 +- .../profiles/tosca-simple-1.0/capabilities.yaml | 8 +- .../profiles/tosca-simple-1.0/data.yaml | 10 +- .../profiles/tosca-simple-1.0/interfaces.yaml | 2 +- .../profiles/tosca-simple-1.0/nodes.yaml| 18 +- .../profiles/tosca-simple-1.0/policies.yaml | 8 +- .../tosca-simple-1.0/relationships.yaml | 16 +- .../profiles/tosca-simple-nfv-1.0/nodes.yaml| 4 +- .../simple_v1_0/data_types.py | 15 +- .../simple_v1_0/modeling/capabilities.py| 14 +- .../simple_v1_0/modeling/data_types.py | 4 - .../simple_v1_0/modeling/functions.py | 18 +- .../simple_v1_0/modeling/interfaces.py | 14 +- .../simple_v1_0/modeling/parameters.py | 27 +- .../simple_v1_0/presentation/types.py | 8 +- .../aria_extension_tosca/simple_v1_0/types.py | 19 + tests/end2end/test_hello_world.py | 2 +- .../node-cellar/node-cellar.yaml| 18 +- .../node-cellar/types/mongodb.yaml | 2 +- .../node-cellar/types/nodejs.yaml | 2 +- .../node-cellar/types/openstack.yaml| 4 +- .../types/shorthand-1/shorthand-1.yaml | 6 +- .../types/typequalified-1/typequalified-1.yaml | 6 +- 60 files changed, 1722 insertions(+), 168 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/80bae440/README.rst -- diff --git a/README.rst b/README.rst index b9a8213..1284808 100644 --- a/README.rst +++ b/README.rst @@ -91,7 +91,7 @@ This section will describe how to run a simple "Hello World" example. First, provide ARIA with the ARIA "he
[1/2] incubator-ariatosca git commit: ARIA-321 Provide Clearwater IMS example [Forced Update!]
Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-321-clearwater 762b6c349 -> 80bae440b (forced update) http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/80bae440/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/data.yaml -- diff --git a/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/data.yaml b/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/data.yaml index 771a969..61d4186 100644 --- a/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/data.yaml +++ b/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/data.yaml @@ -18,7 +18,7 @@ data_types: # # Primitive # - + timestamp: _extensions: coerce_value: aria_extension_tosca.simple_v1_0.data_types.coerce_timestamp @@ -60,7 +60,7 @@ data_types: specification: tosca-simple-1.0 specification_section: 3.2.5 specification_url: 'http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.0/cos01/TOSCA-Simple-Profile-YAML-v1.0-cos01.html#TYPE_TOSCA_MAP' - + # # Scalar # @@ -142,7 +142,7 @@ data_types: The optional user (name or ID) used for non-token based credentials. type: string required: false - + tosca.datatypes.network.NetworkInfo: _extensions: shorthand_name: NetworkInfo @@ -171,7 +171,7 @@ data_types: entry_schema: type: string required: false - + tosca.datatypes.network.PortInfo: _extensions: shorthand_name: PortInfo @@ -210,7 +210,7 @@ data_types: entry_schema: type: string required: false - + tosca.datatypes.network.PortDef: _extensions: shorthand_name: PortDef http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/80bae440/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/interfaces.yaml -- diff --git a/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/interfaces.yaml b/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/interfaces.yaml index 473bd98..29cc8dd 100644 --- a/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/interfaces.yaml +++ b/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/interfaces.yaml @@ -24,7 +24,7 @@ interface_types: specification_url: 'http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.0/cos01/TOSCA-Simple-Profile-YAML-v1.0-cos01.html#_Ref384391055' description: >- This is the default (root) TOSCA Interface Type definition that all other TOSCA Interface Types derive from. - + tosca.interfaces.node.lifecycle.Standard: _extensions: shorthand_name: Standard http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/80bae440/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/nodes.yaml -- diff --git a/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/nodes.yaml b/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/nodes.yaml index 1d2fe90..05963b7 100644 --- a/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/nodes.yaml +++ b/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/nodes.yaml @@ -45,14 +45,14 @@ node_types: type: tosca.interfaces.node.lifecycle.Standard capabilities: feature: -type: tosca.capabilities.Node +type: tosca.capabilities.Node requirements: - dependency: capability: tosca.capabilities.Node node: tosca.nodes.Root relationship: tosca.relationships.DependsOn occurrences: [ 0, UNBOUNDED ] - + tosca.nodes.Compute: _extensions: shorthand_name: Compute @@ -133,11 +133,11 @@ node_types: capability: tosca.capabilities.Endpoint relationship: tosca.relationships.RoutesTo occurrences: [ 0, UNBOUNDED ] - + # # Software # - + tosca.nodes.SoftwareComponent: _extensions: shorthand_name: SoftwareComponent @@ -211,7 +211,7 @@ node_types: capability: tosca.capabilities.Container node: tosca.nodes.WebServer relationship: tosca.relationships.HostedOn - + tosca.nodes.DBMS: _extensions: shorthand_name: DBMS # ARIA NOTE: omitted in the spec @@ -276,7 +276,7 @@ node_types: capability: tosca.capabilities.Container node: tosca.nodes.DBMS relationship: tosca.relationships.HostedOn - + # # Container # @@ -351,7 +351,7 @@ node_types: capabilities: storage_endpoint: type: tosca.capabilities.Endpoint - + tosca.nodes.BlockStorage: _extensions: shorthand_name: BlockStorage @@ -463,7 +463,7 @@ node_types: capabilities: link: type: tosca.capabilities.network.Linkable - + tosca.nodes.network.Port: _extensi
[2/2] incubator-ariatosca git commit: ARIA-321 Provide Clearwater IMS example
ARIA-321 Provide Clearwater IMS example * Allows capabilities, interfaces, and properties to override parent definition types only if the new type is a descendant of the overridden type * Fix bugs in model instrumentation (to allow ctx access to capability properties and complex values) * Fix to get_property intrinsic function * Don't let scalar values be negative * Doc fixes related to ARIA-277 Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/762b6c34 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/762b6c34 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/762b6c34 Branch: refs/heads/ARIA-321-clearwater Commit: 762b6c349bc0c21e7fa4252d70666003b9b3c00c Parents: c2b8e65 Author: Tal Liron Authored: Tue Jul 18 17:25:27 2017 -0500 Committer: Tal Liron Committed: Thu Jul 27 21:55:08 2017 -0500 -- README.rst | 2 +- aria/modeling/functions.py | 4 +- aria/modeling/service_common.py | 4 +- aria/modeling/service_instance.py | 43 +- aria/orchestrator/context/common.py | 6 +- .../execution_plugin/ctx_proxy/server.py| 39 +- aria/storage/collection_instrumentation.py | 15 +- aria/storage/core.py| 2 +- .../clearwater/clearwater-single-static.yaml| 111 +++ examples/clearwater/scripts/bono/create.sh | 4 + examples/clearwater/scripts/bono/delete.sh | 0 examples/clearwater/scripts/dime/create.sh | 5 + examples/clearwater/scripts/dime/delete.sh | 0 examples/clearwater/scripts/ellis/configure.sh | 14 + examples/clearwater/scripts/ellis/create.sh | 4 + examples/clearwater/scripts/ellis/delete.sh | 0 examples/clearwater/scripts/homer/create.sh | 12 + examples/clearwater/scripts/homer/delete.sh | 0 examples/clearwater/scripts/homestead/create.sh | 10 + examples/clearwater/scripts/homestead/delete.sh | 0 examples/clearwater/scripts/host/configure.sh | 157 + examples/clearwater/scripts/memento/create.sh | 4 + examples/clearwater/scripts/memento/delete.sh | 0 examples/clearwater/scripts/ralf/create.sh | 0 examples/clearwater/scripts/ralf/delete.sh | 0 examples/clearwater/scripts/sprout/create.sh| 4 + examples/clearwater/scripts/sprout/delete.sh| 0 examples/clearwater/scripts/vellum/create.sh| 8 + examples/clearwater/scripts/vellum/delete.sh| 0 examples/clearwater/types/cassandra.yaml| 16 + examples/clearwater/types/clearwater.yaml | 683 +++ examples/clearwater/types/ims.yaml | 431 examples/clearwater/types/smtp.yaml | 21 + examples/hello-world/hello-world.yaml | 38 ++ examples/hello-world/helloworld.yaml| 38 -- .../block-storage-1/block-storage-1.yaml| 6 +- .../block-storage-2/block-storage-2.yaml| 6 +- .../block-storage-3/block-storage-3.yaml| 4 +- .../block-storage-4/block-storage-4.yaml| 2 +- .../use-cases/non-normative-types.yaml | 6 +- .../webserver-dbms-1/webserver-dbms-1.yaml | 10 +- .../profiles/tosca-simple-1.0/artifacts.yaml| 18 +- .../profiles/tosca-simple-1.0/capabilities.yaml | 8 +- .../profiles/tosca-simple-1.0/data.yaml | 10 +- .../profiles/tosca-simple-1.0/interfaces.yaml | 2 +- .../profiles/tosca-simple-1.0/nodes.yaml| 18 +- .../profiles/tosca-simple-1.0/policies.yaml | 8 +- .../tosca-simple-1.0/relationships.yaml | 16 +- .../profiles/tosca-simple-nfv-1.0/nodes.yaml| 4 +- .../simple_v1_0/data_types.py | 15 +- .../simple_v1_0/modeling/capabilities.py| 14 +- .../simple_v1_0/modeling/data_types.py | 4 - .../simple_v1_0/modeling/functions.py | 18 +- .../simple_v1_0/modeling/interfaces.py | 14 +- .../simple_v1_0/modeling/parameters.py | 27 +- .../simple_v1_0/presentation/types.py | 8 +- .../aria_extension_tosca/simple_v1_0/types.py | 19 + tests/end2end/test_hello_world.py | 2 +- .../execution_plugin/test_ctx_proxy_server.py | 48 +- .../node-cellar/node-cellar.yaml| 18 +- .../node-cellar/types/mongodb.yaml | 2 +- .../node-cellar/types/nodejs.yaml | 2 +- .../node-cellar/types/openstack.yaml| 4 +- .../types/shorthand-1/shorthand-1.yaml | 6 +- .../types/typequalified-1/typequalified-1.yaml | 6 +- 65 files changed, 1789 insertions(+), 211 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/762b6c34/README.rst -
[1/2] incubator-ariatosca git commit: ARIA-321 Provide Clearwater IMS example [Forced Update!]
Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-321-clearwater f7d5f0f04 -> 762b6c349 (forced update) http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/762b6c34/examples/tosca-simple-1.0/use-cases/webserver-dbms-1/webserver-dbms-1.yaml -- diff --git a/examples/tosca-simple-1.0/use-cases/webserver-dbms-1/webserver-dbms-1.yaml b/examples/tosca-simple-1.0/use-cases/webserver-dbms-1/webserver-dbms-1.yaml index faf109d..daa24df 100644 --- a/examples/tosca-simple-1.0/use-cases/webserver-dbms-1/webserver-dbms-1.yaml +++ b/examples/tosca-simple-1.0/use-cases/webserver-dbms-1/webserver-dbms-1.yaml @@ -51,11 +51,11 @@ topology_template: Standard: create: wordpress_install.sh configure: -implementation: wordpress_configure.sh +implementation: wordpress_configure.sh inputs: wp_db_name: { get_property: [ mysql_database, name ] } wp_db_user: { get_property: [ mysql_database, user ] } - wp_db_password: { get_property: [ mysql_database, password ] } + wp_db_password: { get_property: [ mysql_database, password ] } # In my own template, find requirement/capability, find port property wp_db_port: { get_property: [ SELF, database_endpoint, port ] } @@ -85,7 +85,7 @@ topology_template: - host: server interfaces: Standard: - # ARIA NOTE: not declared in spec + # ARIA NOTE: not declared in spec #inputs: # db_root_password: { get_property: [ mysql_dbms, root_password ] } create: mysql_dbms_install.sh @@ -112,8 +112,8 @@ topology_template: os: properties: architecture: x86_64 -type: linux -distribution: fedora +type: linux +distribution: fedora version: 17.0 outputs: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/762b6c34/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/artifacts.yaml -- diff --git a/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/artifacts.yaml b/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/artifacts.yaml index cfb0df5..945622f 100644 --- a/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/artifacts.yaml +++ b/extensions/aria_extension_tosca/profiles/tosca-simple-1.0/artifacts.yaml @@ -24,7 +24,7 @@ artifact_types: specification_url: 'http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.0/cos01/TOSCA-Simple-Profile-YAML-v1.0-cos01.html#DEFN_TYPE_ARTIFACTS_ROOT' description: >- This is the default (root) TOSCA Artifact Type definition that all other TOSCA base Artifact Types derive from. - + tosca.artifacts.File: _extensions: shorthand_name: File @@ -34,11 +34,11 @@ artifact_types: description: >- This artifact type is used when an artifact definition needs to have its associated file simply treated as a file and no special handling/handlers are invoked (i.e., it is not treated as either an implementation or deployment artifact type). derived_from: tosca.artifacts.Root - + # # Deployments # - + tosca.artifacts.Deployment: _extensions: shorthand_name: Deployment # ARIA NOTE: omitted in the spec @@ -51,7 +51,7 @@ artifact_types: represents a binary packaging of an application or service that is used to install/create or deploy it as part of a node's lifecycle. derived_from: tosca.artifacts.Root - + tosca.artifacts.Deployment.Image: _extensions: shorthand_name: Deployment.Image @@ -64,7 +64,7 @@ artifact_types: (whether real or virtual) whose contents are typically already installed and pre-configured (i.e., "stateful") and prepared to be run on a known target container. derived_from: tosca.artifacts.Deployment - + tosca.artifacts.Deployment.Image.VM: _extensions: shorthand_name: Deployment.VM # ARIA NOTE: omitted in the spec @@ -78,11 +78,11 @@ artifact_types: with any configurations and can be run on another machine using a hypervisor which virtualizes typical server (i.e., hardware) resources. derived_from: tosca.artifacts.Deployment - + # # Implementations # - + tosca.artifacts.Implementation: _extensions: shorthand_name: Implementation # ARIA NOTE: omitted in the spec @@ -94,7 +94,7 @@ artifact_types: This artifact type represents the parent type for all implementation artifacts in TOSCA. These artifacts are used to implement operations of TOSCA interfaces either directly (e.g., scripts) or indirectly (e.g., config. files). derived_from: tosca.artifacts.Root - + tosca.artifacts.Implement
incubator-ariatosca git commit: ARIA-324 Refactor ctx proxy access [Forced Update!]
Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-324-refactor-ctx-access c4ee51772 -> ddb85e240 (forced update) ARIA-324 Refactor ctx proxy access Our previous use of "." to delimit nested dict keys was wrong (keys could have a ".") and inflexible. The new implementation uses subsequent args to move into the dict. The same format can now be used to access object attributes. This commit also changes how to support setting values: we must now use "=" as the penultimate argument with the new value following. Also fixed: callables will now "grab" the number of args they need instead of all remaining args, making it possible to do further inspection on the returned value from the callable. To allow for this, kwargs are now expected as the first arg rather than the last. Relatedly, this commit instruments all parameter fields from all models and fixes related bugs in the instrumentation implementation. Furthmore, this commit fixes a bad null check in the ctx client, and also allows it to retrieve Unicode data. Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/ddb85e24 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/ddb85e24 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/ddb85e24 Branch: refs/heads/ARIA-324-refactor-ctx-access Commit: ddb85e240de400ef81b140240f8bc2036cd24b80 Parents: c2b8e65 Author: Tal Liron Authored: Thu Jul 27 17:58:17 2017 -0500 Committer: Tal Liron Committed: Thu Jul 27 21:50:50 2017 -0500 -- aria/orchestrator/context/common.py | 19 ++- aria/orchestrator/context/operation.py | 46 +++--- .../execution_plugin/ctx_proxy/client.py| 7 +- .../execution_plugin/ctx_proxy/server.py| 144 +-- aria/orchestrator/workflows/api/task.py | 13 +- aria/storage/collection_instrumentation.py | 88 ++-- aria/storage/core.py| 6 +- .../execution_plugin/test_ctx_proxy_server.py | 96 ++--- .../orchestrator/execution_plugin/test_local.py | 34 ++--- 9 files changed, 193 insertions(+), 260 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/ddb85e24/aria/orchestrator/context/common.py -- diff --git a/aria/orchestrator/context/common.py b/aria/orchestrator/context/common.py index f400142..3c5f618 100644 --- a/aria/orchestrator/context/common.py +++ b/aria/orchestrator/context/common.py @@ -38,10 +38,27 @@ class BaseContext(object): """ INSTRUMENTATION_FIELDS = ( +modeling.models.Service.inputs, +modeling.models.ServiceTemplate.inputs, +modeling.models.Policy.properties, +modeling.models.PolicyTemplate.properties, modeling.models.Node.attributes, modeling.models.Node.properties, modeling.models.NodeTemplate.attributes, -modeling.models.NodeTemplate.properties +modeling.models.NodeTemplate.properties, +modeling.models.Group.properties, +modeling.models.GroupTemplate.properties, +modeling.models.Capability.properties, +# TODO ARIA-279: modeling.models.Capability.attributes, +modeling.models.CapabilityTemplate.properties, +# TODO ARIA-279: modeling.models.CapabilityTemplate.attributes +modeling.models.Relationship.properties, +modeling.models.Artifact.properties, +modeling.models.ArtifactTemplate.properties, +modeling.models.Interface.inputs, +modeling.models.InterfaceTemplate.inputs, +modeling.models.Operation.inputs, +modeling.models.OperationTemplate.inputs ) class PrefixedLogger(object): http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/ddb85e24/aria/orchestrator/context/operation.py -- diff --git a/aria/orchestrator/context/operation.py b/aria/orchestrator/context/operation.py index 7d5f40c..8613ec3 100644 --- a/aria/orchestrator/context/operation.py +++ b/aria/orchestrator/context/operation.py @@ -48,8 +48,7 @@ class BaseOperationContext(common.BaseContext): @property def task(self): """ -The task in the model storage -:return: Task model +The task in the model storage. """ # SQLAlchemy prevents from accessing an object which was created on a different thread. # So we retrieve the object from the storage if the current thread isn't the same as the @@ -62,7 +61,7 @@ class BaseOperationContext(common.BaseContext): @property def plugin_workdir(self): """ -A work directory that is unique to the plugin and the depl
incubator-ariatosca git commit: ARIA-324 Refactor ctx proxy access [Forced Update!]
Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-324-refactor-ctx-access 956e98b20 -> c4ee51772 (forced update) ARIA-324 Refactor ctx proxy access Our previous use of "." to delimit nested dict keys was wrong (keys could have a ".") and inflexible. The new implementation uses subsequent args to move into the dict. The same format can now be used to access object attributes. This commit also changes how to support setting values: we must now use "=" as the penultimate argument with the new value following. Also fixed: callables will now "grab" the number of args they need instead of all remaining args, making it possible to do further inspection on the returned value from the callable. To allow for this, kwargs are now expected as the first arg rather than the last. Relatedly, this commit instruments all parameter fields from all models and fixes related bugs in the instrumentation implementation. Furthmore, this commit fixes a bad null check in the ctx client, and also allows it to retrieve Unicode data. Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/c4ee5177 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/c4ee5177 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/c4ee5177 Branch: refs/heads/ARIA-324-refactor-ctx-access Commit: c4ee51772294b3355d135baae09769f4c188f62d Parents: c2b8e65 Author: Tal Liron Authored: Thu Jul 27 17:58:17 2017 -0500 Committer: Tal Liron Committed: Thu Jul 27 21:36:42 2017 -0500 -- aria/orchestrator/context/common.py | 19 ++- aria/orchestrator/context/operation.py | 46 +++--- .../execution_plugin/ctx_proxy/client.py| 7 +- .../execution_plugin/ctx_proxy/server.py| 145 +-- aria/orchestrator/workflows/api/task.py | 13 +- aria/storage/collection_instrumentation.py | 88 +-- aria/storage/core.py| 6 +- .../execution_plugin/test_ctx_proxy_server.py | 96 ++-- .../orchestrator/execution_plugin/test_local.py | 34 ++--- 9 files changed, 194 insertions(+), 260 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/c4ee5177/aria/orchestrator/context/common.py -- diff --git a/aria/orchestrator/context/common.py b/aria/orchestrator/context/common.py index f400142..3c5f618 100644 --- a/aria/orchestrator/context/common.py +++ b/aria/orchestrator/context/common.py @@ -38,10 +38,27 @@ class BaseContext(object): """ INSTRUMENTATION_FIELDS = ( +modeling.models.Service.inputs, +modeling.models.ServiceTemplate.inputs, +modeling.models.Policy.properties, +modeling.models.PolicyTemplate.properties, modeling.models.Node.attributes, modeling.models.Node.properties, modeling.models.NodeTemplate.attributes, -modeling.models.NodeTemplate.properties +modeling.models.NodeTemplate.properties, +modeling.models.Group.properties, +modeling.models.GroupTemplate.properties, +modeling.models.Capability.properties, +# TODO ARIA-279: modeling.models.Capability.attributes, +modeling.models.CapabilityTemplate.properties, +# TODO ARIA-279: modeling.models.CapabilityTemplate.attributes +modeling.models.Relationship.properties, +modeling.models.Artifact.properties, +modeling.models.ArtifactTemplate.properties, +modeling.models.Interface.inputs, +modeling.models.InterfaceTemplate.inputs, +modeling.models.Operation.inputs, +modeling.models.OperationTemplate.inputs ) class PrefixedLogger(object): http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/c4ee5177/aria/orchestrator/context/operation.py -- diff --git a/aria/orchestrator/context/operation.py b/aria/orchestrator/context/operation.py index 7d5f40c..8613ec3 100644 --- a/aria/orchestrator/context/operation.py +++ b/aria/orchestrator/context/operation.py @@ -48,8 +48,7 @@ class BaseOperationContext(common.BaseContext): @property def task(self): """ -The task in the model storage -:return: Task model +The task in the model storage. """ # SQLAlchemy prevents from accessing an object which was created on a different thread. # So we retrieve the object from the storage if the current thread isn't the same as the @@ -62,7 +61,7 @@ class BaseOperationContext(common.BaseContext): @property def plugin_workdir(self): """ -A work directory that is unique to the plugin and the deploy
[GitHub] incubator-ariatosca issue #188: ARIA-324 Refactor ctx access
Github user asfgit commented on the issue: https://github.com/apache/incubator-ariatosca/pull/188 Can one of the admins verify this patch? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] incubator-ariatosca pull request #188: ARIA-324 Refactor ctx access
GitHub user tliron opened a pull request: https://github.com/apache/incubator-ariatosca/pull/188 ARIA-324 Refactor ctx access Our previous use of "." to delimit nested dict keys was wrong (keys could have a ".") and inflexible. The new implementation uses subsequent args to move into the dict. The same format can now be used to access object attributes. This commit also changes how to support setting values: we must now use "=" as the penultimate argument with the new value following. Also fixed: callables will now "grab" the number of args they need instead of all remaining args, making it possible to do further inspection on the returned value from the callable. To allow for this, kwargs are now expected as the first arg rather than the last. Furthmore, this commit fixes a bad null check in the ctx client, and also allows it to retrieve Unicode data. You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/incubator-ariatosca ARIA-324-refactor-ctx-access Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-ariatosca/pull/188.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #188 commit 956e98b20874b99e80b12849b3c10dc869a4b4f6 Author: Tal Liron Date: 2017-07-27T22:58:17Z ARIA-324 Refactor ctx proxy access Our previous use of "." to delimit nested dict keys was wrong (keys could have a ".") and inflexible. The new implementation uses subsequent args to move into the dict. The same format can now be used to access object attributes. This commit also changes how to support setting values: we must now use "=" as the penultimate argument with the new value following. Also fixed: callables will now "grab" the number of args they need instead of all remaining args, making it possible to do further inspection on the returned value from the callable. To allow for this, kwargs are now expected as the first arg rather than the last. Relatedly, this commit instruments all parameter fields from all models and fixes related bugs in the instrumentation implementation. Furthmore, this commit fixes a bad null check in the ctx client, and also allows it to retrieve Unicode data. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
incubator-ariatosca git commit: ARIA-324 Refactor ctx proxy access [Forced Update!]
Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-324-refactor-ctx-access 638a4346d -> 956e98b20 (forced update) ARIA-324 Refactor ctx proxy access Our previous use of "." to delimit nested dict keys was wrong (keys could have a ".") and inflexible. The new implementation uses subsequent args to move into the dict. The same format can now be used to access object attributes. This commit also changes how to support setting values: we must now use "=" as the penultimate argument with the new value following. Also fixed: callables will now "grab" the number of args they need instead of all remaining args, making it possible to do further inspection on the returned value from the callable. To allow for this, kwargs are now expected as the first arg rather than the last. Relatedly, this commit instruments all parameter fields from all models and fixes related bugs in the instrumentation implementation. Furthmore, this commit fixes a bad null check in the ctx client, and also allows it to retrieve Unicode data. Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/956e98b2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/956e98b2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/956e98b2 Branch: refs/heads/ARIA-324-refactor-ctx-access Commit: 956e98b20874b99e80b12849b3c10dc869a4b4f6 Parents: c2b8e65 Author: Tal Liron Authored: Thu Jul 27 17:58:17 2017 -0500 Committer: Tal Liron Committed: Thu Jul 27 21:18:20 2017 -0500 -- aria/orchestrator/context/common.py | 19 ++- aria/orchestrator/context/operation.py | 46 +++--- .../execution_plugin/ctx_proxy/client.py| 7 +- .../execution_plugin/ctx_proxy/server.py| 141 +-- aria/orchestrator/workflows/api/task.py | 13 +- aria/storage/collection_instrumentation.py | 88 ++-- aria/storage/core.py| 6 +- .../execution_plugin/test_ctx_proxy_server.py | 96 ++--- .../orchestrator/execution_plugin/test_local.py | 34 ++--- 9 files changed, 192 insertions(+), 258 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/956e98b2/aria/orchestrator/context/common.py -- diff --git a/aria/orchestrator/context/common.py b/aria/orchestrator/context/common.py index f400142..3c5f618 100644 --- a/aria/orchestrator/context/common.py +++ b/aria/orchestrator/context/common.py @@ -38,10 +38,27 @@ class BaseContext(object): """ INSTRUMENTATION_FIELDS = ( +modeling.models.Service.inputs, +modeling.models.ServiceTemplate.inputs, +modeling.models.Policy.properties, +modeling.models.PolicyTemplate.properties, modeling.models.Node.attributes, modeling.models.Node.properties, modeling.models.NodeTemplate.attributes, -modeling.models.NodeTemplate.properties +modeling.models.NodeTemplate.properties, +modeling.models.Group.properties, +modeling.models.GroupTemplate.properties, +modeling.models.Capability.properties, +# TODO ARIA-279: modeling.models.Capability.attributes, +modeling.models.CapabilityTemplate.properties, +# TODO ARIA-279: modeling.models.CapabilityTemplate.attributes +modeling.models.Relationship.properties, +modeling.models.Artifact.properties, +modeling.models.ArtifactTemplate.properties, +modeling.models.Interface.inputs, +modeling.models.InterfaceTemplate.inputs, +modeling.models.Operation.inputs, +modeling.models.OperationTemplate.inputs ) class PrefixedLogger(object): http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/956e98b2/aria/orchestrator/context/operation.py -- diff --git a/aria/orchestrator/context/operation.py b/aria/orchestrator/context/operation.py index 7d5f40c..8613ec3 100644 --- a/aria/orchestrator/context/operation.py +++ b/aria/orchestrator/context/operation.py @@ -48,8 +48,7 @@ class BaseOperationContext(common.BaseContext): @property def task(self): """ -The task in the model storage -:return: Task model +The task in the model storage. """ # SQLAlchemy prevents from accessing an object which was created on a different thread. # So we retrieve the object from the storage if the current thread isn't the same as the @@ -62,7 +61,7 @@ class BaseOperationContext(common.BaseContext): @property def plugin_workdir(self): """ -A work directory that is unique to the plugin and the depl
incubator-ariatosca git commit: ARIA-324 Refactor ctx access
Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-324-refactor-ctx-access [created] 638a4346d ARIA-324 Refactor ctx access Our previous use of "." to delimit nested dict keys was wrong (keys could have a ".") and inflexible. The new implementation uses subsequent args to move into the dict. The same format can now be used to access object attributes. This commit also changes how to support setting values: we must now use "=" as the penultimate argument with the new value following. Also fixed: callables will now "grab" the number of args they need instead of all remaining args, making it possible to do further inspection on the returned value from the callable. To allow for this, kwargs are now expected as the first arg rather than the last. Furthmore, this commit fixes a bad null check in the ctx client, and also allows it to retrieve Unicode data. Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/638a4346 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/638a4346 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/638a4346 Branch: refs/heads/ARIA-324-refactor-ctx-access Commit: 638a4346d5771d986a86ae996ddd3fb9d6d0d49a Parents: c2b8e65 Author: Tal Liron Authored: Thu Jul 27 17:58:17 2017 -0500 Committer: Tal Liron Committed: Thu Jul 27 17:58:17 2017 -0500 -- aria/orchestrator/context/common.py | 19 ++- aria/orchestrator/context/operation.py | 46 +++--- .../execution_plugin/ctx_proxy/client.py| 7 +- .../execution_plugin/ctx_proxy/server.py| 139 +-- aria/storage/collection_instrumentation.py | 19 ++- aria/storage/core.py| 6 +- .../execution_plugin/test_ctx_proxy_server.py | 96 ++--- .../orchestrator/execution_plugin/test_local.py | 34 ++--- 8 files changed, 153 insertions(+), 213 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/638a4346/aria/orchestrator/context/common.py -- diff --git a/aria/orchestrator/context/common.py b/aria/orchestrator/context/common.py index f400142..3c5f618 100644 --- a/aria/orchestrator/context/common.py +++ b/aria/orchestrator/context/common.py @@ -38,10 +38,27 @@ class BaseContext(object): """ INSTRUMENTATION_FIELDS = ( +modeling.models.Service.inputs, +modeling.models.ServiceTemplate.inputs, +modeling.models.Policy.properties, +modeling.models.PolicyTemplate.properties, modeling.models.Node.attributes, modeling.models.Node.properties, modeling.models.NodeTemplate.attributes, -modeling.models.NodeTemplate.properties +modeling.models.NodeTemplate.properties, +modeling.models.Group.properties, +modeling.models.GroupTemplate.properties, +modeling.models.Capability.properties, +# TODO ARIA-279: modeling.models.Capability.attributes, +modeling.models.CapabilityTemplate.properties, +# TODO ARIA-279: modeling.models.CapabilityTemplate.attributes +modeling.models.Relationship.properties, +modeling.models.Artifact.properties, +modeling.models.ArtifactTemplate.properties, +modeling.models.Interface.inputs, +modeling.models.InterfaceTemplate.inputs, +modeling.models.Operation.inputs, +modeling.models.OperationTemplate.inputs ) class PrefixedLogger(object): http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/638a4346/aria/orchestrator/context/operation.py -- diff --git a/aria/orchestrator/context/operation.py b/aria/orchestrator/context/operation.py index 7d5f40c..8613ec3 100644 --- a/aria/orchestrator/context/operation.py +++ b/aria/orchestrator/context/operation.py @@ -48,8 +48,7 @@ class BaseOperationContext(common.BaseContext): @property def task(self): """ -The task in the model storage -:return: Task model +The task in the model storage. """ # SQLAlchemy prevents from accessing an object which was created on a different thread. # So we retrieve the object from the storage if the current thread isn't the same as the @@ -62,7 +61,7 @@ class BaseOperationContext(common.BaseContext): @property def plugin_workdir(self): """ -A work directory that is unique to the plugin and the deployment id +A work directory that is unique to the plugin and the service ID. """ if self.task.plugin is None: return None @@ -120,20 +119,18 @@ class NodeOperationContext(BaseOperationCon
[GitHub] incubator-ariatosca pull request #187: ARIA-313 Fix handling the `required` ...
Github user AviaE commented on a diff in the pull request: https://github.com/apache/incubator-ariatosca/pull/187#discussion_r129910938 --- Diff: aria/orchestrator/workflows/api/task.py --- @@ -137,6 +137,11 @@ def __init__(self, operation = self.actor.interfaces[self.interface_name].operations[self.operation_name] self.plugin = operation.plugin self.function = operation.function + +modeling_utils.validate_required_inputs_are_supplied( +declared_inputs=operation.inputs, +supplied_inputs=operation.arguments) --- End diff -- After consulting with @tliron and reviewing the TOSCA spec, I came to the conclusion that the validation of the `required` field of inputs that belong to operations and interfaces (as opposed to topology template and workflow inputs) should be done in the parsing stage. This reasoning follows the TOSCA spirit, where anything that is declared in the type and is required, must be assigned in the corresponding template. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
incubator-ariatosca git commit: fixed dumps issues [Forced Update!]
Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-174-Refactor-instantiation-phase b3724c942 -> d6b268958 (forced update) fixed dumps issues Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/d6b26895 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/d6b26895 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/d6b26895 Branch: refs/heads/ARIA-174-Refactor-instantiation-phase Commit: d6b268958d797e3f3bb8ea9143a3ff8f57ccb58a Parents: ec7b9c9 Author: max-orlov Authored: Thu Jul 27 18:07:11 2017 +0300 Committer: max-orlov Committed: Thu Jul 27 18:23:46 2017 +0300 -- aria/cli/commands/service_templates.py | 4 +- aria/cli/commands/services.py | 4 +- aria/orchestrator/topology/common.py | 4 +- aria/orchestrator/topology/instance_handler.py | 269 ++-- aria/orchestrator/topology/template_handler.py | 256 ++- aria/orchestrator/topology/topology.py | 164 ++-- 6 files changed, 361 insertions(+), 340 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d6b26895/aria/cli/commands/service_templates.py -- diff --git a/aria/cli/commands/service_templates.py b/aria/cli/commands/service_templates.py index 482170b..608d178 100644 --- a/aria/cli/commands/service_templates.py +++ b/aria/cli/commands/service_templates.py @@ -73,9 +73,9 @@ def show(service_template_name, model_storage, mode_full, mode_types, format_jso elif format_yaml: console.puts(formatting.yaml_dumps(collections.prune(service_template.as_raw))) else: -logger.info(Topology().dump(service_template)) +console.puts(Topology().dump(service_template)) elif mode_types: -logger.info(Topology().dump_types(service_template=service_template)) +console.puts(Topology().dump_types(service_template=service_template)) else: logger.info('Showing service template {0}...'.format(service_template_name)) service_template_dict = service_template.to_dict() http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d6b26895/aria/cli/commands/services.py -- diff --git a/aria/cli/commands/services.py b/aria/cli/commands/services.py index 3b07866..4890bb7 100644 --- a/aria/cli/commands/services.py +++ b/aria/cli/commands/services.py @@ -74,9 +74,9 @@ def show(service_name, model_storage, mode_full, mode_graph, format_json, format elif format_yaml: console.puts(formatting.yaml_dumps(collections.prune(service.as_raw))) else: -logger.info(Topology().dump(service)) +console.puts(Topology().dump(service)) elif mode_graph: -logger.info(Topology().dump_graph(service)) +console.puts(Topology().dump_graph(service)) else: logger.info('Showing service {0}...'.format(service_name)) service_dict = service.to_dict() http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d6b26895/aria/orchestrator/topology/common.py -- diff --git a/aria/orchestrator/topology/common.py b/aria/orchestrator/topology/common.py index e788b4a..45e9ab0 100644 --- a/aria/orchestrator/topology/common.py +++ b/aria/orchestrator/topology/common.py @@ -33,13 +33,13 @@ class _Handler(object): for template in templates: self._topology.validate(template) -def dump(self, console): +def dump(self, out_stream): pass class _TemplateHandlerMixin(_Handler): -def instantiate(self, instance_cls, **kwargs): +def instantiate(self, instance_cls): raise NotImplementedError http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d6b26895/aria/orchestrator/topology/instance_handler.py -- diff --git a/aria/orchestrator/topology/instance_handler.py b/aria/orchestrator/topology/instance_handler.py index dc204fe..2c32466 100644 --- a/aria/orchestrator/topology/instance_handler.py +++ b/aria/orchestrator/topology/instance_handler.py @@ -29,24 +29,25 @@ class Artifact(common._InstanceHandlerMixin): def validate(self, **kwargs): self._topology.validate(self._model.properties) -def dump(self, console): -console.write(console.node(self._model.name)) -if self._model.description: -console.write(console.meta(self._model.description)) -with console.indent: -console.write('Artifact type: {0}'.format(console.type(sel
incubator-ariatosca git commit: fixed dumps issues
Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-174-Refactor-instantiation-phase ec7b9c970 -> b3724c942 fixed dumps issues Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/b3724c94 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/b3724c94 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/b3724c94 Branch: refs/heads/ARIA-174-Refactor-instantiation-phase Commit: b3724c942d35f2d6e25e6af4fd7dfc6ed54de34e Parents: ec7b9c9 Author: max-orlov Authored: Thu Jul 27 18:07:11 2017 +0300 Committer: max-orlov Committed: Thu Jul 27 18:07:11 2017 +0300 -- aria/cli/commands/service_templates.py | 4 +- aria/cli/commands/services.py | 4 +- aria/orchestrator/topology/common.py | 4 +- aria/orchestrator/topology/instance_handler.py | 269 ++-- aria/orchestrator/topology/template_handler.py | 252 +- aria/orchestrator/topology/topology.py | 164 ++-- 6 files changed, 359 insertions(+), 338 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b3724c94/aria/cli/commands/service_templates.py -- diff --git a/aria/cli/commands/service_templates.py b/aria/cli/commands/service_templates.py index 482170b..608d178 100644 --- a/aria/cli/commands/service_templates.py +++ b/aria/cli/commands/service_templates.py @@ -73,9 +73,9 @@ def show(service_template_name, model_storage, mode_full, mode_types, format_jso elif format_yaml: console.puts(formatting.yaml_dumps(collections.prune(service_template.as_raw))) else: -logger.info(Topology().dump(service_template)) +console.puts(Topology().dump(service_template)) elif mode_types: -logger.info(Topology().dump_types(service_template=service_template)) +console.puts(Topology().dump_types(service_template=service_template)) else: logger.info('Showing service template {0}...'.format(service_template_name)) service_template_dict = service_template.to_dict() http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b3724c94/aria/cli/commands/services.py -- diff --git a/aria/cli/commands/services.py b/aria/cli/commands/services.py index 3b07866..4890bb7 100644 --- a/aria/cli/commands/services.py +++ b/aria/cli/commands/services.py @@ -74,9 +74,9 @@ def show(service_name, model_storage, mode_full, mode_graph, format_json, format elif format_yaml: console.puts(formatting.yaml_dumps(collections.prune(service.as_raw))) else: -logger.info(Topology().dump(service)) +console.puts(Topology().dump(service)) elif mode_graph: -logger.info(Topology().dump_graph(service)) +console.puts(Topology().dump_graph(service)) else: logger.info('Showing service {0}...'.format(service_name)) service_dict = service.to_dict() http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b3724c94/aria/orchestrator/topology/common.py -- diff --git a/aria/orchestrator/topology/common.py b/aria/orchestrator/topology/common.py index e788b4a..45e9ab0 100644 --- a/aria/orchestrator/topology/common.py +++ b/aria/orchestrator/topology/common.py @@ -33,13 +33,13 @@ class _Handler(object): for template in templates: self._topology.validate(template) -def dump(self, console): +def dump(self, out_stream): pass class _TemplateHandlerMixin(_Handler): -def instantiate(self, instance_cls, **kwargs): +def instantiate(self, instance_cls): raise NotImplementedError http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b3724c94/aria/orchestrator/topology/instance_handler.py -- diff --git a/aria/orchestrator/topology/instance_handler.py b/aria/orchestrator/topology/instance_handler.py index dc204fe..2c32466 100644 --- a/aria/orchestrator/topology/instance_handler.py +++ b/aria/orchestrator/topology/instance_handler.py @@ -29,24 +29,25 @@ class Artifact(common._InstanceHandlerMixin): def validate(self, **kwargs): self._topology.validate(self._model.properties) -def dump(self, console): -console.write(console.node(self._model.name)) -if self._model.description: -console.write(console.meta(self._model.description)) -with console.indent: -console.write('Artifact type: {0}'.format(console.type(self._model.type.name
[2/2] incubator-ariatosca git commit: removed the old style class from consumption, removed any unnecessary and local imports
removed the old style class from consumption, removed any unnecessary and local imports Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/ec7b9c97 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/ec7b9c97 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/ec7b9c97 Branch: refs/heads/ARIA-174-Refactor-instantiation-phase Commit: ec7b9c9702509f6619d4ae20508d06134ee10f26 Parents: bb67dbb Author: max-orlov Authored: Thu Jul 27 16:45:03 2017 +0300 Committer: max-orlov Committed: Thu Jul 27 17:15:25 2017 +0300 -- aria/cli/commands/service_templates.py | 6 +- aria/cli/commands/services.py | 6 +- aria/core.py | 24 +- aria/orchestrator/topology/__init__.py | 216 +-- aria/orchestrator/topology/instance.py | 633 aria/orchestrator/topology/instance_handler.py | 633 aria/orchestrator/topology/template.py | 583 -- aria/orchestrator/topology/template_handler.py | 583 ++ aria/orchestrator/topology/topology.py | 256 aria/parser/consumption/__init__.py| 3 - aria/parser/consumption/consumer.py| 9 +- aria/parser/consumption/context.py | 2 - aria/parser/consumption/modeling.py| 24 +- aria/parser/consumption/style.py | 50 -- 14 files changed, 1507 insertions(+), 1521 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/ec7b9c97/aria/cli/commands/service_templates.py -- diff --git a/aria/cli/commands/service_templates.py b/aria/cli/commands/service_templates.py index 6eef97a..482170b 100644 --- a/aria/cli/commands/service_templates.py +++ b/aria/cli/commands/service_templates.py @@ -28,7 +28,7 @@ from ...core import Core from ...storage import exceptions as storage_exceptions from ...parser import consumption from ...utils import (formatting, collections, console) -from ... orchestrator import topology +from ... orchestrator.topology import Topology DESCRIPTION_FIELD_LENGTH_LIMIT = 20 SERVICE_TEMPLATE_COLUMNS = \ @@ -73,9 +73,9 @@ def show(service_template_name, model_storage, mode_full, mode_types, format_jso elif format_yaml: console.puts(formatting.yaml_dumps(collections.prune(service_template.as_raw))) else: -logger.info(topology.Handler().dump(service_template)) +logger.info(Topology().dump(service_template)) elif mode_types: - logger.info(topology.Handler().dump_types(service_template=service_template)) +logger.info(Topology().dump_types(service_template=service_template)) else: logger.info('Showing service template {0}...'.format(service_template_name)) service_template_dict = service_template.to_dict() http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/ec7b9c97/aria/cli/commands/services.py -- diff --git a/aria/cli/commands/services.py b/aria/cli/commands/services.py index 93bea7f..3b07866 100644 --- a/aria/cli/commands/services.py +++ b/aria/cli/commands/services.py @@ -20,7 +20,7 @@ CLI ``services`` sub-commands. import os from StringIO import StringIO -from aria.orchestrator import topology +from aria.orchestrator.topology import Topology from . import service_templates from .. import helptexts from .. import table @@ -74,9 +74,9 @@ def show(service_name, model_storage, mode_full, mode_graph, format_json, format elif format_yaml: console.puts(formatting.yaml_dumps(collections.prune(service.as_raw))) else: -logger.info(topology.Handler().dump(service)) +logger.info(Topology().dump(service)) elif mode_graph: -logger.info(topology.Handler().dump_graph(service)) +logger.info(Topology().dump_graph(service)) else: logger.info('Showing service {0}...'.format(service_name)) service_dict = service.to_dict() http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/ec7b9c97/aria/core.py -- diff --git a/aria/core.py b/aria/core.py index 444bcb9..e726be7 100644 --- a/aria/core.py +++ b/aria/core.py @@ -17,10 +17,10 @@ ARIA core module. """ -from aria.orchestrator import topology from . import exceptions from .parser import consumption from .parser.loading.location import UriLocation +from .orchestrator.topology import Topology class Core(object): @@ -74,20 +74,20 @@ class Core(object): # setting no autoflush
[1/2] incubator-ariatosca git commit: removed the old style class from consumption, removed any unnecessary and local imports [Forced Update!]
Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-174-Refactor-instantiation-phase d1db39926 -> ec7b9c970 (forced update) http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/ec7b9c97/aria/orchestrator/topology/template.py -- diff --git a/aria/orchestrator/topology/template.py b/aria/orchestrator/topology/template.py deleted file mode 100644 index 51be788..000 --- a/aria/orchestrator/topology/template.py +++ /dev/null @@ -1,583 +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 datetime import datetime - -from ...utils import formatting -from ...modeling import utils as modeling_utils -from . import utils, common - - -class ServiceTemplate(common._TemplateHandlerMixin): -def dump(self, console): -if self._model.description is not None: -console.write(console.meta(self._model.description)) -self._topology.dump(self._model.meta_data, console, 'Metadata') -self._topology.dump(self._model.node_templates, console) -self._topology.dump(self._model.group_templates, console) -self._topology.dump(self._model.policy_templates, console) -self._topology.dump(self._model.substitution_template, console) -self._topology.dump(self._model.inputs, console, 'Inputs') -self._topology.dump(self._model.outputs, console, 'Outputs') -self._topology.dump(self._model.workflow_templates, console, 'Workflow templates') - -def coerce(self, **kwargs): -self._coerce(self._model.meta_data, - self._model.node_templates, - self._model.group_templates, - self._model.policy_templates, - self._model.substitution_template, - self._model.inputs, - self._model.outputs, - self._model.workflow_templates, - **kwargs) - -def instantiate(self, instance_cls, inputs=None): # pylint: disable=arguments-differ -now = datetime.now() -service = instance_cls( -created_at=now, -updated_at=now, -description=utils.deepcopy_with_locators(self._model.description), -service_template=self._model, -inputs=modeling_utils.merge_parameter_values(inputs, self._model.inputs) -) - -for plugin_specification in self._model.plugin_specifications.itervalues(): -if plugin_specification.enabled and self._topology._model_storage: -if utils.resolve_plugin_specification(plugin_specification, - self._topology.model_storage.plugin.list()): -plugin = plugin_specification.plugin -service.plugins[plugin.name] = plugin -else: -self._topology.report('specified plugin not found: {0}'.format( -plugin_specification.name), level=self._topology.Issue.EXTERNAL) -service.meta_data = self._topology.instantiate(self._model.meta_data) - -for node_template in self._model.node_templates.itervalues(): -for _ in range(self._scaling(node_template)['default_instances']): -node = self._topology.instantiate(node_template) -service.nodes[node.name] = node - -service.groups = self._topology.instantiate(self._model.group_templates) -service.policies = self._topology.instantiate(self._model.policy_templates) -service.workflows = self._topology.instantiate(self._model.workflow_templates) -service.substitution = self._topology.instantiate(self._model.substitution_template) -service.outputs = self._topology.instantiate(self._model.outputs) - -return service - -def _scaling(self, node_template): -scaling = {} - -def extract_property(properties, name): -if name in scaling: -return -prop = properties.get(name) -if (prop is not None) and (prop.type_name == 'integer') and (prop.value is not None): -
[1/2] incubator-ariatosca git commit: removed the old style class from consumption, removed any unnecessary and local imports
Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-174-Refactor-instantiation-phase bb67dbb52 -> d1db39926 http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d1db3992/aria/orchestrator/topology/template.py -- diff --git a/aria/orchestrator/topology/template.py b/aria/orchestrator/topology/template.py deleted file mode 100644 index 51be788..000 --- a/aria/orchestrator/topology/template.py +++ /dev/null @@ -1,583 +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 datetime import datetime - -from ...utils import formatting -from ...modeling import utils as modeling_utils -from . import utils, common - - -class ServiceTemplate(common._TemplateHandlerMixin): -def dump(self, console): -if self._model.description is not None: -console.write(console.meta(self._model.description)) -self._topology.dump(self._model.meta_data, console, 'Metadata') -self._topology.dump(self._model.node_templates, console) -self._topology.dump(self._model.group_templates, console) -self._topology.dump(self._model.policy_templates, console) -self._topology.dump(self._model.substitution_template, console) -self._topology.dump(self._model.inputs, console, 'Inputs') -self._topology.dump(self._model.outputs, console, 'Outputs') -self._topology.dump(self._model.workflow_templates, console, 'Workflow templates') - -def coerce(self, **kwargs): -self._coerce(self._model.meta_data, - self._model.node_templates, - self._model.group_templates, - self._model.policy_templates, - self._model.substitution_template, - self._model.inputs, - self._model.outputs, - self._model.workflow_templates, - **kwargs) - -def instantiate(self, instance_cls, inputs=None): # pylint: disable=arguments-differ -now = datetime.now() -service = instance_cls( -created_at=now, -updated_at=now, -description=utils.deepcopy_with_locators(self._model.description), -service_template=self._model, -inputs=modeling_utils.merge_parameter_values(inputs, self._model.inputs) -) - -for plugin_specification in self._model.plugin_specifications.itervalues(): -if plugin_specification.enabled and self._topology._model_storage: -if utils.resolve_plugin_specification(plugin_specification, - self._topology.model_storage.plugin.list()): -plugin = plugin_specification.plugin -service.plugins[plugin.name] = plugin -else: -self._topology.report('specified plugin not found: {0}'.format( -plugin_specification.name), level=self._topology.Issue.EXTERNAL) -service.meta_data = self._topology.instantiate(self._model.meta_data) - -for node_template in self._model.node_templates.itervalues(): -for _ in range(self._scaling(node_template)['default_instances']): -node = self._topology.instantiate(node_template) -service.nodes[node.name] = node - -service.groups = self._topology.instantiate(self._model.group_templates) -service.policies = self._topology.instantiate(self._model.policy_templates) -service.workflows = self._topology.instantiate(self._model.workflow_templates) -service.substitution = self._topology.instantiate(self._model.substitution_template) -service.outputs = self._topology.instantiate(self._model.outputs) - -return service - -def _scaling(self, node_template): -scaling = {} - -def extract_property(properties, name): -if name in scaling: -return -prop = properties.get(name) -if (prop is not None) and (prop.type_name == 'integer') and (prop.value is not None): -scaling[nam
[2/2] incubator-ariatosca git commit: removed the old style class from consumption, removed any unnecessary and local imports
removed the old style class from consumption, removed any unnecessary and local imports Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/d1db3992 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/d1db3992 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/d1db3992 Branch: refs/heads/ARIA-174-Refactor-instantiation-phase Commit: d1db399269f257f1cb751e16a0deaefb7d892d1e Parents: bb67dbb Author: max-orlov Authored: Thu Jul 27 16:45:03 2017 +0300 Committer: max-orlov Committed: Thu Jul 27 16:45:03 2017 +0300 -- aria/cli/commands/service_templates.py | 6 +- aria/cli/commands/services.py | 6 +- aria/core.py | 24 +- aria/orchestrator/topology/__init__.py | 216 +-- aria/orchestrator/topology/instance.py | 633 aria/orchestrator/topology/instance_handler.py | 633 aria/orchestrator/topology/template.py | 583 -- aria/orchestrator/topology/template_handler.py | 583 ++ aria/orchestrator/topology/topology.py | 255 aria/parser/consumption/__init__.py| 3 - aria/parser/consumption/consumer.py| 9 +- aria/parser/consumption/context.py | 2 - aria/parser/consumption/modeling.py| 24 +- aria/parser/consumption/style.py | 50 -- 14 files changed, 1506 insertions(+), 1521 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d1db3992/aria/cli/commands/service_templates.py -- diff --git a/aria/cli/commands/service_templates.py b/aria/cli/commands/service_templates.py index 6eef97a..482170b 100644 --- a/aria/cli/commands/service_templates.py +++ b/aria/cli/commands/service_templates.py @@ -28,7 +28,7 @@ from ...core import Core from ...storage import exceptions as storage_exceptions from ...parser import consumption from ...utils import (formatting, collections, console) -from ... orchestrator import topology +from ... orchestrator.topology import Topology DESCRIPTION_FIELD_LENGTH_LIMIT = 20 SERVICE_TEMPLATE_COLUMNS = \ @@ -73,9 +73,9 @@ def show(service_template_name, model_storage, mode_full, mode_types, format_jso elif format_yaml: console.puts(formatting.yaml_dumps(collections.prune(service_template.as_raw))) else: -logger.info(topology.Handler().dump(service_template)) +logger.info(Topology().dump(service_template)) elif mode_types: - logger.info(topology.Handler().dump_types(service_template=service_template)) +logger.info(Topology().dump_types(service_template=service_template)) else: logger.info('Showing service template {0}...'.format(service_template_name)) service_template_dict = service_template.to_dict() http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d1db3992/aria/cli/commands/services.py -- diff --git a/aria/cli/commands/services.py b/aria/cli/commands/services.py index 93bea7f..3b07866 100644 --- a/aria/cli/commands/services.py +++ b/aria/cli/commands/services.py @@ -20,7 +20,7 @@ CLI ``services`` sub-commands. import os from StringIO import StringIO -from aria.orchestrator import topology +from aria.orchestrator.topology import Topology from . import service_templates from .. import helptexts from .. import table @@ -74,9 +74,9 @@ def show(service_name, model_storage, mode_full, mode_graph, format_json, format elif format_yaml: console.puts(formatting.yaml_dumps(collections.prune(service.as_raw))) else: -logger.info(topology.Handler().dump(service)) +logger.info(Topology().dump(service)) elif mode_graph: -logger.info(topology.Handler().dump_graph(service)) +logger.info(Topology().dump_graph(service)) else: logger.info('Showing service {0}...'.format(service_name)) service_dict = service.to_dict() http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d1db3992/aria/core.py -- diff --git a/aria/core.py b/aria/core.py index 444bcb9..e726be7 100644 --- a/aria/core.py +++ b/aria/core.py @@ -17,10 +17,10 @@ ARIA core module. """ -from aria.orchestrator import topology from . import exceptions from .parser import consumption from .parser.loading.location import UriLocation +from .orchestrator.topology import Topology class Core(object): @@ -74,20 +74,20 @@ class Core(object): # setting no autoflush
incubator-ariatosca git commit: fixed docs
Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-174-Refactor-instantiation-phase fcc6b9c6e -> bb67dbb52 fixed docs Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/bb67dbb5 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/bb67dbb5 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/bb67dbb5 Branch: refs/heads/ARIA-174-Refactor-instantiation-phase Commit: bb67dbb526de4adffe7416f25ce7b390b6652e07 Parents: fcc6b9c Author: max-orlov Authored: Thu Jul 27 14:46:17 2017 +0300 Committer: max-orlov Committed: Thu Jul 27 14:46:17 2017 +0300 -- aria/parser/reading/__init__.py | 2 -- 1 file changed, 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/bb67dbb5/aria/parser/reading/__init__.py -- diff --git a/aria/parser/reading/__init__.py b/aria/parser/reading/__init__.py index 9fab5df..c110585 100644 --- a/aria/parser/reading/__init__.py +++ b/aria/parser/reading/__init__.py @@ -24,8 +24,6 @@ Reading package. JinjaReader JsonReader Locator - deepcopy_with_locators - copy_locators RawReader Reader ReaderSource
incubator-ariatosca git commit: removed singleton, added ability to extend the issue list, and fixed issue relating the cpability/requirement instantiation
Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-174-Refactor-instantiation-phase 4bdf57c7b -> fcc6b9c6e removed singleton, added ability to extend the issue list, and fixed issue relating the cpability/requirement instantiation Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/fcc6b9c6 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/fcc6b9c6 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/fcc6b9c6 Branch: refs/heads/ARIA-174-Refactor-instantiation-phase Commit: fcc6b9c6e42b083dff90cf36f521eabfd5272abe Parents: 4bdf57c Author: max-orlov Authored: Thu Jul 27 14:28:49 2017 +0300 Committer: max-orlov Committed: Thu Jul 27 14:28:49 2017 +0300 -- aria/cli/commands/service_templates.py| 4 ++-- aria/cli/commands/services.py | 4 ++-- aria/core.py | 7 +++ aria/orchestrator/topology/__init__.py| 3 --- aria/orchestrator/topology/instance.py| 12 ++-- aria/orchestrator/topology/template.py| 14 -- aria/parser/consumption/consumer.py | 6 +- aria/parser/consumption/modeling.py | 2 +- aria/parser/validation/issue.py | 4 tests/instantiation/test_configuration.py | 15 --- 10 files changed, 39 insertions(+), 32 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/fcc6b9c6/aria/cli/commands/service_templates.py -- diff --git a/aria/cli/commands/service_templates.py b/aria/cli/commands/service_templates.py index d1a9479..6eef97a 100644 --- a/aria/cli/commands/service_templates.py +++ b/aria/cli/commands/service_templates.py @@ -73,9 +73,9 @@ def show(service_template_name, model_storage, mode_full, mode_types, format_jso elif format_yaml: console.puts(formatting.yaml_dumps(collections.prune(service_template.as_raw))) else: -logger.info(topology.handler.dump(service_template)) +logger.info(topology.Handler().dump(service_template)) elif mode_types: - logger.info(topology.handler.dump_types(service_template=service_template)) + logger.info(topology.Handler().dump_types(service_template=service_template)) else: logger.info('Showing service template {0}...'.format(service_template_name)) service_template_dict = service_template.to_dict() http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/fcc6b9c6/aria/cli/commands/services.py -- diff --git a/aria/cli/commands/services.py b/aria/cli/commands/services.py index 43faf37..93bea7f 100644 --- a/aria/cli/commands/services.py +++ b/aria/cli/commands/services.py @@ -74,9 +74,9 @@ def show(service_name, model_storage, mode_full, mode_graph, format_json, format elif format_yaml: console.puts(formatting.yaml_dumps(collections.prune(service.as_raw))) else: -logger.info(topology.handler.dump(service)) +logger.info(topology.Handler().dump(service)) elif mode_graph: -logger.info(topology.handler.dump_graph(service)) +logger.info(topology.Handler().dump_graph(service)) else: logger.info('Showing service {0}...'.format(service_name)) service_dict = service.to_dict() http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/fcc6b9c6/aria/core.py -- diff --git a/aria/core.py b/aria/core.py index 0870bac..444bcb9 100644 --- a/aria/core.py +++ b/aria/core.py @@ -87,10 +87,9 @@ class Core(object): handler.configure_operations(service) handler.coerce(service) -# TODO: fix this -# if context.validation.dump_issues(): -# raise exceptions.InstantiationError('Failed to instantiate service template `{0}`' -# .format(service_template.name)) +if handler.dump_issues(): +raise exceptions.InstantiationError('Failed to instantiate service template `{0}`' + .format(service_template.name)) storage_session.flush() # flushing so service.id would auto-populate service.name = service_name or '{0}_{1}'.format(service_template.name, service.id) http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/fcc6b9c6/aria/orchestrator/topology/__init__.py -- diff --git a/aria/orchestrator/topology/__init__.py b/aria/orchestrator/topology/__init__.p
incubator-ariatosca git commit: fixed outputs issue
Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-174-Refactor-instantiation-phase 1e7586af3 -> 4bdf57c7b fixed outputs issue Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/4bdf57c7 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/4bdf57c7 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/4bdf57c7 Branch: refs/heads/ARIA-174-Refactor-instantiation-phase Commit: 4bdf57c7b178441882bf8929e5c3816e66dec5b5 Parents: 1e7586a Author: max-orlov Authored: Thu Jul 27 11:55:46 2017 +0300 Committer: max-orlov Committed: Thu Jul 27 11:55:46 2017 +0300 -- aria/core.py | 3 ++- aria/orchestrator/topology/template.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/4bdf57c7/aria/core.py -- diff --git a/aria/core.py b/aria/core.py index 77ed3de..0870bac 100644 --- a/aria/core.py +++ b/aria/core.py @@ -74,13 +74,14 @@ class Core(object): # setting no autoflush for the duration of instantiation - this helps avoid dependency # constraints as they're being set up with storage_session.no_autoflush: - handler = topology.Handler(self.model_storage) service = handler.instantiate(service_template, inputs=inputs) handler.coerce(service) + handler.validate(service) handler.satisfy_requirements(service) handler.coerce(service) + handler.validate_capabilities(service) handler.find_hosts(service) handler.configure_operations(service) http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/4bdf57c7/aria/orchestrator/topology/template.py -- diff --git a/aria/orchestrator/topology/template.py b/aria/orchestrator/topology/template.py index 8f06ba0..29a2397 100644 --- a/aria/orchestrator/topology/template.py +++ b/aria/orchestrator/topology/template.py @@ -76,7 +76,7 @@ class ServiceTemplate(common._TemplateHandlerMixin): if self._model.substitution_template is not None: service.substitution = self._topology.instantiate(self._model.substitution_template) -service.outputs = self._topology.instantiate(self._model.outputs) +service.outputs = self._topology.instantiate(self._model.outputs) return service
incubator-ariatosca git commit: linting fixes
Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-174-Refactor-instantiation-phase 3a4ed87ba -> 1e7586af3 linting fixes Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/1e7586af Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/1e7586af Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/1e7586af Branch: refs/heads/ARIA-174-Refactor-instantiation-phase Commit: 1e7586af3d2468d615f27b494a654fc35e85911e Parents: 3a4ed87 Author: max-orlov Authored: Thu Jul 27 11:27:22 2017 +0300 Committer: max-orlov Committed: Thu Jul 27 11:27:22 2017 +0300 -- aria/modeling/functions.py | 2 +- aria/modeling/mixins.py | 2 +- .../execution_plugin/instantiation.py | 8 +- aria/orchestrator/topology/__init__.py | 65 ++- aria/orchestrator/topology/common.py| 15 +-- aria/orchestrator/topology/instance.py | 111 ++- aria/orchestrator/topology/template.py | 58 +- aria/orchestrator/topology/utils.py | 8 +- aria/parser/modeling/context.py | 2 +- aria/parser/reading/locator.py | 2 - aria/parser/validation/issue.py | 2 +- 11 files changed, 138 insertions(+), 137 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/1e7586af/aria/modeling/functions.py -- diff --git a/aria/modeling/functions.py b/aria/modeling/functions.py index 425b69b..7330268 100644 --- a/aria/modeling/functions.py +++ b/aria/modeling/functions.py @@ -102,7 +102,7 @@ def evaluate(value, container_holder, report_issues=False): # pylint: disable=to final = False except exceptions.CannotEvaluateFunctionException: pass -except InvalidValueError as e: +except InvalidValueError: if report_issues: # TODO: do not use the context for "reporting" pass http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/1e7586af/aria/modeling/mixins.py -- diff --git a/aria/modeling/mixins.py b/aria/modeling/mixins.py index fd31e3e..33f2306 100644 --- a/aria/modeling/mixins.py +++ b/aria/modeling/mixins.py @@ -135,7 +135,7 @@ class InstanceModelMixin(ModelMixin): pass -class TemplateModelMixin(InstanceModelMixin): +class TemplateModelMixin(InstanceModelMixin): # pylint: disable=abstract-method """ Mix-in for service template models. http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/1e7586af/aria/orchestrator/execution_plugin/instantiation.py -- diff --git a/aria/orchestrator/execution_plugin/instantiation.py b/aria/orchestrator/execution_plugin/instantiation.py index 0e3a441..49605b9 100644 --- a/aria/orchestrator/execution_plugin/instantiation.py +++ b/aria/orchestrator/execution_plugin/instantiation.py @@ -120,10 +120,10 @@ def _configure_remote(operation): # TODO: fix pass # context = ConsumptionContext.get_thread_local() -# context.validation.report('must configure "ssh.password", "ssh.key", or "ssh.key_filename" ' -# 'for "{0}"' -# .format(operation.implementation), -# level=validation.Issue.BETWEEN_TYPES) +# context.validation.report( +# 'must configure "ssh.password", "ssh.key", or "ssh.key_filename" for "{0}"'.format( +# operation.implementation), +# level=validation.Issue.BETWEEN_TYPES) operation.arguments['fabric_env'] = Argument.wrap('fabric_env', fabric_env, 'Fabric configuration.') http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/1e7586af/aria/orchestrator/topology/__init__.py -- diff --git a/aria/orchestrator/topology/__init__.py b/aria/orchestrator/topology/__init__.py index afa5334..afb7d22 100644 --- a/aria/orchestrator/topology/__init__.py +++ b/aria/orchestrator/topology/__init__.py @@ -17,7 +17,7 @@ from StringIO import StringIO from ...parser.validation import issue from ...parser.consumption.style import Style from ...modeling import models -from ...utils import console +from ...utils import console as console_utils from . import ( template, instance, @@ -58,7 +58,7 @@ class Handler(issue.Reporter):