Commit d40869d5 authored by Spiros Koulouzis's avatar Spiros Koulouzis

define Orchestrator and capabilities

parent 0e9b7d25
tosca_definitions_version: tosca_simple_yaml_1_0 tosca_definitions_version: tosca_simple_yaml_1_0
imports: imports:
- indigo_custom_types: types/nodes.yaml - nodes: types/nodes.yaml
- capabilities: types/capabilities.yaml
description: > description: >
TOSCA example TOSCA example
...@@ -10,7 +11,7 @@ topology_template: ...@@ -10,7 +11,7 @@ topology_template:
node_templates: node_templates:
wordpress: wordpress:
type: tosca.nodes.SWITCH.Container.Application.Docker type: tosca.nodes.ARTICONF.Container.Application.Docker
requirements: requirements:
- service: - service:
node: mysql node: mysql
...@@ -32,7 +33,7 @@ topology_template: ...@@ -32,7 +33,7 @@ topology_template:
WORDPRESS_DB_NAME: wordpress WORDPRESS_DB_NAME: wordpress
mysql: mysql:
type: tosca.nodes.SWITCH.Container.Application.Docker type: tosca.nodes.ARTICONF.Container.Application.Docker
properties: properties:
volumes: volumes:
- db_data:/var/lib/mysql - db_data:/var/lib/mysql
......
tosca_definitions_version: tosca_simple_yaml_1_0
capability_types:
tosca.capabilities.ARTICONF.Orchestrator:
derived_from: tosca.capabilities.Container
properties:
some_properties:
type: string
required: no
...@@ -2,7 +2,7 @@ tosca_definitions_version: tosca_simple_yaml_1_0 ...@@ -2,7 +2,7 @@ tosca_definitions_version: tosca_simple_yaml_1_0
node_types: node_types:
tosca.nodes.SWITCH.Container.Application.Docker: tosca.nodes.ARTICONF.Container.Application.Docker:
#derived_from: tosca.nodes.Container.Application.Docker #derived_from: tosca.nodes.Container.Application.Docker
description: description of container description: description of container
capabilities: capabilities:
...@@ -31,6 +31,31 @@ node_types: ...@@ -31,6 +31,31 @@ node_types:
required: false required: false
requirements: requirements:
- host: - host:
capability: tosca.capabilities.Compute capability: tosca.capabilities.ARTICONF.Orchestrator
node: tosca.nodes.ARTICONF.Orchestrator
relationship: tosca.relationships.HostedOn
tosca.nodes.ARTICONF.Orchestrator:
derived_from: tosca.nodes.SoftwareComponent
description: a container orchestrator
requirements:
- host:
capability: tosca.capabilities.Container
node: tosca.nodes.Compute
relationship: tosca.relationships.HostedOn
capabilities:
host:
type: tosca.capabilities.ARTICONF.Orchestrator
tosca.nodes.ARTICONF.Orchestrator.Kubernetes:
derived_from: tosca.nodes.ARTICONF.Orchestrator
description: Kubernetes orchestrator
requirements:
- host:
capability: tosca.capabilities.Scalable
node: tosca.nodes.Compute node: tosca.nodes.Compute
relationship: tosca.relationships.HostedOn relationship: tosca.relationships.HostedOn
...@@ -22,10 +22,9 @@ class BasicPlanner: ...@@ -22,10 +22,9 @@ class BasicPlanner:
for node in self.template.nodetemplates: for node in self.template.nodetemplates:
missing_requirements = self.get_missing_requirements(node) missing_requirements = self.get_missing_requirements(node)
print(missing_requirements)
for req in missing_requirements: for req in missing_requirements:
node.requirements.append(req) node.requirements.append(req)
print('----------------------')
# print(node.get_properties().keys()) # print(node.get_properties().keys())
# print(node.get_capabilities().keys) # print(node.get_capabilities().keys)
......
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