ARIA-321 Provide Clearwater IMS example Related fixes included in this commit:
* Allows capabilities, interfaces, and properties to override parent definition types only if the new type is a descendant of the overridden type * Fix to get_property intrinsic function * Fix the "required" field for parameters (it wasn't working) * 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/7679bc1f Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/7679bc1f Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/7679bc1f Branch: refs/heads/ARIA-321-clearwater Commit: 7679bc1f9dbc7c47c3b2d8144657a98a23fe764a Parents: 8981791 Author: Tal Liron <tal.li...@gmail.com> Authored: Thu Jul 27 17:58:17 2017 -0500 Committer: Tal Liron <tal.li...@gmail.com> Committed: Tue Aug 15 17:46:34 2017 -0500 ---------------------------------------------------------------------- README.rst | 2 +- aria/modeling/functions.py | 4 +- aria/modeling/service_common.py | 2 +- aria/modeling/service_instance.py | 104 ++- aria/orchestrator/topology/template_handler.py | 17 +- aria/orchestrator/topology/topology.py | 12 +- .../clearwater-live-test-existing.yaml | 54 ++ .../clearwater/clearwater-single-existing.yaml | 147 ++++ examples/clearwater/scripts/bono/create.sh | 20 + examples/clearwater/scripts/bono/delete.sh | 15 + examples/clearwater/scripts/dime/create.sh | 21 + examples/clearwater/scripts/dime/delete.sh | 15 + examples/clearwater/scripts/ellis/configure.sh | 29 + examples/clearwater/scripts/ellis/create.sh | 19 + examples/clearwater/scripts/ellis/delete.sh | 15 + examples/clearwater/scripts/homer/create.sh | 27 + examples/clearwater/scripts/homer/delete.sh | 15 + examples/clearwater/scripts/homestead/create.sh | 25 + examples/clearwater/scripts/homestead/delete.sh | 15 + .../clearwater/scripts/host-base/configure.sh | 23 + examples/clearwater/scripts/host/configure.sh | 183 +++++ examples/clearwater/scripts/live-test/create.sh | 69 ++ examples/clearwater/scripts/live-test/delete.sh | 23 + examples/clearwater/scripts/memento/create.sh | 20 + examples/clearwater/scripts/memento/delete.sh | 15 + examples/clearwater/scripts/ralf/create.sh | 15 + examples/clearwater/scripts/ralf/delete.sh | 15 + examples/clearwater/scripts/sprout/create.sh | 19 + examples/clearwater/scripts/sprout/delete.sh | 15 + examples/clearwater/scripts/vellum/create.sh | 23 + examples/clearwater/scripts/vellum/delete.sh | 15 + examples/clearwater/types/cassandra.yaml | 30 + examples/clearwater/types/clearwater.yaml | 728 +++++++++++++++++++ examples/clearwater/types/ims.yaml | 446 ++++++++++++ examples/clearwater/types/smtp.yaml | 35 + 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/assignments.py | 8 +- .../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 | 47 +- .../simple_v1_0/presentation/types.py | 8 +- .../aria_extension_tosca/simple_v1_0/types.py | 25 +- 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 +- 67 files changed, 2427 insertions(+), 192 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/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 "hello world" service-template and name it (e.g. ``my-service-template``):: - aria service-templates store examples/hello-world/helloworld.yaml my-service-template + aria service-templates store examples/hello-world/hello-world.yaml my-service-template Now create a service based on this service-template and name it (e.g. ``my-service``):: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/aria/modeling/functions.py ---------------------------------------------------------------------- diff --git a/aria/modeling/functions.py b/aria/modeling/functions.py index 31c3839..554bbfb 100644 --- a/aria/modeling/functions.py +++ b/aria/modeling/functions.py @@ -19,6 +19,7 @@ Mechanism for evaluating intrinsic functions. from ..parser.exceptions import InvalidValueError from ..parser.consumption import ConsumptionContext from ..utils.collections import OrderedDict +from ..utils.type import full_type_name from . import exceptions @@ -88,7 +89,8 @@ def evaluate(value, container_holder, report_issues=False): # pylint: disable=to if (evaluation is None) \ or (not hasattr(evaluation, 'value')) \ or (not hasattr(evaluation, 'final')): - raise InvalidValueError('bad __evaluate__ implementation') + raise InvalidValueError('bad __evaluate__ implementation: {0}' + .format(full_type_name(value))) evaluated = True value = evaluation.value http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/aria/modeling/service_common.py ---------------------------------------------------------------------- diff --git a/aria/modeling/service_common.py b/aria/modeling/service_common.py index 478e530..d1f6b00 100644 --- a/aria/modeling/service_common.py +++ b/aria/modeling/service_common.py @@ -28,7 +28,7 @@ from sqlalchemy.ext.declarative import declared_attr from ..utils import ( collections, - formatting, + formatting ) from .mixins import InstanceModelMixin, TemplateModelMixin, ParameterMixin from . import relationship http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/aria/modeling/service_instance.py ---------------------------------------------------------------------- diff --git a/aria/modeling/service_instance.py b/aria/modeling/service_instance.py index daeb0a4..589bd6b 100644 --- a/aria/modeling/service_instance.py +++ b/aria/modeling/service_instance.py @@ -38,7 +38,7 @@ from .mixins import InstanceModelMixin from ..utils import ( collections, - formatting, + formatting ) @@ -228,6 +228,80 @@ class ServiceBase(InstanceModelMixin): :type: :class:`~datetime.datetime` """) + def get_node_by_type(self, type_name): + """ + Finds the first node of a type (or descendent type). + """ + service_template = self.service_template + + if service_template is not None: + node_types = service_template.node_types + if node_types is not None: + for node in self.nodes.itervalues(): + if node_types.is_descendant(type_name, node.type.name): + return node + + return None + + def get_policy_by_type(self, type_name): + """ + Finds the first policy of a type (or descendent type). + """ + service_template = self.service_template + + if service_template is not None: + policy_types = service_template.policy_types + if policy_types is not None: + for policy in self.policies.itervalues(): + if policy_types.is_descendant(type_name, policy.type.name): + return policy + + return None + + def satisfy_requirements(self): + satisfied = True + for node in self.nodes.itervalues(): + if not node.satisfy_requirements(): + satisfied = False + return satisfied + + def validate_capabilities(self): + satisfied = True + for node in self.nodes.itervalues(): + if not node.validate_capabilities(): + satisfied = False + return satisfied + + def find_hosts(self): + for node in self.nodes.itervalues(): + node.find_host() + + def configure_operations(self): + for node in self.nodes.itervalues(): + node.configure_operations() + for group in self.groups.itervalues(): + group.configure_operations() + for operation in self.workflows.itervalues(): + operation.configure() + + def is_node_a_target(self, target_node): + for node in self.nodes.itervalues(): + if self._is_node_a_target(node, target_node): + return True + return False + + def _is_node_a_target(self, source_node, target_node): + if source_node.outbound_relationships: + for relationship_model in source_node.outbound_relationships: + if relationship_model.target_node.name == target_node.name: + return True + else: + node = relationship_model.target_node + if node is not None: + if self._is_node_a_target(node, target_node): + return True + return False + @property def as_raw(self): return collections.OrderedDict(( @@ -479,14 +553,15 @@ class NodeBase(InstanceModelMixin): @classmethod def determine_state(cls, op_name, is_transitional): - """ :returns the state the node should be in as a result of running the - operation on this node. + """ + :returns the state the node should be in as a result of running the operation on this node. - e.g. if we are running tosca.interfaces.node.lifecycle.Standard.create, then - the resulting state should either 'creating' (if the task just started) or 'created' - (if the task ended). + E.g. if we are running tosca.interfaces.node.lifecycle.Standard.create, then + the resulting state should either 'creating' (if the task just started) or 'created' + (if the task ended). - If the operation is not a standard tosca lifecycle operation, then we return None""" + If the operation is not a standard TOSCA lifecycle operation, then we return None. + """ state_type = 'transitional' if is_transitional else 'finished' try: @@ -497,11 +572,24 @@ class NodeBase(InstanceModelMixin): def is_available(self): return self.state not in (self.INITIAL, self.DELETED, self.ERROR) + def get_outbound_relationship_by_name(self, name): + for the_relationship in self.outbound_relationships: + if the_relationship.name == name: + return the_relationship + return None + + def get_inbound_relationship_by_name(self, name): + for the_relationship in self.inbound_relationships: + if the_relationship.name == name: + return the_relationship + return None + @property def host_address(self): if self.host and self.host.attributes: attribute = self.host.attributes.get('ip') - return attribute.value if attribute else None + if attribute is not None: + return attribute.value return None @property http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/aria/orchestrator/topology/template_handler.py ---------------------------------------------------------------------- diff --git a/aria/orchestrator/topology/template_handler.py b/aria/orchestrator/topology/template_handler.py index bf0ef9f..a84a988 100644 --- a/aria/orchestrator/topology/template_handler.py +++ b/aria/orchestrator/topology/template_handler.py @@ -206,12 +206,15 @@ class CapabilityTemplate(common.TemplateHandlerBase): self._topology.coerce(self._model.properties, **kwargs) def instantiate(self, instance_cls, **_): - return instance_cls(name=self._model.name, - type=self._model.type, - min_occurrences=self._model.min_occurrences, - max_occurrences=self._model.max_occurrences, - occurrences=0, - capability_template=self._model) + capability = instance_cls( + name=self._model.name, + type=self._model.type, + min_occurrences=self._model.min_occurrences, + max_occurrences=self._model.max_occurrences, + occurrences=0, + capability_template=self._model) + capability.properties = self._topology.instantiate(self._model.properties) + return capability def validate(self, **kwargs): self._topology.validate(self._model.properties, **kwargs) @@ -446,7 +449,7 @@ class SubstitutionTemplate(common.TemplateHandlerBase): class SubstitutionTemplateMapping(common.TemplateHandlerBase): def dump(self, out_stream): - if self._topology.capability_template is not None: + if self._model.capability_template is not None: node_template = self._model.capability_template.node_template else: node_template = self._model.requirement_template.node_template http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/aria/orchestrator/topology/topology.py ---------------------------------------------------------------------- diff --git a/aria/orchestrator/topology/topology.py b/aria/orchestrator/topology/topology.py index 8ee33d1..f86c9dd 100644 --- a/aria/orchestrator/topology/topology.py +++ b/aria/orchestrator/topology/topology.py @@ -57,11 +57,11 @@ class Topology(issue.ReporterMixin): @staticmethod def _init_handlers(module_): """ - Register handlers from a handler module to the models + Register handlers from a handler module to the models. - :param module_: The module to look for handlers - :return: a dict where the key is the models class, and the value is the handler class - associated with it from the provided module + :param module_: the module to look for handlers + :returns: dict where the key is the models class, and the value is the handler class + associated with it from the provided module """ handlers = {} for attribute_name in dir(module_): @@ -74,11 +74,11 @@ class Topology(issue.ReporterMixin): def instantiate(self, model, **kwargs): """ - instantiate the provided model + Instantiate the provided model. :param model: :param kwargs: - :return: + :returns: """ if isinstance(model, dict): return dict((name, self.instantiate(value, **kwargs)) http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/examples/clearwater/clearwater-live-test-existing.yaml ---------------------------------------------------------------------- diff --git a/examples/clearwater/clearwater-live-test-existing.yaml b/examples/clearwater/clearwater-live-test-existing.yaml new file mode 100644 index 0000000..7d21df0 --- /dev/null +++ b/examples/clearwater/clearwater-live-test-existing.yaml @@ -0,0 +1,54 @@ +# 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. + +tosca_definitions_version: tosca_simple_yaml_1_0 + +description: >- + Project Clearwater is an open-source IMS core, developed by Metaswitch Networks and released under + the GNU GPLv3. + +metadata: + template_name: clearwater-live-test-existing + template_author: ARIA + template_version: '1.0' + aria_version: '0.1.2' + +imports: + - types/clearwater.yaml + - aria-1.0 + +topology_template: + + inputs: + hosts.ssh.user: + type: string + hosts.ssh.password: + type: string + existing_host.public_address: + type: string + + node_templates: + live_test: + type: clearwater.LiveTest + + existing_host: + type: clearwater.HostBase + attributes: + public_address: { get_input: existing_host.public_address } + capabilities: + host: + properties: + ssh.user: { get_input: hosts.ssh.user } + ssh.password: { get_input: hosts.ssh.password } http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/examples/clearwater/clearwater-single-existing.yaml ---------------------------------------------------------------------- diff --git a/examples/clearwater/clearwater-single-existing.yaml b/examples/clearwater/clearwater-single-existing.yaml new file mode 100644 index 0000000..e2f41a0 --- /dev/null +++ b/examples/clearwater/clearwater-single-existing.yaml @@ -0,0 +1,147 @@ +# 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. + +tosca_definitions_version: tosca_simple_yaml_1_0 + +description: >- + Project Clearwater is an open-source IMS core, developed by Metaswitch Networks and released under + the GNU GPLv3. + +metadata: + template_name: clearwater-single-existing + template_author: ARIA + template_version: '1.0' + aria_version: '0.1.2' + +imports: + - types/clearwater.yaml + - aria-1.0 + +topology_template: + + inputs: + hosts.ssh.user: + description: >- + Existing SSH user. + type: string + hosts.ssh.password: + description: >- + Existing SSH password. + type: string + existing_host.public_address: + description: >- + Existing IP address that can be accessed by ARIA. + type: string + existing_host.private_address: + description: >- + Existing IP address that can be accessed within the service. + type: string + default: { get_input: existing_host.public_address } + existing_host.hostname: + description: >- + The hostname will be changed to this. + type: string + default: aria-clearwater-single + + node_templates: + bono: + type: clearwater.Bono + requirements: + - sip_downstream: clearwater.Sprout + - sip_secure_downstream: clearwater.Sprout + - ralf: clearwater.Ralf + + sprout: + type: clearwater.Sprout + requirements: + - ralf: clearwater.Ralf +# cyclical: see ARIA-327 +# - sip_upstream: clearwater.Bono + + dime: + type: clearwater.Dime + + homestead: + type: clearwater.Homestead + + ralf: + type: clearwater.Ralf + description: >- + Optional, only required if you are using a CCF (Charging Collection Function). + + homer: + type: clearwater.Homer + + vellum: + type: clearwater.Vellum +# requirements: +# cyclical: see ARIA-327 +# - ralf: clearwater.Ralf + + i-cscf: + type: clearwater.I-CSCF + + s-cscf: + type: clearwater.S-CSCF + + ellis: + type: clearwater.Ellis + description: >- + Optional, only required if you want a web frontend. + properties: + provision_numbers_count: 1000 + requirements: + - ralf: clearwater.Ralf + + existing_host: + type: clearwater.Host + attributes: + public_address: { get_input: existing_host.public_address } + private_address: { get_input: existing_host.private_address } + capabilities: + host: + properties: + hostname: { get_input: existing_host.hostname } + ssh.user: { get_input: hosts.ssh.user } + ssh.password: { get_input: hosts.ssh.password } + max_log_directory_size: 50 MiB + reduce_cassandra_mem_usage: true + + smtp: + type: smtp.SMTP + properties: + address: 127.0.0.1 + capabilities: + smtp: + properties: + username: username + password: password + + policies: + configuration: + type: clearwater.Configuration + properties: + zone: example.com + secret: secret + + substitution_mappings: + node_type: ims.nodes.IMS + capabilities: + p-cscf: [ bono, p-cscf ] + i-cscf: [ i-cscf, i-cscf ] + s-cscf: [ s-cscf, s-cscf ] + hss: [ homestead, hss ] + ctf: [ ralf, ctf ] + xdms: [ homer, xdms ] http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/examples/clearwater/scripts/bono/create.sh ---------------------------------------------------------------------- diff --git a/examples/clearwater/scripts/bono/create.sh b/examples/clearwater/scripts/bono/create.sh new file mode 100644 index 0000000..b2a3a68 --- /dev/null +++ b/examples/clearwater/scripts/bono/create.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# 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. + +set -e + +yes | aptdcon --hide-terminal --install bono +yes | aptdcon --hide-terminal --install restund http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/examples/clearwater/scripts/bono/delete.sh ---------------------------------------------------------------------- diff --git a/examples/clearwater/scripts/bono/delete.sh b/examples/clearwater/scripts/bono/delete.sh new file mode 100644 index 0000000..5cae7ef --- /dev/null +++ b/examples/clearwater/scripts/bono/delete.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# 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. http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/examples/clearwater/scripts/dime/create.sh ---------------------------------------------------------------------- diff --git a/examples/clearwater/scripts/dime/create.sh b/examples/clearwater/scripts/dime/create.sh new file mode 100644 index 0000000..9b25876 --- /dev/null +++ b/examples/clearwater/scripts/dime/create.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# 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. + +set -e + +# Installs Homestead and Ralf +yes | aptdcon --hide-terminal --install dime +yes | aptdcon --hide-terminal --install clearwater-prov-tools http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/examples/clearwater/scripts/dime/delete.sh ---------------------------------------------------------------------- diff --git a/examples/clearwater/scripts/dime/delete.sh b/examples/clearwater/scripts/dime/delete.sh new file mode 100644 index 0000000..5cae7ef --- /dev/null +++ b/examples/clearwater/scripts/dime/delete.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# 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. http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/examples/clearwater/scripts/ellis/configure.sh ---------------------------------------------------------------------- diff --git a/examples/clearwater/scripts/ellis/configure.sh b/examples/clearwater/scripts/ellis/configure.sh new file mode 100644 index 0000000..b52cc08 --- /dev/null +++ b/examples/clearwater/scripts/ellis/configure.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# 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. + +set -e + +PROVISION_NUMBERS_START=$(ctx node properties provision_numbers_start) +PROVISION_NUMBERS_COUNT=$(ctx node properties provision_numbers_count) + +if [ "$PROVISION_NUMBERS_COUNT" != 0 ]; then + cd /usr/share/clearwater/ellis + . env/bin/activate + python src/metaswitch/ellis/tools/create_numbers.py \ + --start "$PROVISION_NUMBERS_START" \ + --count "$PROVISION_NUMBERS_COUNT" + deactivate +fi http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/examples/clearwater/scripts/ellis/create.sh ---------------------------------------------------------------------- diff --git a/examples/clearwater/scripts/ellis/create.sh b/examples/clearwater/scripts/ellis/create.sh new file mode 100644 index 0000000..bdd9341 --- /dev/null +++ b/examples/clearwater/scripts/ellis/create.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# 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. + +set -e + +yes | aptdcon --hide-terminal --install ellis http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/examples/clearwater/scripts/ellis/delete.sh ---------------------------------------------------------------------- diff --git a/examples/clearwater/scripts/ellis/delete.sh b/examples/clearwater/scripts/ellis/delete.sh new file mode 100644 index 0000000..5cae7ef --- /dev/null +++ b/examples/clearwater/scripts/ellis/delete.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# 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. http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/examples/clearwater/scripts/homer/create.sh ---------------------------------------------------------------------- diff --git a/examples/clearwater/scripts/homer/create.sh b/examples/clearwater/scripts/homer/create.sh new file mode 100644 index 0000000..5f40960 --- /dev/null +++ b/examples/clearwater/scripts/homer/create.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# 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. + +set -e + +yes | aptdcon --hide-terminal --install homer + +# ARIA fix to avoid warnings by Twisted for missing service_identity library +# (Crest is used by both Homer and Homestead-prov) +cd /usr/share/clearwater/crest +. env/bin/activate +pip install service_identity +deactivate +service homer restart http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/examples/clearwater/scripts/homer/delete.sh ---------------------------------------------------------------------- diff --git a/examples/clearwater/scripts/homer/delete.sh b/examples/clearwater/scripts/homer/delete.sh new file mode 100644 index 0000000..5cae7ef --- /dev/null +++ b/examples/clearwater/scripts/homer/delete.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# 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. http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/examples/clearwater/scripts/homestead/create.sh ---------------------------------------------------------------------- diff --git a/examples/clearwater/scripts/homestead/create.sh b/examples/clearwater/scripts/homestead/create.sh new file mode 100644 index 0000000..d280033 --- /dev/null +++ b/examples/clearwater/scripts/homestead/create.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# 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. + +set -e + +# ARIA fix to avoid warnings by Twisted for missing service_identity library +# (Crest is used by both Homer and Homestead-prov) +cd /usr/share/clearwater/crest +. env/bin/activate +pip install service_identity +deactivate +service homer restart http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/examples/clearwater/scripts/homestead/delete.sh ---------------------------------------------------------------------- diff --git a/examples/clearwater/scripts/homestead/delete.sh b/examples/clearwater/scripts/homestead/delete.sh new file mode 100644 index 0000000..5cae7ef --- /dev/null +++ b/examples/clearwater/scripts/homestead/delete.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# 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. http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/examples/clearwater/scripts/host-base/configure.sh ---------------------------------------------------------------------- diff --git a/examples/clearwater/scripts/host-base/configure.sh b/examples/clearwater/scripts/host-base/configure.sh new file mode 100644 index 0000000..c5b87d9 --- /dev/null +++ b/examples/clearwater/scripts/host-base/configure.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# 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. + +set -e + +if ! type aptdcon > /dev/null; then + # This will allow us to do concurrent installs + apt update + apt install aptdaemon --yes +fi http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/examples/clearwater/scripts/host/configure.sh ---------------------------------------------------------------------- diff --git a/examples/clearwater/scripts/host/configure.sh b/examples/clearwater/scripts/host/configure.sh new file mode 100644 index 0000000..61cb835 --- /dev/null +++ b/examples/clearwater/scripts/host/configure.sh @@ -0,0 +1,183 @@ +#!/bin/bash +# 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. + +set -e + +HOSTNAME=$(ctx node capabilities host properties hostname) + +# Change hostname +OLD_HOSTNAME=$(hostname) +if [ "$OLD_HOSTNAME" != "$HOSTNAME" ]; then + hostname "$HOSTNAME" + echo "$HOSTNAME" > /etc/hostname + sed --in-place --expression "s/127.0.1.1\s\+$OLD_HOSTNAME/127.0.1.1 $HOSTNAME/" /etc/hosts +fi + +ZONE=$(ctx service get_policy_by_type [ clearwater.Configuration ] properties zone) +GEOGRAPHICALLY_REDUNDANT=$(ctx service get_policy_by_type [ clearwater.Configuration ] properties geographically_redundant) +SITE_NAME=$(ctx service get_policy_by_type [ clearwater.Configuration ] properties site_name) +SECRET=$(ctx service get_policy_by_type [ clearwater.Configuration ] properties secret) + +SMTP_HOSTNAME=$(ctx service get_node_by_type [ clearwater.Ellis ] get_outbound_relationship_by_name [ smtp ] target_node properties address) +SMTP_USERNAME=$(ctx service get_node_by_type [ clearwater.Ellis ] get_outbound_relationship_by_name [ smtp ] target_node capabilities smtp properties username) +SMTP_PASSWORD=$(ctx service get_node_by_type [ clearwater.Ellis ] get_outbound_relationship_by_name [ smtp ] target_node capabilities smtp properties password) + +MAX_LOG_DIRECTORY_SIZE=$(ctx node capabilities host properties max_log_directory_size value) +REDUCE_CASSANDRA_MEM_USAGE=$(ctx node capabilities host properties reduce_cassandra_mem_usage) + +PRIVATE_IP=$(ctx node attributes private_address) +PUBLIC_IP=$(ctx node attributes public_address) +PUBLIC_HOSTNAME=$(hostname) +# TODO: comma-separated list of all private IP addresses in group +ETCD_CLUSTER=$PRIVATE_IP + +REPO_FILE=/etc/apt/sources.list.d/clearwater.list +REPO_LINE='deb http://repo.cw-ngv.com/stable binary/' +KEY_URL=http://repo.cw-ngv.com/repo_key + + +# +# Repository +# + +if [ ! -f "$REPO_FILE" ]; then + echo "$REPO_LINE" > "$REPO_FILE" + curl --location "$KEY_URL" | apt-key add - +fi + +apt update + +if ! type aptdcon > /dev/null; then + # This will allow us to do concurrent installs + apt install aptdaemon --yes +fi + +yes | aptdcon --hide-terminal --install clearwater-management + + +# +# DNS +# + +S_CSCF_HOST="$PRIVATE_IP scscf.$PUBLIC_HOSTNAME # ARIA" +grep --quiet --fixed-strings "$S_CSCF_HOST" /etc/hosts || echo "$S_CSCF_HOST" >> /etc/hosts + + +# +# Local configuration +# + +mkdir --parents /etc/clearwater +CONFIG_FILE=/etc/clearwater/local_config +echo "# Created by ARIA on $(date -u)" > "$CONFIG_FILE" + +echo >> "$CONFIG_FILE" +echo "# Local IP configuration" >> "$CONFIG_FILE" +echo "local_ip=$PRIVATE_IP" >> "$CONFIG_FILE" +echo "public_ip=$PUBLIC_IP" >> "$CONFIG_FILE" +echo "public_hostname=$PUBLIC_HOSTNAME" >> "$CONFIG_FILE" +echo "etcd_cluster=$ETCD_CLUSTER" >> "$CONFIG_FILE" + +if [ "$MAX_LOG_DIRECTORY_SIZE" != 0 ]; then + echo >> "$CONFIG_FILE" + echo "max_log_directory_size=$MAX_LOG_DIRECTORY_SIZE" >> "$CONFIG_FILE" +fi + +if [ "$GEOGRAPHICALLY_REDUNDANT" = True ]; then + echo >> "$CONFIG_FILE" + echo "# Geographically redundant" >> "$CONFIG_FILE" + echo "local_site_name=$SITE_NAME" >> "$CONFIG_FILE" + + # On the first Vellum node in the second site, you should set remote_cassandra_seeds to the + # IP address of a Vellum node in the first site. + #echo "remote_cassandra_seeds=" >> "$CONFIG_FILE" +fi + + +# +# Shared configuration +# + +if [ "$GEOGRAPHICALLY_REDUNDANT" = True ]; then + SPROUT_HOSTNAME=sprout.$SITE_NAME.$ZONE + SPROUT_REGISTRATION_STORE=vellum.$SITE_NAME.$ZONE + HS_HOSTNAME=hs.$SITE_NAME.$ZONE:8888 + HS_PROVISIONING_HOSTNAME=hs.$SITE_NAME.$ZONE:8889 + RALF_HOSTNAME=ralf.$SITE_NAME.$ZONE:10888 + RALF_SESSION_STORE=vellum.$ZONE + XDMS_HOSTNAME=homer.$SITE_NAME.$ZONE:7888 + CHRONOS_HOSTNAME=vellum.$SITE_NAME.$ZONE + CASSANDRA_HOSTNAME=vellum.$SITE_NAME.$ZONE +else + VELLUM_IP=$PRIVATE_IP + HOMESTEAD_IP=$PRIVATE_IP + HOMER_IP=$PRIVATE_IP + + SPROUT_HOSTNAME=$PUBLIC_HOSTNAME + SPROUT_REGISTRATION_STORE=$VELLUM_IP + HS_HOSTNAME=$HOMESTEAD_IP:8888 + HS_PROVISIONING_HOSTNAME=$HOMESTEAD_IP:8889 + RALF_HOSTNAME= + RALF_SESSION_STORE= + XDMS_HOSTNAME=$HOMER_IP:7888 + CHRONOS_HOSTNAME= + CASSANDRA_HOSTNAME= +fi + +mkdir --parents /etc/clearwater +CONFIG_FILE=/etc/clearwater/shared_config +echo "# Created by ARIA on $(date -u)" > "$CONFIG_FILE" + +echo >> "$CONFIG_FILE" +echo "# Deployment definitions" >> "$CONFIG_FILE" +echo "home_domain=$ZONE" >> "$CONFIG_FILE" +echo "sprout_hostname=$SPROUT_HOSTNAME" >> "$CONFIG_FILE" +echo "sprout_registration_store=$SPROUT_REGISTRATION_STORE" >> "$CONFIG_FILE" +echo "hs_hostname=$HS_HOSTNAME" >> "$CONFIG_FILE" +echo "hs_provisioning_hostname=$HS_PROVISIONING_HOSTNAME" >> "$CONFIG_FILE" +echo "ralf_hostname=$RALF_HOSTNAME" >> "$CONFIG_FILE" +echo "ralf_session_store=$RALF_SESSION_STORE" >> "$CONFIG_FILE" +echo "xdms_hostname=$XDMS_HOSTNAME" >> "$CONFIG_FILE" +echo "chronos_hostname=$CHRONOS_HOSTNAME" >> "$CONFIG_FILE" +echo "cassandra_hostname=$CASSANDRA_HOSTNAME" >> "$CONFIG_FILE" + +echo >> "$CONFIG_FILE" +echo "# Email server configuration" >> "$CONFIG_FILE" +echo "smtp_smarthost=$SMTP_HOSTNAME" >> "$CONFIG_FILE" +echo "smtp_username=$SMTP_USERNAME" >> "$CONFIG_FILE" +echo "smtp_password=$SMTP_PASSWORD" >> "$CONFIG_FILE" +echo "email_recovery_sender=clearwater@$ZONE" >> "$CONFIG_FILE" + +echo >> "$CONFIG_FILE" +echo "# I-CSCF/S-CSCF configuration (used by Bono to proxy to Sprout)" >> "$CONFIG_FILE" +echo "upstream_hostname=scscf.$HOSTNAME" >> "$CONFIG_FILE" + +echo >> "$CONFIG_FILE" +echo "# Keys" >> "$CONFIG_FILE" +echo "signup_key=$SECRET" >> "$CONFIG_FILE" +echo "turn_workaround=$SECRET" >> "$CONFIG_FILE" +echo "ellis_api_key=$SECRET" >> "$CONFIG_FILE" +echo "ellis_cookie_key=$SECRET" >> "$CONFIG_FILE" + +if [ "$REDUCE_CASSANDRA_MEM_USAGE" = True ]; then + echo >> "$CONFIG_FILE" + echo "# $REDUCE_CASSANDRA_MEM_USAGE" >> "$CONFIG_FILE" + echo "reduce_cassandra_mem_usage=Y" >> "$CONFIG_FILE" +fi + +# Copy to other hosts in etcd group +#yes | aptdcon --hide-terminal --install clearwater-config-manager +#cw-upload_shared_config http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/examples/clearwater/scripts/live-test/create.sh ---------------------------------------------------------------------- diff --git a/examples/clearwater/scripts/live-test/create.sh b/examples/clearwater/scripts/live-test/create.sh new file mode 100644 index 0000000..f28bff3 --- /dev/null +++ b/examples/clearwater/scripts/live-test/create.sh @@ -0,0 +1,69 @@ +#!/bin/bash +# 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. + +set -e + +LIB=/opt/clearwater-live-test +COMMAND=/usr/bin/clearwater-live-test +RUBY_VERSION=1.9.3 +RVM=/usr/local/rvm +QUAFF_OLD_URL=g...@github.com:metaswitch/quaff.git +QUAFF_NEW_URL=https://github.com/Metaswitch/quaff.git + +# Build requirements +yes | aptdcon --hide-terminal --install build-essential +yes | aptdcon --hide-terminal --install bundler +yes | aptdcon --hide-terminal --install git + +# Required by nokogiri Ruby gem +yes | aptdcon --hide-terminal --install zlib1g-dev + +# Install Ruby enVironment Manager +if [ ! -d "$RVM" ]; then + # Install + curl --location https://get.rvm.io | bash -s stable +fi + +# Install Ruby using RVM +. "$RVM/scripts/rvm" +rvm autolibs enable +rvm install "$RUBY_VERSION" +rvm use "$RUBY_VERSION@global" + +# Install Clearwater Live Test +if [ ! -d "$LIB" ]; then + mkdir --parents /opt + cd /opt + git clone --depth 1 https://github.com/Metaswitch/clearwater-live-test.git + cd clearwater-live-test + chmod a+rw -R . + + # Note: we must fix the URLs for Quaff + sed --in-place --expression "s,$QUAFF_OLD_URL,$QUAFF_NEW_URL,g" Gemfile Gemfile.lock + + # Install required Ruby gems + bundle install +fi + +# Create command +echo "#!/bin/bash" > "$COMMAND" +echo ". \"$RVM/scripts/rvm\"" >> "$COMMAND" +echo "rvm use \"$RUBY_VERSION@global\"" >> "$COMMAND" +echo "cd \"$LIB\"" >> "$COMMAND" +echo "rake \"\$@\"" >> "$COMMAND" +chmod a+x "$COMMAND" + +# clearwater-live-test test[example.com] SIGNUP_CODE=secret PROXY=192.168.1.171 ELLIS=192.168.1.171 http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/examples/clearwater/scripts/live-test/delete.sh ---------------------------------------------------------------------- diff --git a/examples/clearwater/scripts/live-test/delete.sh b/examples/clearwater/scripts/live-test/delete.sh new file mode 100644 index 0000000..079627c --- /dev/null +++ b/examples/clearwater/scripts/live-test/delete.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# 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. + +set -e + +LIB=/opt/clearwater-live-test +COMMAND=/usr/bin/clearwater-live-test + +rm --recursive --force "$LIB" +rm --force "$COMMAND" http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/examples/clearwater/scripts/memento/create.sh ---------------------------------------------------------------------- diff --git a/examples/clearwater/scripts/memento/create.sh b/examples/clearwater/scripts/memento/create.sh new file mode 100644 index 0000000..91ffd9f --- /dev/null +++ b/examples/clearwater/scripts/memento/create.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# 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. + +set -e + +yes | aptdcon --hide-terminal --install memento-as +yes | aptdcon --hide-terminal --install memento-nginx http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/examples/clearwater/scripts/memento/delete.sh ---------------------------------------------------------------------- diff --git a/examples/clearwater/scripts/memento/delete.sh b/examples/clearwater/scripts/memento/delete.sh new file mode 100644 index 0000000..5cae7ef --- /dev/null +++ b/examples/clearwater/scripts/memento/delete.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# 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. http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/examples/clearwater/scripts/ralf/create.sh ---------------------------------------------------------------------- diff --git a/examples/clearwater/scripts/ralf/create.sh b/examples/clearwater/scripts/ralf/create.sh new file mode 100644 index 0000000..5cae7ef --- /dev/null +++ b/examples/clearwater/scripts/ralf/create.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# 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. http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/examples/clearwater/scripts/ralf/delete.sh ---------------------------------------------------------------------- diff --git a/examples/clearwater/scripts/ralf/delete.sh b/examples/clearwater/scripts/ralf/delete.sh new file mode 100644 index 0000000..5cae7ef --- /dev/null +++ b/examples/clearwater/scripts/ralf/delete.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# 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. http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/examples/clearwater/scripts/sprout/create.sh ---------------------------------------------------------------------- diff --git a/examples/clearwater/scripts/sprout/create.sh b/examples/clearwater/scripts/sprout/create.sh new file mode 100644 index 0000000..a9946b9 --- /dev/null +++ b/examples/clearwater/scripts/sprout/create.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# 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. + +set -e + +yes | aptdcon --hide-terminal --install sprout http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/examples/clearwater/scripts/sprout/delete.sh ---------------------------------------------------------------------- diff --git a/examples/clearwater/scripts/sprout/delete.sh b/examples/clearwater/scripts/sprout/delete.sh new file mode 100644 index 0000000..5cae7ef --- /dev/null +++ b/examples/clearwater/scripts/sprout/delete.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# 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. http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/examples/clearwater/scripts/vellum/create.sh ---------------------------------------------------------------------- diff --git a/examples/clearwater/scripts/vellum/create.sh b/examples/clearwater/scripts/vellum/create.sh new file mode 100644 index 0000000..1d7b2db --- /dev/null +++ b/examples/clearwater/scripts/vellum/create.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# 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. + +set -e + +yes | aptdcon --hide-terminal --install vellum + +# Memento +# TODO: see if there is a Memento node +#yes | aptdcon --hide-terminal --install memento-cassandra http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/examples/clearwater/scripts/vellum/delete.sh ---------------------------------------------------------------------- diff --git a/examples/clearwater/scripts/vellum/delete.sh b/examples/clearwater/scripts/vellum/delete.sh new file mode 100644 index 0000000..5cae7ef --- /dev/null +++ b/examples/clearwater/scripts/vellum/delete.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# 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. http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/examples/clearwater/types/cassandra.yaml ---------------------------------------------------------------------- diff --git a/examples/clearwater/types/cassandra.yaml b/examples/clearwater/types/cassandra.yaml new file mode 100644 index 0000000..cbb3a5d --- /dev/null +++ b/examples/clearwater/types/cassandra.yaml @@ -0,0 +1,30 @@ +# 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. + +capability_types: + + cassandra.Endpoint: + derived_from: tosca.capabilities.Endpoint.Database + properties: + port: # override + type: tosca.datatypes.network.PortDef + default: 7000 + + cassandra.Endpoint.Thrift: + derived_from: tosca.capabilities.Endpoint.Database + properties: + port: # override + type: tosca.datatypes.network.PortDef + default: 9160 http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7679bc1f/examples/clearwater/types/clearwater.yaml ---------------------------------------------------------------------- diff --git a/examples/clearwater/types/clearwater.yaml b/examples/clearwater/types/clearwater.yaml new file mode 100644 index 0000000..1021262 --- /dev/null +++ b/examples/clearwater/types/clearwater.yaml @@ -0,0 +1,728 @@ +# 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. + +imports: + - ims.yaml + - smtp.yaml + - cassandra.yaml + +dsl_definitions: + + clearwater_operation_dependencies: &CLEARWATER_OPERATION_DEPENDENCIES + - "ssh.user > { get_property: [ HOST, host, ssh.user ] }" + - "ssh.password > { get_property: [ HOST, host, ssh.password ] }" + - "ssh.address > { get_attribute: [ HOST, public_address ] }" + - "ssh.use_sudo > true" + +policy_types: + + clearwater.Configuration: + derived_from: tosca.policies.Root + properties: + zone: + description: >- + The domain name for SIP addresses, for example if its "example.com" then a SIP address + could be "6505550...@example.com". + type: string + geographically_redundant: + description: >- + Enable a geographically redundant deployment. + + See: http://clearwater.readthedocs.io/en/stable/Geographic_redundancy.html + type: boolean + default: false + site_name: + description: >- + Used by geographically redundant deployments. + type: string + required: false + secret: + description: >- + Used for registration via Ellis. + type: string + +capability_types: + + clearwater.Container: + description: >- + Clearwater container capability. + derived_from: tosca.capabilities.Container + properties: + hostname: + type: string + ssh.user: + type: string + ssh.password: + type: string + max_log_directory_size: + type: scalar-unit.size + default: 0 B # 0 means no max size + reduce_cassandra_mem_usage: + type: boolean + default: false + + # http://clearwater.readthedocs.io/en/stable/Clearwater_IP_Port_Usage.html + + # SIP endpoints + + clearwater.Endpoint.SIP.Upstream: + derived_from: tosca.capabilities.Endpoint + properties: + protocol: # override + type: string + default: sip + port: # override + type: tosca.datatypes.network.PortDef + default: 5052 + + clearwater.Endpoint.SIP.Upstream.Secure: + derived_from: tosca.capabilities.Endpoint + properties: + protocol: # override + type: string + default: sip + port: # override + type: tosca.datatypes.network.PortDef + default: 5054 + secure: # override + type: boolean + default: true + + clearwater.Endpoint.SIP.Proxy: + derived_from: tosca.capabilities.Endpoint + properties: + protocol: # override + type: string + default: sip + port: # override + type: tosca.datatypes.network.PortDef + default: 5058 + + clearwater.Endpoint.SIP.Public: + derived_from: tosca.capabilities.Endpoint.Public + properties: + protocol: # override + type: string + default: sip + port: # override + type: tosca.datatypes.network.PortDef + default: 5060 + + clearwater.Endpoint.SIP.Public.Secure: + derived_from: tosca.capabilities.Endpoint.Public + properties: + protocol: # override + type: string + default: sip + port: # override + type: tosca.datatypes.network.PortDef + default: 5062 + secure: # override + type: boolean + default: true + + # STUN endpoints + + clearwater.Endpoint.STUN: + derived_from: tosca.capabilities.Endpoint + properties: + protocol: # override + type: string + default: stun + port: # override + type: tosca.datatypes.network.PortDef + default: 3478 + + # Diameter endpoints + + clearwater.Endpoint.Diameter.HSS: + description: >- + In shared_config: hs_listen_port + derived_from: tosca.capabilities.Endpoint + properties: + protocol: # override + type: string + default: diameter + port: # override + type: tosca.datatypes.network.PortDef + default: 3868 + + clearwater.Endpoint.Diameter.CTF: + description: >- + In shared_config: ralf_listen_port + derived_from: tosca.capabilities.Endpoint + properties: + protocol: # override + type: string + default: diameter + port: # override + type: tosca.datatypes.network.PortDef + default: 3869 + + # Management endpoints + + clearwater.Endpoint.Management.Homer: + derived_from: ims.interfaces.HTTP + properties: + port: # override + type: tosca.datatypes.network.PortDef + default: 7888 + + clearwater.Endpoint.Management.Homestead: + derived_from: ims.interfaces.HTTP + properties: + port: # override + type: tosca.datatypes.network.PortDef + default: 8888 + + clearwater.Endpoint.Management.Homestead.Provisioning: + description: >- + In shared_config: homestead_provisioning_port + derived_from: ims.interfaces.HTTP + properties: + port: # override + type: tosca.datatypes.network.PortDef + default: 8889 + + clearwater.Endpoint.Management.Sprout: + derived_from: ims.interfaces.HTTP + properties: + port: # override + type: tosca.datatypes.network.PortDef + default: 9886 + + clearwater.Endpoint.Management.Ralf: + derived_from: ims.interfaces.HTTP + properties: + port: # override + type: tosca.datatypes.network.PortDef + default: 9888 # note: some documentation shows 10888 + + # Web endpoints + + clearwater.Endpoint.Public.Web: + derived_from: tosca.capabilities.Endpoint.Public + properties: + protocol: # override + type: string + default: http + port: # override + type: tosca.datatypes.network.PortDef + default: 80 + url_path: # override + type: string + default: / + + clearwater.Endpoint.Public.Web.Secure: + derived_from: tosca.capabilities.Endpoint.Public + properties: + protocol: # override + type: string + default: https + port: # override + type: tosca.datatypes.network.PortDef + default: 443 + secure: # override + type: boolean + default: true + url_path: # override + type: string + default: / + + # Other endpoints + + clearwater.Endpoint.Chronos: + derived_from: tosca.capabilities.Endpoint + properties: + port: # override + type: tosca.datatypes.network.PortDef + default: 7253 + + clearwater.Endpoint.Memcached: + derived_from: tosca.capabilities.Endpoint + properties: + port: # override + type: tosca.datatypes.network.PortDef + default: 11211 + + clearwater.Endpoint.Astaire: + derived_from: tosca.capabilities.Endpoint + properties: + port: # override + type: tosca.datatypes.network.PortDef + default: 11311 + +data_types: + + clearwater.Number: + derived_from: string + constraints: + - pattern: '^\d{10}$' + +node_types: + + # http://clearwater.readthedocs.io/en/stable/Clearwater_Architecture.html + + clearwater.SoftwareComponent: + description: >- + Clearwater software components must be installed in a Clearwater-capable compute node. + derived_from: tosca.nodes.SoftwareComponent + requirements: + - host: # override + capability: clearwater.Container + relationship: tosca.relationships.HostedOn + + clearwater.Bono: + description: >- + Clearwater edge proxy. + + The Bono nodes form a horizontally scalable SIP edge proxy providing both a SIP IMS Gm + compliant interface and a WebRTC interface to clients. Client connections are load balanced + across the nodes. The Bono node provides the anchor point for the client's connection to the + Clearwater system, including support for various NAT traversal mechanisms. A client is + therefore anchored to a particular Bono node for the duration of its registration, but can + move to another Bono node if the connection or client fails. + + Clients can connect to Bono using SIP/UDP or SIP/TCP. Bono supports any WebRTC client that + performs call setup signaling using SIP over WebSocket. + + Alternatively, Clearwater can be deployed with a third party P-CSCF or Session Border + Controller implementing P-CSCF. In this case Bono nodes are not required. + derived_from: clearwater.SoftwareComponent + capabilities: + p-cscf: ims.functions.P-CSCF + gm: ims.interfaces.Gm + sip_endpoint: clearwater.Endpoint.SIP.Public + sip_secure_endpoint: clearwater.Endpoint.SIP.Public.Secure + sip_proxy: clearwater.Endpoint.SIP.Proxy # open to Sprout + stun_endoint: clearwater.Endpoint.STUN + requirements: + - sip_downstream: + capability: clearwater.Endpoint.SIP.Upstream + occurrences: [ 0, UNBOUNDED ] + - sip_secure_downstream: + capability: clearwater.Endpoint.SIP.Upstream.Secure + occurrences: [ 0, UNBOUNDED ] + - ralf: # for billable events + capability: clearwater.Endpoint.Management.Ralf + occurrences: [ 0, 1 ] + interfaces: + Standard: + type: tosca.interfaces.node.lifecycle.Standard + create: + implementation: + primary: scripts/bono/create.sh + dependencies: *CLEARWATER_OPERATION_DEPENDENCIES + delete: + implementation: + primary: scripts/bono/delete.sh + dependencies: *CLEARWATER_OPERATION_DEPENDENCIES + + clearwater.Sprout: + description: >- + Clearwater SIP router. + + The Sprout nodes act as a horizontally scalable, combined SIP registrar and authoritative + routing proxy, and handle client authentication and the ISC interface to application servers. + The Sprout nodes also contain the in-built MMTEL application server. SIP transactions are load + balanced across the Sprout cluster, so there is no long-lived association between a client and + a particular Sprout node. Sprout does not store any long-lived data itself and instead uses + web service interfaces to Homestead and Homer to retrieve HSS configuration such as + authentication data/user profiles and MMTEL service settings APIs to Vellum for storing + subscriber registration data and for running timers. + + Sprout is where the bulk of the I-CSCF and S-CSCF function resides, with the remainder + provided by Dime (and backed by the long-lived data stores on Vellum). + derived_from: clearwater.SoftwareComponent + capabilities: + sip_endpoint: clearwater.Endpoint.SIP.Upstream # open to Bono + sip_secure_endpoint: clearwater.Endpoint.SIP.Upstream.Secure # open to Bono + management_endpoint: clearwater.Endpoint.Management.Sprout + memento: + type: tosca.capabilities.Container + valid_source_types: [ clearwater.Memento ] + requirements: +# cyclical: see ARIA-327 +# - sip_upstream: +# capability: clearwater.Endpoint.SIP.Proxy +# occurrences: [ 0, UNBOUNDED ] + - homer: # for subscriber profiles + capability: clearwater.Endpoint.Management.Homer + - ralf: # for billable events + capability: clearwater.Endpoint.Management.Ralf + occurrences: [ 0, 1 ] + - chronos: + capability: clearwater.Endpoint.Chronos + node: clearwater.Vellum + - astaire: + capability: clearwater.Endpoint.Astaire + node: clearwater.Vellum + interfaces: + Standard: + type: tosca.interfaces.node.lifecycle.Standard + create: + implementation: + primary: scripts/sprout/create.sh + dependencies: *CLEARWATER_OPERATION_DEPENDENCIES + delete: + implementation: + primary: scripts/sprout/delete.sh + dependencies: *CLEARWATER_OPERATION_DEPENDENCIES + + clearwater.Memento: + derived_from: tosca.nodes.Root + capabilities: + sip-as: ims.functions.SIP-AS + web_secure_endpoint: clearwater.Endpoint.Public.Web.Secure + requirements: + - host: + capability: tosca.capabilities.Container + node: clearwater.Sprout + - cassandra_thrift: + capability: cassandra.Endpoint.Thrift + node: clearwater.Vellum + interfaces: + Standard: + type: tosca.interfaces.node.lifecycle.Standard + create: + implementation: + primary: scripts/memento/create.sh + dependencies: *CLEARWATER_OPERATION_DEPENDENCIES + delete: + implementation: + primary: scripts/memento/delete.sh + dependencies: *CLEARWATER_OPERATION_DEPENDENCIES + + clearwater.Dime: + description: >- + Clearwater Diameter gateway. + + Dime nodes run Clearwater's Homestead and Ralf components. + derived_from: clearwater.SoftwareComponent + capabilities: + host: + type: tosca.capabilities.Container + valid_source_types: [ clearwater.DimeSoftwareComponent ] + interfaces: + Standard: + type: tosca.interfaces.node.lifecycle.Standard + create: + implementation: + primary: scripts/dime/create.sh + dependencies: *CLEARWATER_OPERATION_DEPENDENCIES + delete: + implementation: + primary: scripts/dime/delete.sh + dependencies: *CLEARWATER_OPERATION_DEPENDENCIES + + clearwater.DimeSoftwareComponent: + description: >- + Base type for Dime software components. + derived_from: clearwater.SoftwareComponent + requirements: + - host: # override + capability: tosca.capabilities.Container + node: clearwater.Dime + + clearwater.Homestead: + description: >- + Clearwater HSS cache. + + Homestead provides a web services interface to Sprout for retrieving authentication + credentials and user profile information. It can either master the data (in which case it + exposes a web services provisioning interface) or can pull the data from an IMS compliant HSS + over the Cx interface. The Homestead nodes themselves are stateless - the mastered / cached + subscriber data is all stored on Vellum (via Cassandra's Thrift interface). + + In the IMS architecture, the HSS mirror function is considered to be part of the I-CSCF and + S-CSCF components, so in Clearwater I-CSCF and S-CSCF function is implemented with a + combination of Sprout and Dime clusters. + derived_from: clearwater.DimeSoftwareComponent + capabilities: + hss: ims.functions.HSS + cx: ims.interfaces.Cx + diameter_endpoint: clearwater.Endpoint.Diameter.HSS + management_endpoint: clearwater.Endpoint.Management.Homestead # open to Ellis + provisioning_management_endpoint: clearwater.Endpoint.Management.Homestead.Provisioning # open to Ellis + requirements: + - cassandra_thrift: + capability: cassandra.Endpoint.Thrift + node: clearwater.Vellum + interfaces: + Standard: + type: tosca.interfaces.node.lifecycle.Standard + create: + implementation: + primary: scripts/homestead/create.sh + dependencies: *CLEARWATER_OPERATION_DEPENDENCIES + delete: + implementation: + primary: scripts/homestead/delete.sh + dependencies: *CLEARWATER_OPERATION_DEPENDENCIES + + clearwater.Ralf: + description: >- + Clearwater CTF. + + Ralf provides an HTTP API that both Bono and Sprout can use to report billable events that + should be passed to the CDF (Charging Data Function) over the Rf billing interface. Ralf is + stateless, using Vellum to maintain the long lived session state and run the timers necessary + to enable it to conform to the Rf protocol. + derived_from: clearwater.DimeSoftwareComponent + capabilities: + ctf: ims.functions.CTF + rf: ims.interfaces.Rf + diameter_endpoint: clearwater.Endpoint.Diameter.CTF + management_endpoint: clearwater.Endpoint.Management.Ralf # open to Sprout, Bono, Vellum + requirements: + - chronos: + capability: clearwater.Endpoint.Chronos + node: clearwater.Vellum + - astaire: + capability: clearwater.Endpoint.Astaire + node: clearwater.Vellum + interfaces: + Standard: + type: tosca.interfaces.node.lifecycle.Standard + create: + implementation: + primary: scripts/ralf/create.sh + dependencies: *CLEARWATER_OPERATION_DEPENDENCIES + delete: + implementation: + primary: scripts/ralf/delete.sh + dependencies: *CLEARWATER_OPERATION_DEPENDENCIES + + clearwater.Vellum: + description: >- + Clearwater state store. + + Vellum is used to maintain all long-lived state in the deployment. It does this by running a + number of cloud optimized, distributed storage clusters. + + - Cassandra. Cassandra is used by Homestead to store authentication credentials and profile + information, and is used by Homer to store MMTEL service settings. Vellum exposes Cassandra's + Thrift API. + + - etcd. etcd is used by Vellum itself to share clustering information between Vellum nodes and + by other nodes in the deployment for shared configuration. + + - Chronos. Chronos is a distributed, redundant, reliable timer service developed by + Clearwater. It is used by Sprout and Ralf nodes to enable timers to be run (e.g. for SIP + Registration expiry) without pinning operations to a specific node (one node can set the timer + and another act on it when it pops). Chronos is accessed via an HTTP API. + + - Memcached / Astaire. Vellum also runs a Memcached cluster fronted by Astaire. Astaire is a + service developed by Clearwater that enabled more rapid scale up and scale down of memcached + clusters. This cluster is used by Sprout and Ralf for storing registration and session state. + derived_from: clearwater.SoftwareComponent + capabilities: + cassandra_endpoint: cassandra.Endpoint # open to other Vellum + cassandra_thrift_endpoint: cassandra.Endpoint.Thrift # open to Homer, Dime (Homestead), Sprout (Memento) + chronos_endpoint: clearwater.Endpoint.Chronos # open to other Vellum, Sprout, Dime (Ralf) + memcached_endpoint: clearwater.Endpoint.Memcached # open to other Vellum + astaire_endpoint: clearwater.Endpoint.Astaire # open to Sprout, Dime (Ralf) +# cyclical: see ARIA-327 +# requirements: +# - ralf: +# capability: clearwater.Endpoint.Management.Ralf +# occurrences: [ 0, 1 ] + interfaces: + Standard: + type: tosca.interfaces.node.lifecycle.Standard + create: + implementation: + primary: scripts/vellum/create.sh + dependencies: *CLEARWATER_OPERATION_DEPENDENCIES + delete: + implementation: + primary: scripts/vellum/delete.sh + dependencies: *CLEARWATER_OPERATION_DEPENDENCIES + + clearwater.Homer: + description: >- + Clearwater XDMS. + + Homer is a standard XDMS used to store MMTEL service settings documents for each user of the + system. Documents are created, read, updated and deleted using a standard XCAP interface. As + with Homestead, the Homer nodes use Vellum as the data store for all long lived data. + derived_from: clearwater.SoftwareComponent + capabilities: + xdms: ims.functions.XDMS + management_endpoint: clearwater.Endpoint.Management.Homer # open to Sprout, Ellis + requirements: + - cassandra_thrift: + capability: cassandra.Endpoint.Thrift + node: clearwater.Vellum + interfaces: + Standard: + type: tosca.interfaces.node.lifecycle.Standard + create: + implementation: + primary: scripts/homer/create.sh + dependencies: *CLEARWATER_OPERATION_DEPENDENCIES + delete: + implementation: + primary: scripts/homer/delete.sh + dependencies: *CLEARWATER_OPERATION_DEPENDENCIES + + clearwater.Ellis: + description: >- + Ellis is a sample provisioning portal providing self sign-up, password management, line + management and control of MMTEL service settings. It is not intended to be a part of + production Clearwater deployments (it is not easy to horizontally scale because of the MySQL + underpinnings for one thing) but to make the system easy to use out of the box. + derived_from: clearwater.SoftwareComponent + properties: + provision_numbers_start: + type: clearwater.Number + default: '6505550000' + provision_numbers_count: + type: integer + default: 0 # 0 means do not provision numbers + constraints: + - greater_or_equal: 0 + capabilities: + web_endpoint: clearwater.Endpoint.Public.Web + web_secure_endpoint: clearwater.Endpoint.Public.Web.Secure + requirements: + - homer: # for subscriber profiles + capability: clearwater.Endpoint.Management.Homer + - homestead: # for subscriber authentication + capability: clearwater.Endpoint.Management.Homestead + - homestead_provisioning: + capability: clearwater.Endpoint.Management.Homestead.Provisioning + - ralf: # TODO: really? + capability: clearwater.Endpoint.Management.Ralf + occurrences: [ 0, 1 ] + - smtp: + capability: smtp.SMTP + interfaces: + Standard: + type: tosca.interfaces.node.lifecycle.Standard + create: + implementation: + primary: scripts/ellis/create.sh + dependencies: *CLEARWATER_OPERATION_DEPENDENCIES + configure: + implementation: + primary: scripts/ellis/configure.sh + dependencies: *CLEARWATER_OPERATION_DEPENDENCIES + delete: + implementation: + primary: scripts/ellis/delete.sh + dependencies: *CLEARWATER_OPERATION_DEPENDENCIES + + clearwater.I-CSCF: + description: >- + Clearwater I-CSCF. + + Logical node encompassing Sprout and Homestead. Required only if you need to expose the I-CSCF + function. + derived_from: tosca.nodes.Root + capabilities: + i-cscf: ims.functions.I-CSCF + requirements: + - sprout: + capability: tosca.capabilities.Node + node: clearwater.Sprout + - homestead: + capability: tosca.capabilities.Node + node: clearwater.Homestead + + clearwater.S-CSCF: + description: >- + Clearwater S-CSCF. + + Logical node encompassing Sprout and Homestead. Required only if you need to expose the S-CSCF + function. + derived_from: tosca.nodes.Root + capabilities: + s-cscf: ims.functions.S-CSCF + requirements: + - sprout: + capability: tosca.capabilities.Node + node: clearwater.Sprout + - homestead: + capability: tosca.capabilities.Node + node: clearwater.Homestead + + clearwater.LiveTest: + derived_from: tosca.nodes.SoftwareComponent + interfaces: + Standard: + type: tosca.interfaces.node.lifecycle.Standard + create: + implementation: + primary: scripts/live-test/create.sh + dependencies: *CLEARWATER_OPERATION_DEPENDENCIES + delete: + implementation: + primary: scripts/live-test/delete.sh + dependencies: *CLEARWATER_OPERATION_DEPENDENCIES + + clearwater.HostBase: + derived_from: tosca.nodes.Compute + interfaces: + Standard: + type: tosca.interfaces.node.lifecycle.Standard + configure: + implementation: + primary: scripts/host-base/configure.sh + dependencies: *CLEARWATER_OPERATION_DEPENDENCIES + capabilities: + host: # override + type: clearwater.Container + valid_source_types: [ tosca.nodes.SoftwareComponent ] + os: # override + type: tosca.capabilities.OperatingSystem + properties: + architecture: + type: string + default: x86_64 + type: + type: string + default: linux + distribution: + type: string + default: ubuntu + version: + type: version + default: 14.04 + + clearwater.Host: + description: >- + Default Clearwater host. + + Note that any node can function as a Clearwater host as long as it has a clearwater.Container + capability. + derived_from: clearwater.HostBase + capabilities: + host: # override + type: clearwater.Container + valid_source_types: [ tosca.nodes.SoftwareComponent ] + properties: + mem_size: + type: scalar-unit.size + constraints: + - greater_or_equal: 0 MB + default: 4 GB # will run out of memory with less than this + interfaces: + Standard: + type: tosca.interfaces.node.lifecycle.Standard + configure: + implementation: + primary: scripts/host/configure.sh + dependencies: *CLEARWATER_OPERATION_DEPENDENCIES