Commit 66eecd36 authored by Spiros Koulouzis's avatar Spiros Koulouzis

renamed Orchestrator type

parent c545cb6e
......@@ -28,16 +28,17 @@ topology_template:
file: alogo53/ws-pema-lifewatch
repository: docker_hub
policies:
- location:
type: tosca.policies.ARTICONF.Placement.Requirement.Provider
targets: [ ws-pema-lifewatch ]
properties:
accepted_providers:
- ExoGENI
- docker_orchestrator:
type: tosca.policies.ARTICONF.Requirement.docker.Orchestrator
targets: [ ws-pema-lifewatch ]
properties:
accepted_orchestrator_types:
- tosca.nodes.ARTICONF.docker.Orchestrator.Kubernetes
#policies:
#- location:
#type: tosca.policies.ARTICONF.Requirement.Provider
#targets: [ ws-pema-lifewatch ]
#properties:
#accepted_providers:
#- ExoGENI
#- orchestrator:
#type: tosca.policies.ARTICONF.Requirement.docker.Orchestrator
#targets: [ ws-pema-lifewatch ]
#properties:
#accepted_orchestrator_types:
#- tosca.nodes.ARTICONF.docker.Orchestrator.Kubernetes
......@@ -33,7 +33,7 @@ node_types:
- host:
capability: tosca.capabilities.ARTICONF.docker.Orchestrator
node: tosca.nodes.ARTICONF.docker.Orchestrator
relationship: tosca.relationships.HostedOn
relationship: tosca.relationships.HostedOn
tosca.nodes.ARTICONF.docker.Orchestrator:
derived_from: tosca.nodes.ARTICONF.Root
......@@ -84,13 +84,13 @@ node_types:
type: tosca.interfaces.ARTICONF.Kubernetes
install:
inputs:
playbook: https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/ansible_playbooks/install_k8s.yml
playbook: https://raw.githubusercontent.com/skoulouzis/CONF/develop/ansible_playbooks/install_k8s.yml
create:
inputs:
playbook: https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/ansible_playbooks/create_k8s.yml
playbook: https://raw.githubusercontent.com/skoulouzis/CONF/develop/ansible_playbooks/create_k8s.yml
configure:
inputs:
playbook: https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/ansible_playbooks/dashboard.yaml
playbook: https://raw.githubusercontent.com/skoulouzis/CONF/develop/ansible_playbooks/dashboard.yaml
tosca.nodes.ARTICONF.docker.Orchestrator.Swarm:
......
......@@ -179,6 +179,9 @@ class Planner:
def find_best_node_for_requirements(self, all_requirements):
"""Returns the 'best' node for a set of requirements. Here we count the number of requiremets that the node
can cover and return the one which covers the most """
# Check if we have a preference from policies
matching_nodes = {}
number_of_matching_requirement = {}
# Loop requirements to find nodes per requirement
......
......@@ -19,7 +19,7 @@ class SimpleAnalyzer(SpecificationAnalyzer):
return_nodes = []
# nodes_with_occurrences_in_requirements = tosca_util.get_nodes_with_occurrences_in_requirements(
# self.tosca_template.nodetemplates)
orchestrator_nodes = tosca_helper.get_nodes_by_type('tosca.nodes.ARTICONF.Orchestrator',
orchestrator_nodes = tosca_helper.get_nodes_by_type('tosca.nodes.ARTICONF.docker.Orchestrator',
self.tosca_template.nodetemplates, self.all_node_types,
self.all_custom_def)
......@@ -115,7 +115,7 @@ class SimpleAnalyzer(SpecificationAnalyzer):
logging.info('Setting properties for: ' + str(affected_node.type))
# ancestors_types = tosca_helper.get_all_ancestors_types(affected_node, self.all_node_types, self.all_custom_def)
# if 'tosca.nodes.ARTICONF.Orchestrator' in ancestors_types:
# if 'tosca.nodes.ARTICONF.docker.Orchestrator' in ancestors_types:
# logging.info('Do Something')
ancestors_properties = tosca_helper.get_all_ancestors_properties(affected_node, self.all_node_types,
self.all_custom_def)
......
......@@ -67,8 +67,9 @@ class MyTestCase(unittest.TestCase):
test_tosca_template = test_planner.set_infrastructure_specifications()
template_dict = tosca_helper.get_tosca_template_2_topology_template_dictionary(test_tosca_template)
logger.info("template ----: \n" + yaml.dump(template_dict))
ToscaTemplate(yaml_dict_tpl=copy.deepcopy(template_dict))
print(yaml.dump(template_dict))
ToscaTemplate(yaml_dict_tpl=copy.deepcopy(template_dict))
test_response = {'toscaTemplate': template_dict}
response = {'toscaTemplate': template_dict}
......
......@@ -121,8 +121,8 @@ def node_type_2_node_template(node_type, all_custom_def):
node_type[next(iter(node_type))].pop('type')
node_template = NodeTemplate(name, node_template_dict, node_type)
# For some reason the tosca.nodes.ARTICONF.Orchestrator doesn't have all definitions so we need to add them
# manually. We get 'toscaparser.common.exception.InvalidTypeError: Type "tosca.nodes.ARTICONF.Orchestrator"
# For some reason the tosca.nodes.ARTICONF.docker.Orchestrator doesn't have all definitions so we need to add them
# manually. We get 'toscaparser.common.exception.InvalidTypeError: Type "tosca.nodes.ARTICONF.docker.Orchestrator"
# is not a valid type.'
if len(node_template.custom_def) < len(all_custom_def):
for def_key in all_custom_def:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment