Commit 6f681612 authored by Spiros Koulouzis's avatar Spiros Koulouzis

deployer works with playbooks. Missing the k8s dashboard

parent f07e3772
......@@ -124,6 +124,37 @@ topology_template:
file: "alogo53/ws-pema-lifewatch"
repository: "docker_hub"
type: "tosca.artifacts.Deployment.Image.Container.Docker"
interfaces:
Kubernetes:
type: tosca.interfaces.ARTICONF.Kubernetes
delete:
inputs:
repository: https://github.com/skoulouzis/playbooks.git
playbooks:
- delete_service.yml
create:
inputs:
repository: https://github.com/skoulouzis/playbooks.git
playbooks:
- create_service.yml
scale:
inputs:
repository: https://github.com/skoulouzis/playbooks.git
playbooks:
- scale_service.yml
replicas: 1
autoscale:
inputs:
repository: https://github.com/skoulouzis/playbooks.git
playbooks:
- autoscale_service.yml
horizontal_pod_autoscaler: horizontal_pod_autoscaler.yml
info:
inputs:
repository: https://github.com/skoulouzis/playbooks.git
playbooks:
- get_info_service.yml
description: "TOSCA example"
imports:
- nodes: "https://raw.githubusercontent.com/skoulouzis/DRIP/develop/TOSCA/types/nodes.yaml"
......
......@@ -34,6 +34,36 @@ topology_template:
type: tosca.artifacts.Deployment.Image.Container.Docker
file: mongo:3
repository: docker_hub
interfaces:
Kubernetes:
delete:
inputs:
repository: https://github.com/skoulouzis/playbooks.git
playbooks:
- delete_service.yml
create:
inputs:
repository: https://github.com/skoulouzis/playbooks.git
playbooks:
- create_service.yml
scale:
inputs:
repository: https://github.com/skoulouzis/playbooks.git
playbooks:
- scale_service.yml
replicas: 1
autoscale:
inputs:
repository: https://github.com/skoulouzis/playbooks.git
playbooks:
- autoscale_service.yml
horizontal_pod_autoscaler: horizontal_pod_autoscaler.yml
info:
inputs:
repository: https://github.com/skoulouzis/playbooks.git
playbooks:
- get_info_service.yml
policies:
- scalability:
......
......@@ -27,6 +27,35 @@ topology_template:
type: tosca.artifacts.Deployment.Image.Container.Docker
file: alogo53/ws-pema-lifewatch
repository: docker_hub
interfaces:
Kubernetes:
delete:
inputs:
repository: https://github.com/skoulouzis/playbooks.git
playbooks:
- delete_service.yml
create:
inputs:
repository: https://github.com/skoulouzis/playbooks.git
playbooks:
- create_service.yml
scale:
inputs:
repository: https://github.com/skoulouzis/playbooks.git
playbooks:
- scale_service.yml
replicas: 1
autoscale:
inputs:
repository: https://github.com/skoulouzis/playbooks.git
playbooks:
- autoscale_service.yml
horizontal_pod_autoscaler: horizontal_pod_autoscaler.yml
info:
inputs:
repository: https://github.com/skoulouzis/playbooks.git
playbooks:
- get_info_service.yml
topology:
......
......@@ -49,13 +49,6 @@ node_types:
type: string
required: false
description: url of the service
interfaces:
Kubernetes:
create:
implementation: image
inputs:
strategy:
type: Recreate
interfaces:
Kubernetes:
type: tosca.interfaces.ARTICONF.Kubernetes
......
......@@ -11,4 +11,4 @@ six==1.14.0
python_dateutil==2.8.1
setuptools==46.1.3
urllib3==1.25.8
kubernetes==11.0.0
\ No newline at end of file
......@@ -18,7 +18,11 @@ class DeployService:
source = nodes_pair[1]
interface_types = tosca_helper.get_interface_types(source)
if interface_types and 'Standard' in interface_types:
if interface_types:
if 'Standard' in interface_types:
ansible_service = AnsibleService(self.semaphore_base_url,self.semaphore_username,self.semaphore_password)
ansible_service.execute(nodes_pair)
else:
print(interface_types)
return None
......@@ -20,7 +20,7 @@ services:
- "3306:3306"
semaphore:
image: ansiblesemaphore/semaphore
image: alogo53/docker_ansible_semaphore
environment:
SEMAPHORE_DB_USER: semaphore
SEMAPHORE_DB_PASS: semaphore
......@@ -61,7 +61,7 @@ services:
- rabbit
- mongo
- sure-tosca
image: manager:3.0.0
image: alogo53/manager:3.0.0 #manager:3.0.0
environment:
RABBITMQ_HOST: rabbit
MONGO_HOST: mongo
......@@ -78,7 +78,7 @@ services:
depends_on:
- rabbit
- sure-tosca
image: planner:3.0.0
image: alogo53/planner:3.0.0 #planner:3.0.0
environment:
RABBITMQ_HOST: rabbit
......@@ -86,19 +86,19 @@ services:
depends_on:
- rabbit
- sure-tosca
image: provisioner:3.0.0
image: alogo53/provisioner:3.0.0 #provisioner:3.0.0
environment:
RABBITMQ_HOST: rabbit
SURE_TOSCA_BASE_PATH: http://sure-tosca:8081/tosca-sure/1.0.0
#deployer:
#depends_on:
#- rabbit
#- sure-tosca
#image: deployer:3.0.0
#environment:
#RABBITMQ_HOST: rabbit
#SURE_TOSCA_BASE_PATH: http://sure-tosca:8081/tosca-sure/1.0.0
deployer:
depends_on:
- rabbit
- sure-tosca
image: alogo53/deployer:3.0.0 #deployer:3.0.0
environment:
RABBITMQ_HOST: rabbit
SURE_TOSCA_BASE_PATH: http://sure-tosca:8081/tosca-sure/1.0.0
#volumes:
......
......@@ -158,6 +158,7 @@ class Planner:
""" Resolve requirements. Go over all nodes and recursively resolve requirements till node has no
requirements e.g. docker -> k8s -> cluster -> vm """
for node in self.tosca_template.nodetemplates:
self.add_interfaces(node)
self.add_required_nodes(node)
return self.add_required_nodes_to_template(self.required_nodes)
......@@ -295,3 +296,10 @@ class Planner:
if parent_node_type_name == self.all_node_types[tosca_node_type]['derived_from']:
child_nodes[tosca_node_type] = self.all_node_types[tosca_node_type]
return child_nodes
def add_interfaces(self, node):
# node_type_interfaces = tosca_helper.get_node_type_interfaces(node)
# node_template_interfaces = tosca_helper.get_node_template_interfaces(node)
# if not node_template_interfaces and node_type_interfaces:
# tosca_helper.add_interfaces(node,node_type_interfaces)
return node
wheel==0.34.1
wheel==0.34.2
pika==1.1.0
names==0.3.0
networkx==2.4
pyyaml==5.3
tosca-parser==1.7.0
matplotlib==3.1.2
\ No newline at end of file
pyyaml==5.3.1
tosca-parser==2.0.0
matplotlib==3.2.1
\ No newline at end of file
......@@ -270,3 +270,18 @@ def get_node_template_dict(node_template):
# print(node_template.templates)
return node_template_dict
def get_node_type_interfaces(node):
node_type_interfaces = node.type_definition.interfaces
return node_type_interfaces
def get_node_template_interfaces(node):
node_template_interfaces = node.interfaces
return node_template_interfaces
def add_interfaces(node,node_type_interfaces):
# node.interfaces = node_type_interfaces
return node
\ No newline at end of file
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