Commit acd049d1 authored by Spiros Koulouzis's avatar Spiros Koulouzis

renames

parent ef7d6bba
......@@ -12,7 +12,7 @@ topology_template:
interfaces:
Standard:
create: "dumy.yaml"
type: "tosca.nodes.ARTICONF.VM.Compute"
type: "tosca.nodes.QC.VM.Compute"
compute_1:
properties:
disk_size: "10000 MB"
......@@ -23,11 +23,11 @@ topology_template:
interfaces:
Standard:
create: "dumy.yaml"
type: "tosca.nodes.ARTICONF.VM.Compute"
type: "tosca.nodes.QC.VM.Compute"
kubernetes:
requirements:
- host:
capability: "tosca.capabilities.ARTICONF.VM.topology"
capability: "tosca.capabilities.QC.VM.topology"
node: "topology"
relationship: "tosca.relationships.HostedOn"
interfaces:
......@@ -41,14 +41,14 @@ topology_template:
delete:
inputs:
playbook: "https://raw.githubusercontent.com/skoulouzis/CONF/develop/ansible_playbooks/k8s_delete.yaml"
type: "tosca.nodes.ARTICONF.docker.Orchestrator.Kubernetes"
type: "tosca.nodes.QC.docker.Orchestrator.Kubernetes"
topology:
properties:
domain: "Frankfurt"
provider: "EC2"
requirements:
- vm:
capability: "tosca.capabilities.ARTICONF.VM"
capability: "tosca.capabilities.QC.VM"
node: "compute_1"
relationship: "tosca.relationships.DependsOn"
interfaces:
......@@ -73,14 +73,14 @@ topology_template:
inputs:
code_type: "SEQ"
object_type: "SubTopology"
type: "tosca.nodes.ARTICONF.VM.topology"
type: "tosca.nodes.QC.VM.topology"
topology_1:
properties:
domain: "Frankfurt"
provider: "EC2"
requirements:
- vm:
capability: "tosca.capabilities.ARTICONF.VM"
capability: "tosca.capabilities.QC.VM"
node: "compute_1"
relationship: "tosca.relationships.DependsOn"
interfaces:
......@@ -105,7 +105,7 @@ topology_template:
inputs:
code_type: "SEQ"
object_type: "SubTopology"
type: "tosca.nodes.ARTICONF.VM.topology"
type: "tosca.nodes.QC.VM.topology"
artifacts:
provisioned_files:
required: false
......@@ -116,10 +116,10 @@ topology_template:
- "30001:8080"
requirements:
- host:
capability: "tosca.capabilities.ARTICONF.docker.Orchestrator"
capability: "tosca.capabilities.QC.docker.Orchestrator"
node: "kubernetes"
relationship: "tosca.relationships.HostedOn"
type: "tosca.nodes.ARTICONF.Container.Application.Docker"
type: "tosca.nodes.QC.Container.Application.Docker"
artifacts:
image:
file: "alogo53/ws-pema-lifewatch"
......
......@@ -11,7 +11,7 @@ topology_template:
interfaces:
Standard:
create: "dumy.yaml"
type: "tosca.nodes.ARTICONF.VM.Compute"
type: "tosca.nodes.QC.VM.Compute"
compute_1:
properties:
disk_size: "10000 MB"
......@@ -22,11 +22,11 @@ topology_template:
interfaces:
Standard:
create: "dumy.yaml"
type: "tosca.nodes.ARTICONF.VM.Compute"
type: "tosca.nodes.QC.VM.Compute"
kubernetes:
requirements:
- host:
capability: "tosca.capabilities.ARTICONF.VM.topology"
capability: "tosca.capabilities.QC.VM.topology"
node: "topology"
relationship: "tosca.relationships.HostedOn"
interfaces:
......@@ -40,14 +40,14 @@ topology_template:
delete:
inputs:
playbook: "https://raw.githubusercontent.com/skoulouzis/CONF/develop/ansible_playbooks/k8s_delete.yaml"
type: "tosca.nodes.ARTICONF.docker.Orchestrator.Kubernetes"
type: "tosca.nodes.QC.docker.Orchestrator.Kubernetes"
topology:
properties:
domain: "Frankfurt"
provider: "EC2"
requirements:
- vm:
capability: "tosca.capabilities.ARTICONF.VM"
capability: "tosca.capabilities.QC.VM"
node: "compute_1"
relationship: "tosca.relationships.DependsOn"
interfaces:
......@@ -72,14 +72,14 @@ topology_template:
inputs:
code_type: "SEQ"
object_type: "SubTopology"
type: "tosca.nodes.ARTICONF.VM.topology"
type: "tosca.nodes.QC.VM.topology"
topology_1:
properties:
domain: "Frankfurt"
provider: "EC2"
requirements:
- vm:
capability: "tosca.capabilities.ARTICONF.VM"
capability: "tosca.capabilities.QC.VM"
node: "compute_1"
relationship: "tosca.relationships.DependsOn"
interfaces:
......@@ -104,7 +104,7 @@ topology_template:
inputs:
code_type: "SEQ"
object_type: "SubTopology"
type: "tosca.nodes.ARTICONF.VM.topology"
type: "tosca.nodes.QC.VM.topology"
artifacts:
provisioned_files:
required: false
......@@ -115,10 +115,10 @@ topology_template:
- "30001:8080"
requirements:
- host:
capability: "tosca.capabilities.ARTICONF.docker.Orchestrator"
capability: "tosca.capabilities.QC.docker.Orchestrator"
node: "kubernetes"
relationship: "tosca.relationships.HostedOn"
type: "tosca.nodes.ARTICONF.Container.Application.Docker"
type: "tosca.nodes.QC.Container.Application.Docker"
artifacts:
image:
file: "alogo53/ws-pema-lifewatch"
......
......@@ -11,7 +11,7 @@ topology_template:
interfaces:
Standard:
create: "dumy.yaml"
type: "tosca.nodes.ARTICONF.VM.Compute"
type: "tosca.nodes.QC.VM.Compute"
compute_1:
properties:
disk_size: "10000 MB"
......@@ -22,11 +22,11 @@ topology_template:
interfaces:
Standard:
create: "dumy.yaml"
type: "tosca.nodes.ARTICONF.VM.Compute"
type: "tosca.nodes.QC.VM.Compute"
kubernetes:
requirements:
- host:
capability: "tosca.capabilities.ARTICONF.VM.topology"
capability: "tosca.capabilities.QC.VM.topology"
node: "topology"
relationship: "tosca.relationships.HostedOn"
interfaces:
......@@ -40,18 +40,18 @@ topology_template:
delete:
inputs:
playbook: "https://raw.githubusercontent.com/skoulouzis/CONF/develop/ansible_playbooks/k8s_delete.yaml"
type: "tosca.nodes.ARTICONF.docker.Orchestrator.Kubernetes"
type: "tosca.nodes.QC.docker.Orchestrator.Kubernetes"
topology:
properties:
domain: "Frankfurt"
provider: "EC2"
requirements:
- vm:
capability: "tosca.capabilities.ARTICONF.VM"
capability: "tosca.capabilities.QC.VM"
node: "compute"
relationship: "tosca.relationships.DependsOn"
- vm:
capability: "tosca.capabilities.ARTICONF.VM"
capability: "tosca.capabilities.QC.VM"
node: "compute_1"
relationship: "tosca.relationships.DependsOn"
interfaces:
......@@ -76,7 +76,7 @@ topology_template:
inputs:
code_type: "SEQ"
object_type: "SubTopology"
type: "tosca.nodes.ARTICONF.VM.topology"
type: "tosca.nodes.QC.VM.topology"
artifacts:
provisioned_files:
required: false
......@@ -87,10 +87,10 @@ topology_template:
- "30001:8080"
requirements:
- host:
capability: "tosca.capabilities.ARTICONF.docker.Orchestrator"
capability: "tosca.capabilities.QC.docker.Orchestrator"
node: "kubernetes"
relationship: "tosca.relationships.HostedOn"
type: "tosca.nodes.ARTICONF.Container.Application.Docker"
type: "tosca.nodes.QC.Container.Application.Docker"
artifacts:
image:
file: "alogo53/ws-pema-lifewatch"
......
This diff is collapsed.
......@@ -18,7 +18,7 @@ topology_template:
node_templates:
mongo:
type: tosca.nodes.ARTICONF.Container.Application.Docker
type: tosca.nodes.QC.Container.Application.Docker
properties:
ports:
- "30001:27017"
......@@ -67,13 +67,13 @@ topology_template:
policies:
- scalability:
type: tosca.policies.ARTICONF.Performance.CPU
type: tosca.policies.QC.Performance.CPU
targets: [ mongo ]
properties:
constraint_name: cpu_load
max_value: 90
- faultTolerance:
type: tosca.policies.ARTICONF.FaultTolerance
type: tosca.policies.QC.FaultTolerance
targets: [ mongo ]
properties:
level: 1
......@@ -17,7 +17,7 @@ topology_template:
num_cores: 2
os: Ubuntu 18.04
user_name: vm_user
type: tosca.nodes.ARTICONF.VM.Compute
type: tosca.nodes.QC.VM.Compute
......
......@@ -13,7 +13,7 @@ topology_template:
delete:
inputs:
playbook: "https://raw.githubusercontent.com/skoulouzis/CONF/develop/ansible_playbooks/k8s_delete.yaml"
type: "tosca.nodes.ARTICONF.docker.Orchestrator.Kubernetes"
type: "tosca.nodes.QC.docker.Orchestrator.Kubernetes"
description: "TOSCA example"
imports:
- nodes: "https://raw.githubusercontent.com/skoulouzis/DRIP/develop/TOSCA/types/nodes.yaml"
......
......@@ -18,7 +18,7 @@ topology_template:
node_templates:
ws-pema:
type: tosca.nodes.ARTICONF.Container.Application.Docker
type: tosca.nodes.QC.Container.Application.Docker
properties:
ports:
- "30001:8080"
......@@ -59,7 +59,7 @@ topology_template:
topology:
type: tosca.nodes.ARTICONF.VM.topology
type: tosca.nodes.QC.VM.topology
interfaces:
CloudsStorm:
provision:
......
......@@ -17,5 +17,5 @@ topology_template:
properties:
domain: Frankfurt
provider: EC2
type: tosca.nodes.ARTICONF.VM.topology
type: tosca.nodes.QC.VM.topology
tosca_definitions_version: tosca_simple_yaml_1_0
......@@ -3,7 +3,7 @@ tosca_definitions_version: tosca_simple_yaml_1_0
artifacts:
tosca.datatypes.ARTICONF.CloudStorm.Deployment:
tosca.datatypes.QC.CloudStorm.Deployment:
derived_from: tosca.artifacts.Deployment
file_contents:
type: string
......
......@@ -2,28 +2,28 @@ tosca_definitions_version: tosca_simple_yaml_1_0
capability_types:
tosca.capabilities.ARTICONF.docker.Orchestrator:
tosca.capabilities.QC.docker.Orchestrator:
derived_from: tosca.capabilities.Container
properties:
some_properties:
type: string
required: no
tosca.capabilities.ARTICONF.VM:
tosca.capabilities.QC.VM:
derived_from: tosca.capabilities.Compute
properties:
some_properties:
type: string
required: no
tosca.capabilities.ARTICONF.VM.topology:
tosca.capabilities.QC.VM.topology:
derived_from: tosca.capabilities.Compute
properties:
some_properties:
type: string
required: no
tosca.capabilities.ARTICONF.Useless:
tosca.capabilities.QC.Useless:
properties:
some_properties:
type: string
......
......@@ -3,7 +3,7 @@ tosca_definitions_version: tosca_simple_yaml_1_0
data_types:
tosca.datatypes.ARTICONF.Credential:
tosca.datatypes.QC.Credential:
derived_from: tosca.datatypes.Credential
properties:
cloud_provider_name:
......@@ -11,7 +11,7 @@ data_types:
required: true
tosca.datatypes.ARTICONF.coordinates:
tosca.datatypes.QC.coordinates:
derived_from: tosca.datatypes.Root
properties:
longitude:
......
tosca_definitions_version: tosca_simple_yaml_1_0
interface_types:
tosca.interfaces.ARTICONF.CloudsStorm:
tosca.interfaces.QC.CloudsStorm:
description: Interface for VM topology management with CloudsStorm. More at https://cloudsstorm.github.io/
derived_from: tosca.interfaces.node.lifecycle.Standard
inputs:
......@@ -62,7 +62,7 @@ interface_types:
description: Provision the defined objects (resources). ObjectType can be SubTopology or VM.
tosca.interfaces.ARTICONF.Standard:
tosca.interfaces.QC.Standard:
derived_from: tosca.interfaces.node.lifecycle.Standard
inputs:
inventory_file:
......@@ -75,8 +75,8 @@ interface_types:
type: string
required: false
tosca.interfaces.ARTICONF.Kubernetes:
derived_from: tosca.interfaces.ARTICONF.Standard
tosca.interfaces.QC.Kubernetes:
derived_from: tosca.interfaces.QC.Standard
inputs:
replicas:
type: integer
......
......@@ -2,7 +2,7 @@ tosca_definitions_version: tosca_simple_yaml_1_0
node_types:
tosca.nodes.ARTICONF.Root:
tosca.nodes.QC.Root:
description: root ARTICONF node
attributes:
current_state:
......@@ -15,8 +15,8 @@ node_types:
description: the current state of the node
tosca.nodes.ARTICONF.Container.Application.Docker:
derived_from: tosca.nodes.ARTICONF.Application
tosca.nodes.QC.Container.Application.Docker:
derived_from: tosca.nodes.QC.Application
description: description of container
properties:
ports:
......@@ -41,8 +41,8 @@ node_types:
required: false
requirements:
- host:
capability: tosca.capabilities.ARTICONF.docker.Orchestrator
node: tosca.nodes.ARTICONF.docker.Orchestrator
capability: tosca.capabilities.QC.docker.Orchestrator
node: tosca.nodes.QC.docker.Orchestrator
relationship: tosca.relationships.HostedOn
attributes:
service_url:
......@@ -51,7 +51,7 @@ node_types:
description: url of the service
interfaces:
Kubernetes:
type: tosca.interfaces.ARTICONF.Kubernetes
type: tosca.interfaces.QC.Kubernetes
delete:
inputs:
repository: https://github.com/skoulouzis/playbooks.git
......@@ -83,17 +83,17 @@ node_types:
tosca.nodes.ARTICONF.docker.Orchestrator:
derived_from: tosca.nodes.ARTICONF.Application
tosca.nodes.QC.docker.Orchestrator:
derived_from: tosca.nodes.QC.Application
description: a container orchestrator
requirements:
- host:
capability: tosca.capabilities.ARTICONF.VM.topology
node: tosca.nodes.ARTICONF.VM.topology
capability: tosca.capabilities.QC.VM.topology
node: tosca.nodes.QC.VM.topology
relationship: tosca.relationships.HostedOn
capabilities:
orchestrator:
type: tosca.capabilities.ARTICONF.docker.Orchestrator
type: tosca.capabilities.QC.docker.Orchestrator
host:
type: tosca.capabilities.Container.Docker
container:
......@@ -113,8 +113,8 @@ node_types:
- greater_or_equal: 1
tosca.nodes.ARTICONF.docker.Orchestrator.Kubernetes:
derived_from: tosca.nodes.ARTICONF.docker.Orchestrator
tosca.nodes.QC.docker.Orchestrator.Kubernetes:
derived_from: tosca.nodes.QC.docker.Orchestrator
description: Kubernetes orchestrator
attributes:
tokens:
......@@ -129,7 +129,7 @@ node_types:
description: the dashboard access url
interfaces:
Standard:
type: tosca.interfaces.ARTICONF.Standard
type: tosca.interfaces.QC.Standard
create:
inputs:
repository: https://github.com/skoulouzis/playbooks.git
......@@ -151,19 +151,19 @@ node_types:
- k8s_delete.yaml
tosca.nodes.ARTICONF.VM.topology:
derived_from: tosca.nodes.ARTICONF.Infrastructure
tosca.nodes.QC.VM.topology:
derived_from: tosca.nodes.QC.Infrastructure
description: topology of VMs
requirements:
- vm:
capability: tosca.capabilities.ARTICONF.VM
node: tosca.nodes.ARTICONF.Infrastructure
capability: tosca.capabilities.QC.VM
node: tosca.nodes.QC.Infrastructure
relationship: tosca.relationships.DependsOn
capabilities:
scalable:
type: tosca.capabilities.Scalable
topology:
type: tosca.capabilities.ARTICONF.VM.topology
type: tosca.capabilities.QC.VM.topology
properties:
name:
type: string
......@@ -184,12 +184,12 @@ node_types:
default: "EC2"
description: The name of the provider e.g. EC2, ExoGENI etc.
coordinates:
type: tosca.datatypes.ARTICONF.coordinates
type: tosca.datatypes.QC.coordinates
required: false
description: The coordinates of the domain
attributes:
ssh_keys:
type: tosca.datatypes.ARTICONF.Credential
type: tosca.datatypes.QC.Credential
required: false
artifacts:
provisioned_files:
......@@ -197,7 +197,7 @@ node_types:
required: false
interfaces:
CloudsStorm:
type: tosca.interfaces.ARTICONF.CloudsStorm
type: tosca.interfaces.QC.CloudsStorm
provision:
inputs:
code_type: SEQ
......@@ -219,12 +219,12 @@ node_types:
code_type: SEQ
object_type: SubTopology
tosca.nodes.ARTICONF.VM.Compute:
derived_from: tosca.nodes.ARTICONF.Infrastructure
tosca.nodes.QC.VM.Compute:
derived_from: tosca.nodes.QC.Infrastructure
description: vm
capabilities:
compute:
type: tosca.capabilities.ARTICONF.VM
type: tosca.capabilities.QC.VM
properties:
num_cores:
type: integer
......@@ -283,17 +283,17 @@ node_types:
required: true
default: "vm"
root_key_pair:
type: tosca.datatypes.ARTICONF.Credential
type: tosca.datatypes.QC.Credential
required: false
user_key_pair:
type: tosca.datatypes.ARTICONF.Credential
type: tosca.datatypes.QC.Credential
required: false
interfaces:
Standard:
create: dumy.yaml
tosca.nodes.ARTICONF.Infrastructure:
derived_from: tosca.nodes.ARTICONF.Root
tosca.nodes.QC.Infrastructure:
derived_from: tosca.nodes.QC.Root
description: Base infrastructure node
capabilities:
compute:
......@@ -301,6 +301,6 @@ node_types:
node:
type: tosca.capabilities.Node
tosca.nodes.ARTICONF.Application:
derived_from: tosca.nodes.ARTICONF.Root
tosca.nodes.QC.Application:
derived_from: tosca.nodes.QC.Root
description: Base application node
......@@ -2,7 +2,7 @@ tosca_definitions_version: tosca_simple_yaml_1_0
policy_types:
tosca.policies.ARTICONF.Performance:
tosca.policies.QC.Performance:
derived_from: tosca.policies.Performance
description: QoS constraint
properties:
......@@ -19,19 +19,19 @@ policy_types:
required: false
description: the maximum acceptable value
tosca.policies.ARTICONF.Performance.CPU:
derived_from: tosca.policies.ARTICONF.Performance
tosca.policies.QC.Performance.CPU:
derived_from: tosca.policies.QC.Performance
description: CPU load constraint as percentage
tosca.policies.ARTICONF.Performance.Mem:
tosca.policies.QC.Performance.Mem:
derived_from: tosca.policies.Performance
description: Memory load constraint as percentage
tosca.policies.ARTICONF.Performance.Disk:
tosca.policies.QC.Performance.Disk:
derived_from: tosca.policies.Performance
description: Disk size as MB
tosca.policies.ARTICONF.FaultTolerance:
tosca.policies.QC.FaultTolerance:
derived_from: tosca.policies.Root
description: the level of acceptable faults
properties:
......
......@@ -21,16 +21,16 @@ package nl.uva.sne.drip.commons.utils;
*/
public class Constants {
public static final String VM_CAPABILITY = "tosca.capabilities.ARTICONF.VM";
public static final String VM_TYPE = "tosca.nodes.ARTICONF.VM.Compute";
public static final String VM_CAPABILITY = "tosca.capabilities.QC.VM";
public static final String VM_TYPE = "tosca.nodes.QC.VM.Compute";
public static final String VM_NUM_OF_CORES = "num_cores";
public static final String MEM_SIZE = "mem_size";
public static final String DISK_SIZE = "disk_size";
public static final String VM_OS = "os";
public static final String VM_TOPOLOGY = "tosca.nodes.ARTICONF.VM.topology";
public static final String APPLICATION_TYPE = "tosca.nodes.ARTICONF.Application";
public static final String CLOUD_STORM_INTERFACE = "tosca.interfaces.ARTICONF.CloudsStorm";
public static final String ENCODED_FILE_DATATYPE = "tosca.datatypes.ARTICONF.encodedFile";
public static final String VM_TOPOLOGY = "tosca.nodes.QC.VM.topology";
public static final String APPLICATION_TYPE = "tosca.nodes.QC.Application";
public static final String CLOUD_STORM_INTERFACE = "tosca.interfaces.QC.CloudsStorm";
public static final String ENCODED_FILE_DATATYPE = "tosca.datatypes.QC.encodedFile";
public static final String CLOUD_STORM_FILES_ZIP_SUFIX = "cloudStromFiles.zip";
public static enum NODE_STATES {
......
# To change this license header, choose License Headers in Project Properties.
# To change this template file, choose Tools | Templates
# and open the template in the editor.
import configparser
import json
import logging
import os
import os.path
import sys
import tempfile
import time
import logging
import pika
import yaml
import sys
from time import sleep
from concurrent.futures import thread
from threading import Thread
from service import ansible_service
from time import sleep
from service.deploy_service import DeployService
from service.tosca_helper import ToscaHelper
import pika
import sure_tosca_client
import yaml
logger = logging.getLogger(__name__)
......@@ -31,14 +30,7 @@ done = False
# logger.handler_set = True
def init_chanel(args):
global rabbitmq_host
if len(args) > 1:
rabbitmq_host = args[1]
queue_name = args[2] # deployer
else:
rabbitmq_host = '127.0.0.1'
def init_chanel(rabbitmq_host, queue_name):
connection = pika.BlockingConnection(pika.ConnectionParameters(host=rabbitmq_host))
channel = connection.channel()
channel.queue_declare(queue=queue_name)
......@@ -66,12 +58,13 @@ def on_request(ch, method, props, body):
ch.basic_ack(delivery_tag=method.delivery_tag)
def init_sure_tosca_client(sure_tosca_base_path):
configuration = sure_tosca_client.Configuration()
sure_tosca_client.configuration.host = sure_tosca_base_path
api_client = sure_tosca_client.ApiClient(configuration=configuration)
sure_tosca_client_api = sure_tosca_client.api.default_api.DefaultApi(api_client=api_client) # noqa: E501
return sure_tosca_client_api
def save_tosca_template(tosca_template_dict):
tmp_path = tempfile.mkdtemp()
tosca_template_path = tmp_path + os.path.sep + 'toscaTemplate.yml'
with open(tosca_template_path, 'w') as outfile:
yaml.dump(tosca_template_dict, outfile, default_flow_style=False)
return tosca_template_path
def handle_delivery(message):
......@@ -85,35 +78,16 @@ def handle_delivery(message):
tosca_file_name = 'tosca_template'
tosca_template_dict = parsed_json_message['toscaTemplate']
print(yaml.dump(tosca_template_dict))
sure_tosca_client.upload_tosca_template()
# tosca_interfaces = tosca.get_interfaces(tosca_template_dict)
# tmp_path = tempfile.mkdtemp()
# vms = tosca.get_vms(tosca_template_dict)
# inventory_path = ansible_service.write_inventory_file(tmp_path, vms)
# paths = ansible_service.write_playbooks_from_tosca_interface(tosca_interfaces, tmp_path)
# tokens = {}
# for playbook_path in paths:
# out, err = ansible_service.run(inventory_path, playbook_path)
# api_key, join_token, discovery_token_ca_cert_hash = ansible_service.parse_api_tokens(out.decode("utf-8"))
# if api_key:
# tokens['api_key'] = api_key
# if join_token:
# tokens['join_token'] = join_token
# if discovery_token_ca_cert_hash:
# tokens['discovery_token_ca_cert_hash'] = discovery_token_ca_cert_hash
#
# ansible_playbook_path = k8s_service.write_ansible_k8s_files(tosca_template_dict, tmp_path)
# out, err = ansible_service.run(inventory_path, ansible_playbook_path)
# dashboard_token = ansible_service.parse_dashboard_tokens(out.decode("utf-8"))
# tokens['dashboard_token'] = dashboard_token
#
# tosca_template_dict = tosca.add_tokens(tokens, tosca_template_dict)
# tosca_template_dict = tosca.add_dashboard_url(k8s_service.get_dashboard_url(vms), tosca_template_dict)
# tosca_template_dict = tosca.add_service_url(k8s_service.get_service_urls(vms, tosca_template_dict),
# tosca_template_dict)
tosca_template_path = save_tosca_template(tosca_template_dict)
tosca_helper = ToscaHelper(sure_tosca_base_url, tosca_template_path)
# nodes_to_deploy = tosca_helper.get_application_nodes()
nodes_pairs = tosca_helper.get_deployment_node_pairs()
deployService = DeployService(semaphore_base_url=semaphore_base_url, semaphore_username=semaphore_username,
semaphore_password=semaphore_password)
for node_pair in nodes_pairs:
deployService.deploy(node_pair)
response = {'toscaTemplate': tosca_template_dict}
output_current_milli_time = int(round(time.time() * 1000))
......@@ -131,29 +105,33 @@ def threaded_function(args):
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO)
if sys.argv[1] == "test_local":
tosca_path = "../TOSCA/"
input_tosca_file_path = tosca_path + '/application_example_provisioned.yaml'
with open(input_tosca_file_path) as f:
# use safe_load instead load
tosca_template_json = yaml.safe_load(f)
else:
logger.info("Input args: " + sys.argv[0] + ' ' + sys.argv[1] + ' ' + sys.argv[2])
global channel, queue_name, connection, sure_tosca_client
channel, connection = init_chanel(sys.argv)
queue_name = sys.argv[2]
sure_tosca_base_url = sys.argv[3] # "http://localhost:8081/tosca-sure/1.0.0/"
sure_tosca_client = init_sure_tosca_client(sure_tosca_base_url)
logger.info("Awaiting RPC requests")
try:
thread = Thread(target=threaded_function, args=(1,))
thread.start()
start(channel)
except Exception as e:
done = True
e = sys.exc_info()[0]
logger.info("Error: " + str(e))
print(e)
exit(-1)
global channel, queue_name, connection, rabbitmq_host, sure_tosca_base_url,semaphore_base_url, semaphore_username, \
semaphore_password
config = configparser.ConfigParser()
config.read('properties.ini')
sure_tosca_base_url = config['tosca-sure']['base_url']
semaphore_base_url = config['semaphore']['base_url']
semaphore_username = config['semaphore']['username']
semaphore_password = config['semaphore']['password']
rabbitmq_host = config['message_broker']['host']
queue_name = config['message_broker']['queue_name']
logger.info('Properties sure_tosca_base_url: ' + sure_tosca_base_url + ', semaphore_base_url: ' + semaphore_base_url
+ ', rabbitmq_host: ' + rabbitmq_host+ ', queue_name: '+queue_name)
channel, connection = init_chanel(rabbitmq_host, queue_name)
logger.info("Awaiting RPC requests")
try:
thread = Thread(target=threaded_function, args=(1,))
thread.start()
start(channel)
except Exception as e:
done = True
e = sys.exc_info()[0]
logger.info("Error: " + str(e))
print(e)
exit(-1)
[tosca-sure]
base_url = http://localhost:8081/tosca-sure/1.0.0
[semaphore]
username = admin
password = password
base_url = http://localhost:3000/api
[message_broker]
host = localhost
queue_name = deployer
\ No newline at end of file
......@@ -31,27 +31,27 @@ class AnsibleService:
def execute(self,nodes_pair):
vms = nodes_pair[0]
orchestrator = nodes_pair[1]
name = orchestrator.name
application = nodes_pair[1]
name = application.name
desired_state = None
interfaces = orchestrator.node_template.interfaces
if 'current_state' in orchestrator.node_template.attributes:
current_state = orchestrator.node_template.attributes['current_state']
if 'desired_state' in orchestrator.node_template.attributes:
desired_state = orchestrator.node_template.attributes['desired_state']
interfaces = application.node_template.interfaces
if 'current_state' in application.node_template.attributes:
current_state = application.node_template.attributes['current_state']
if 'desired_state' in application.node_template.attributes:
desired_state = application.node_template.attributes['desired_state']
if desired_state:
project_id = self.semaphore_helper.create_project(orchestrator.name)
project_id = self.semaphore_helper.create_project(application.name)
inventory_contents = yaml.dump( self.build_yml_inventory(vms),default_flow_style=False)
private_key = self.get_private_key(vms)
key_id = self.semaphore_helper.create_ssh_key(orchestrator.name, project_id, private_key)
inventory_id = self.semaphore_helper.create_inventory(orchestrator.name, project_id, key_id,inventory_contents)
key_id = self.semaphore_helper.create_ssh_key(application.name, project_id, private_key)
inventory_id = self.semaphore_helper.create_inventory(application.name, project_id, key_id,inventory_contents)
if 'RUNNING' == desired_state:
standard = interfaces['Standard']
create = standard['create']
inputs = create['inputs']
git_url = inputs['repository']
playbook_names = inputs['playbooks']
playbook_names = inputs['resources']
for playbook_name in playbook_names:
task_id = self.run_task(name, project_id, key_id, git_url, inventory_id, playbook_name)
if self.semaphore_helper.get_task(project_id, task_id).status != 'success':
......@@ -61,7 +61,7 @@ class AnsibleService:
configure = standard['configure']
inputs = configure['inputs']
git_url = inputs['repository']
playbook_names = inputs['playbooks']
playbook_names = inputs['resources']
for playbook_name in playbook_names:
task_id = self.run_task(name, project_id, key_id, git_url, inventory_id, playbook_name)
if self.semaphore_helper.get_task(project_id, task_id).status != 'success':
......@@ -100,8 +100,7 @@ class AnsibleService:
def run_task(self, name, project_id, key_id, git_url, inventory_id, playbook_name):
logger.info('project_id: '+str(project_id)+ ' task name: ' + str(name)+ ' git url: '+git_url+' playbook: '+playbook_name)
if not self.repository_id:
self.repository_id = self.semaphore_helper.create_repository(name, project_id, key_id, git_url)
self.repository_id = self.semaphore_helper.create_repository(name, project_id, key_id, git_url)
template_id = self.semaphore_helper.create_template(project_id, key_id, inventory_id, self.repository_id,
playbook_name)
task_id = self.semaphore_helper.execute_task(project_id, template_id, playbook_name)
......
......@@ -36,7 +36,7 @@ class ToscaHelper:
return interface_types
def get_application_nodes(self):
return self.tosca_client.get_node_templates(self.doc_id, type_name='tosca.nodes.ARTICONF.Application')
return self.tosca_client.get_node_templates(self.doc_id, type_name='tosca.nodes.QC.Application')
def get_deployment_node_pairs(self):
nodes_to_deploy = self.get_application_nodes()
......@@ -48,12 +48,11 @@ class ToscaHelper:
# But the topology is directly connected to the orchestrator not the VMs.
# So we explicitly get the VMs
# I don't like this solution but I can't think of something better.
if related_node.node_template.type == 'tosca.nodes.ARTICONF.VM.topology':
vms = self.tosca_client.get_node_templates(self.doc_id,type_name='tosca.nodes.ARTICONF.VM.Compute')
if related_node.node_template.type == 'tosca.nodes.QC.VM.topology':
vms = self.tosca_client.get_node_templates(self.doc_id,type_name='tosca.nodes.QC.VM.Compute')
related_node = vms
pair = (related_node, node)
nodes_pairs.append(pair)
return nodes_pairs
@classmethod
......
......@@ -25,7 +25,7 @@ services:
- "3306:3306"
semaphore:
image: semaphore
image: qcdis/docker_ansible_semaphore
environment:
SEMAPHORE_DB_USER: semaphore
SEMAPHORE_DB_PASS: semaphore
......
version: '3'
services:
nginx:
image: nginx
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- ./cert.pem:/etc/nginx/cert/cert.pem
- ./privkey.pem:/etc/nginx/cert/privkey.pem
#- ./www:/data/www
ports:
- "30000:80"
- "30001:443"
#nginx:
#image: nginx
#volumes:
#- ./nginx.conf:/etc/nginx/nginx.conf
#- ./cert.pem:/etc/nginx/cert.pem
#- ./privkey.pem:/etc/nginx/privkey.pem
##- ./www:/data/www
#ports:
#- "80:80"
#- "443:443"
rabbit:
image: rabbitmq:3.8-management
#ports:
#- "5671-5672:5671-5672"
#- "15672:15672"
#- "4369:4369"
#- "15671:15671"
ports:
- "5671-5672:5671-5672"
- "15672:15672"
- "4369:4369"
- "15671:15671"
mysql:
image: mysql:5.6
......@@ -31,7 +31,7 @@ services:
#- "3306:3306"
semaphore:
image: semaphore
image: qcdis/docker_ansible_semaphore
environment:
SEMAPHORE_DB_USER: semaphore
SEMAPHORE_DB_PASS: semaphore
......@@ -45,29 +45,28 @@ services:
SEMAPHORE_ADMIN: admin
SEMAPHORE_WEB_ROOT: http://0.0.0.0:3000
ports:
- "30002:3000"
- "3000:3000"
depends_on:
- mysql
mongo:
image: mongo:4
#ports:
#- "27017:27017"
ports:
- "27017:27017"
manager:
depends_on:
- rabbit
- mongo
- sure-tosca
image: qcdis/manager:3.0.0
environment:
RABBITMQ_HOST: rabbit
MONGO_HOST: mongo
SURE_TOSCA_BASE_PATH: http://sure-tosca:8081/tosca-sure/1.0.0
ports:
- "8080:8080"
#manager:
#depends_on:
#- rabbit
#- mongo
#- sure-tosca
#image: qcdis/manager:3.0.0
#environment:
#RABBITMQ_HOST: rabbit
#MONGO_HOST: mongo
#SURE_TOSCA_BASE_PATH: http://sure-tosca:8081/tosca-sure/1.0.0
#ports:
#- "8080:8080"
sure-tosca:
image: qcdis/sure-tosca:3.0.0
......@@ -82,23 +81,23 @@ services:
environment:
RABBITMQ_HOST: rabbit
provisioner:
depends_on:
- rabbit
- sure-tosca
image: qcdis/provisioner:3.0.0
environment:
RABBITMQ_HOST: rabbit
SURE_TOSCA_BASE_PATH: http://sure-tosca:8081/tosca-sure/1.0.0
#provisioner:
#depends_on:
#- rabbit
#- sure-tosca
#image: qcdis/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: qcdis/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: qcdis/deployer:3.0.0
#environment:
#RABBITMQ_HOST: rabbit
#SURE_TOSCA_BASE_PATH: http://sure-tosca:8081/tosca-sure/1.0.0
......@@ -12,13 +12,13 @@ http {
# this is necessary for us to be able to disable request buffering in all cases
proxy_http_version 1.1;
upstream semaphore {
server semaphore:3000;
}
# upstream sure-tosca {
# server sure-tosca:8081;
# }
# upstream semaphore {
# server semaphore:3000;
# }
# upstream manager {
# server manager:8080;
# }
server {
listen [::]:80 default_server;
......@@ -27,9 +27,6 @@ http {
}
server {
# auth_basic "User's Area";
# auth_basic_user_file /etc/nginx/htpasswd;
listen 443 ssl;
server_name _;
......@@ -37,8 +34,8 @@ http {
add_header Strict-Transport-Security "max-age=31536000" always;
# SSL
# ssl_certificate /etc/nginx/cert/cert.pem;
# ssl_certificate_key /etc/nginx/cert/privkey.pem;
ssl_certificate /etc/nginx/cert.pem;
ssl_certificate_key /etc/nginx/privkey.pem;
# Recommendations from https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html
ssl_protocols TLSv1.1 TLSv1.2;
......@@ -53,7 +50,7 @@ http {
chunked_transfer_encoding on;
location / {
proxy_pass http://semaphore/;
proxy_pass http://semaphore:3000/;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
......@@ -64,17 +61,16 @@ http {
proxy_request_buffering off;
}
location /api/ws {
proxy_pass http://semaphore/api/ws;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Origin "";
}
# location /api/ws {
# proxy_pass http://semaphore:3000/api/ws;
# proxy_http_version 1.1;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection "upgrade";
# proxy_set_header Origin "";
# }
location /tosca-sure/1.0.0/ {
proxy_pass http://sure-tosca:8081/tosca-sure/1.0.0/;
location /manger/ {
proxy_pass http://manager:8080/manger/;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
......@@ -85,8 +81,20 @@ http {
proxy_request_buffering off;
}
location /manager/ {
proxy_pass http:///manager:8080/manager;
location /manger/swagger-ui.html {
proxy_pass http://manager:8080/swagger-ui.html/;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off;
proxy_request_buffering off;
}
location /tosca-sure/1.0.0/ {
proxy_pass http://sure-tosca:8081/tosca-sure/1.0.0/;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
......@@ -97,6 +105,4 @@ http {
proxy_request_buffering off;
}
}
}
......@@ -22,7 +22,7 @@
"create": "dumy.yaml"
}
},
"type": "tosca.nodes.ARTICONF.VM.Compute",
"type": "tosca.nodes.QC.VM.Compute",
"attributes": {
"user_key_pair": {
"protocol": "ssh",
......@@ -57,7 +57,7 @@
"create": "dumy.yaml"
}
},
"type": "tosca.nodes.ARTICONF.VM.Compute",
"type": "tosca.nodes.QC.VM.Compute",
"attributes": {
"user_key_pair": {
"protocol": "ssh",
......@@ -83,7 +83,7 @@
"requirements": [
{
"host": {
"capability": "tosca.capabilities.ARTICONF.VM.topology",
"capability": "tosca.capabilities.QC.VM.topology",
"node": "topology",
"relationship": "tosca.relationships.HostedOn"
}
......@@ -111,7 +111,7 @@
}
}
},
"type": "tosca.nodes.ARTICONF.docker.Orchestrator.Kubernetes"
"type": "tosca.nodes.QC.docker.Orchestrator.Kubernetes"
},
"topology": {
"properties": {
......@@ -121,14 +121,14 @@
"requirements": [
{
"vm": {
"capability": "tosca.capabilities.ARTICONF.VM",
"capability": "tosca.capabilities.QC.VM",
"node": "compute",
"relationship": "tosca.relationships.DependsOn"
}
},
{
"vm": {
"capability": "tosca.capabilities.ARTICONF.VM",
"capability": "tosca.capabilities.QC.VM",
"node": "compute_1",
"relationship": "tosca.relationships.DependsOn"
}
......@@ -168,7 +168,7 @@
}
}
},
"type": "tosca.nodes.ARTICONF.VM.topology",
"type": "tosca.nodes.QC.VM.topology",
"attributes": {
"credential": {
"cloud_provider_name": "EC2",
......@@ -186,7 +186,7 @@
"encoding": "base64",
"file_contents": "XXXXXXXXXXXXXXXXXx",
"file_ext": "zip",
"type": "tosca.datatypes.ARTICONF.encodedFile"
"type": "tosca.datatypes.QC.encodedFile"
}
}
},
......@@ -199,13 +199,13 @@
"requirements": [
{
"host": {
"capability": "tosca.capabilities.ARTICONF.docker.Orchestrator",
"capability": "tosca.capabilities.QC.docker.Orchestrator",
"node": "kubernetes",
"relationship": "tosca.relationships.HostedOn"
}
}
],
"type": "tosca.nodes.ARTICONF.Container.Application.Docker",
"type": "tosca.nodes.QC.Container.Application.Docker",
"artifacts": {
"image": {
"file": "alogo53/ws-pema-lifewatch",
......
......@@ -17,7 +17,7 @@
"create": "dumy.yaml"
}
},
"type": "tosca.nodes.ARTICONF.VM.Compute",
"type": "tosca.nodes.QC.VM.Compute",
"attributes": {
"host_name": "vm0",
"node_type": "t2.micro",
......@@ -51,7 +51,7 @@
"create": "dumy.yaml"
}
},
"type": "tosca.nodes.ARTICONF.VM.Compute",
"type": "tosca.nodes.QC.VM.Compute",
"attributes": {
"host_name": "vm1",
"node_type": "t2.micro",
......@@ -76,7 +76,7 @@
"requirements": [
{
"host": {
"capability": "tosca.capabilities.ARTICONF.VM.topology",
"capability": "tosca.capabilities.QC.VM.topology",
"node": "topology",
"relationship": "tosca.relationships.HostedOn"
}
......@@ -104,7 +104,7 @@
}
}
},
"type": "tosca.nodes.ARTICONF.docker.Orchestrator.Kubernetes"
"type": "tosca.nodes.QC.docker.Orchestrator.Kubernetes"
},
"topology": {
"properties": {
......@@ -114,14 +114,14 @@
"requirements": [
{
"vm": {
"capability": "tosca.capabilities.ARTICONF.VM",
"capability": "tosca.capabilities.QC.VM",
"node": "compute",
"relationship": "tosca.relationships.DependsOn"
}
},
{
"vm": {
"capability": "tosca.capabilities.ARTICONF.VM",
"capability": "tosca.capabilities.QC.VM",
"node": "compute_1",
"relationship": "tosca.relationships.DependsOn"
}
......@@ -161,7 +161,7 @@
}
}
},
"type": "tosca.nodes.ARTICONF.VM.topology",
"type": "tosca.nodes.QC.VM.topology",
"attributes": {
"credential": {
"cloud_provider_name": "EC2",
......@@ -178,7 +178,7 @@
"provisioned_files": {
"file_ext": "zip",
"file_contents": "XXXXXXXXXXXXXXXXXXXx",
"type": "tosca.datatypes.ARTICONF.encodedFile",
"type": "tosca.datatypes.QC.encodedFile",
"encoding": "base64"
}
}
......@@ -192,13 +192,13 @@
"requirements": [
{
"host": {
"capability": "tosca.capabilities.ARTICONF.docker.Orchestrator",
"capability": "tosca.capabilities.QC.docker.Orchestrator",
"node": "kubernetes",
"relationship": "tosca.relationships.HostedOn"
}
}
],
"type": "tosca.nodes.ARTICONF.Container.Application.Docker",
"type": "tosca.nodes.QC.Container.Application.Docker",
"artifacts": {
"image": {
"file": "alogo53/ws-pema-lifewatch",
......
......@@ -22,7 +22,7 @@
"create": "dumy.yaml"
}
},
"type": "tosca.nodes.ARTICONF.VM.Compute",
"type": "tosca.nodes.QC.VM.Compute",
"attributes": {
"user_key_pair": {
"protocol": "ssh",
......@@ -57,7 +57,7 @@
"create": "dumy.yaml"
}
},
"type": "tosca.nodes.ARTICONF.VM.Compute",
"type": "tosca.nodes.QC.VM.Compute",
"attributes": {
"user_key_pair": {
"protocol": "ssh",
......@@ -83,7 +83,7 @@
"requirements": [
{
"host": {
"capability": "tosca.capabilities.ARTICONF.VM.topology",
"capability": "tosca.capabilities.QC.VM.topology",
"node": "topology",
"relationship": "tosca.relationships.HostedOn"
}
......@@ -121,7 +121,7 @@
}
}
},
"type": "tosca.nodes.ARTICONF.docker.Orchestrator.Kubernetes",
"type": "tosca.nodes.QC.docker.Orchestrator.Kubernetes",
"attributes": {
"desired_state": "RUNNING"
}
......@@ -134,14 +134,14 @@
"requirements": [
{
"vm": {
"capability": "tosca.capabilities.ARTICONF.VM",
"capability": "tosca.capabilities.QC.VM",
"node": "compute",
"relationship": "tosca.relationships.DependsOn"
}
},
{
"vm": {
"capability": "tosca.capabilities.ARTICONF.VM",
"capability": "tosca.capabilities.QC.VM",
"node": "compute_1",
"relationship": "tosca.relationships.DependsOn"
}
......@@ -157,7 +157,7 @@
}
}
},
"type": "tosca.nodes.ARTICONF.VM.topology",
"type": "tosca.nodes.QC.VM.topology",
"attributes": {
"credential": {
"cloud_provider_name": "ExoGENI",
......@@ -175,7 +175,7 @@
"provisioned_files": {
"file_ext": "zip",
"file_contents": "XXXXXXXX",
"type": "tosca.datatypes.ARTICONF.encodedFile",
"type": "tosca.datatypes.QC.encodedFile",
"encoding": "base64"
}
}
......@@ -189,13 +189,13 @@
"requirements": [
{
"host": {
"capability": "tosca.capabilities.ARTICONF.docker.Orchestrator",
"capability": "tosca.capabilities.QC.docker.Orchestrator",
"node": "kubernetes",
"relationship": "tosca.relationships.HostedOn"
}
}
],
"type": "tosca.nodes.ARTICONF.Container.Application.Docker",
"type": "tosca.nodes.QC.Container.Application.Docker",
"attributes": {
"desired_state": "RUNNING"
},
......
......@@ -17,7 +17,7 @@
"create": "dumy.yaml"
}
},
"type": "tosca.nodes.ARTICONF.VM.Compute",
"type": "tosca.nodes.QC.VM.Compute",
"attributes": {
"user_key_pair": {
"protocol": "ssh",
......@@ -52,7 +52,7 @@
"create": "dumy.yaml"
}
},
"type": "tosca.nodes.ARTICONF.VM.Compute",
"type": "tosca.nodes.QC.VM.Compute",
"attributes": {
"user_key_pair": {
"protocol": "ssh",
......@@ -78,7 +78,7 @@
"requirements": [
{
"host": {
"capability": "tosca.capabilities.ARTICONF.VM.topology",
"capability": "tosca.capabilities.QC.VM.topology",
"node": "topology",
"relationship": "tosca.relationships.HostedOn"
}
......@@ -103,7 +103,7 @@
}
}
},
"type": "tosca.nodes.ARTICONF.docker.Orchestrator.Kubernetes"
"type": "tosca.nodes.QC.docker.Orchestrator.Kubernetes"
},
"topology": {
"properties": {
......@@ -113,14 +113,14 @@
"requirements": [
{
"vm": {
"capability": "tosca.capabilities.ARTICONF.VM",
"capability": "tosca.capabilities.QC.VM",
"node": "compute",
"relationship": "tosca.relationships.DependsOn"
}
},
{
"vm": {
"capability": "tosca.capabilities.ARTICONF.VM",
"capability": "tosca.capabilities.QC.VM",
"node": "compute_1",
"relationship": "tosca.relationships.DependsOn"
}
......@@ -160,7 +160,7 @@
}
}
},
"type": "tosca.nodes.ARTICONF.VM.topology",
"type": "tosca.nodes.QC.VM.topology",
"attributes": {
"credential": {
"cloud_provider_name": "EC2",
......@@ -183,13 +183,13 @@
"requirements": [
{
"host": {
"capability": "tosca.capabilities.ARTICONF.docker.Orchestrator",
"capability": "tosca.capabilities.QC.docker.Orchestrator",
"node": "kubernetes",
"relationship": "tosca.relationships.HostedOn"
}
}
],
"type": "tosca.nodes.ARTICONF.Container.Application.Docker",
"type": "tosca.nodes.QC.Container.Application.Docker",
"artifacts": {
"image": {
"file": "alogo53/ws-pema-lifewatch",
......
......@@ -15,7 +15,7 @@
"30001:8080"
]
},
"type": "tosca.nodes.ARTICONF.Container.Application.Docker",
"type": "tosca.nodes.QC.Container.Application.Docker",
"artifacts": {
"image": {
"type": "tosca.artifacts.Deployment.Image.Container.Docker",
......
......@@ -34,7 +34,7 @@
"os": "Ubuntu 18.04",
"user_name": "vm_user"
},
"type": "tosca.nodes.ARTICONF.VM.Compute"
"type": "tosca.nodes.QC.VM.Compute"
},
"compute_1": {
"interfaces": {
......@@ -49,7 +49,7 @@
"os": "Ubuntu 18.04",
"user_name": "vm_user"
},
"type": "tosca.nodes.ARTICONF.VM.Compute"
"type": "tosca.nodes.QC.VM.Compute"
},
"kubernetes": {
"interfaces": {
......@@ -77,13 +77,13 @@
"requirements": [
{
"host": {
"capability": "tosca.capabilities.ARTICONF.VM.topology",
"capability": "tosca.capabilities.QC.VM.topology",
"node": "topology",
"relationship": "tosca.relationships.HostedOn"
}
}
],
"type": "tosca.nodes.ARTICONF.docker.Orchestrator.Kubernetes"
"type": "tosca.nodes.QC.docker.Orchestrator.Kubernetes"
},
"topology": {
"artifacts": {
......@@ -133,20 +133,20 @@
"requirements": [
{
"vm": {
"capability": "tosca.capabilities.ARTICONF.VM",
"capability": "tosca.capabilities.QC.VM",
"node": "compute",
"relationship": "tosca.relationships.DependsOn"
}
},
{
"vm": {
"capability": "tosca.capabilities.ARTICONF.VM",
"capability": "tosca.capabilities.QC.VM",
"node": "compute_1",
"relationship": "tosca.relationships.DependsOn"
}
}
],
"type": "tosca.nodes.ARTICONF.VM.topology"
"type": "tosca.nodes.QC.VM.topology"
},
"ws-pema": {
"artifacts": {
......@@ -164,13 +164,13 @@
"requirements": [
{
"host": {
"capability": "tosca.capabilities.ARTICONF.docker.Orchestrator",
"capability": "tosca.capabilities.QC.docker.Orchestrator",
"node": "kubernetes",
"relationship": "tosca.relationships.HostedOn"
}
}
],
"type": "tosca.nodes.ARTICONF.Container.Application.Docker"
"type": "tosca.nodes.QC.Container.Application.Docker"
}
}
}
......
......@@ -22,7 +22,7 @@
"create": "dumy.yaml"
}
},
"type": "tosca.nodes.ARTICONF.VM.Compute"
"type": "tosca.nodes.QC.VM.Compute"
},
"compute_1": {
"properties": {
......@@ -37,13 +37,13 @@
"create": "dumy.yaml"
}
},
"type": "tosca.nodes.ARTICONF.VM.Compute"
"type": "tosca.nodes.QC.VM.Compute"
},
"kubernetes": {
"requirements": [
{
"host": {
"capability": "tosca.capabilities.ARTICONF.VM.topology",
"capability": "tosca.capabilities.QC.VM.topology",
"node": "topology",
"relationship": "tosca.relationships.HostedOn"
}
......@@ -71,7 +71,7 @@
}
}
},
"type": "tosca.nodes.ARTICONF.docker.Orchestrator.Kubernetes"
"type": "tosca.nodes.QC.docker.Orchestrator.Kubernetes"
},
"topology": {
"properties": {
......@@ -81,14 +81,14 @@
"requirements": [
{
"vm": {
"capability": "tosca.capabilities.ARTICONF.VM",
"capability": "tosca.capabilities.QC.VM",
"node": "compute",
"relationship": "tosca.relationships.DependsOn"
}
},
{
"vm": {
"capability": "tosca.capabilities.ARTICONF.VM",
"capability": "tosca.capabilities.QC.VM",
"node": "compute_1",
"relationship": "tosca.relationships.DependsOn"
}
......@@ -128,7 +128,7 @@
}
}
},
"type": "tosca.nodes.ARTICONF.VM.topology",
"type": "tosca.nodes.QC.VM.topology",
"attributes": {
"credential": {
"cloud_provider_name": "EC2",
......@@ -156,13 +156,13 @@
"requirements": [
{
"host": {
"capability": "tosca.capabilities.ARTICONF.docker.Orchestrator",
"capability": "tosca.capabilities.QC.docker.Orchestrator",
"node": "kubernetes",
"relationship": "tosca.relationships.HostedOn"
}
}
],
"type": "tosca.nodes.ARTICONF.Container.Application.Docker",
"type": "tosca.nodes.QC.Container.Application.Docker",
"artifacts": {
"image": {
"file": "alogo53/ws-pema-lifewatch",
......
......@@ -311,7 +311,7 @@
"\n",
"\n",
"for node_name in tosca_dict['topology_template']['node_templates']:\n",
" if tosca_dict['topology_template']['node_templates'][node_name]['type'] == 'tosca.nodes.ARTICONF.VM.Compute':\n",
" if tosca_dict['topology_template']['node_templates'][node_name]['type'] == 'tosca.nodes.QC.VM.Compute':\n",
" print(node_name+': '+tosca_dict['topology_template']['node_templates'][node_name]['attributes']['public_ip'])"
]
},
......@@ -349,12 +349,12 @@
"nx.draw(graph, with_labels=True)\n",
"\n",
"for node_name in tosca_dict['topology_template']['node_templates']:\n",
" if tosca_dict['topology_template']['node_templates'][node_name]['type'] == 'tosca.nodes.ARTICONF.docker.Orchestrator.Kubernetes':\n",
" if tosca_dict['topology_template']['node_templates'][node_name]['type'] == 'tosca.nodes.QC.docker.Orchestrator.Kubernetes':\n",
" for token in tosca_dict['topology_template']['node_templates'][node_name]['attributes']['tokens']:\n",
" if token['user'] == 'dashboard_token':\n",
" print(node_name+': '+' dashboard_token: '+token['token'])\n",
" print(node_name+': '+str(tosca_dict['topology_template']['node_templates'][node_name]['attributes']['dashboard_url']))\n",
" if tosca_dict['topology_template']['node_templates'][node_name]['type'] == 'tosca.nodes.ARTICONF.Container.Application.Docker':\n",
" if tosca_dict['topology_template']['node_templates'][node_name]['type'] == 'tosca.nodes.QC.Container.Application.Docker':\n",
" print(node_name+': '+str(tosca_dict['topology_template']['node_templates'][node_name]['attributes']['service_url']))\n",
" "
]
......
......@@ -104,7 +104,7 @@ class TestDefaultApi(unittest.TestCase):
file_id = self.upload_tosca_template('application_example_provisioned.yaml')
node_templates = self.api.get_node_templates(file_id)
self.assertIsNotNone(node_templates)
nodes_to_deploy = self.api.get_node_templates(file_id,type_name = 'tosca.nodes.ARTICONF.Application')
nodes_to_deploy = self.api.get_node_templates(file_id,type_name = 'tosca.nodes.QC.Application')
......
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