Commit c545cb6e authored by Spiros Koulouzis's avatar Spiros Koulouzis

added docker Orchestrator requirement

parent b11f9e1e
description: TOSCA example description: TOSCA example
imports: imports:
- nodes: https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/nodes.yaml - nodes: https://raw.githubusercontent.com/skoulouzis/CONF/develop/TOSCA/types/nodes.yaml
- data: https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/TOSCA/types/data.yml - data: https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/TOSCA/types/data.yml
- capabilities: https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/capabilities.yaml - capabilities: https://raw.githubusercontent.com/skoulouzis/CONF/develop/TOSCA/types/capabilities.yaml
- policies: https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/policies.yaml - policies: https://raw.githubusercontent.com/skoulouzis/CONF/develop/TOSCA/types/policies.yaml
- interfaces: https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/interfaces.yml - interfaces: https://raw.githubusercontent.com/skoulouzis/CONF/develop/TOSCA/types/interfaces.yml
topology_template: topology_template:
node_templates: node_templates:
compute: compute:
......
...@@ -141,8 +141,8 @@ topology_template: ...@@ -141,8 +141,8 @@ topology_template:
type: "tosca.policies.ARTICONF.FaultTolerance" type: "tosca.policies.ARTICONF.FaultTolerance"
description: "TOSCA example" description: "TOSCA example"
imports: imports:
- nodes: "https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/nodes.yaml" - nodes: https://raw.githubusercontent.com/skoulouzis/CONF/develop/TOSCA/types/nodes.yaml
- data: "https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/TOSCA/types/data.yml" - data: https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/TOSCA/types/data.yml
- capabilities: "https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/capabilities.yaml" - capabilities: https://raw.githubusercontent.com/skoulouzis/CONF/develop/TOSCA/types/capabilities.yaml
- policies: "https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/policies.yaml" - policies: https://raw.githubusercontent.com/skoulouzis/CONF/develop/TOSCA/types/policies.yaml
- interfaces: "https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/interfaces.yml" - interfaces: https://raw.githubusercontent.com/skoulouzis/CONF/develop/TOSCA/types/interfaces.yml
...@@ -157,8 +157,8 @@ topology_template: ...@@ -157,8 +157,8 @@ topology_template:
type: "tosca.policies.ARTICONF.FaultTolerance" type: "tosca.policies.ARTICONF.FaultTolerance"
description: "TOSCA example" description: "TOSCA example"
imports: imports:
- nodes: "https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/nodes.yaml" - nodes: https://raw.githubusercontent.com/skoulouzis/CONF/develop/TOSCA/types/nodes.yaml
- data: "https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/TOSCA/types/data.yml" - data: https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/TOSCA/types/data.yml
- capabilities: "https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/capabilities.yaml" - capabilities: https://raw.githubusercontent.com/skoulouzis/CONF/develop/TOSCA/types/capabilities.yaml
- policies: "https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/policies.yaml" - policies: https://raw.githubusercontent.com/skoulouzis/CONF/develop/TOSCA/types/policies.yaml
- interfaces: "https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/interfaces.yml" - interfaces: https://raw.githubusercontent.com/skoulouzis/CONF/develop/TOSCA/types/interfaces.yml
tosca_definitions_version: tosca_simple_yaml_1_0 tosca_definitions_version: tosca_simple_yaml_1_0
imports: imports:
- nodes: https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/nodes.yaml - nodes: https://raw.githubusercontent.com/skoulouzis/CONF/develop/TOSCA/types/nodes.yaml
- data: https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/TOSCA/types/data.yml - data: https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/TOSCA/types/data.yml
- capabilities: https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/capabilities.yaml - capabilities: https://raw.githubusercontent.com/skoulouzis/CONF/develop/TOSCA/types/capabilities.yaml
- policies: https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/policies.yaml - policies: https://raw.githubusercontent.com/skoulouzis/CONF/develop/TOSCA/types/policies.yaml
- interfaces: https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/interfaces.yml - interfaces: https://raw.githubusercontent.com/skoulouzis/CONF/develop/TOSCA/types/interfaces.yml
repositories: repositories:
docker_hub: https://hub.docker.com/ docker_hub: https://hub.docker.com/
......
tosca_definitions_version: tosca_simple_yaml_1_0 tosca_definitions_version: tosca_simple_yaml_1_0
imports: imports:
- nodes: https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/nodes.yaml - nodes: https://raw.githubusercontent.com/skoulouzis/CONF/develop/TOSCA/types/nodes.yaml
- data: https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/TOSCA/types/data.yml - data: https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/TOSCA/types/data.yml
- capabilities: https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/capabilities.yaml - capabilities: https://raw.githubusercontent.com/skoulouzis/CONF/develop/TOSCA/types/capabilities.yaml
- policies: https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/policies.yaml - policies: https://raw.githubusercontent.com/skoulouzis/CONF/develop/TOSCA/types/policies.yaml
- interfaces: https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/interfaces.yml - interfaces: https://raw.githubusercontent.com/skoulouzis/CONF/develop/TOSCA/types/interfaces.yml
repositories: repositories:
docker_hub: https://hub.docker.com/ docker_hub: https://hub.docker.com/
...@@ -35,3 +35,9 @@ topology_template: ...@@ -35,3 +35,9 @@ topology_template:
properties: properties:
accepted_providers: accepted_providers:
- ExoGENI - ExoGENI
- docker_orchestrator:
type: tosca.policies.ARTICONF.Requirement.docker.Orchestrator
targets: [ ws-pema-lifewatch ]
properties:
accepted_orchestrator_types:
- tosca.nodes.ARTICONF.docker.Orchestrator.Kubernetes
...@@ -31,11 +31,11 @@ node_types: ...@@ -31,11 +31,11 @@ node_types:
required: false required: false
requirements: requirements:
- host: - host:
capability: tosca.capabilities.ARTICONF.Orchestrator capability: tosca.capabilities.ARTICONF.docker.Orchestrator
node: tosca.nodes.ARTICONF.Orchestrator node: tosca.nodes.ARTICONF.docker.Orchestrator
relationship: tosca.relationships.HostedOn relationship: tosca.relationships.HostedOn
tosca.nodes.ARTICONF.Orchestrator: tosca.nodes.ARTICONF.docker.Orchestrator:
derived_from: tosca.nodes.ARTICONF.Root derived_from: tosca.nodes.ARTICONF.Root
description: a container orchestrator description: a container orchestrator
requirements: requirements:
...@@ -45,7 +45,7 @@ node_types: ...@@ -45,7 +45,7 @@ node_types:
relationship: tosca.relationships.HostedOn relationship: tosca.relationships.HostedOn
capabilities: capabilities:
orchestrator: orchestrator:
type: tosca.capabilities.ARTICONF.Orchestrator type: tosca.capabilities.ARTICONF.docker.Orchestrator
host: host:
type: tosca.capabilities.Container.Docker type: tosca.capabilities.Container.Docker
container: container:
...@@ -65,8 +65,8 @@ node_types: ...@@ -65,8 +65,8 @@ node_types:
- greater_or_equal: 1 - greater_or_equal: 1
tosca.nodes.ARTICONF.Orchestrator.Kubernetes: tosca.nodes.ARTICONF.docker.Orchestrator.Kubernetes:
derived_from: tosca.nodes.ARTICONF.Orchestrator derived_from: tosca.nodes.ARTICONF.docker.Orchestrator
description: Kubernetes orchestrator description: Kubernetes orchestrator
attributes: attributes:
tokens: tokens:
...@@ -93,12 +93,12 @@ node_types: ...@@ -93,12 +93,12 @@ node_types:
playbook: https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/ansible_playbooks/dashboard.yaml playbook: https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/ansible_playbooks/dashboard.yaml
#tosca.nodes.ARTICONF.Orchestrator.Swarm: tosca.nodes.ARTICONF.docker.Orchestrator.Swarm:
#derived_from: tosca.nodes.ARTICONF.Orchestrator derived_from: tosca.nodes.ARTICONF.docker.Orchestrator
#description: swarm orchestrator description: swarm orchestrator
#interfaces: interfaces:
#Standard: Standard:
#create: interfaces/playbooks/docker_swarm_install.yaml create: interfaces/playbooks/docker_swarm_install.yaml
tosca.nodes.ARTICONF.VM.topology: tosca.nodes.ARTICONF.VM.topology:
derived_from: tosca.nodes.ARTICONF.Infrastructure derived_from: tosca.nodes.ARTICONF.Infrastructure
......
...@@ -41,12 +41,22 @@ policy_types: ...@@ -41,12 +41,22 @@ policy_types:
description: the minimum acceptable value description: the minimum acceptable value
tosca.policies.ARTICONF.Placement.Requirement.Provider: tosca.policies.ARTICONF.Requirement.Provider:
derived_from: tosca.policies.Placement derived_from: tosca.policies.Root
description: defines cloud providr where vm topology can be deployed description: defines cloud provider where vm topology can be deployed
properties: properties:
accepted_providers: accepted_providers:
type: list type: list
description: list of the acceptable providers description: list of the acceptable providers
schema_entry: schema_entry:
type: string type: string
tosca.policies.ARTICONF.Requirement.docker.Orchestrator:
derived_from: tosca.policies.Root
description: defines type of docker.Orchestrator
properties:
accepted_orchestrator_types:
type: list
description: list of the acceptable orchestrator types e.g. tosca.nodes.ARTICONF.docker.Orchestrator.Kubernetes
schema_entry:
type: string
...@@ -52,9 +52,7 @@ class MyTestCase(unittest.TestCase): ...@@ -52,9 +52,7 @@ class MyTestCase(unittest.TestCase):
# print("Output message:" + json.dumps(response)) # print("Output message:" + json.dumps(response))
# self.assertEqual(True, True) # self.assertEqual(True, True)
def test_planner_policies(self):
def test_planner2(self):
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
input_tosca_file_path = get_tosca_files_path('lifeWatch_vre1.yaml') input_tosca_file_path = get_tosca_files_path('lifeWatch_vre1.yaml')
...@@ -70,12 +68,13 @@ class MyTestCase(unittest.TestCase): ...@@ -70,12 +68,13 @@ class MyTestCase(unittest.TestCase):
template_dict = tosca_helper.get_tosca_template_2_topology_template_dictionary(test_tosca_template) template_dict = tosca_helper.get_tosca_template_2_topology_template_dictionary(test_tosca_template)
logger.info("template ----: \n" + yaml.dump(template_dict)) logger.info("template ----: \n" + yaml.dump(template_dict))
ToscaTemplate(yaml_dict_tpl=copy.deepcopy(template_dict)) ToscaTemplate(yaml_dict_tpl=copy.deepcopy(template_dict))
print(yaml.dump(template_dict))
test_response = {'toscaTemplate': template_dict} test_response = {'toscaTemplate': template_dict}
response = {'toscaTemplate': template_dict} response = {'toscaTemplate': template_dict}
output_current_milli_time = int(round(time.time() * 1000)) output_current_milli_time = int(round(time.time() * 1000))
response["creationDate"] = output_current_milli_time response["creationDate"] = output_current_milli_time
response["parameters"] = [] response["parameters"] = []
print("Output message:" + json.dumps(response)) # print("Output message:" + json.dumps(response))
self.assertEqual(True, True) self.assertEqual(True, True)
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