From 555ed220193bb40436e9070e6eaffdbb39b9a835 Mon Sep 17 00:00:00 2001 From: jmuell Date: Tue, 14 Nov 2017 22:25:08 +0100 Subject: [PATCH 01/52] copy template.yaml from docker-example --- .../csars/yaml/valid/lamp-csar/template.yaml | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml new file mode 100644 index 000000000..39b1d4538 --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml @@ -0,0 +1,106 @@ +tosca_definitions_version: tosca_simple_yaml_1_0 +description: Template for deploying the simple-task-app via docker +metadata: + template_name: simple-task-docker-template + template_author: stupro-toscana + template_version: 1.0 + +node_types: + DockerEngine: + derived_from: tosca.nodes.Root + # needs capability: DockerHost or similar.. + capabilities: + host: + type: DockerHost + requirements: + - os: + type: linux + distribution: ubuntu + architecture: x86_64 + interfaces: + Standard: + create: + implementation: docker/dockerengine_create.sh + start: + implementation: docker/dockerengine_start.sh + stop: + implementation: docker/dockerengine_stop.sh + DockerApp: + derived_from: tosca.nodes.Root + requirements: + - host: + capability: DockerHost + node: DockerEngine + relationship: tosca.relationships.HostedOn + - network: + capability: SimplePublicWebEndpoint + attributes: + tag: + type: string + description: the tag for the docker image + identifier: + type: string + description: the identifier (name) for the docker container + interfaces: + Standard: + create: + implementation: docker/dockerapp_create.sh + start: + implementation: docker/dockerapp_create.sh + stop: + implementation: docker/dockerapp_stop.sh + delete: + implementation: docker/dockerapp_delete.sh +capability_types: + DockerHost: + derived_from: tosca.capabilities.Root + valid_source_types: [ DockerApp ] + SimplePublicWebEndpoint: + derived_from: tosca.capabilities.Endpoint + properties: + protocol: + default: http + port: + default: 80 + url_path: + default: / + network_name: + default: PUBLIC + +topology_template: + node_templates: + myDockerEngine: + type: DockerEngine + + simpleTaskApp: + type: DockerApp + attributes: + tag: + description: tag for docker image + value: simple-task-app + identifier: + description: identifier of docker container + value: simple-task-app-1 + endpoint: + value: { get_operation_output: [ SELF, Standard, create, endpoint ] } + interfaces: + Standard: + inputs: + tag: { get_attribute: [ SELF, tag ] } + identifier: { get_attribute: [ SELF, identifier ] } + create: + implementation: + primary: simple-task-app/create.sh + # dependencies will get copied by orchestrator to the same location + # as create.sh, before create.sh is executed + dependencies: + - simple-task-app/Dockerfile + - simple-task-app/createdb.sql + - simple-task-app/index.php + - simple-task-app/mysql-credentials.php + + + outputs: + endpoint: + description: the endpoint of the simple-task-app +value: { get_attribute: [ simpleTaskApp, endpoint ] } From c1a37d08982382aace0e623629662e043c6e5a92 Mon Sep 17 00:00:00 2001 From: jmuell Date: Tue, 14 Nov 2017 22:48:59 +0100 Subject: [PATCH 02/52] add first node types to template.yaml --- .../csars/yaml/valid/lamp-csar/template.yaml | 119 ++++-------------- 1 file changed, 23 insertions(+), 96 deletions(-) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml index 39b1d4538..42e094932 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml @@ -1,106 +1,33 @@ tosca_definitions_version: tosca_simple_yaml_1_0 -description: Template for deploying the simple-task-app via docker +description: Template for deploying a lamp-stack application metadata: - template_name: simple-task-docker-template + template_name: lamp-stack-template template_author: stupro-toscana template_version: 1.0 node_types: - DockerEngine: - derived_from: tosca.nodes.Root - # needs capability: DockerHost or similar.. - capabilities: - host: - type: DockerHost - requirements: - - os: - type: linux - distribution: ubuntu - architecture: x86_64 - interfaces: - Standard: - create: - implementation: docker/dockerengine_create.sh - start: - implementation: docker/dockerengine_start.sh - stop: - implementation: docker/dockerengine_stop.sh - DockerApp: - derived_from: tosca.nodes.Root - requirements: - - host: - capability: DockerHost - node: DockerEngine - relationship: tosca.relationships.HostedOn - - network: - capability: SimplePublicWebEndpoint - attributes: - tag: - type: string - description: the tag for the docker image - identifier: - type: string - description: the identifier (name) for the docker container - interfaces: - Standard: - create: - implementation: docker/dockerapp_create.sh - start: - implementation: docker/dockerapp_create.sh - stop: - implementation: docker/dockerapp_stop.sh - delete: - implementation: docker/dockerapp_delete.sh -capability_types: - DockerHost: - derived_from: tosca.capabilities.Root - valid_source_types: [ DockerApp ] - SimplePublicWebEndpoint: - derived_from: tosca.capabilities.Endpoint - properties: - protocol: - default: http - port: - default: 80 - url_path: - default: / - network_name: - default: PUBLIC + ApacheWebServer: + derived_from: tosca.nodes.WebServer -topology_template: - node_templates: - myDockerEngine: - type: DockerEngine + mysql: + derived_from: tosca.nodes.Database - simpleTaskApp: - type: DockerApp - attributes: - tag: - description: tag for docker image - value: simple-task-app - identifier: - description: identifier of docker container - value: simple-task-app-1 - endpoint: - value: { get_operation_output: [ SELF, Standard, create, endpoint ] } - interfaces: - Standard: - inputs: - tag: { get_attribute: [ SELF, tag ] } - identifier: { get_attribute: [ SELF, identifier ] } - create: - implementation: - primary: simple-task-app/create.sh - # dependencies will get copied by orchestrator to the same location - # as create.sh, before create.sh is executed - dependencies: - - simple-task-app/Dockerfile - - simple-task-app/createdb.sql - - simple-task-app/index.php - - simple-task-app/mysql-credentials.php +topology_template: + node_templates: + ApacheWebServer: + type: tosca.nodes.WebServer.Apache + properties: #TODO + requirements: + - host: WebServer - outputs: - endpoint: - description: the endpoint of the simple-task-app -value: { get_attribute: [ simpleTaskApp, endpoint ] } + mysql: + type: tosca.nodes.DBMS.MySQL + properties: + root_password: { get_input: my_mysql_rootpw } + port: { get_input: my_mysql_port } + requirements: + - host: db_server + interfaces: + Standard: + configure: scripts/my_own_configure.sh From 95a1a05bc1b9c1fb2e6c19563e75c46c9d45aefd Mon Sep 17 00:00:00 2001 From: jmuell Date: Tue, 14 Nov 2017 23:08:06 +0100 Subject: [PATCH 03/52] add some db nodetypes --- .../csars/yaml/valid/lamp-csar/template.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml index 42e094932..af8841f2b 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml @@ -11,6 +11,17 @@ node_types: mysql: derived_from: tosca.nodes.Database + requirements: + - host: + node: tosca.nodes.DBMS.MySQL + + dbms: + derived_from: tosca.nodes.DBMS + properties: + port: + description: reflect the default MySQL server port + default: 3306 + topology_template: @@ -21,6 +32,10 @@ topology_template: requirements: - host: WebServer + WebServer: + type: tosca.nodes.Compute + # TODO + mysql: type: tosca.nodes.DBMS.MySQL properties: From 98e2945025926cad9b70d705aaa9c8c60ecb386a Mon Sep 17 00:00:00 2001 From: jmuell Date: Wed, 15 Nov 2017 00:07:25 +0100 Subject: [PATCH 04/52] add node_templates for LAMP and delete node_types --- .../csars/yaml/valid/lamp-csar/template.yaml | 68 +++++++++++-------- 1 file changed, 41 insertions(+), 27 deletions(-) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml index af8841f2b..1d9645112 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml @@ -5,44 +5,58 @@ metadata: template_author: stupro-toscana template_version: 1.0 -node_types: - ApacheWebServer: - derived_from: tosca.nodes.WebServer - - mysql: - derived_from: tosca.nodes.Database - requirements: - - host: - node: tosca.nodes.DBMS.MySQL - - dbms: - derived_from: tosca.nodes.DBMS - properties: - port: - description: reflect the default MySQL server port - default: 3306 - - topology_template: node_templates: + + my_app: + type: tosca.nodes.SoftwareComponent + requirements: + - host: ApacheWebServer + ApacheWebServer: - type: tosca.nodes.WebServer.Apache + type: tosca.nodes.WebServer properties: #TODO requirements: - - host: WebServer - - WebServer: - type: tosca.nodes.Compute - # TODO + - host: server + interfaces: + Standard: + create: webserver_install.sh + start: webserver_start.sh + + my_db: + type: tosca.nodes.Database.MySQL + properties: + name: { get_input: database_name } + user: { get_input: database_user } + password: { get_input: database_password } + port: { get_input: database_port } + capabilities: + database_endpoint: + properties: + port: { get_input: db_port } + requirements: + - host: mysql_dbms + interfaces: + Standard: + create: + implementation: db_create.sh - mysql: + mysql_dbms: type: tosca.nodes.DBMS.MySQL properties: root_password: { get_input: my_mysql_rootpw } port: { get_input: my_mysql_port } requirements: - - host: db_server + - host: server interfaces: Standard: - configure: scripts/my_own_configure.sh + inputs: + db_root_password: { get_property: [ mysql_dbms, root_password ] } + create: mysql_dbms_install.sh + start: mysql_dbms_start.sh + configure: mysql_dbms_configure.sh + + server: + type: tosca.nodes.Compute + capabilities: #TODO From 184e1d59ea36c5b21995681f6196fbc18fbcc1df Mon Sep 17 00:00:00 2001 From: jmuell Date: Wed, 15 Nov 2017 16:55:44 +0100 Subject: [PATCH 05/52] add php Interface to my_app node_template --- .../test/resources/csars/yaml/valid/lamp-csar/template.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml index 1d9645112..d212eff8a 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml @@ -13,10 +13,13 @@ topology_template: type: tosca.nodes.SoftwareComponent requirements: - host: ApacheWebServer + interfaces: + Standard: + create: install_php.sh + start: start_myphpapp.sh ApacheWebServer: type: tosca.nodes.WebServer - properties: #TODO requirements: - host: server interfaces: From 1f85a7a861a7639cbcb1700854e3b52b3a04a064 Mon Sep 17 00:00:00 2001 From: jmuell Date: Wed, 15 Nov 2017 17:22:02 +0100 Subject: [PATCH 06/52] add scripts to install php and start myphpapp --- .../valid/lamp-csar/scripts/install_php.sh | 4 + .../lamp-csar/scripts/start_myphpapp.php | 82 +++++++++++++++++++ .../csars/yaml/valid/lamp-csar/template.yaml | 26 ++++-- 3 files changed, 103 insertions(+), 9 deletions(-) create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/install_php.sh create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/start_myphpapp.php diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/install_php.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/install_php.sh new file mode 100644 index 000000000..ed7786e1f --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/install_php.sh @@ -0,0 +1,4 @@ +#!/bin/bash +# install php on a linux machine with php-mysql +sudo apt-get install php -Y +sudo apt-get install php-mysql -Y diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/start_myphpapp.php b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/start_myphpapp.php new file mode 100644 index 000000000..8ade46673 --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/start_myphpapp.php @@ -0,0 +1,82 @@ +query("INSERT INTO tasks(task) VALUES('".$task."')")) { + echo("Creating task failed"); + } + $conn->close(); +} +/** +* reads from db and prints it in html +*/ +function readFromDb() +{ + $sql = "select * from tasks"; + $conn = newDbConnection(); + $result = $conn->query($sql); + $conn->close(); + if ($result->num_rows > 0) { + // output data for each row + while ($row = $result->fetch_assoc()) { + echo htmlspecialchars("id: " . $row['id']. " - Task: " . $row['task'])."
"; + } + return; + } + echo "0 results"; +} +/** +* generates new DB connection with given credentials +*/ +function newDbConnection() +{ + extract($GLOBALS); + $conn = new mysqli($host, $username, $password, $database, $port); + if ($conn->connect_error) { + die("Connection failed: " . $conn->connect_error); + } + return $conn; +} +?> + + + + + SimpleTaskApp + + + +

SimpleTaskApp

+ +
+ + +
+ + + diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml index d212eff8a..1276f9b42 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml @@ -15,8 +15,8 @@ topology_template: - host: ApacheWebServer interfaces: Standard: - create: install_php.sh - start: start_myphpapp.sh + create: scripts/install_php.sh + start: scripts/start_myphpapp.php ApacheWebServer: type: tosca.nodes.WebServer @@ -24,8 +24,8 @@ topology_template: - host: server interfaces: Standard: - create: webserver_install.sh - start: webserver_start.sh + create: scripts/webserver_install.sh + start: scripts/webserver_start.sh my_db: type: tosca.nodes.Database.MySQL @@ -43,7 +43,7 @@ topology_template: interfaces: Standard: create: - implementation: db_create.sh + implementation: scripts/db_create.sh mysql_dbms: type: tosca.nodes.DBMS.MySQL @@ -56,10 +56,18 @@ topology_template: Standard: inputs: db_root_password: { get_property: [ mysql_dbms, root_password ] } - create: mysql_dbms_install.sh - start: mysql_dbms_start.sh - configure: mysql_dbms_configure.sh + create: scripts/mysql_dbms_install.sh + start: scripts/mysql_dbms_start.sh + configure: scripts/mysql_dbms_configure.sh server: type: tosca.nodes.Compute - capabilities: #TODO + capabilities: + host: + properties: + disk_size: 10 GB + os: + properties: + type: linux + distribution: ubuntu + version: 16.04 From c400ce3b9362ac5cfeba6162cfb3c4afa304c792 Mon Sep 17 00:00:00 2001 From: jmuell Date: Wed, 15 Nov 2017 17:44:32 +0100 Subject: [PATCH 07/52] add create_db script --- .../csars/yaml/valid/lamp-csar/scripts/db_create.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/db_create.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/db_create.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/db_create.sh new file mode 100644 index 000000000..e2bc21e3d --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/db_create.sh @@ -0,0 +1,7 @@ +# Setup MySQL root password and create user +cat << EOF | mysql -u root --password=db_root_password +CREATE DATABASE mydb; +USE mydb; +create table tasks (id INT not null auto_increment,task varchar(255), primary key(id)); +EXIT +EOF From c626eee21ac6f6467ebd9f24a5be715043c04832 Mon Sep 17 00:00:00 2001 From: jmuell Date: Wed, 15 Nov 2017 17:57:23 +0100 Subject: [PATCH 08/52] add scripts for dbms --- .../resources/csars/yaml/valid/lamp-csar/scripts/db_create.sh | 1 + .../csars/yaml/valid/lamp-csar/scripts/mysql_dbms_configure.sh | 2 ++ .../csars/yaml/valid/lamp-csar/scripts/mysql_dbms_install.sh | 3 +++ .../csars/yaml/valid/lamp-csar/scripts/mysql_dbms_start.sh | 2 ++ 4 files changed, 8 insertions(+) create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/mysql_dbms_configure.sh create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/mysql_dbms_install.sh create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/mysql_dbms_start.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/db_create.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/db_create.sh index e2bc21e3d..6b8e6d42f 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/db_create.sh +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/db_create.sh @@ -1,3 +1,4 @@ +#!/bin/bash # Setup MySQL root password and create user cat << EOF | mysql -u root --password=db_root_password CREATE DATABASE mydb; diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/mysql_dbms_configure.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/mysql_dbms_configure.sh new file mode 100644 index 000000000..87480b8ba --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/mysql_dbms_configure.sh @@ -0,0 +1,2 @@ +#!/bin/bash +sudo mysqladmin -u root -p password my_mysql_rootpw diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/mysql_dbms_install.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/mysql_dbms_install.sh new file mode 100644 index 000000000..1d4bfce3e --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/mysql_dbms_install.sh @@ -0,0 +1,3 @@ +#!/bin/bash +sudo apt-get install mysql-server -Y +sudo systemctl enable mysql.service diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/mysql_dbms_start.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/mysql_dbms_start.sh new file mode 100644 index 000000000..986fc4f72 --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/mysql_dbms_start.sh @@ -0,0 +1,2 @@ +#!/bin/bash +sudo systemctl start mysql.service From 1589402424bbda90d40c83df3a923e4b886d5f23 Mon Sep 17 00:00:00 2001 From: jmuell Date: Wed, 15 Nov 2017 18:05:46 +0100 Subject: [PATCH 09/52] add scripts for apache --- .../csars/yaml/valid/lamp-csar/scripts/webserver_install.sh | 2 ++ .../csars/yaml/valid/lamp-csar/scripts/webserver_start.sh | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/webserver_install.sh create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/webserver_start.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/webserver_install.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/webserver_install.sh new file mode 100644 index 000000000..d464b6a98 --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/webserver_install.sh @@ -0,0 +1,2 @@ +#!/bin/bash +sudo apt-get install apache2 -Y diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/webserver_start.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/webserver_start.sh new file mode 100644 index 000000000..d8cf0070b --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/webserver_start.sh @@ -0,0 +1,2 @@ +#!/bin/bash +sudo service apache2 start From c65bac1a897794f4759395fbf28a4d18193905c9 Mon Sep 17 00:00:00 2001 From: Marvin Munoz Baron Date: Wed, 15 Nov 2017 18:23:26 +0100 Subject: [PATCH 10/52] Complete compute node --- .../test/resources/csars/yaml/valid/lamp-csar/template.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml index 1276f9b42..e0a2b4f59 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml @@ -65,9 +65,12 @@ topology_template: capabilities: host: properties: + num_cpus: 1 disk_size: 10 GB + meme_size: 4096 MB os: properties: + architecture: x86_64 type: linux distribution: ubuntu version: 16.04 From 4239e62ce904a4126b9a6e3084136a84bd5036fd Mon Sep 17 00:00:00 2001 From: Marvin Munoz Baron Date: Wed, 15 Nov 2017 20:13:59 +0100 Subject: [PATCH 11/52] Refactor LAMP yaml template --- .../csars/yaml/valid/lamp-csar/template.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml index e0a2b4f59..2a7dd29c3 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml @@ -1,5 +1,5 @@ tosca_definitions_version: tosca_simple_yaml_1_0 -description: Template for deploying a lamp-stack application +description: Template for deploying a LAMP stack. metadata: template_name: lamp-stack-template template_author: stupro-toscana @@ -7,18 +7,19 @@ metadata: topology_template: - node_templates: + node_templates: my_app: type: tosca.nodes.SoftwareComponent requirements: - - host: ApacheWebServer + - host: apache_web_server + - database_endpoint: my_db interfaces: Standard: create: scripts/install_php.sh start: scripts/start_myphpapp.php - ApacheWebServer: + apache_web_server: type: tosca.nodes.WebServer requirements: - host: server @@ -66,11 +67,10 @@ topology_template: host: properties: num_cpus: 1 - disk_size: 10 GB - meme_size: 4096 MB + disk_size: 25 GB + mem_size: 2048 MB os: properties: - architecture: x86_64 type: linux distribution: ubuntu version: 16.04 From 3197946c9a27752200514d162c2645e6187279ac Mon Sep 17 00:00:00 2001 From: Marvin Munoz Baron Date: Wed, 15 Nov 2017 20:20:38 +0100 Subject: [PATCH 12/52] Add inputs/outputs to lamp template --- .../csars/yaml/valid/lamp-csar/template.yaml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml index 2a7dd29c3..5f739c5e1 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml @@ -7,6 +7,19 @@ metadata: topology_template: + inputs: + database_name: + type: string + database_user: + type: string + database_password: + type: string + database_port: + type: integer + my_mysql_rootpw: + type: string + my_mysql_port: + type: integer node_templates: my_app: @@ -38,7 +51,7 @@ topology_template: capabilities: database_endpoint: properties: - port: { get_input: db_port } + port: { get_property: [SELF, port] } requirements: - host: mysql_dbms interfaces: @@ -74,3 +87,7 @@ topology_template: type: linux distribution: ubuntu version: 16.04 + outputs: + endpoint: + description: endpoint of the php-app + value: { get_attribute: [ my_app, #TODO ] } From 839e8e5307a315615bcb7e15aada74c1ad90cbd3 Mon Sep 17 00:00:00 2001 From: Marvin Munoz Baron Date: Wed, 15 Nov 2017 21:12:34 +0100 Subject: [PATCH 13/52] Fix inputs/outputs in LAMP template --- .../lamp-csar/scripts/mysql_dbms_configure.sh | 2 +- .../lamp-csar/scripts/start_myphpapp.php | 12 +++++----- .../csars/yaml/valid/lamp-csar/template.yaml | 24 ++++++++++++------- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/mysql_dbms_configure.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/mysql_dbms_configure.sh index 87480b8ba..c6861c967 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/mysql_dbms_configure.sh +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/mysql_dbms_configure.sh @@ -1,2 +1,2 @@ #!/bin/bash -sudo mysqladmin -u root -p password my_mysql_rootpw +sudo mysqladmin -u root -p password db_root_password diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/start_myphpapp.php b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/start_myphpapp.php index 8ade46673..f31554f30 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/start_myphpapp.php +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/start_myphpapp.php @@ -2,11 +2,11 @@ // include the credentials to connect to the db //include_once "mysql-credentials.php"; -$host = "127.0.0.1"; -$username = "root"; -$password = ""; -$database = "mydb"; -$port = 3306; +$db_host = "127.0.0.1"; +$db_user = "root"; +$db_password = ""; +$db_name = "mydb"; +$db_port = 3306; // get task from post after task was entered in form $post = $_POST['task']; @@ -49,7 +49,7 @@ function readFromDb() function newDbConnection() { extract($GLOBALS); - $conn = new mysqli($host, $username, $password, $database, $port); + $conn = new mysqli($db_host, $db_user, $db_password, $db_name, $db_port); if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml index 5f739c5e1..be2f0b3d1 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml @@ -23,14 +23,21 @@ topology_template: node_templates: my_app: - type: tosca.nodes.SoftwareComponent + type: tosca.nodes.WebApplication requirements: - host: apache_web_server - database_endpoint: my_db interfaces: Standard: create: scripts/install_php.sh - start: scripts/start_myphpapp.php + start: + implementation: scripts/start_myphpapp.php + inputs: + db_host: { #TODO needs to be the address of the Apache server? } + db_name: { get_property: [ my_db, name ] } + db_user: { get_property: [ my_db, user ] } + db_password: { get_property: [ my_db, password ] } + db_port: { get_property: [ SELF, database_endpoint, port ] } apache_web_server: type: tosca.nodes.WebServer @@ -51,13 +58,12 @@ topology_template: capabilities: database_endpoint: properties: - port: { get_property: [SELF, port] } + port: { get_input: database_port } requirements: - host: mysql_dbms interfaces: Standard: - create: - implementation: scripts/db_create.sh + create: scripts/db_create.sh mysql_dbms: type: tosca.nodes.DBMS.MySQL @@ -70,9 +76,9 @@ topology_template: Standard: inputs: db_root_password: { get_property: [ mysql_dbms, root_password ] } - create: scripts/mysql_dbms_install.sh - start: scripts/mysql_dbms_start.sh - configure: scripts/mysql_dbms_configure.sh + create: scripts/mysql_dbms_install.sh + start: scripts/mysql_dbms_start.sh + configure: scripts/mysql_dbms_configure.sh server: type: tosca.nodes.Compute @@ -90,4 +96,4 @@ topology_template: outputs: endpoint: description: endpoint of the php-app - value: { get_attribute: [ my_app, #TODO ] } + value: { get_attribute: [ server, public_address ] } From 998f2f72752d87b4e833537ff12a85098d9b6ce8 Mon Sep 17 00:00:00 2001 From: Marvin Munoz Baron Date: Wed, 15 Nov 2017 21:19:33 +0100 Subject: [PATCH 14/52] Add db_host to LAMP template --- .../src/test/resources/csars/yaml/valid/lamp-csar/template.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml index be2f0b3d1..a34c63f06 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml @@ -33,7 +33,7 @@ topology_template: start: implementation: scripts/start_myphpapp.php inputs: - db_host: { #TODO needs to be the address of the Apache server? } + db_host: { get_attribute: [ apache_web_server, private_address ] } db_name: { get_property: [ my_db, name ] } db_user: { get_property: [ my_db, user ] } db_password: { get_property: [ my_db, password ] } From c94f782e14cef83efbae922ebbf5fae765241787 Mon Sep 17 00:00:00 2001 From: jmuell Date: Thu, 16 Nov 2017 09:33:10 +0100 Subject: [PATCH 15/52] change Y to y in installscripts --- .../csars/yaml/valid/lamp-csar/scripts/install_php.sh | 4 ++-- .../csars/yaml/valid/lamp-csar/scripts/mysql_dbms_install.sh | 2 +- .../csars/yaml/valid/lamp-csar/scripts/webserver_install.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/install_php.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/install_php.sh index ed7786e1f..0220b3fe4 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/install_php.sh +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/install_php.sh @@ -1,4 +1,4 @@ #!/bin/bash # install php on a linux machine with php-mysql -sudo apt-get install php -Y -sudo apt-get install php-mysql -Y +sudo apt-get install php -y +sudo apt-get install php-mysql -y diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/mysql_dbms_install.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/mysql_dbms_install.sh index 1d4bfce3e..002569af4 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/mysql_dbms_install.sh +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/mysql_dbms_install.sh @@ -1,3 +1,3 @@ #!/bin/bash -sudo apt-get install mysql-server -Y +sudo apt-get install mysql-server -y sudo systemctl enable mysql.service diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/webserver_install.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/webserver_install.sh index d464b6a98..5fe5db1b7 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/webserver_install.sh +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/webserver_install.sh @@ -1,2 +1,2 @@ #!/bin/bash -sudo apt-get install apache2 -Y +sudo apt-get install apache2 -y From 788254087a39b1a19fc17f4891bbf9f6c2641a57 Mon Sep 17 00:00:00 2001 From: jmuell Date: Thu, 16 Nov 2017 11:23:06 +0100 Subject: [PATCH 16/52] Fix some bugs in shellscripts --- .../resources/csars/yaml/valid/lamp-csar/scripts/db_create.sh | 2 +- .../csars/yaml/valid/lamp-csar/scripts/mysql_dbms_install.sh | 4 ++++ .../csars/yaml/valid/lamp-csar/scripts/start_myphpapp.sh | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/start_myphpapp.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/db_create.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/db_create.sh index 6b8e6d42f..a1d0d04a9 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/db_create.sh +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/db_create.sh @@ -1,6 +1,6 @@ #!/bin/bash # Setup MySQL root password and create user -cat << EOF | mysql -u root --password=db_root_password +cat << EOF | mysql -u root --password=abc CREATE DATABASE mydb; USE mydb; create table tasks (id INT not null auto_increment,task varchar(255), primary key(id)); diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/mysql_dbms_install.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/mysql_dbms_install.sh index 002569af4..200f9f395 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/mysql_dbms_install.sh +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/mysql_dbms_install.sh @@ -1,3 +1,7 @@ #!/bin/bash +# install mysql-server without password promt. +# insert a fix pw +echo "mysql-server mysql-server/root_password password abc" | sudo debconf-set-selections +echo "mysql-server mysql-server/root_password_again password abc" | sudo debconf-set-selections sudo apt-get install mysql-server -y sudo systemctl enable mysql.service diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/start_myphpapp.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/start_myphpapp.sh new file mode 100644 index 000000000..af53975bd --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/start_myphpapp.sh @@ -0,0 +1,2 @@ +#!/bin/bash +sudo mv myphpapp.php /var/www/html/ From 34f2dc72c234ad15fed8cbf393e9b5f42086ff9c Mon Sep 17 00:00:00 2001 From: jmuell Date: Thu, 16 Nov 2017 11:23:57 +0100 Subject: [PATCH 17/52] Change structure and template --- .../lamp-csar/scripts/{start_myphpapp.php => myphpapp.php} | 2 +- .../test/resources/csars/yaml/valid/lamp-csar/template.yaml | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) rename server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/{start_myphpapp.php => myphpapp.php} (98%) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/start_myphpapp.php b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/myphpapp.php similarity index 98% rename from server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/start_myphpapp.php rename to server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/myphpapp.php index f31554f30..c9fd6622c 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/start_myphpapp.php +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/myphpapp.php @@ -4,7 +4,7 @@ $db_host = "127.0.0.1"; $db_user = "root"; -$db_password = ""; +$db_password = "abc"; $db_name = "mydb"; $db_port = 3306; diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml index a34c63f06..d383f9829 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml @@ -31,7 +31,10 @@ topology_template: Standard: create: scripts/install_php.sh start: - implementation: scripts/start_myphpapp.php + implementation: + primary: scripts/start_myphpapp.sh + dependencies: + - scripts/myphpapp.php inputs: db_host: { get_attribute: [ apache_web_server, private_address ] } db_name: { get_property: [ my_db, name ] } From 0d940fe3e96c4ab1172f9d24f667bf9222101752 Mon Sep 17 00:00:00 2001 From: jmuell Date: Thu, 16 Nov 2017 12:00:49 +0100 Subject: [PATCH 18/52] Add missing package to apache_install_script --- .../resources/csars/yaml/valid/lamp-csar/scripts/myphpapp.php | 2 +- .../csars/yaml/valid/lamp-csar/scripts/webserver_install.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/myphpapp.php b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/myphpapp.php index c9fd6622c..0a7431b8a 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/myphpapp.php +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/myphpapp.php @@ -70,7 +70,7 @@ function newDbConnection()

SimpleTaskApp

-
+
diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/webserver_install.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/webserver_install.sh index 5fe5db1b7..d18484e9a 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/webserver_install.sh +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/webserver_install.sh @@ -1,2 +1,3 @@ #!/bin/bash sudo apt-get install apache2 -y +sudo apt-get install libapache2-mod-php7.0 From 23741e4e6dff37ad11d9187355a156a92d5f5c6a Mon Sep 17 00:00:00 2001 From: jmuell Date: Thu, 16 Nov 2017 18:39:52 +0100 Subject: [PATCH 19/52] Export mysql credentials and move php --- .../csars/yaml/valid/lamp-csar/myphpapp.php | 82 +++++++++++++++++++ .../valid/lamp-csar/mysql-credentials.php | 7 ++ .../yaml/valid/lamp-csar/scripts/myphpapp.php | 7 +- .../valid/lamp-csar/scripts/start_myphpapp.sh | 1 + .../csars/yaml/valid/lamp-csar/template.yaml | 3 +- 5 files changed, 93 insertions(+), 7 deletions(-) create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar/myphpapp.php create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar/mysql-credentials.php diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/myphpapp.php b/server/src/test/resources/csars/yaml/valid/lamp-csar/myphpapp.php new file mode 100644 index 000000000..0a7431b8a --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/myphpapp.php @@ -0,0 +1,82 @@ +query("INSERT INTO tasks(task) VALUES('".$task."')")) { + echo("Creating task failed"); + } + $conn->close(); +} +/** +* reads from db and prints it in html +*/ +function readFromDb() +{ + $sql = "select * from tasks"; + $conn = newDbConnection(); + $result = $conn->query($sql); + $conn->close(); + if ($result->num_rows > 0) { + // output data for each row + while ($row = $result->fetch_assoc()) { + echo htmlspecialchars("id: " . $row['id']. " - Task: " . $row['task'])."
"; + } + return; + } + echo "0 results"; +} +/** +* generates new DB connection with given credentials +*/ +function newDbConnection() +{ + extract($GLOBALS); + $conn = new mysqli($db_host, $db_user, $db_password, $db_name, $db_port); + if ($conn->connect_error) { + die("Connection failed: " . $conn->connect_error); + } + return $conn; +} +?> + + + + + SimpleTaskApp + + + +

SimpleTaskApp

+ +
+ + +
+ + + diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/mysql-credentials.php b/server/src/test/resources/csars/yaml/valid/lamp-csar/mysql-credentials.php new file mode 100644 index 000000000..1e4fd6878 --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/mysql-credentials.php @@ -0,0 +1,7 @@ + diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/myphpapp.php b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/myphpapp.php index 0a7431b8a..6ce7893bc 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/myphpapp.php +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/myphpapp.php @@ -1,12 +1,7 @@ Date: Thu, 16 Nov 2017 18:42:58 +0100 Subject: [PATCH 20/52] Delete old duplicate file --- .../yaml/valid/lamp-csar/scripts/myphpapp.php | 77 ------------------- 1 file changed, 77 deletions(-) delete mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/myphpapp.php diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/myphpapp.php b/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/myphpapp.php deleted file mode 100644 index 6ce7893bc..000000000 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/myphpapp.php +++ /dev/null @@ -1,77 +0,0 @@ -query("INSERT INTO tasks(task) VALUES('".$task."')")) { - echo("Creating task failed"); - } - $conn->close(); -} -/** -* reads from db and prints it in html -*/ -function readFromDb() -{ - $sql = "select * from tasks"; - $conn = newDbConnection(); - $result = $conn->query($sql); - $conn->close(); - if ($result->num_rows > 0) { - // output data for each row - while ($row = $result->fetch_assoc()) { - echo htmlspecialchars("id: " . $row['id']. " - Task: " . $row['task'])."
"; - } - return; - } - echo "0 results"; -} -/** -* generates new DB connection with given credentials -*/ -function newDbConnection() -{ - extract($GLOBALS); - $conn = new mysqli($db_host, $db_user, $db_password, $db_name, $db_port); - if ($conn->connect_error) { - die("Connection failed: " . $conn->connect_error); - } - return $conn; -} -?> - - - - - SimpleTaskApp - - - -

SimpleTaskApp

- -
- - -
- - - From b8df47178090aa1ff262417e967d475177803383 Mon Sep 17 00:00:00 2001 From: Marvin Munoz Baron Date: Thu, 16 Nov 2017 18:58:49 +0100 Subject: [PATCH 21/52] Change LAMP-CSAR structure --- .../webserver_install.sh | 0 .../webserver_start.sh | 0 .../lamp-csar/{scripts => my_app}/install_php.sh | 0 .../valid/lamp-csar/{ => my_app}/myphpapp.php | 0 .../lamp-csar/{ => my_app}/mysql-credentials.php | 0 .../{scripts => my_app}/start_myphpapp.sh | 0 .../lamp-csar/{scripts => my_db}/db_create.sh | 0 .../mysql_dbms_configure.sh | 0 .../mysql_dbms_install.sh | 0 .../{scripts => mysql_dbms}/mysql_dbms_start.sh | 0 .../csars/yaml/valid/lamp-csar/template.yaml | 16 ++++++++-------- 11 files changed, 8 insertions(+), 8 deletions(-) rename server/src/test/resources/csars/yaml/valid/lamp-csar/{scripts => apache_web_server}/webserver_install.sh (100%) rename server/src/test/resources/csars/yaml/valid/lamp-csar/{scripts => apache_web_server}/webserver_start.sh (100%) rename server/src/test/resources/csars/yaml/valid/lamp-csar/{scripts => my_app}/install_php.sh (100%) rename server/src/test/resources/csars/yaml/valid/lamp-csar/{ => my_app}/myphpapp.php (100%) rename server/src/test/resources/csars/yaml/valid/lamp-csar/{ => my_app}/mysql-credentials.php (100%) rename server/src/test/resources/csars/yaml/valid/lamp-csar/{scripts => my_app}/start_myphpapp.sh (100%) rename server/src/test/resources/csars/yaml/valid/lamp-csar/{scripts => my_db}/db_create.sh (100%) rename server/src/test/resources/csars/yaml/valid/lamp-csar/{scripts => mysql_dbms}/mysql_dbms_configure.sh (100%) rename server/src/test/resources/csars/yaml/valid/lamp-csar/{scripts => mysql_dbms}/mysql_dbms_install.sh (100%) rename server/src/test/resources/csars/yaml/valid/lamp-csar/{scripts => mysql_dbms}/mysql_dbms_start.sh (100%) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/webserver_install.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/apache_web_server/webserver_install.sh similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/webserver_install.sh rename to server/src/test/resources/csars/yaml/valid/lamp-csar/apache_web_server/webserver_install.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/webserver_start.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/apache_web_server/webserver_start.sh similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/webserver_start.sh rename to server/src/test/resources/csars/yaml/valid/lamp-csar/apache_web_server/webserver_start.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/install_php.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/my_app/install_php.sh similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/install_php.sh rename to server/src/test/resources/csars/yaml/valid/lamp-csar/my_app/install_php.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/myphpapp.php b/server/src/test/resources/csars/yaml/valid/lamp-csar/my_app/myphpapp.php similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar/myphpapp.php rename to server/src/test/resources/csars/yaml/valid/lamp-csar/my_app/myphpapp.php diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/mysql-credentials.php b/server/src/test/resources/csars/yaml/valid/lamp-csar/my_app/mysql-credentials.php similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar/mysql-credentials.php rename to server/src/test/resources/csars/yaml/valid/lamp-csar/my_app/mysql-credentials.php diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/start_myphpapp.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/my_app/start_myphpapp.sh similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/start_myphpapp.sh rename to server/src/test/resources/csars/yaml/valid/lamp-csar/my_app/start_myphpapp.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/db_create.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/my_db/db_create.sh similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/db_create.sh rename to server/src/test/resources/csars/yaml/valid/lamp-csar/my_db/db_create.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/mysql_dbms_configure.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/mysql_dbms/mysql_dbms_configure.sh similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/mysql_dbms_configure.sh rename to server/src/test/resources/csars/yaml/valid/lamp-csar/mysql_dbms/mysql_dbms_configure.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/mysql_dbms_install.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/mysql_dbms/mysql_dbms_install.sh similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/mysql_dbms_install.sh rename to server/src/test/resources/csars/yaml/valid/lamp-csar/mysql_dbms/mysql_dbms_install.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/mysql_dbms_start.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/mysql_dbms/mysql_dbms_start.sh similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar/scripts/mysql_dbms_start.sh rename to server/src/test/resources/csars/yaml/valid/lamp-csar/mysql_dbms/mysql_dbms_start.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml index dc3ef8797..16245d9ae 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml @@ -29,10 +29,10 @@ topology_template: - database_endpoint: my_db interfaces: Standard: - create: scripts/install_php.sh + create: my_app/install_php.sh start: implementation: - primary: scripts/start_myphpapp.sh + primary: my_app/start_myphpapp.sh dependencies: - myphpapp.php - mysql-credentials.php @@ -49,8 +49,8 @@ topology_template: - host: server interfaces: Standard: - create: scripts/webserver_install.sh - start: scripts/webserver_start.sh + create: apache_web_server/webserver_install.sh + start: apache_web_server/webserver_start.sh my_db: type: tosca.nodes.Database.MySQL @@ -67,7 +67,7 @@ topology_template: - host: mysql_dbms interfaces: Standard: - create: scripts/db_create.sh + create: my_db/db_create.sh mysql_dbms: type: tosca.nodes.DBMS.MySQL @@ -80,9 +80,9 @@ topology_template: Standard: inputs: db_root_password: { get_property: [ mysql_dbms, root_password ] } - create: scripts/mysql_dbms_install.sh - start: scripts/mysql_dbms_start.sh - configure: scripts/mysql_dbms_configure.sh + create: mysql_dbms/mysql_dbms_install.sh + start: mysql_dbms/mysql_dbms_start.sh + configure: mysql_dbms/mysql_dbms_configure.sh server: type: tosca.nodes.Compute From d28bae197724c0b9a23a640ee2f4300656a6c9e2 Mon Sep 17 00:00:00 2001 From: Marvin Munoz Baron Date: Thu, 16 Nov 2017 19:08:13 +0100 Subject: [PATCH 22/52] Add no-input LAMP-CSAR --- .../apache_web_server/webserver_install.sh | 3 + .../apache_web_server/webserver_start.sh | 2 + .../lamp-csar-no-input/my_app/install_php.sh | 4 + .../lamp-csar-no-input/my_app/myphpapp.php | 82 +++++++++++++++++ .../my_app/mysql-credentials.php | 7 ++ .../my_app/start_myphpapp.sh | 3 + .../lamp-csar-no-input/my_db/db_create.sh | 8 ++ .../mysql_dbms/mysql_dbms_configure.sh | 2 + .../mysql_dbms/mysql_dbms_install.sh | 7 ++ .../mysql_dbms/mysql_dbms_start.sh | 2 + .../valid/lamp-csar-no-input/template.yaml | 89 +++++++++++++++++++ .../csars/yaml/valid/lamp-csar/template.yaml | 18 ++-- 12 files changed, 215 insertions(+), 12 deletions(-) create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/apache_web_server/webserver_install.sh create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/apache_web_server/webserver_start.sh create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/install_php.sh create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/myphpapp.php create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/mysql-credentials.php create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/start_myphpapp.sh create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_db/db_create.sh create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/mysql_dbms/mysql_dbms_configure.sh create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/mysql_dbms/mysql_dbms_install.sh create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/mysql_dbms/mysql_dbms_start.sh create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/template.yaml diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/apache_web_server/webserver_install.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/apache_web_server/webserver_install.sh new file mode 100644 index 000000000..d18484e9a --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/apache_web_server/webserver_install.sh @@ -0,0 +1,3 @@ +#!/bin/bash +sudo apt-get install apache2 -y +sudo apt-get install libapache2-mod-php7.0 diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/apache_web_server/webserver_start.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/apache_web_server/webserver_start.sh new file mode 100644 index 000000000..d8cf0070b --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/apache_web_server/webserver_start.sh @@ -0,0 +1,2 @@ +#!/bin/bash +sudo service apache2 start diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/install_php.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/install_php.sh new file mode 100644 index 000000000..0220b3fe4 --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/install_php.sh @@ -0,0 +1,4 @@ +#!/bin/bash +# install php on a linux machine with php-mysql +sudo apt-get install php -y +sudo apt-get install php-mysql -y diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/myphpapp.php b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/myphpapp.php new file mode 100644 index 000000000..0a7431b8a --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/myphpapp.php @@ -0,0 +1,82 @@ +query("INSERT INTO tasks(task) VALUES('".$task."')")) { + echo("Creating task failed"); + } + $conn->close(); +} +/** +* reads from db and prints it in html +*/ +function readFromDb() +{ + $sql = "select * from tasks"; + $conn = newDbConnection(); + $result = $conn->query($sql); + $conn->close(); + if ($result->num_rows > 0) { + // output data for each row + while ($row = $result->fetch_assoc()) { + echo htmlspecialchars("id: " . $row['id']. " - Task: " . $row['task'])."
"; + } + return; + } + echo "0 results"; +} +/** +* generates new DB connection with given credentials +*/ +function newDbConnection() +{ + extract($GLOBALS); + $conn = new mysqli($db_host, $db_user, $db_password, $db_name, $db_port); + if ($conn->connect_error) { + die("Connection failed: " . $conn->connect_error); + } + return $conn; +} +?> + + + + + SimpleTaskApp + + + +

SimpleTaskApp

+ +
+ + +
+ + + diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/mysql-credentials.php b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/mysql-credentials.php new file mode 100644 index 000000000..1e4fd6878 --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/mysql-credentials.php @@ -0,0 +1,7 @@ + diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/start_myphpapp.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/start_myphpapp.sh new file mode 100644 index 000000000..c278150a8 --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/start_myphpapp.sh @@ -0,0 +1,3 @@ +#!/bin/bash +sudo mv myphpapp.php /var/www/html/ +sudo mv mysql-credentials.php /var/www/html/ diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_db/db_create.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_db/db_create.sh new file mode 100644 index 000000000..a1d0d04a9 --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_db/db_create.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# Setup MySQL root password and create user +cat << EOF | mysql -u root --password=abc +CREATE DATABASE mydb; +USE mydb; +create table tasks (id INT not null auto_increment,task varchar(255), primary key(id)); +EXIT +EOF diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/mysql_dbms/mysql_dbms_configure.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/mysql_dbms/mysql_dbms_configure.sh new file mode 100644 index 000000000..c6861c967 --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/mysql_dbms/mysql_dbms_configure.sh @@ -0,0 +1,2 @@ +#!/bin/bash +sudo mysqladmin -u root -p password db_root_password diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/mysql_dbms/mysql_dbms_install.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/mysql_dbms/mysql_dbms_install.sh new file mode 100644 index 000000000..200f9f395 --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/mysql_dbms/mysql_dbms_install.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# install mysql-server without password promt. +# insert a fix pw +echo "mysql-server mysql-server/root_password password abc" | sudo debconf-set-selections +echo "mysql-server mysql-server/root_password_again password abc" | sudo debconf-set-selections +sudo apt-get install mysql-server -y +sudo systemctl enable mysql.service diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/mysql_dbms/mysql_dbms_start.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/mysql_dbms/mysql_dbms_start.sh new file mode 100644 index 000000000..986fc4f72 --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/mysql_dbms/mysql_dbms_start.sh @@ -0,0 +1,2 @@ +#!/bin/bash +sudo systemctl start mysql.service diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/template.yaml new file mode 100644 index 000000000..f078ade07 --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/template.yaml @@ -0,0 +1,89 @@ +tosca_definitions_version: tosca_simple_yaml_1_0 +description: Template for deploying a LAMP stack. +metadata: + template_name: lamp-stack-template + template_author: stupro-toscana + template_version: 1.0 + + +topology_template: + node_templates: + my_app: + type: tosca.nodes.WebApplication + requirements: + - host: apache_web_server + - database_endpoint: my_db + interfaces: + Standard: + create: my_app/install_php.sh + start: + implementation: + primary: my_app/start_myphpapp.sh + dependencies: + - myphpapp.php + - mysql-credentials.php + inputs: + db_host: { get_attribute: [ apache_web_server, private_address ] } + db_name: { get_property: [ my_db, name ] } + db_user: { get_property: [ my_db, user ] } + db_password: { get_property: [ my_db, password ] } + db_port: { get_property: [ SELF, database_endpoint, port ] } + + apache_web_server: + type: tosca.nodes.WebServer.Apache + requirements: + - host: server + interfaces: + Standard: + create: apache_web_server/webserver_install.sh + start: apache_web_server/webserver_start.sh + + my_db: + type: tosca.nodes.Database.MySQL + properties: + name: { get_input: database_name } + user: { get_input: database_user } + password: { get_input: database_password } + port: { get_input: database_port } + capabilities: + database_endpoint: + properties: + port: { get_input: database_port } + requirements: + - host: mysql_dbms + interfaces: + Standard: + create: my_db/db_create.sh + + mysql_dbms: + type: tosca.nodes.DBMS.MySQL + properties: + root_password: { abc } + port: { 3306 } + requirements: + - host: server + interfaces: + Standard: + inputs: + db_root_password: { get_property: [ mysql_dbms, root_password ] } + create: mysql_dbms/mysql_dbms_install.sh + start: mysql_dbms/mysql_dbms_start.sh + configure: mysql_dbms/mysql_dbms_configure.sh + + server: + type: tosca.nodes.Compute + capabilities: + host: + properties: + num_cpus: 1 + disk_size: 25 GB + mem_size: 2048 MB + os: + properties: + type: linux + distribution: ubuntu + version: 16.04 + outputs: + endpoint: + description: endpoint of the php-app + value: { get_attribute: [ server, public_address ] } diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml index 16245d9ae..941e70f56 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml @@ -36,15 +36,9 @@ topology_template: dependencies: - myphpapp.php - mysql-credentials.php - inputs: - db_host: { get_attribute: [ apache_web_server, private_address ] } - db_name: { get_property: [ my_db, name ] } - db_user: { get_property: [ my_db, user ] } - db_password: { get_property: [ my_db, password ] } - db_port: { get_property: [ SELF, database_endpoint, port ] } apache_web_server: - type: tosca.nodes.WebServer + type: tosca.nodes.WebServer.Apache requirements: - host: server interfaces: @@ -55,14 +49,14 @@ topology_template: my_db: type: tosca.nodes.Database.MySQL properties: - name: { get_input: database_name } - user: { get_input: database_user } - password: { get_input: database_password } - port: { get_input: database_port } + name: { mydb } + user: { root } + password: { 123 } + port: { 3306 } capabilities: database_endpoint: properties: - port: { get_input: database_port } + port: { 3306 } requirements: - host: mysql_dbms interfaces: From fe8130dd7390e7549b3c97c8eab72e60a7778431 Mon Sep 17 00:00:00 2001 From: Marvin Munoz Baron Date: Thu, 16 Nov 2017 19:08:51 +0100 Subject: [PATCH 23/52] Add CSAR-files for LAMP CSARs --- .../csars/yaml/valid/lamp-csar-no-input.csar | Bin 0 -> 5567 bytes .../resources/csars/yaml/valid/lamp-csar.csar | Bin 0 -> 5269 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar-no-input.csar create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar.csar diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input.csar b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input.csar new file mode 100644 index 0000000000000000000000000000000000000000..c5b7f55418f04cc6ddc543acd89440bedf1c1df5 GIT binary patch literal 5567 zcmb7I2|SePA0IJc9BCCH(KaY@8|OF^xnkUd8jNv-Y0M0oHrJ*QlOvR?h>==rE3I7R zzRz3{q0~}ZR9cnre~o5mtYP;*pU>m>zMs$gJm2r{czy>fGgh`;pw-{$t2i_2!}mY@ zfb?_o$H}4zZg^SjX;~jEE|4g1wdn>4<{R8_ZfI`|Dj4I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sO`CKWA|^NK@e?E@q@FTGOw+FZ$FrXJMD(Ab(Ok@Vijdt%XLra61$=_jFB#|}9o z{*FGHm7Iy1l3o$GAWTYG-0n8#lxFE&u2$afJUnOgQEBr|@8sUqtgBTku~b2OQ?Wj) zG2)j|?nZ5gFFz_p*DT7ea{J9paL2W!7NEj)`K1EBGOv3Dpp)Odb4sIpH+3t!bH<^h#c(iN z6KN#L`o`Qy!H$x)+hj+g5w&&%7TJ=WH1b469ug=u$S2&Frv)@X{Jte)7thR|`l-P` zO>vYOeEZKDkQ#VOzC*d>Ze$2Jb=X#Z(^!%u8@b!uM@bh0>i(`qQqXq~ zu&nP^VD}krN!0R|4qI$;fT^c3N;U^DZu}d2x6q>gQrNUsxr$nntp;xIZFfHhh(soa zHhdd-b3CJTY;=LEJ~6B$xp6#4etTGV4sj#|F{~xKA*e?>N?_alwTE;7F#9sKB-^yx zm_`ZI-b3xpO`CqUS3u`SiIb7s!Z0&X%k4Po9+MLH4VV)tgZBfsOUFscbvw7k+b$`& zJG)0pZX(kz+#S6nC6iQvNC``lWae(IB8f>%7e3}~OrRB{Bt+nKk;H5v$$CPG>Go_P zT1DMnk_g0Xf$c(|Y&I!rmFpRsmG%0oEomSqM^Ra~Ci Date: Thu, 16 Nov 2017 19:13:16 +0100 Subject: [PATCH 24/52] include mysql-credentials --- .../csars/yaml/valid/lamp-csar/my_app/myphpapp.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/my_app/myphpapp.php b/server/src/test/resources/csars/yaml/valid/lamp-csar/my_app/myphpapp.php index 0a7431b8a..0fb716ad7 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/my_app/myphpapp.php +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/my_app/myphpapp.php @@ -1,12 +1,6 @@ Date: Thu, 16 Nov 2017 19:18:38 +0100 Subject: [PATCH 25/52] Fix no-input LAMP-CSAR --- .../csars/yaml/valid/lamp-csar-no-input.csar | Bin 5567 -> 5456 bytes .../mysql_dbms/mysql_dbms_configure.sh | 2 +- .../valid/lamp-csar-no-input/template.yaml | 18 +++++------------- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input.csar b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input.csar index c5b7f55418f04cc6ddc543acd89440bedf1c1df5..b18272cdddfac75763c0e7a2cbd3781ed592ce2b 100644 GIT binary patch delta 1009 zcmdn5eL-u(MMiNh1`x2ERp7l#>t~7?kPX77lLh(3CjVnpGE-L6Ps+^GPf9G#;N>bV zP03fttt>9gNleMj%u~=URVd2OFHz7fP$)<&E-ue6N>NBmO6KL-oXAwj!Dj+AbzzM9 z-33ex3_To^A8@JFFAcq$ciBK>-~27*ADAy}Nltd!``Y1A+EfSEM@)*RJN=`xKc4@y zSy15pxs8)eJTJF)?G!IP_w(HQ@|^0oTyB;*twM1bPhSW}w9i&u8S3W|%(Qlf&P&nQ zn7D$1R?%bXXTlwHKRax@CB(Pv%G3bsLnr=b{heuXzN`JsC#R_UutOVy+fq z$mtzql$pk9k!{K>!ddB<_(o7vB&w@8M)X|!|p zla27%z~8y{#7t(cE@@qnM~2+<>bFZwX}G(I>DN5-d79^R`WGG6(mC>ImeMn)MCH?y zX6-$BXCJ@I&aWr8L{GdC;-IxAu@*t=O%M&X_xfPU;97L_18v)fK~~Wdsk~W z9NmAp>U+ew4QeHiShZt$eJ&KbFW0=S;wEPYbg@4xk8Zkp!`qu*yZpVf?7#w)B+ zKU4K^RghZN{~J8v+t!)Izl)ZUlV!ffKXWDjgZz?{#h;c>X6KQ88kT*3y7aR~V|9mra6i7{0W+JL9I|cIC3y$Ie&! zWjnfi>K_x)FMoYja?XS+rB#cr2KUa$I9hQa{(eXOwmX&EZKXae7OX$`!r+d3C$Hws}wR5n+~U^uXu3C_QB?#+>iIyy4&65-71u_ zI_AzE_1E*Fc7Im7zICco>-@zh?seH*$uB<9{3)^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Btp}J0;z;pR&qZ8S5=%oBiSc z|F`GF{cF7vvb=;h7IOA>XN0(wwoSib{MG49?fGLdjCb<3sjJA#PP)WrHGApI@^YCu zr%zuk?LE_ybjMSl_sEybSKDo>C602$ZuxgK`DMk9#V3sX=6`*?xvze%z^kgSGZi(< zYTkcYvUb`9|F8Dvca(2BqH(Y${71>08yttGngpMFP@Kx~s;R_8na`*^67_%*4!`AD?PMJQQ2;ijqC~)JN0Ks#eC>rQ&8|l>^;}Iyy=gEb1I7evrgiZ*}R?Ci%A$u-kdBV5XR=S zahIQO+~fiQ8>U32$%)L`ljkyVO@1uk#~3hKQAlDElgQ*a!7#=PK#uI>OM-q(94wO` zGRsW16N+J4z%qFwi^k+5LVirq96+YrEFx3IJBy B@;3kg diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/mysql_dbms/mysql_dbms_configure.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/mysql_dbms/mysql_dbms_configure.sh index c6861c967..47a101c09 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/mysql_dbms/mysql_dbms_configure.sh +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/mysql_dbms/mysql_dbms_configure.sh @@ -1,2 +1,2 @@ #!/bin/bash -sudo mysqladmin -u root -p password db_root_password +sudo mysqladmin -u root -p password abc diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/template.yaml index f078ade07..c9fd6bbda 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/template.yaml +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/template.yaml @@ -22,12 +22,6 @@ topology_template: dependencies: - myphpapp.php - mysql-credentials.php - inputs: - db_host: { get_attribute: [ apache_web_server, private_address ] } - db_name: { get_property: [ my_db, name ] } - db_user: { get_property: [ my_db, user ] } - db_password: { get_property: [ my_db, password ] } - db_port: { get_property: [ SELF, database_endpoint, port ] } apache_web_server: type: tosca.nodes.WebServer.Apache @@ -41,14 +35,14 @@ topology_template: my_db: type: tosca.nodes.Database.MySQL properties: - name: { get_input: database_name } - user: { get_input: database_user } - password: { get_input: database_password } - port: { get_input: database_port } + name: { mydb } + user: { root } + password: { abc } + port: { 3306 } capabilities: database_endpoint: properties: - port: { get_input: database_port } + port: { 3306 } requirements: - host: mysql_dbms interfaces: @@ -64,8 +58,6 @@ topology_template: - host: server interfaces: Standard: - inputs: - db_root_password: { get_property: [ mysql_dbms, root_password ] } create: mysql_dbms/mysql_dbms_install.sh start: mysql_dbms/mysql_dbms_start.sh configure: mysql_dbms/mysql_dbms_configure.sh From 0191a5ade3a8781ad4d50e16ed34ce60577945a8 Mon Sep 17 00:00:00 2001 From: jmuell Date: Sat, 18 Nov 2017 12:15:46 +0100 Subject: [PATCH 26/52] Change package install in one line --- .../valid/lamp-csar/apache_web_server/webserver_install.sh | 3 +-- .../resources/csars/yaml/valid/lamp-csar/my_app/install_php.sh | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/apache_web_server/webserver_install.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/apache_web_server/webserver_install.sh index d18484e9a..5bb9f5986 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/apache_web_server/webserver_install.sh +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/apache_web_server/webserver_install.sh @@ -1,3 +1,2 @@ #!/bin/bash -sudo apt-get install apache2 -y -sudo apt-get install libapache2-mod-php7.0 +sudo apt-get install -y apache2 libapache2-mod-php7.0 diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/my_app/install_php.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/my_app/install_php.sh index 0220b3fe4..a718ff77c 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/my_app/install_php.sh +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/my_app/install_php.sh @@ -1,4 +1,3 @@ #!/bin/bash # install php on a linux machine with php-mysql -sudo apt-get install php -y -sudo apt-get install php-mysql -y +sudo apt-get install -y php php-mysql From f8eb6ae6aff48af0086d92134ea6de4bcdc8bc0d Mon Sep 17 00:00:00 2001 From: jmuell Date: Sat, 18 Nov 2017 12:27:06 +0100 Subject: [PATCH 27/52] Delete duplicate folder and copy second template --- .../apache_web_server/webserver_install.sh | 3 - .../apache_web_server/webserver_start.sh | 2 - .../lamp-csar-no-input/my_app/install_php.sh | 4 - .../lamp-csar-no-input/my_app/myphpapp.php | 82 ------------------- .../my_app/mysql-credentials.php | 7 -- .../my_app/start_myphpapp.sh | 3 - .../lamp-csar-no-input/my_db/db_create.sh | 8 -- .../mysql_dbms/mysql_dbms_configure.sh | 2 - .../mysql_dbms/mysql_dbms_install.sh | 7 -- .../mysql_dbms/mysql_dbms_start.sh | 2 - .../template-no-input.yaml} | 0 11 files changed, 120 deletions(-) delete mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/apache_web_server/webserver_install.sh delete mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/apache_web_server/webserver_start.sh delete mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/install_php.sh delete mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/myphpapp.php delete mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/mysql-credentials.php delete mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/start_myphpapp.sh delete mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_db/db_create.sh delete mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/mysql_dbms/mysql_dbms_configure.sh delete mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/mysql_dbms/mysql_dbms_install.sh delete mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/mysql_dbms/mysql_dbms_start.sh rename server/src/test/resources/csars/yaml/valid/{lamp-csar-no-input/template.yaml => lamp-csar/template-no-input.yaml} (100%) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/apache_web_server/webserver_install.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/apache_web_server/webserver_install.sh deleted file mode 100644 index d18484e9a..000000000 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/apache_web_server/webserver_install.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -sudo apt-get install apache2 -y -sudo apt-get install libapache2-mod-php7.0 diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/apache_web_server/webserver_start.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/apache_web_server/webserver_start.sh deleted file mode 100644 index d8cf0070b..000000000 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/apache_web_server/webserver_start.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -sudo service apache2 start diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/install_php.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/install_php.sh deleted file mode 100644 index 0220b3fe4..000000000 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/install_php.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -# install php on a linux machine with php-mysql -sudo apt-get install php -y -sudo apt-get install php-mysql -y diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/myphpapp.php b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/myphpapp.php deleted file mode 100644 index 0a7431b8a..000000000 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/myphpapp.php +++ /dev/null @@ -1,82 +0,0 @@ -query("INSERT INTO tasks(task) VALUES('".$task."')")) { - echo("Creating task failed"); - } - $conn->close(); -} -/** -* reads from db and prints it in html -*/ -function readFromDb() -{ - $sql = "select * from tasks"; - $conn = newDbConnection(); - $result = $conn->query($sql); - $conn->close(); - if ($result->num_rows > 0) { - // output data for each row - while ($row = $result->fetch_assoc()) { - echo htmlspecialchars("id: " . $row['id']. " - Task: " . $row['task'])."
"; - } - return; - } - echo "0 results"; -} -/** -* generates new DB connection with given credentials -*/ -function newDbConnection() -{ - extract($GLOBALS); - $conn = new mysqli($db_host, $db_user, $db_password, $db_name, $db_port); - if ($conn->connect_error) { - die("Connection failed: " . $conn->connect_error); - } - return $conn; -} -?> - - - - - SimpleTaskApp - - - -

SimpleTaskApp

- -
- - -
- - - diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/mysql-credentials.php b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/mysql-credentials.php deleted file mode 100644 index 1e4fd6878..000000000 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/mysql-credentials.php +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/start_myphpapp.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/start_myphpapp.sh deleted file mode 100644 index c278150a8..000000000 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_app/start_myphpapp.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -sudo mv myphpapp.php /var/www/html/ -sudo mv mysql-credentials.php /var/www/html/ diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_db/db_create.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_db/db_create.sh deleted file mode 100644 index a1d0d04a9..000000000 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/my_db/db_create.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -# Setup MySQL root password and create user -cat << EOF | mysql -u root --password=abc -CREATE DATABASE mydb; -USE mydb; -create table tasks (id INT not null auto_increment,task varchar(255), primary key(id)); -EXIT -EOF diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/mysql_dbms/mysql_dbms_configure.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/mysql_dbms/mysql_dbms_configure.sh deleted file mode 100644 index 47a101c09..000000000 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/mysql_dbms/mysql_dbms_configure.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -sudo mysqladmin -u root -p password abc diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/mysql_dbms/mysql_dbms_install.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/mysql_dbms/mysql_dbms_install.sh deleted file mode 100644 index 200f9f395..000000000 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/mysql_dbms/mysql_dbms_install.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -# install mysql-server without password promt. -# insert a fix pw -echo "mysql-server mysql-server/root_password password abc" | sudo debconf-set-selections -echo "mysql-server mysql-server/root_password_again password abc" | sudo debconf-set-selections -sudo apt-get install mysql-server -y -sudo systemctl enable mysql.service diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/mysql_dbms/mysql_dbms_start.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/mysql_dbms/mysql_dbms_start.sh deleted file mode 100644 index 986fc4f72..000000000 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/mysql_dbms/mysql_dbms_start.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -sudo systemctl start mysql.service diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar/template-no-input.yaml similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar-no-input/template.yaml rename to server/src/test/resources/csars/yaml/valid/lamp-csar/template-no-input.yaml From 1d3ba141561f6b5f5e207ce0ab9eb38b1f4373a6 Mon Sep 17 00:00:00 2001 From: jmuell Date: Mon, 20 Nov 2017 12:35:12 +0100 Subject: [PATCH 28/52] Add update&upgrade to install scripts --- .../valid/lamp-csar/apache_web_server/webserver_install.sh | 3 ++- .../resources/csars/yaml/valid/lamp-csar/my_app/install_php.sh | 1 + .../yaml/valid/lamp-csar/mysql_dbms/mysql_dbms_install.sh | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/apache_web_server/webserver_install.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/apache_web_server/webserver_install.sh index 5bb9f5986..5217bedb0 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/apache_web_server/webserver_install.sh +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/apache_web_server/webserver_install.sh @@ -1,2 +1,3 @@ #!/bin/bash -sudo apt-get install -y apache2 libapache2-mod-php7.0 +sudo apt-get update -y && sudo apt-get upgrade -y +sudo apt-get install -y apache2 libapache2-mod-php7.0 diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/my_app/install_php.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/my_app/install_php.sh index a718ff77c..570f39c77 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/my_app/install_php.sh +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/my_app/install_php.sh @@ -1,3 +1,4 @@ #!/bin/bash # install php on a linux machine with php-mysql +sudo apt-get update -y && sudo apt-get upgrade -y sudo apt-get install -y php php-mysql diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/mysql_dbms/mysql_dbms_install.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/mysql_dbms/mysql_dbms_install.sh index 200f9f395..618cf26f7 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/mysql_dbms/mysql_dbms_install.sh +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/mysql_dbms/mysql_dbms_install.sh @@ -1,7 +1,8 @@ #!/bin/bash # install mysql-server without password promt. # insert a fix pw +sudo apt-get update -y && sudo apt-get upgrade -y echo "mysql-server mysql-server/root_password password abc" | sudo debconf-set-selections echo "mysql-server mysql-server/root_password_again password abc" | sudo debconf-set-selections sudo apt-get install mysql-server -y -sudo systemctl enable mysql.service +sudo systemctl enable mysql From 9685f1aeab18ae84c397b755e423434c0f63242a Mon Sep 17 00:00:00 2001 From: jmuell Date: Mon, 20 Nov 2017 12:36:50 +0100 Subject: [PATCH 29/52] Exchange deprecated version of starting service --- .../yaml/valid/lamp-csar/apache_web_server/webserver_start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/apache_web_server/webserver_start.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/apache_web_server/webserver_start.sh index d8cf0070b..4448a1246 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/apache_web_server/webserver_start.sh +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/apache_web_server/webserver_start.sh @@ -1,2 +1,2 @@ #!/bin/bash -sudo service apache2 start +sudo systemctl start apache2 From f259aea4c2ff6a77f970a08cc1ccadf7df1b4b1d Mon Sep 17 00:00:00 2001 From: jmuell Date: Mon, 20 Nov 2017 12:38:55 +0100 Subject: [PATCH 30/52] Delete unnecessary .service --- .../csars/yaml/valid/lamp-csar/mysql_dbms/mysql_dbms_start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/mysql_dbms/mysql_dbms_start.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/mysql_dbms/mysql_dbms_start.sh index 986fc4f72..563b89a3d 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/mysql_dbms/mysql_dbms_start.sh +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/mysql_dbms/mysql_dbms_start.sh @@ -1,2 +1,2 @@ #!/bin/bash -sudo systemctl start mysql.service +sudo systemctl start mysql From 5a62c520d80a2063536258f6c331a2245877da8d Mon Sep 17 00:00:00 2001 From: jmuell Date: Mon, 20 Nov 2017 12:39:56 +0100 Subject: [PATCH 31/52] Update msql configure --- .../csars/yaml/valid/lamp-csar/my_db/db_create.sh | 8 -------- .../valid/lamp-csar/mysql_dbms/mysql_dbms_configure.sh | 7 ++++++- .../csars/yaml/valid/lamp-csar/template-no-input.yaml | 3 --- .../resources/csars/yaml/valid/lamp-csar/template.yaml | 3 --- 4 files changed, 6 insertions(+), 15 deletions(-) delete mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar/my_db/db_create.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/my_db/db_create.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/my_db/db_create.sh deleted file mode 100644 index a1d0d04a9..000000000 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/my_db/db_create.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -# Setup MySQL root password and create user -cat << EOF | mysql -u root --password=abc -CREATE DATABASE mydb; -USE mydb; -create table tasks (id INT not null auto_increment,task varchar(255), primary key(id)); -EXIT -EOF diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/mysql_dbms/mysql_dbms_configure.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar/mysql_dbms/mysql_dbms_configure.sh index c6861c967..6385adbc0 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/mysql_dbms/mysql_dbms_configure.sh +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/mysql_dbms/mysql_dbms_configure.sh @@ -1,2 +1,7 @@ #!/bin/bash -sudo mysqladmin -u root -p password db_root_password +cat << EOF | mysql -u root --password=abc +CREATE DATABASE mydb; +USE mydb; +create table tasks (id INT not null auto_increment,task varchar(255), primary key(id)); +EXIT +EOF diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/template-no-input.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar/template-no-input.yaml index c9fd6bbda..0fb779870 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/template-no-input.yaml +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/template-no-input.yaml @@ -45,9 +45,6 @@ topology_template: port: { 3306 } requirements: - host: mysql_dbms - interfaces: - Standard: - create: my_db/db_create.sh mysql_dbms: type: tosca.nodes.DBMS.MySQL diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml index 941e70f56..7cebfc0d2 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml @@ -59,9 +59,6 @@ topology_template: port: { 3306 } requirements: - host: mysql_dbms - interfaces: - Standard: - create: my_db/db_create.sh mysql_dbms: type: tosca.nodes.DBMS.MySQL From 5a837987443cc50b9d27bb1c7fc48e51c1a490c8 Mon Sep 17 00:00:00 2001 From: jmuell Date: Mon, 20 Nov 2017 12:48:40 +0100 Subject: [PATCH 32/52] Create two seperate folders for input & NoInput --- .../apache_web_server/webserver_install.sh | 0 .../apache_web_server/webserver_start.sh | 0 .../my_app/install_php.sh | 0 .../my_app/myphpapp.php | 0 .../my_app/mysql-credentials.php | 0 .../my_app/start_myphpapp.sh | 0 .../mysql_dbms/mysql_dbms_configure.sh | 0 .../mysql_dbms/mysql_dbms_install.sh | 0 .../mysql_dbms/mysql_dbms_start.sh | 0 .../template.yaml | 0 .../apache_web_server/webserver_install.sh | 3 + .../apache_web_server/webserver_start.sh | 2 + .../lamp-csar_NoInput/my_app/install_php.sh | 4 + .../lamp-csar_NoInput/my_app/myphpapp.php | 76 +++++++++++++++++++ .../my_app/mysql-credentials.php | 7 ++ .../my_app/start_myphpapp.sh | 3 + .../mysql_dbms/mysql_dbms_configure.sh | 7 ++ .../mysql_dbms/mysql_dbms_install.sh | 8 ++ .../mysql_dbms/mysql_dbms_start.sh | 2 + .../template.yaml} | 0 20 files changed, 112 insertions(+) rename server/src/test/resources/csars/yaml/valid/{lamp-csar => lamp-csar_Input}/apache_web_server/webserver_install.sh (100%) rename server/src/test/resources/csars/yaml/valid/{lamp-csar => lamp-csar_Input}/apache_web_server/webserver_start.sh (100%) rename server/src/test/resources/csars/yaml/valid/{lamp-csar => lamp-csar_Input}/my_app/install_php.sh (100%) rename server/src/test/resources/csars/yaml/valid/{lamp-csar => lamp-csar_Input}/my_app/myphpapp.php (100%) rename server/src/test/resources/csars/yaml/valid/{lamp-csar => lamp-csar_Input}/my_app/mysql-credentials.php (100%) rename server/src/test/resources/csars/yaml/valid/{lamp-csar => lamp-csar_Input}/my_app/start_myphpapp.sh (100%) rename server/src/test/resources/csars/yaml/valid/{lamp-csar => lamp-csar_Input}/mysql_dbms/mysql_dbms_configure.sh (100%) rename server/src/test/resources/csars/yaml/valid/{lamp-csar => lamp-csar_Input}/mysql_dbms/mysql_dbms_install.sh (100%) rename server/src/test/resources/csars/yaml/valid/{lamp-csar => lamp-csar_Input}/mysql_dbms/mysql_dbms_start.sh (100%) rename server/src/test/resources/csars/yaml/valid/{lamp-csar => lamp-csar_Input}/template.yaml (100%) create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/apache_web_server/webserver_install.sh create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/apache_web_server/webserver_start.sh create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/my_app/install_php.sh create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/my_app/myphpapp.php create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/my_app/mysql-credentials.php create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/my_app/start_myphpapp.sh create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/mysql_dbms/mysql_dbms_configure.sh create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/mysql_dbms/mysql_dbms_install.sh create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/mysql_dbms/mysql_dbms_start.sh rename server/src/test/resources/csars/yaml/valid/{lamp-csar/template-no-input.yaml => lamp-csar_NoInput/template.yaml} (100%) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/apache_web_server/webserver_install.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/apache_web_server/webserver_install.sh similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar/apache_web_server/webserver_install.sh rename to server/src/test/resources/csars/yaml/valid/lamp-csar_Input/apache_web_server/webserver_install.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/apache_web_server/webserver_start.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/apache_web_server/webserver_start.sh similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar/apache_web_server/webserver_start.sh rename to server/src/test/resources/csars/yaml/valid/lamp-csar_Input/apache_web_server/webserver_start.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/my_app/install_php.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/my_app/install_php.sh similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar/my_app/install_php.sh rename to server/src/test/resources/csars/yaml/valid/lamp-csar_Input/my_app/install_php.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/my_app/myphpapp.php b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/my_app/myphpapp.php similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar/my_app/myphpapp.php rename to server/src/test/resources/csars/yaml/valid/lamp-csar_Input/my_app/myphpapp.php diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/my_app/mysql-credentials.php b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/my_app/mysql-credentials.php similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar/my_app/mysql-credentials.php rename to server/src/test/resources/csars/yaml/valid/lamp-csar_Input/my_app/mysql-credentials.php diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/my_app/start_myphpapp.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/my_app/start_myphpapp.sh similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar/my_app/start_myphpapp.sh rename to server/src/test/resources/csars/yaml/valid/lamp-csar_Input/my_app/start_myphpapp.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/mysql_dbms/mysql_dbms_configure.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_configure.sh similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar/mysql_dbms/mysql_dbms_configure.sh rename to server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_configure.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/mysql_dbms/mysql_dbms_install.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_install.sh similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar/mysql_dbms/mysql_dbms_install.sh rename to server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_install.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/mysql_dbms/mysql_dbms_start.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_start.sh similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar/mysql_dbms/mysql_dbms_start.sh rename to server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_start.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/template.yaml similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar/template.yaml rename to server/src/test/resources/csars/yaml/valid/lamp-csar_Input/template.yaml diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/apache_web_server/webserver_install.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/apache_web_server/webserver_install.sh new file mode 100644 index 000000000..5217bedb0 --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/apache_web_server/webserver_install.sh @@ -0,0 +1,3 @@ +#!/bin/bash +sudo apt-get update -y && sudo apt-get upgrade -y +sudo apt-get install -y apache2 libapache2-mod-php7.0 diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/apache_web_server/webserver_start.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/apache_web_server/webserver_start.sh new file mode 100644 index 000000000..4448a1246 --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/apache_web_server/webserver_start.sh @@ -0,0 +1,2 @@ +#!/bin/bash +sudo systemctl start apache2 diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/my_app/install_php.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/my_app/install_php.sh new file mode 100644 index 000000000..570f39c77 --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/my_app/install_php.sh @@ -0,0 +1,4 @@ +#!/bin/bash +# install php on a linux machine with php-mysql +sudo apt-get update -y && sudo apt-get upgrade -y +sudo apt-get install -y php php-mysql diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/my_app/myphpapp.php b/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/my_app/myphpapp.php new file mode 100644 index 000000000..0fb716ad7 --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/my_app/myphpapp.php @@ -0,0 +1,76 @@ +query("INSERT INTO tasks(task) VALUES('".$task."')")) { + echo("Creating task failed"); + } + $conn->close(); +} +/** +* reads from db and prints it in html +*/ +function readFromDb() +{ + $sql = "select * from tasks"; + $conn = newDbConnection(); + $result = $conn->query($sql); + $conn->close(); + if ($result->num_rows > 0) { + // output data for each row + while ($row = $result->fetch_assoc()) { + echo htmlspecialchars("id: " . $row['id']. " - Task: " . $row['task'])."
"; + } + return; + } + echo "0 results"; +} +/** +* generates new DB connection with given credentials +*/ +function newDbConnection() +{ + extract($GLOBALS); + $conn = new mysqli($db_host, $db_user, $db_password, $db_name, $db_port); + if ($conn->connect_error) { + die("Connection failed: " . $conn->connect_error); + } + return $conn; +} +?> + + + + + SimpleTaskApp + + + +

SimpleTaskApp

+ +
+ + +
+ + + diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/my_app/mysql-credentials.php b/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/my_app/mysql-credentials.php new file mode 100644 index 000000000..1e4fd6878 --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/my_app/mysql-credentials.php @@ -0,0 +1,7 @@ + diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/my_app/start_myphpapp.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/my_app/start_myphpapp.sh new file mode 100644 index 000000000..c278150a8 --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/my_app/start_myphpapp.sh @@ -0,0 +1,3 @@ +#!/bin/bash +sudo mv myphpapp.php /var/www/html/ +sudo mv mysql-credentials.php /var/www/html/ diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/mysql_dbms/mysql_dbms_configure.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/mysql_dbms/mysql_dbms_configure.sh new file mode 100644 index 000000000..6385adbc0 --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/mysql_dbms/mysql_dbms_configure.sh @@ -0,0 +1,7 @@ +#!/bin/bash +cat << EOF | mysql -u root --password=abc +CREATE DATABASE mydb; +USE mydb; +create table tasks (id INT not null auto_increment,task varchar(255), primary key(id)); +EXIT +EOF diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/mysql_dbms/mysql_dbms_install.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/mysql_dbms/mysql_dbms_install.sh new file mode 100644 index 000000000..618cf26f7 --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/mysql_dbms/mysql_dbms_install.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# install mysql-server without password promt. +# insert a fix pw +sudo apt-get update -y && sudo apt-get upgrade -y +echo "mysql-server mysql-server/root_password password abc" | sudo debconf-set-selections +echo "mysql-server mysql-server/root_password_again password abc" | sudo debconf-set-selections +sudo apt-get install mysql-server -y +sudo systemctl enable mysql diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/mysql_dbms/mysql_dbms_start.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/mysql_dbms/mysql_dbms_start.sh new file mode 100644 index 000000000..563b89a3d --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/mysql_dbms/mysql_dbms_start.sh @@ -0,0 +1,2 @@ +#!/bin/bash +sudo systemctl start mysql diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar/template-no-input.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/template.yaml similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar/template-no-input.yaml rename to server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/template.yaml From 8f23b3318b9a86c1da24e3909fa07950d0c7db58 Mon Sep 17 00:00:00 2001 From: jmuell Date: Mon, 20 Nov 2017 13:35:24 +0100 Subject: [PATCH 33/52] Use environment variables in script to enable input --- .../valid/lamp-csar_Input/my_app/mysql-credentials.php | 8 ++++---- .../lamp-csar_Input/mysql_dbms/mysql_dbms_configure.sh | 2 +- .../lamp-csar_Input/mysql_dbms/mysql_dbms_install.sh | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/my_app/mysql-credentials.php b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/my_app/mysql-credentials.php index 1e4fd6878..d645d4e35 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/my_app/mysql-credentials.php +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/my_app/mysql-credentials.php @@ -1,7 +1,7 @@ diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_configure.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_configure.sh index 6385adbc0..b16dbf6d4 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_configure.sh +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_configure.sh @@ -1,5 +1,5 @@ #!/bin/bash -cat << EOF | mysql -u root --password=abc +cat << EOF | mysql -u root --password=${my_mysql_rootpw} CREATE DATABASE mydb; USE mydb; create table tasks (id INT not null auto_increment,task varchar(255), primary key(id)); diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_install.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_install.sh index 618cf26f7..571c736bb 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_install.sh +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_install.sh @@ -2,7 +2,7 @@ # install mysql-server without password promt. # insert a fix pw sudo apt-get update -y && sudo apt-get upgrade -y -echo "mysql-server mysql-server/root_password password abc" | sudo debconf-set-selections -echo "mysql-server mysql-server/root_password_again password abc" | sudo debconf-set-selections +echo "mysql-server mysql-server/root_password password ${my_mysql_rootpw}" | sudo debconf-set-selections +echo "mysql-server mysql-server/root_password_again password ${my_mysql_rootpw}" | sudo debconf-set-selections sudo apt-get install mysql-server -y sudo systemctl enable mysql From 62cacc29b149a636974bf92d7f40fcf19f58b2e7 Mon Sep 17 00:00:00 2001 From: Manuel Kloppenburg Date: Mon, 20 Nov 2017 13:48:54 +0100 Subject: [PATCH 34/52] Added input references and removed unnecessary references to concrete implementaion of scripts --- .../yaml/valid/lamp-csar_Input/template.yaml | 30 ++++++------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/template.yaml index 7cebfc0d2..162d81d56 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/template.yaml +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/template.yaml @@ -10,16 +10,10 @@ topology_template: inputs: database_name: type: string - database_user: - type: string - database_password: - type: string database_port: type: integer - my_mysql_rootpw: + database_password: type: string - my_mysql_port: - type: integer node_templates: my_app: @@ -29,6 +23,7 @@ topology_template: - database_endpoint: my_db interfaces: Standard: + inputs: db_host: { get_attribute: [ server, private_address ] } create: my_app/install_php.sh start: implementation: @@ -41,38 +36,31 @@ topology_template: type: tosca.nodes.WebServer.Apache requirements: - host: server - interfaces: - Standard: - create: apache_web_server/webserver_install.sh - start: apache_web_server/webserver_start.sh my_db: type: tosca.nodes.Database.MySQL properties: - name: { mydb } - user: { root } - password: { 123 } - port: { 3306 } + name: { get_input: database_name } + password: { get_input: database_password } + port: { get_input: database_port } capabilities: database_endpoint: properties: - port: { 3306 } + port: { get_property: [ SELF, port ] } requirements: - host: mysql_dbms mysql_dbms: type: tosca.nodes.DBMS.MySQL properties: - root_password: { get_input: my_mysql_rootpw } - port: { get_input: my_mysql_port } + root_password: { get_input: database_password } + port: { get_input: database_port } requirements: - host: server interfaces: Standard: inputs: - db_root_password: { get_property: [ mysql_dbms, root_password ] } - create: mysql_dbms/mysql_dbms_install.sh - start: mysql_dbms/mysql_dbms_start.sh + db_root_password: { get_property: [ SELF, root_password ] } configure: mysql_dbms/mysql_dbms_configure.sh server: From 86c5d316674a1f47cd08f46d632eac9be8bb68b4 Mon Sep 17 00:00:00 2001 From: jmuell Date: Mon, 20 Nov 2017 13:54:16 +0100 Subject: [PATCH 35/52] Deleted unnecessary files --- .../apache_web_server/webserver_install.sh | 3 --- .../lamp-csar_Input/apache_web_server/webserver_start.sh | 2 -- .../yaml/valid/lamp-csar_Input/my_app/install_php.sh | 2 +- .../valid/lamp-csar_Input/my_app/mysql-credentials.php | 2 +- .../lamp-csar_Input/mysql_dbms/mysql_dbms_configure.sh | 2 +- .../lamp-csar_Input/mysql_dbms/mysql_dbms_install.sh | 8 -------- .../valid/lamp-csar_Input/mysql_dbms/mysql_dbms_start.sh | 2 -- 7 files changed, 3 insertions(+), 18 deletions(-) delete mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar_Input/apache_web_server/webserver_install.sh delete mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar_Input/apache_web_server/webserver_start.sh delete mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_install.sh delete mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_start.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/apache_web_server/webserver_install.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/apache_web_server/webserver_install.sh deleted file mode 100644 index 5217bedb0..000000000 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/apache_web_server/webserver_install.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -sudo apt-get update -y && sudo apt-get upgrade -y -sudo apt-get install -y apache2 libapache2-mod-php7.0 diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/apache_web_server/webserver_start.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/apache_web_server/webserver_start.sh deleted file mode 100644 index 4448a1246..000000000 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/apache_web_server/webserver_start.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -sudo systemctl start apache2 diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/my_app/install_php.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/my_app/install_php.sh index 570f39c77..d3d61ecb4 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/my_app/install_php.sh +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/my_app/install_php.sh @@ -1,4 +1,4 @@ #!/bin/bash # install php on a linux machine with php-mysql sudo apt-get update -y && sudo apt-get upgrade -y -sudo apt-get install -y php php-mysql +sudo apt-get install -y php php-mysql libapache2-mod-php7.0 diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/my_app/mysql-credentials.php b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/my_app/mysql-credentials.php index d645d4e35..f32cefde7 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/my_app/mysql-credentials.php +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/my_app/mysql-credentials.php @@ -1,7 +1,7 @@ diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_configure.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_configure.sh index b16dbf6d4..86641e949 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_configure.sh +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_configure.sh @@ -1,5 +1,5 @@ #!/bin/bash -cat << EOF | mysql -u root --password=${my_mysql_rootpw} +cat << EOF | mysql -u root --password=${database_password} CREATE DATABASE mydb; USE mydb; create table tasks (id INT not null auto_increment,task varchar(255), primary key(id)); diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_install.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_install.sh deleted file mode 100644 index 571c736bb..000000000 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_install.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -# install mysql-server without password promt. -# insert a fix pw -sudo apt-get update -y && sudo apt-get upgrade -y -echo "mysql-server mysql-server/root_password password ${my_mysql_rootpw}" | sudo debconf-set-selections -echo "mysql-server mysql-server/root_password_again password ${my_mysql_rootpw}" | sudo debconf-set-selections -sudo apt-get install mysql-server -y -sudo systemctl enable mysql diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_start.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_start.sh deleted file mode 100644 index 563b89a3d..000000000 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_start.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -sudo systemctl start mysql From 05e9d5d6fe340e10a0db32ea6ad117828ba2dafa Mon Sep 17 00:00:00 2001 From: Manuel Kloppenburg Date: Mon, 20 Nov 2017 16:00:57 +0100 Subject: [PATCH 36/52] Changed output to full URL --- .../csars/yaml/valid/lamp-csar_Input/template.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/template.yaml index 162d81d56..de83d3336 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/template.yaml +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/template.yaml @@ -23,7 +23,7 @@ topology_template: - database_endpoint: my_db interfaces: Standard: - inputs: db_host: { get_attribute: [ server, private_address ] } + inputs: database_host: { get_attribute: [ server, private_address ] } create: my_app/install_php.sh start: implementation: @@ -76,7 +76,8 @@ topology_template: type: linux distribution: ubuntu version: 16.04 + outputs: - endpoint: - description: endpoint of the php-app - value: { get_attribute: [ server, public_address ] } + server_url: + description: Concatenated URL with public server address and port + value: { concat: [ 'http://', get_attribute: [ server, public_address ], ':', get_attribute: [ server, port ]] } From 01067248d288f80f8bd6fa8b08c361fc56b27ebe Mon Sep 17 00:00:00 2001 From: Manuel Kloppenburg Date: Mon, 20 Nov 2017 16:01:38 +0100 Subject: [PATCH 37/52] Adapted no_input template to input template --- .../valid/lamp-csar_NoInput/template.yaml | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/template.yaml index 0fb779870..c632c0f7a 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/template.yaml +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/template.yaml @@ -27,36 +27,31 @@ topology_template: type: tosca.nodes.WebServer.Apache requirements: - host: server - interfaces: - Standard: - create: apache_web_server/webserver_install.sh - start: apache_web_server/webserver_start.sh my_db: type: tosca.nodes.Database.MySQL properties: - name: { mydb } - user: { root } - password: { abc } - port: { 3306 } + name: mydb + user: root + password: abc + port: 3306 capabilities: database_endpoint: properties: - port: { 3306 } + port: 3306 requirements: - host: mysql_dbms mysql_dbms: type: tosca.nodes.DBMS.MySQL properties: - root_password: { abc } - port: { 3306 } + root_password: abc + port: 3306 requirements: - host: server interfaces: Standard: create: mysql_dbms/mysql_dbms_install.sh - start: mysql_dbms/mysql_dbms_start.sh configure: mysql_dbms/mysql_dbms_configure.sh server: @@ -72,7 +67,8 @@ topology_template: type: linux distribution: ubuntu version: 16.04 + outputs: - endpoint: - description: endpoint of the php-app - value: { get_attribute: [ server, public_address ] } + server_url: + description: Concatenated URL with public server address and port + value: { concat: [ 'http://', get_attribute: [ server, public_address ], ':', get_attribute: [ server, port ]] } From ef9751e2116fe60da688df9da3b1ece027986d5e Mon Sep 17 00:00:00 2001 From: jmuell Date: Mon, 20 Nov 2017 16:36:08 +0100 Subject: [PATCH 38/52] Add missing variables --- .../valid/lamp-csar_Input/mysql_dbms/mysql_dbms_configure.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_configure.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_configure.sh index 86641e949..87050fd58 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_configure.sh +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_configure.sh @@ -1,7 +1,7 @@ #!/bin/bash cat << EOF | mysql -u root --password=${database_password} -CREATE DATABASE mydb; -USE mydb; +CREATE DATABASE ${database_name}; +USE ${database_name}; create table tasks (id INT not null auto_increment,task varchar(255), primary key(id)); EXIT EOF From 0db48a55eac95539fffe45be68a1a36fbfd001dd Mon Sep 17 00:00:00 2001 From: jmuell Date: Mon, 20 Nov 2017 16:36:25 +0100 Subject: [PATCH 39/52] Delete unnecessary files --- .../lamp-csar_NoInput/apache_web_server/webserver_install.sh | 3 --- .../lamp-csar_NoInput/apache_web_server/webserver_start.sh | 2 -- .../csars/yaml/valid/lamp-csar_NoInput/my_app/install_php.sh | 2 +- .../valid/lamp-csar_NoInput/mysql_dbms/mysql_dbms_start.sh | 2 -- 4 files changed, 1 insertion(+), 8 deletions(-) delete mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/apache_web_server/webserver_install.sh delete mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/apache_web_server/webserver_start.sh delete mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/mysql_dbms/mysql_dbms_start.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/apache_web_server/webserver_install.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/apache_web_server/webserver_install.sh deleted file mode 100644 index 5217bedb0..000000000 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/apache_web_server/webserver_install.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -sudo apt-get update -y && sudo apt-get upgrade -y -sudo apt-get install -y apache2 libapache2-mod-php7.0 diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/apache_web_server/webserver_start.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/apache_web_server/webserver_start.sh deleted file mode 100644 index 4448a1246..000000000 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/apache_web_server/webserver_start.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -sudo systemctl start apache2 diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/my_app/install_php.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/my_app/install_php.sh index 570f39c77..d3d61ecb4 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/my_app/install_php.sh +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/my_app/install_php.sh @@ -1,4 +1,4 @@ #!/bin/bash # install php on a linux machine with php-mysql sudo apt-get update -y && sudo apt-get upgrade -y -sudo apt-get install -y php php-mysql +sudo apt-get install -y php php-mysql libapache2-mod-php7.0 diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/mysql_dbms/mysql_dbms_start.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/mysql_dbms/mysql_dbms_start.sh deleted file mode 100644 index 563b89a3d..000000000 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/mysql_dbms/mysql_dbms_start.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -sudo systemctl start mysql From d758fcafce2488f8f4551c4878327bf4869c9ef2 Mon Sep 17 00:00:00 2001 From: Marvin Munoz Baron Date: Tue, 21 Nov 2017 12:09:55 +0100 Subject: [PATCH 40/52] Remove mysl_dbms_install.sh from no-input LAMP-CSAR --- .../lamp-csar_NoInput/mysql_dbms/mysql_dbms_install.sh | 8 -------- .../csars/yaml/valid/lamp-csar_NoInput/template.yaml | 1 - 2 files changed, 9 deletions(-) delete mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/mysql_dbms/mysql_dbms_install.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/mysql_dbms/mysql_dbms_install.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/mysql_dbms/mysql_dbms_install.sh deleted file mode 100644 index 618cf26f7..000000000 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/mysql_dbms/mysql_dbms_install.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -# install mysql-server without password promt. -# insert a fix pw -sudo apt-get update -y && sudo apt-get upgrade -y -echo "mysql-server mysql-server/root_password password abc" | sudo debconf-set-selections -echo "mysql-server mysql-server/root_password_again password abc" | sudo debconf-set-selections -sudo apt-get install mysql-server -y -sudo systemctl enable mysql diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/template.yaml index c632c0f7a..7e2494ee6 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/template.yaml +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/template.yaml @@ -51,7 +51,6 @@ topology_template: - host: server interfaces: Standard: - create: mysql_dbms/mysql_dbms_install.sh configure: mysql_dbms/mysql_dbms_configure.sh server: From 4c77efe727451b77f4cebae2de24798a0c4e5e65 Mon Sep 17 00:00:00 2001 From: Marvin Munoz Baron Date: Tue, 21 Nov 2017 12:23:57 +0100 Subject: [PATCH 41/52] Rename lamp-csar folders to use lower-case --- .../{lamp-csar_Input => lamp-csar_input}/my_app/install_php.sh | 0 .../{lamp-csar_Input => lamp-csar_input}/my_app/myphpapp.php | 0 .../my_app/mysql-credentials.php | 0 .../{lamp-csar_Input => lamp-csar_input}/my_app/start_myphpapp.sh | 0 .../mysql_dbms/mysql_dbms_configure.sh | 0 .../yaml/valid/{lamp-csar_Input => lamp-csar_input}/template.yaml | 0 .../my_app/install_php.sh | 0 .../{lamp-csar_NoInput => lamp-csar_noinput}/my_app/myphpapp.php | 0 .../my_app/mysql-credentials.php | 0 .../my_app/start_myphpapp.sh | 0 .../mysql_dbms/mysql_dbms_configure.sh | 0 .../valid/{lamp-csar_NoInput => lamp-csar_noinput}/template.yaml | 0 12 files changed, 0 insertions(+), 0 deletions(-) rename server/src/test/resources/csars/yaml/valid/{lamp-csar_Input => lamp-csar_input}/my_app/install_php.sh (100%) rename server/src/test/resources/csars/yaml/valid/{lamp-csar_Input => lamp-csar_input}/my_app/myphpapp.php (100%) rename server/src/test/resources/csars/yaml/valid/{lamp-csar_Input => lamp-csar_input}/my_app/mysql-credentials.php (100%) rename server/src/test/resources/csars/yaml/valid/{lamp-csar_Input => lamp-csar_input}/my_app/start_myphpapp.sh (100%) rename server/src/test/resources/csars/yaml/valid/{lamp-csar_Input => lamp-csar_input}/mysql_dbms/mysql_dbms_configure.sh (100%) rename server/src/test/resources/csars/yaml/valid/{lamp-csar_Input => lamp-csar_input}/template.yaml (100%) rename server/src/test/resources/csars/yaml/valid/{lamp-csar_NoInput => lamp-csar_noinput}/my_app/install_php.sh (100%) rename server/src/test/resources/csars/yaml/valid/{lamp-csar_NoInput => lamp-csar_noinput}/my_app/myphpapp.php (100%) rename server/src/test/resources/csars/yaml/valid/{lamp-csar_NoInput => lamp-csar_noinput}/my_app/mysql-credentials.php (100%) rename server/src/test/resources/csars/yaml/valid/{lamp-csar_NoInput => lamp-csar_noinput}/my_app/start_myphpapp.sh (100%) rename server/src/test/resources/csars/yaml/valid/{lamp-csar_NoInput => lamp-csar_noinput}/mysql_dbms/mysql_dbms_configure.sh (100%) rename server/src/test/resources/csars/yaml/valid/{lamp-csar_NoInput => lamp-csar_noinput}/template.yaml (100%) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/my_app/install_php.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_input/my_app/install_php.sh similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar_Input/my_app/install_php.sh rename to server/src/test/resources/csars/yaml/valid/lamp-csar_input/my_app/install_php.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/my_app/myphpapp.php b/server/src/test/resources/csars/yaml/valid/lamp-csar_input/my_app/myphpapp.php similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar_Input/my_app/myphpapp.php rename to server/src/test/resources/csars/yaml/valid/lamp-csar_input/my_app/myphpapp.php diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/my_app/mysql-credentials.php b/server/src/test/resources/csars/yaml/valid/lamp-csar_input/my_app/mysql-credentials.php similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar_Input/my_app/mysql-credentials.php rename to server/src/test/resources/csars/yaml/valid/lamp-csar_input/my_app/mysql-credentials.php diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/my_app/start_myphpapp.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_input/my_app/start_myphpapp.sh similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar_Input/my_app/start_myphpapp.sh rename to server/src/test/resources/csars/yaml/valid/lamp-csar_input/my_app/start_myphpapp.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_configure.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_input/mysql_dbms/mysql_dbms_configure.sh similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar_Input/mysql_dbms/mysql_dbms_configure.sh rename to server/src/test/resources/csars/yaml/valid/lamp-csar_input/mysql_dbms/mysql_dbms_configure.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_Input/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar_input/template.yaml similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar_Input/template.yaml rename to server/src/test/resources/csars/yaml/valid/lamp-csar_input/template.yaml diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/my_app/install_php.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/my_app/install_php.sh similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/my_app/install_php.sh rename to server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/my_app/install_php.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/my_app/myphpapp.php b/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/my_app/myphpapp.php similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/my_app/myphpapp.php rename to server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/my_app/myphpapp.php diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/my_app/mysql-credentials.php b/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/my_app/mysql-credentials.php similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/my_app/mysql-credentials.php rename to server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/my_app/mysql-credentials.php diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/my_app/start_myphpapp.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/my_app/start_myphpapp.sh similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/my_app/start_myphpapp.sh rename to server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/my_app/start_myphpapp.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/mysql_dbms/mysql_dbms_configure.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/mysql_dbms/mysql_dbms_configure.sh similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/mysql_dbms/mysql_dbms_configure.sh rename to server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/mysql_dbms/mysql_dbms_configure.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/template.yaml similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar_NoInput/template.yaml rename to server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/template.yaml From 0284d0ccfccba159f9f8c15dcb23a224925f5186 Mon Sep 17 00:00:00 2001 From: Marvin Munoz Baron Date: Tue, 21 Nov 2017 12:26:18 +0100 Subject: [PATCH 42/52] Rebuild LAMP-CSARs --- .../csars/yaml/valid/lamp-csar-no-input.csar | Bin 5456 -> 0 bytes .../resources/csars/yaml/valid/lamp-csar.csar | Bin 5269 -> 0 bytes .../csars/yaml/valid/lamp-csar_input.csar | Bin 0 -> 3379 bytes .../csars/yaml/valid/lamp-csar_noinput.csar | Bin 0 -> 3280 bytes 4 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar-no-input.csar delete mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar.csar create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar_input.csar create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar_noinput.csar diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input.csar b/server/src/test/resources/csars/yaml/valid/lamp-csar-no-input.csar deleted file mode 100644 index b18272cdddfac75763c0e7a2cbd3781ed592ce2b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5456 zcmb7I2|UyNA0HCUS)?Rc<%pciF-NW(g>vN>GQ%9rG2758SE-!23!%f&?NLOzin(Q# z>meiQsgy#hM|kl6ZEI~F+7?SObyb@v9)bZP zAW&LLpt(zr6J8ehPFWhjViA(%9x~_wv+|KPv?!Ey^?ns;u9~c+x83>{9_w_(Q zXuF{h>XUrnmE*gOHM&0m7vzWVboa+m150DBnT;{8l$-HX2lh~w+JEk4yawSB7~tjW z9gIb>FMtq08t2rU;_j35CsebgT&!N1F@bEq`L>h30j6{t=E_20R$Y_K%hPU z4-rOgGm`7Tr}cS_CQdCTe}vCVwia7&>g@;-LZ1mg>95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5dwZ;< zGy2Q3e@fR2PLS@UsUGM$6ZdFSFlmM~5$bp1GuTAa@5}~QpSPnzj^{2(-LyNj-JEM_gPnm@^xjWS%2f4PCbs5`?-yS`=q=zJFJS=_l#Q--I!a|q?t)sO}a z>BB1P%x$2)Uh80JH4b5(@IO9p2;=nlE-zK+DA9>JnSl)d^8Ue#!Xdk|#)1|z9BjXf z@axo#s3uj3(K6`s^gQG0_F98lXpt~yyi^5@C&|Du`O3+u?mMFW==T?+MeRRD>Fzru z?r2dW5PP>Jivt`drXW0`!jo6AIX!alKKpE*MxHE5KIs}!PQGCzd&fINWXB@L4<$GQBQ4AZbxX1_|s&XBRDXM{s&1JeUaO~Oi{V;!P7 z$=$)nul3j_X8JT9dxCfsQ%)vS?AU7HJ5;?#{dLk z18oMu)pZNkAiCJ-R{d!Kgai1!8i*8#8H6HdSxDLC!w)m;r!X}tEZvHphEjhsU|9`; zbXW)giT_<##>~YS8|Rs<3I5j&`YLA zW*TBxOEoSa{^K|uDm>jX+-5Z`GSjdJnmdd5Gq9P5Db_`>2Tv;kzYjDLbo=ijSUSTo zlQ0G*k>4i4D*XX}X;RZ)uR%)--7?~^JpEgiq`z?`3e=&FIp&*QYEolOxAFPvOsQv# zSW8DgW_RaT#acQDG9$NNo4-ZrFVK7qDk9x7yks@pF(YTJSs~C=FMmleKqfNdLKSJa z?lv$gF5Uhccd0UE#27OScRUxk1atATw+Y(D7L0cZoD)MvT}&RHF1P`prqVR_2^*fx8K~fCWL9 MfqzY0;-mcfA3JZPTmS$7 diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar.csar b/server/src/test/resources/csars/yaml/valid/lamp-csar.csar deleted file mode 100644 index 16e3e0143116e157adddeb7202f2283c9b033ef2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5269 zcma)<2{@GN7r+PECd5^iN|Zs_vNR$4l5Ok~gN$t~VT>6|bIVq4Q6@X-BFc8ll_>k# z*tcYhtZ|F#W+@TE{~MZS2KR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hiEUKv(@~~wuL)MStt|YI{E!!(t13Ovx3NN;VL zAJytSj7BCU9C^1e*U{K1ybB9ad1P3IXt<0+W7dPN z7FQPtOJ`xp~T|v!yuK<}d4;Q=Zh!9xl{%sJv^ukXYSbuDbC{9fI7+3(=?`>X#}|e zF08xX{lVSqXZD8;UhyI>ogZ4Sr-T|swn;0Yjnz7Hhz2)KpC585zfwV#exjg*o5A() zO2^tt)yF8-jOyJSSpInY6vH@f?88e8yre&2DYU{uWtHVYKsG7R_tl4sC5oRfe!#rh zr`ebOlH+rK`M2Kk6YQV5%g-<%3zHl9iS`%li_UKJnm-5L>Xl!EAF`U+zrf!*=g*u|+b uKMk91qOm#s##nxCovlj!^*Xz`0N?8NKOs3-A$|I{;RbZGMBiZ}E&l^eKMCIe literal 0 HcmV?d00001 diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput.csar b/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput.csar new file mode 100644 index 0000000000000000000000000000000000000000..c6a61ce7d55c544dc719970018f11d76deb9cd2b GIT binary patch literal 3280 zcma)u6B65Fum9zNH0OvWmICcyICbP=DZE>m&W$j)@duw~lv+@EaRpF$kn|kn64O zl8K3Sb~pVWDaA2P8Qr5hS;jk)ZRBAl@Q+&`wL??n1Aa!$#=fjw%JrlzPry!fB6RrF zFcPAb?Jpp!ewc~eb@y)5bXO-NIql}T9AUQdYk~^p;i01GX@ltLoY!xi9k5r&BpnN` zmZ>EU^208NJN<3hO>2Z9Je}AINpwAp?nql>^?{L_BHlW8n;Q(uww`ObK5I_ruFf9uY6@O(Q)$IvFz z5@~G$Pb6?+kkRw)S=Zn+Lapb_lf$L8=Vv%WxkI2L;u1r41rmulm3l+X5!Hc1G-BB< zR)?m9c@p81dcE|(HP{B#X21P2jd#ccLP7)m>RZC^lvJGzZ4h-z{E$nreaBgW^0SCS z8HA@M$u*h1<%uF@Pu4i=is;fyJhUILypydpF`AsHBh9Y#i8@yn3mN08erC|y-9I!r zT@W`{hbv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Equ(#h3Vb9z5U`T6bOIVQ(q3=w~ zxv+bY7sl~s&rVRiQs_}46xlapf`OfF4W%JDyee?ZpaySV{Kk2c+gF9KqGGkAOV5U_ z{919$_dmLSimSzpSM?sNG-b>#)qd$o4D>v(<7ygka>C8IY}S>E8@r;y2UC}ywKO$r z`0!z(n4LRIOU_GCe)=O|>Zb9qOZ)Xu=RRA*jpK~Lkz?EV9ShV7CZLwgN9@9&*t&-= zlzF43GUmpn1oka>m2p=)<9AOH>fN@bYs}(bdNWPy8*{1)sVdAaF}B&9y{^#E5wnAw z+}Pjc`0*05K7>6j-_t0XK)oTSdFyCe_iI_b>T_NhjRni(qtb8N9cM+@??>@Dhb}o$ zu93}T1=VvE_rGX%ZFrQ>rM|>o*+KF>VDnCPaIwcBXj2^>C!y;2V*f2#XC_fA^3ITw zlE&NJ7B55X9ikDZ(r{M6e#Ikihq;ct;G64bemuIns_RNByfpA{T)g0IYtxGAQ}y@u zS{OsHD%{A~3%i5pKu)YF)JwpKf+6+IaM}J0NUrN5F!x+}+-xii%p?@a%RrKlx z(mtdAS2U=65V)fJ-)!P~;eQ<~2iVbnalZVQ+i&#$tH4)3mha{I^*kFu-F~B55V@k- W??Pt)Lt6Rc!3?y5o}Oe``SmZH)ZFv{ literal 0 HcmV?d00001 From 1ac9d53d680122f0f974bdbce542060e774772a7 Mon Sep 17 00:00:00 2001 From: Manuel Kloppenburg Date: Tue, 21 Nov 2017 23:32:30 +0100 Subject: [PATCH 43/52] Removed concat function and replaced it by two outputs --- .../csars/yaml/valid/lamp-csar_input/template.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_input/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar_input/template.yaml index de83d3336..d1fb1fc4e 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_input/template.yaml +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_input/template.yaml @@ -78,6 +78,9 @@ topology_template: version: 16.04 outputs: - server_url: - description: Concatenated URL with public server address and port - value: { concat: [ 'http://', get_attribute: [ server, public_address ], ':', get_attribute: [ server, port ]] } + public_address: + description: Public address of the server + value: { get_attribute: [ server, public_address ] } + port: + description: Port of the server + value: { get_attribute: [ server, port ] } From bf8e5b5b84161fabe479fb77a14b6798f78c5d18 Mon Sep 17 00:00:00 2001 From: Manuel Kloppenburg Date: Tue, 21 Nov 2017 23:33:10 +0100 Subject: [PATCH 44/52] Added configure script and adapted template --- .../valid/lamp-csar_input/my_app/configure_myphpapp.sh | 7 +++++++ .../valid/lamp-csar_input/my_app/mysql-credentials.php | 8 ++++---- .../csars/yaml/valid/lamp-csar_input/template.yaml | 8 +++++++- 3 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar_input/my_app/configure_myphpapp.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_input/my_app/configure_myphpapp.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_input/my_app/configure_myphpapp.sh new file mode 100644 index 000000000..b5471e617 --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_input/my_app/configure_myphpapp.sh @@ -0,0 +1,7 @@ +#!/bin/bash +CREDENTIALS="mysql-credentials.php" + +sed -i "s:DATABASE_HOST:${database_host}:g" $CREDENTIALS +sed -i "s:DATABASE_PASSWORD:${database_password}:g" $CREDENTIALS +sed -i "s:DATABASE_NAME:${database_name}:g" $CREDENTIALS +sed -i "s:DATABASE_PORT:${database_port}:g" $CREDENTIALS diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_input/my_app/mysql-credentials.php b/server/src/test/resources/csars/yaml/valid/lamp-csar_input/my_app/mysql-credentials.php index f32cefde7..380ca89e0 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_input/my_app/mysql-credentials.php +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_input/my_app/mysql-credentials.php @@ -1,7 +1,7 @@ diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_input/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar_input/template.yaml index d1fb1fc4e..54e5b4f33 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_input/template.yaml +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_input/template.yaml @@ -23,8 +23,14 @@ topology_template: - database_endpoint: my_db interfaces: Standard: - inputs: database_host: { get_attribute: [ server, private_address ] } create: my_app/install_php.sh + configure: + implementation: my_app/configure_myphpapp.sh + inputs: + database_host: { get_attribute: [ server, private_address ] } + database_password: { get_property: [ my_db, password ] } + database_name: { get_property: [ my_db, name ] } + database_port: { get_property: [ my_db, port ] } start: implementation: primary: my_app/start_myphpapp.sh From e6102cc4e53fe45860aba0b20207ed106262a0ce Mon Sep 17 00:00:00 2001 From: jmuell Date: Wed, 22 Nov 2017 17:14:47 +0100 Subject: [PATCH 45/52] Update input-csar --- .../csars/yaml/valid/lamp-csar_input.csar | Bin 3379 -> 3720 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_input.csar b/server/src/test/resources/csars/yaml/valid/lamp-csar_input.csar index 5f9d3db222ee7bdce5041264e9a568a188677ecd..bf4e1279c016375c5c3088c447b4264d24436aea 100644 GIT binary patch delta 2077 zcmdli)gj9p;LXg!#Q*~7on;ewWmOg}6pgwB#HAJ742&!C$r1W26-P!$JA-DDqD zJyEO*C-<{@O2XB7-;N3Dj0ftP1jI57GL!4L7n6Ybp$RZpaP*liMSW?7O*8BYf zKVRS`w$oF^mWwq$>H759dw~;c=h352f4XXFL@~)UHy{4n9J3(nlTdMR;FG^HwXuo6 zK6g7@Q{3{4y)~lv=Iug81{6n6^wY%d=8ZjG%*-HP-DK9ru41wzOI`WR;IJ$Hr_NmV_tH7{ zpop)iwD2qU$C59c+d@yR)zLe1(O1vQ*Ym9QNuM*C*R)S)1U!1A<(J_bc;ReFfYvsY z5ZV~D($7=JlV#Rq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Hv6gDN(_MRYjy${nZwRpwdS9b|ma)+23Fx&4j2x!XT z<~rZ=W=g4M;;g6E3;HJna;M!-iB#Sd<5;wILzhX)fz50}r;Mbh9X{~(mf^|B_|V?& zm~Zc1o!Ea;OeU32`<%@tzkL&}nl&%Fy;(eMj`W6UHR|^_coYcCPqo;2yCn9ANXXVo)Xfy)g`a1wsan11JZIGO5RRAia%^kc z3-`#@K3n=(*`dC8pO=`qY4oYx3+qfPugp#=_|bO#|K3Rzwv9*R)#L4SPcAO7UR2w5 zJ#6#rEyeP;Rn0P=XP)PhZ}*Yg+oHDPmgVxxKmTM^J+$k*_xp8<*SbsHKPt8)IBWl9 z4e(}Ul4FMFHg8b51Ox005>Tc9!&^rXGq*B6v7kUdG=!Cb8B~5?6j>m{5QSDek0i^I zMn{IpH9S(_+=gGhw~)q%OGQ9yRspdn)N)23dr9LNX1L{;sx7gJO0s%Va4YWhEl~GoM?MbxET=E5pP%>3V!YfIU39QNr^IE67X5g*ovl zNx8+uhN*Wj%dyjILE-ZNNGPFrM3RkRvMjqQUYEfm2dOY*VBkeDM~R(*p(Hi8ASbaT cRj)EJHwSkhv$6qQ0j#1p7|sIA)c~-+0V26ikpKVy From 917a2891dc0c6a39548c403f645fff642d16fc04 Mon Sep 17 00:00:00 2001 From: hnicke Date: Thu, 23 Nov 2017 15:27:50 +0100 Subject: [PATCH 46/52] FIx issues regarding phpapp's lifecycle --- .../lamp-csar_input/my_app/configure_myphpapp.sh | 2 +- .../my_app/create_myphpapp.sh} | 4 ++++ .../lamp-csar_input/my_app/start_myphpapp.sh | 3 --- .../yaml/valid/lamp-csar_input/template.yaml | 15 +++++++-------- .../my_app/create_myphpapp.sh} | 3 +++ .../lamp-csar_noinput/my_app/start_myphpapp.sh | 3 --- .../yaml/valid/lamp-csar_noinput/template.yaml | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) rename server/src/test/resources/csars/yaml/valid/{lamp-csar_noinput/my_app/install_php.sh => lamp-csar_input/my_app/create_myphpapp.sh} (67%) delete mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar_input/my_app/start_myphpapp.sh rename server/src/test/resources/csars/yaml/valid/{lamp-csar_input/my_app/install_php.sh => lamp-csar_noinput/my_app/create_myphpapp.sh} (67%) delete mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/my_app/start_myphpapp.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_input/my_app/configure_myphpapp.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_input/my_app/configure_myphpapp.sh index b5471e617..373db8a68 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_input/my_app/configure_myphpapp.sh +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_input/my_app/configure_myphpapp.sh @@ -1,5 +1,5 @@ #!/bin/bash -CREDENTIALS="mysql-credentials.php" +CREDENTIALS="/var/www/html/mysql-credentials.php" sed -i "s:DATABASE_HOST:${database_host}:g" $CREDENTIALS sed -i "s:DATABASE_PASSWORD:${database_password}:g" $CREDENTIALS diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/my_app/install_php.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_input/my_app/create_myphpapp.sh similarity index 67% rename from server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/my_app/install_php.sh rename to server/src/test/resources/csars/yaml/valid/lamp-csar_input/my_app/create_myphpapp.sh index d3d61ecb4..8db477e8b 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/my_app/install_php.sh +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_input/my_app/create_myphpapp.sh @@ -2,3 +2,7 @@ # install php on a linux machine with php-mysql sudo apt-get update -y && sudo apt-get upgrade -y sudo apt-get install -y php php-mysql libapache2-mod-php7.0 + +sudo mv myphpapp.php /var/www/html/ +sudo mv mysql-credentials.php /var/www/html/ + diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_input/my_app/start_myphpapp.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_input/my_app/start_myphpapp.sh deleted file mode 100644 index c278150a8..000000000 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_input/my_app/start_myphpapp.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -sudo mv myphpapp.php /var/www/html/ -sudo mv mysql-credentials.php /var/www/html/ diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_input/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar_input/template.yaml index 54e5b4f33..dbaddbbf0 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_input/template.yaml +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_input/template.yaml @@ -23,20 +23,19 @@ topology_template: - database_endpoint: my_db interfaces: Standard: - create: my_app/install_php.sh + create: + implementation: + primary: my_app/create_myphpapp.sh + dependencies: + - my_app/myphpapp.php + - my_app/mysql-credentials.php configure: - implementation: my_app/configure_myphpapp.sh + implemenation: my_app/configure_myphpapp.sh inputs: database_host: { get_attribute: [ server, private_address ] } database_password: { get_property: [ my_db, password ] } database_name: { get_property: [ my_db, name ] } database_port: { get_property: [ my_db, port ] } - start: - implementation: - primary: my_app/start_myphpapp.sh - dependencies: - - myphpapp.php - - mysql-credentials.php apache_web_server: type: tosca.nodes.WebServer.Apache diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_input/my_app/install_php.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/my_app/create_myphpapp.sh similarity index 67% rename from server/src/test/resources/csars/yaml/valid/lamp-csar_input/my_app/install_php.sh rename to server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/my_app/create_myphpapp.sh index d3d61ecb4..b0746ca72 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_input/my_app/install_php.sh +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/my_app/create_myphpapp.sh @@ -2,3 +2,6 @@ # install php on a linux machine with php-mysql sudo apt-get update -y && sudo apt-get upgrade -y sudo apt-get install -y php php-mysql libapache2-mod-php7.0 + +sudo mv myphpapp.php /var/www/html/ +sudo mv mysql-credentials.php /var/www/html/ diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/my_app/start_myphpapp.sh b/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/my_app/start_myphpapp.sh deleted file mode 100644 index c278150a8..000000000 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/my_app/start_myphpapp.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -sudo mv myphpapp.php /var/www/html/ -sudo mv mysql-credentials.php /var/www/html/ diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/template.yaml index 7e2494ee6..7ed3b0f1e 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/template.yaml +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/template.yaml @@ -18,7 +18,7 @@ topology_template: create: my_app/install_php.sh start: implementation: - primary: my_app/start_myphpapp.sh + primary: my_app/create_myphpapp.sh dependencies: - myphpapp.php - mysql-credentials.php From 81af33540c56c79e59bf0e424f81a3a18db6ac96 Mon Sep 17 00:00:00 2001 From: Manuel Kloppenburg Date: Sun, 26 Nov 2017 14:35:46 +0100 Subject: [PATCH 47/52] Adapted no input csar --- .../csars/yaml/valid/lamp-csar_noinput/template.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/template.yaml index 7ed3b0f1e..b75f66ceb 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/template.yaml +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/template.yaml @@ -15,8 +15,7 @@ topology_template: - database_endpoint: my_db interfaces: Standard: - create: my_app/install_php.sh - start: + create: implementation: primary: my_app/create_myphpapp.sh dependencies: @@ -68,6 +67,9 @@ topology_template: version: 16.04 outputs: - server_url: - description: Concatenated URL with public server address and port - value: { concat: [ 'http://', get_attribute: [ server, public_address ], ':', get_attribute: [ server, port ]] } + public_address: + description: Public address of the server + value: { get_attribute: [ server, public_address ] } + port: + description: Port of the server + value: { get_attribute: [ server, port ] } From 77d3a1507fb91610943b136954b11aff039c4240 Mon Sep 17 00:00:00 2001 From: Manuel Kloppenburg Date: Sun, 26 Nov 2017 16:09:55 +0100 Subject: [PATCH 48/52] Fixed indentation error and build csars --- .../csars/yaml/valid/lamp-csar_input.csar | Bin 3720 -> 3088 bytes .../yaml/valid/lamp-csar_input/template.yaml | 16 ++++++++-------- .../csars/yaml/valid/lamp-csar_noinput.csar | Bin 3280 -> 2655 bytes .../valid/lamp-csar_noinput/template.yaml | 10 +++++----- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_input.csar b/server/src/test/resources/csars/yaml/valid/lamp-csar_input.csar index bf4e1279c016375c5c3088c447b4264d24436aea..14677b50a8f330d24ee030b78e0c574583b33d77 100644 GIT binary patch literal 3088 zcmZ{m2Rz&9AIC$aRzvO4Qk-&Dg<7?W8Z{d^p;m1Y6*Ok-*;ZREqH(BErIfRYqG(DR zd;iaf8W)t><+xMhpSrsm*L(7MUQb@h_xt&Mzt8h}-oFpj5Jw};-0;x{3Jxw{^%uMmWC~5@xWD3NMqB4|J8*T`SRKHk1kxt zi1aK9ZN@adfvu>?m)t^by>~l1QEXlp0Iqs}jeHx<83 zjKWcx*`-XLBTb=Q9DI*;go-CHy%jj4y%O>+O{Br}Ay<=|^)*4NIvgsoiA&C1uAw_U zbtq$SE{9jfvM=&MTwkz&VVSnZ>P620Iweakurm=a!(&i~NmOV6uy%|mcbqHHM4(E&MMJR=x4*^mUHzIA;z7#shTv!x9e_q;*pGkNx`nN@YKm{X($ zr=OB48aN$2Z9t`w=bLV%iU4DGzoaiMcMMYH+oi-62!QcL@(_h+JNjPY>iJhc4c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/test/resources/csars/yaml/valid/lamp-csar_input/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar_input/template.yaml index dbaddbbf0..dad3122ea 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_input/template.yaml +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_input/template.yaml @@ -23,7 +23,7 @@ topology_template: - database_endpoint: my_db interfaces: Standard: - create: + create: implementation: primary: my_app/create_myphpapp.sh dependencies: @@ -60,13 +60,13 @@ topology_template: properties: root_password: { get_input: database_password } port: { get_input: database_port } - requirements: - - host: server - interfaces: - Standard: - inputs: - db_root_password: { get_property: [ SELF, root_password ] } - configure: mysql_dbms/mysql_dbms_configure.sh + requirements: + - host: server + interfaces: + Standard: + inputs: + db_root_password: { get_property: [ SELF, root_password ] } + configure: mysql_dbms/mysql_dbms_configure.sh server: type: tosca.nodes.Compute diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput.csar b/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput.csar index c6a61ce7d55c544dc719970018f11d76deb9cd2b..470546a763aa58fdca15093749f2302349e5a026 100644 GIT binary patch literal 2655 zcmZ{m2{@E%8^>qt`$uFf70Qxj7>p=R7|lpjOf*T1Z9--kMqxyzI7;8R>_YZ!4#_%G zmTWmuW2Zw=Xb=gZqau7S9Vw^pd9UYsp7(n1`~TecbG`TPx-HGwImFmOz-SL8n{TXJ zgB#co04kmybXoYYC~1ZtyDldSNu zxz$LWljIx;jgU@8G=j|!Y93P$fnS0@>PSuQ&lq#PaTk_ypIdr=4$0_uN5Rk${Bi#e zdeYKxS7yHEsCjLbx+0xz*KMS>Ji1lt7{w{nupCd5TDGml>3C-h538g_7oxFY*aX_h zk@TAWfw>X$lhN*Y)hd=EsiUXVf1x*U->tyj6Wol+H&$Q3Kj)$tjrpnzq(96B0*P+t z@;wP47pl!*R4+_8xD(TMJ|X37E=Bj42G2R8<2R9&vT|W6y2*I8UHSt;d5Ew2Ec0G9 zCVQ|up);A4tj(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ur7sS`m| z8a(!5MWooP=}d+-O?EFR?`$J4s+@Zfd{3io6ENWCOfqgsAMKP8^-*-A2n!v{#_I2D zu&X@{m(tWb(|RTQnwU||j;cr1k?^o`N+%)~(xVT!HB~6~r@Y`lwN!&49~ozFDL9j> z*U+aOa^ZHAunf}X8QcNFV}Th{ejdroT`bXZQP()elw)#!S0L3QNuN~@H<8{F!pzX_ z8+?-UNz7Q@aQRaM07jlPIX-8cVOUk=K~c)RCcYEqu(#h3Vb9z5U`T6bOIVQ(q3=w~ zxv+bY7sl~s&rVRiQs_}46xlapf`OfF4W%JDyee?ZpaySV{Kk2c+gF9KqGGkAOV5U_ z{919$_dmLSimSzpSM?sNG-b>#)qd$o4D>v(<7ygka>C8IY}S>E8@r;y2UC}ywKO$r z`0!z(n4LRIOU_GCe)=O|>Zb9qOZ)Xu=RRA*jpK~Lkz?EV9ShV7CZLwgN9@9&*t&-= zlzF43GUmpn1oka>m2p=)<9AOH>fN@bYs}(bdNWPy8*{1)sVdAaF}B&9y{^#E5wnAw z+}Pjc`0*05K7>6j-_t0XK)oTSdFyCe_iI_b>T_NhjRni(qtb8N9cM+@??>@Dhb}o$ zu93}T1=VvE_rGX%ZFrQ>rM|>o*+KF>VDnCPaIwcBXj2^>C!y;2V*f2#XC_fA^3ITw zlE&NJ7B55X9ikDZ(r{M6e#Ikihq;ct;G64bemuIns_RNByfpA{T)g0IYtxGAQ}y@u zS{OsHD%{A~3%i5pKu)YF)JwpKf+6+IaM}J0NUrN5F!x+}+-xii%p?@a%RrKlx z(mtdAS2U=65V)fJ-)!P~;eQ<~2iVbnalZVQ+i&#$tH4)3mha{I^*kFu-F~B55V@k- W??Pt)Lt6Rc!3?y5o}Oe``SmZH)ZFv{ diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/template.yaml index b75f66ceb..2a53af19a 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/template.yaml +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/template.yaml @@ -46,11 +46,11 @@ topology_template: properties: root_password: abc port: 3306 - requirements: - - host: server - interfaces: - Standard: - configure: mysql_dbms/mysql_dbms_configure.sh + requirements: + - host: server + interfaces: + Standard: + configure: mysql_dbms/mysql_dbms_configure.sh server: type: tosca.nodes.Compute From 52912e455cd40caf26155923e32019399f317ce5 Mon Sep 17 00:00:00 2001 From: Manuel Kloppenburg Date: Sun, 26 Nov 2017 21:30:38 +0100 Subject: [PATCH 49/52] Non-normative Types aren't supported by the winery-parser so changed to normative Types --- .../csars/yaml/valid/lamp-csar_input.csar | Bin 3088 -> 3105 bytes .../yaml/valid/lamp-csar_input/template.yaml | 36 ++++++++++-------- .../csars/yaml/valid/lamp-csar_noinput.csar | Bin 2655 -> 2679 bytes .../valid/lamp-csar_noinput/template.yaml | 30 ++++++++------- 4 files changed, 37 insertions(+), 29 deletions(-) diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_input.csar b/server/src/test/resources/csars/yaml/valid/lamp-csar_input.csar index 14677b50a8f330d24ee030b78e0c574583b33d77..a106f7b1e3558918ad2c3b4050504fd7a77e1493 100644 GIT binary patch delta 932 zcmbOru~331z?+#xgqZ;d)-IgLqs#;(4KD-9$!v_Lfz;;9jA_gut~Ki%5OtGP9Yis) zy{>OrUF99Z8ff%_iGiVpi-Ca`XhunDZb43BNvd9DVs6gXFz@`^20Z(ohjZL0Exf%@ zn(h9ry?VSC6q(B;*c`XbbXlRhvTDocw!hy4KRHjlyX0oWOQGX`JnEjfpWJk5N>A8^ zhfUFXtqb`V@Y+3DVk~)Yg;d7rS+n9Ue0F7Bb|t3%Cc{srj1;jGZdpN%t5Q!Non}x} zymgoAu}z=!qD>MakLsKjZ@F==k?Wd+U)Hr1sSUd9r|mi{cTcuD?%1p#Zcp?H)S*1{DMk3R^!-z??m0QMSrMB?Od**y45#8;>;njFD%D; zDyQtKGE&$lT)(MlV$k^|nVP{`UpZLQddl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UneD-Hr_h8F}hwqETcy1>COuoRka7|PX1>O@aAD;vS)_noXIR)#-My*$>jl}nz>v- k)G01|5XH?677XP!2l4v2{rFI`&g56zhHOuPIf#J)013CL%K!iX diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_input/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar_input/template.yaml index dad3122ea..1bce90785 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_input/template.yaml +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_input/template.yaml @@ -30,7 +30,7 @@ topology_template: - my_app/myphpapp.php - my_app/mysql-credentials.php configure: - implemenation: my_app/configure_myphpapp.sh + implementation: my_app/configure_myphpapp.sh inputs: database_host: { get_attribute: [ server, private_address ] } database_password: { get_property: [ my_db, password ] } @@ -38,12 +38,14 @@ topology_template: database_port: { get_property: [ my_db, port ] } apache_web_server: - type: tosca.nodes.WebServer.Apache + #should be tosca.nodes.WebServer.Apache + type: tosca.nodes.WebServer requirements: - host: server my_db: - type: tosca.nodes.Database.MySQL + #should be tosca.nodes.Database.MySQL + type: tosca.nodes.Database properties: name: { get_input: database_name } password: { get_input: database_password } @@ -56,17 +58,19 @@ topology_template: - host: mysql_dbms mysql_dbms: - type: tosca.nodes.DBMS.MySQL + #should be tosca.nodes.DBMS.MySQL + type: tosca.nodes.DBMS properties: - root_password: { get_input: database_password } - port: { get_input: database_port } + root_password: { get_input: database_password } + port: { get_input: database_port } requirements: - host: server interfaces: Standard: - inputs: - db_root_password: { get_property: [ SELF, root_password ] } - configure: mysql_dbms/mysql_dbms_configure.sh + configure: + implementation: mysql_dbms/mysql_dbms_configure.sh + inputs: + db_root_password: { get_property: [ SELF, root_password ] } server: type: tosca.nodes.Compute @@ -82,10 +86,10 @@ topology_template: distribution: ubuntu version: 16.04 - outputs: - public_address: - description: Public address of the server - value: { get_attribute: [ server, public_address ] } - port: - description: Port of the server - value: { get_attribute: [ server, port ] } + outputs: + public_address: + description: Public address of the server + value: { get_attribute: [ server, public_address ] } + port: + description: Port of the server + value: { get_attribute: [ server, port ] } diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput.csar b/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput.csar index 470546a763aa58fdca15093749f2302349e5a026..07dac4519ba17d42370e1b07845349199670446c 100644 GIT binary patch delta 780 zcmcaF@?C@{z?+#xgqZ;d)-IgLqs#;(4Nn2djepaafz;$wmVOZRjYS}nJdsDLO+pVbwwC`}J?zwR4Bm0&!=S*1Uc&{nvhh_X3t&*jp z$I2(H_wf91!tB;2F5kt`3%BvyI9pVDdQST%z1f~$0vg+Ej?M6w-oeyqnO*NNtCD^8 zd!u#*j(yk6mOCAcuzk;=Y2m<=a(?sC9J9~2Uby8)?_)kP&ntWfzeU%DNxJOGztXj? zOZj|G6MVZVKSHNB(}lC}0?XzK`4-pCQ^$=m&ql7DdtOpPBl}5zL_zzs4q1gqKUgiE ztk7EAs$^lfqKjoA!!6z^6#->$9YYi9wY%PgXBwV0S(D-KzB2jN^S0DA6B2IQ@YY-l zf3V4P>%#A6u0H0y=<=vzl}LL^o98#{m(Ndb*`5FFN~>1|WAEz%L5r*D;s1J9mu6^% zJ=nhqoPTAA>@m_OyMvd3C)YWBwpFZn2A~KDkB!)N2UTCBBrz^&{ z=7rTOm|1R)`dxdXp}2omO?to-=aA?}b%h&ucrBdtM8`$hO?TPz91mYh-|YD+3F(F} z)nfG@efT$P()HC}LymGjsbsZY_@k3)ZVA`FkDo7RDQ`Qt?+2?KSBaU;r@zmBoIU!t z^YG{L3+}qUAAU@FSU794O_<}SODyi*WK_?vVQ}O?hd2p{W<&R`>mz zk!Q`}EwIe|%yo;hzl^gSzSM2jt>W94?$Y?4^V_!-{J#(WJ5%QV_T{oEKkkQZ*_!=9 zJiwcg$(|XUa+!ficXAJhF(`o^GxI+qdKG!9VW F2LSJRZL9zQ delta 776 zcmew^a$kfez?+#xgqZ;d&NfWsQDy>?hNpn!#=mLIKx%R-OFxME#-a|QFJM<$s8FQ#pA&^MfLh_y2uF@mr8k5lOf7Rh4 zYu)cykT->y;kObMqyT)B}0z!^_W9u6Xy^XHmP9jfiBjUG4)e6|psp^_gOV+is*U zQ{bpup6l4!w6RK%Rda@d+s5ZVjZPb_@6G$N?P;~c@s%aL&IbZprsY^lT(%G1c`f0U z`TGlc|GS=UHSArnAlu}ijvY&4;G$2lGq;H4ET5|{A+e(Dg#5-Qe7c;o6?T2|E;tc* z)s5S=AShrurxW8A=@kV*Wp5p?CS=!l@vPo7qe?2=e4d7;*4yI8MqwTsawkgJz1A+c zIcx61?|0rllisB`$t`5+j4nxQ$+Ao5?JvJu7%9L#^#hZXc%kfv3-cGhTd%CLzi+nR zr~Ud;JFAN4um5k@s~o@e_4)0bZt7 zQ@8r9s-fcIr&o)tI?)(plH^ucVRG!s!exhVsYePgck1)Fe%pAT{Kpq*Tk9^$i}gMz zW{%U{JpaM}f9hLqb>wca$o-sC^MrYU^_#-S-pAiJPgAR~G27<%(Q|T;Z#hi%AfPr9$Qnke8M+f(|V`Y`Tm}JMN?nszYk!0dYH!` zZh836Pn*iU+5Pi)c+{qp=oYQW?#?@8{af#jtAMw{GV?R<3+(SV^2~BDs^6?z#kViq ztudeT$1_gx-{=0NJU&>}H!Enp`jWE~pXmp9GcwsT!%}FKHz=jT06T;+c_)V)C~@B8 ja0O8coc16pk<$Z2t>!cbQBOGi&=Rgaml0bX2gn2feZ5py diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/template.yaml index 2a53af19a..3010abf3a 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/template.yaml +++ b/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/template.yaml @@ -23,12 +23,14 @@ topology_template: - mysql-credentials.php apache_web_server: - type: tosca.nodes.WebServer.Apache + #should be tosca.nodes.WebServer.Apache + type: tosca.nodes.WebServer requirements: - host: server my_db: - type: tosca.nodes.Database.MySQL + #should be tosca.nodes.Database.MySQL + type: tosca.nodes.Database properties: name: mydb user: root @@ -42,15 +44,17 @@ topology_template: - host: mysql_dbms mysql_dbms: - type: tosca.nodes.DBMS.MySQL + #should be tosca.nodes.DBMS.MySQL + type: tosca.nodes.DBMS properties: - root_password: abc - port: 3306 + root_password: abc + port: 3306 requirements: - host: server interfaces: Standard: - configure: mysql_dbms/mysql_dbms_configure.sh + configure: + implementation: mysql_dbms/mysql_dbms_configure.sh server: type: tosca.nodes.Compute @@ -66,10 +70,10 @@ topology_template: distribution: ubuntu version: 16.04 - outputs: - public_address: - description: Public address of the server - value: { get_attribute: [ server, public_address ] } - port: - description: Port of the server - value: { get_attribute: [ server, port ] } + outputs: + public_address: + description: Public address of the server + value: { get_attribute: [ server, public_address ] } + port: + description: Port of the server + value: { get_attribute: [ server, port ] } From 83b310423d09555e0c0e80618cc7b556b87c9d24 Mon Sep 17 00:00:00 2001 From: Heiko Nickerl Date: Mon, 27 Nov 2017 23:20:14 +0100 Subject: [PATCH 50/52] Revert NodeTypes to non-normative ones --- .../csars/yaml/valid/lamp-csar_input.csar | Bin 3105 -> 0 bytes .../yaml/valid/lamp-csar_input/template.yaml | 9 +++------ .../csars/yaml/valid/lamp-csar_noinput.csar | Bin 2679 -> 0 bytes .../yaml/valid/lamp-csar_noinput/template.yaml | 9 +++------ .../resources/csars/yaml/valid/lamp_input.csar | Bin 0 -> 3502 bytes .../resources/csars/yaml/valid/lamp_noinput.csar | Bin 0 -> 3024 bytes 6 files changed, 6 insertions(+), 12 deletions(-) delete mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar_input.csar delete mode 100644 server/src/test/resources/csars/yaml/valid/lamp-csar_noinput.csar create mode 100644 server/src/test/resources/csars/yaml/valid/lamp_input.csar create mode 100644 server/src/test/resources/csars/yaml/valid/lamp_noinput.csar diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_input.csar b/server/src/test/resources/csars/yaml/valid/lamp-csar_input.csar deleted file mode 100644 index a106f7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J1LL3Jw=47a z_zLhh{9owwuX_0TG;?j6W@pxo9=;RUUjetKdb_-SKjf_Kz%BL( e=KO=OF_AwJHA@p#=BEGvgn1E}s%Xfu@$_H2I;EQc literal 0 HcmV?d00001 From 9e01ffbbd9d68555fe2c9c4f6f82d26bf453daaf Mon Sep 17 00:00:00 2001 From: Heiko Nickerl Date: Tue, 28 Nov 2017 13:47:28 +0100 Subject: [PATCH 51/52] Unify test csars and provide zip script --- .../core/csar/CsarFilesystemDaoTest.java | 2 +- server/src/test/resources/csars/csar-make | 11 ++ .../yaml/invalid/dependencies_missing.csar | Bin 6229 -> 6045 bytes .../docker/dockerapp_create.sh | 0 .../docker/dockerapp_delete.sh | 0 .../docker/dockerapp_start.sh | 0 .../docker/dockerapp_stop.sh | 0 .../docker/dockerengine_create.sh | 0 .../docker/dockerengine_start.sh | 0 .../docker/dockerengine_stop.sh | 0 .../docker/dockertypes.yaml | 67 ++++++++++++ .../simple-task-app/Dockerfile | 0 .../simple-task-app/createdb.sql | 0 .../simple-task-app/index.php | 0 .../simple-task-app/mysql-credentials.php | 0 .../dependencies_missing/template.yaml | 99 ++++++++++++++++++ .../csars/yaml/invalid/dockerapp_missing.csar | Bin 6041 -> 5864 bytes .../docker/dockerapp_create.sh | 9 ++ .../docker/dockerapp_delete.sh | 3 + .../docker/dockerapp_start.sh | 4 + .../docker/dockerapp_stop.sh | 3 + .../docker/dockerengine_create.sh | 4 + .../docker/dockerengine_start.sh | 2 + .../docker/dockerengine_stop.sh | 2 + .../dockerapp_missing/docker/dockertypes.yaml | 67 ++++++++++++ .../simple-task-app/Dockerfile | 14 +++ .../simple-task-app/createdb.sql | 7 ++ .../simple-task-app/index.php | 79 ++++++++++++++ .../simple-task-app/mysql-credentials.php | 7 ++ .../invalid/dockerapp_missing/template.yaml | 82 +++++++++++++++ .../yaml/invalid/entrypoint_ambiguous.csar | Bin 3745 -> 2754 bytes ...cond_entrypoint_this_will_cause_error.yaml | 2 + .../entrypoint_ambiguous/template.yaml | 2 + .../yaml/invalid/entrypoint_missing.csar | Bin 5015 -> 5165 bytes .../invalid/entrypoint_missing/nothing.txt | 0 .../csars/yaml/valid/entrypoint_is_yml.csar | Bin 5636 -> 5319 bytes .../yaml/valid/entrypoint_is_yml/template.yml | 5 + .../csars/yaml/valid/lamp-input.csar | Bin 0 -> 3502 bytes .../my_app/configure_myphpapp.sh | 0 .../my_app/create_myphpapp.sh | 0 .../my_app/myphpapp.php | 0 .../my_app/mysql-credentials.php | 0 .../mysql_dbms/mysql_dbms_configure.sh | 0 .../template.yaml | 2 +- .../csars/yaml/valid/lamp-noinput.csar | Bin 0 -> 3024 bytes .../my_app/create_myphpapp.sh | 0 .../my_app/myphpapp.php | 0 .../my_app/mysql-credentials.php | 0 .../mysql_dbms/mysql_dbms_configure.sh | 0 .../template.yaml | 2 +- .../csars/yaml/valid/lamp_input.csar | Bin 3502 -> 0 bytes .../csars/yaml/valid/lamp_noinput.csar | Bin 3024 -> 0 bytes .../csars/yaml/valid/simple-task-csar/zip | 2 - .../csars/yaml/valid/simple-task.csar | Bin 6278 -> 5335 bytes .../simple-task/docker/dockerapp_create.sh | 9 ++ .../simple-task/docker/dockerapp_delete.sh | 3 + .../simple-task/docker/dockerapp_start.sh | 4 + .../simple-task/docker/dockerapp_stop.sh | 3 + .../simple-task/docker/dockerengine_create.sh | 4 + .../simple-task/docker/dockerengine_start.sh | 2 + .../simple-task/docker/dockerengine_stop.sh | 2 + .../simple-task/simple-task-app/Dockerfile | 14 +++ .../simple-task/simple-task-app/createdb.sql | 7 ++ .../simple-task/simple-task-app/index.php | 79 ++++++++++++++ .../simple-task-app/mysql-credentials.php | 7 ++ .../template.yaml | 15 ++- 66 files changed, 612 insertions(+), 14 deletions(-) create mode 100755 server/src/test/resources/csars/csar-make rename server/src/test/resources/csars/yaml/{valid/simple-task-csar => invalid/dependencies_missing}/docker/dockerapp_create.sh (100%) mode change 100644 => 100755 rename server/src/test/resources/csars/yaml/{valid/simple-task-csar => invalid/dependencies_missing}/docker/dockerapp_delete.sh (100%) mode change 100644 => 100755 rename server/src/test/resources/csars/yaml/{valid/simple-task-csar => invalid/dependencies_missing}/docker/dockerapp_start.sh (100%) mode change 100644 => 100755 rename server/src/test/resources/csars/yaml/{valid/simple-task-csar => invalid/dependencies_missing}/docker/dockerapp_stop.sh (100%) mode change 100644 => 100755 rename server/src/test/resources/csars/yaml/{valid/simple-task-csar => invalid/dependencies_missing}/docker/dockerengine_create.sh (100%) mode change 100644 => 100755 rename server/src/test/resources/csars/yaml/{valid/simple-task-csar => invalid/dependencies_missing}/docker/dockerengine_start.sh (100%) mode change 100644 => 100755 rename server/src/test/resources/csars/yaml/{valid/simple-task-csar => invalid/dependencies_missing}/docker/dockerengine_stop.sh (100%) mode change 100644 => 100755 create mode 100644 server/src/test/resources/csars/yaml/invalid/dependencies_missing/docker/dockertypes.yaml rename server/src/test/resources/csars/yaml/{valid/simple-task-csar => invalid/dependencies_missing}/simple-task-app/Dockerfile (100%) rename server/src/test/resources/csars/yaml/{valid/simple-task-csar => invalid/dependencies_missing}/simple-task-app/createdb.sql (100%) rename server/src/test/resources/csars/yaml/{valid/simple-task-csar => invalid/dependencies_missing}/simple-task-app/index.php (100%) rename server/src/test/resources/csars/yaml/{valid/simple-task-csar => invalid/dependencies_missing}/simple-task-app/mysql-credentials.php (100%) create mode 100644 server/src/test/resources/csars/yaml/invalid/dependencies_missing/template.yaml create mode 100755 server/src/test/resources/csars/yaml/invalid/dockerapp_missing/docker/dockerapp_create.sh create mode 100755 server/src/test/resources/csars/yaml/invalid/dockerapp_missing/docker/dockerapp_delete.sh create mode 100755 server/src/test/resources/csars/yaml/invalid/dockerapp_missing/docker/dockerapp_start.sh create mode 100755 server/src/test/resources/csars/yaml/invalid/dockerapp_missing/docker/dockerapp_stop.sh create mode 100755 server/src/test/resources/csars/yaml/invalid/dockerapp_missing/docker/dockerengine_create.sh create mode 100755 server/src/test/resources/csars/yaml/invalid/dockerapp_missing/docker/dockerengine_start.sh create mode 100755 server/src/test/resources/csars/yaml/invalid/dockerapp_missing/docker/dockerengine_stop.sh create mode 100644 server/src/test/resources/csars/yaml/invalid/dockerapp_missing/docker/dockertypes.yaml create mode 100644 server/src/test/resources/csars/yaml/invalid/dockerapp_missing/simple-task-app/Dockerfile create mode 100644 server/src/test/resources/csars/yaml/invalid/dockerapp_missing/simple-task-app/createdb.sql create mode 100644 server/src/test/resources/csars/yaml/invalid/dockerapp_missing/simple-task-app/index.php create mode 100644 server/src/test/resources/csars/yaml/invalid/dockerapp_missing/simple-task-app/mysql-credentials.php create mode 100644 server/src/test/resources/csars/yaml/invalid/dockerapp_missing/template.yaml create mode 100644 server/src/test/resources/csars/yaml/invalid/entrypoint_ambiguous/second_entrypoint_this_will_cause_error.yaml create mode 100644 server/src/test/resources/csars/yaml/invalid/entrypoint_ambiguous/template.yaml create mode 100644 server/src/test/resources/csars/yaml/invalid/entrypoint_missing/nothing.txt create mode 100644 server/src/test/resources/csars/yaml/valid/entrypoint_is_yml/template.yml create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-input.csar rename server/src/test/resources/csars/yaml/valid/{lamp-csar_input => lamp-input}/my_app/configure_myphpapp.sh (100%) rename server/src/test/resources/csars/yaml/valid/{lamp-csar_input => lamp-input}/my_app/create_myphpapp.sh (100%) rename server/src/test/resources/csars/yaml/valid/{lamp-csar_input => lamp-input}/my_app/myphpapp.php (100%) rename server/src/test/resources/csars/yaml/valid/{lamp-csar_input => lamp-input}/my_app/mysql-credentials.php (100%) rename server/src/test/resources/csars/yaml/valid/{lamp-csar_input => lamp-input}/mysql_dbms/mysql_dbms_configure.sh (100%) rename server/src/test/resources/csars/yaml/valid/{lamp-csar_input => lamp-input}/template.yaml (98%) create mode 100644 server/src/test/resources/csars/yaml/valid/lamp-noinput.csar rename server/src/test/resources/csars/yaml/valid/{lamp-csar_noinput => lamp-noinput}/my_app/create_myphpapp.sh (100%) rename server/src/test/resources/csars/yaml/valid/{lamp-csar_noinput => lamp-noinput}/my_app/myphpapp.php (100%) rename server/src/test/resources/csars/yaml/valid/{lamp-csar_noinput => lamp-noinput}/my_app/mysql-credentials.php (100%) rename server/src/test/resources/csars/yaml/valid/{lamp-csar_noinput => lamp-noinput}/mysql_dbms/mysql_dbms_configure.sh (100%) rename server/src/test/resources/csars/yaml/valid/{lamp-csar_noinput => lamp-noinput}/template.yaml (97%) delete mode 100644 server/src/test/resources/csars/yaml/valid/lamp_input.csar delete mode 100644 server/src/test/resources/csars/yaml/valid/lamp_noinput.csar delete mode 100644 server/src/test/resources/csars/yaml/valid/simple-task-csar/zip create mode 100644 server/src/test/resources/csars/yaml/valid/simple-task/docker/dockerapp_create.sh create mode 100644 server/src/test/resources/csars/yaml/valid/simple-task/docker/dockerapp_delete.sh create mode 100644 server/src/test/resources/csars/yaml/valid/simple-task/docker/dockerapp_start.sh create mode 100644 server/src/test/resources/csars/yaml/valid/simple-task/docker/dockerapp_stop.sh create mode 100644 server/src/test/resources/csars/yaml/valid/simple-task/docker/dockerengine_create.sh create mode 100644 server/src/test/resources/csars/yaml/valid/simple-task/docker/dockerengine_start.sh create mode 100644 server/src/test/resources/csars/yaml/valid/simple-task/docker/dockerengine_stop.sh create mode 100644 server/src/test/resources/csars/yaml/valid/simple-task/simple-task-app/Dockerfile create mode 100644 server/src/test/resources/csars/yaml/valid/simple-task/simple-task-app/createdb.sql create mode 100644 server/src/test/resources/csars/yaml/valid/simple-task/simple-task-app/index.php create mode 100644 server/src/test/resources/csars/yaml/valid/simple-task/simple-task-app/mysql-credentials.php rename server/src/test/resources/csars/yaml/valid/{simple-task-csar => simple-task}/template.yaml (93%) diff --git a/server/src/test/java/org/opentosca/toscana/core/csar/CsarFilesystemDaoTest.java b/server/src/test/java/org/opentosca/toscana/core/csar/CsarFilesystemDaoTest.java index 3e18e3295..4787a2a69 100644 --- a/server/src/test/java/org/opentosca/toscana/core/csar/CsarFilesystemDaoTest.java +++ b/server/src/test/java/org/opentosca/toscana/core/csar/CsarFilesystemDaoTest.java @@ -60,7 +60,7 @@ public void create() throws Exception { File transformationFolder = new File(csarFolder, CsarFilesystemDao.TRANSFORMATION_DIR); assertTrue(contentFolder.isDirectory()); assertTrue(transformationFolder.isDirectory()); - assertTrue(contentFolder.list().length > 3); // not elegant but lazy.. + assertTrue(contentFolder.list().length > 2); // not elegant but lazy.. } @Test diff --git a/server/src/test/resources/csars/csar-make b/server/src/test/resources/csars/csar-make new file mode 100755 index 000000000..f6f3e0cfa --- /dev/null +++ b/server/src/test/resources/csars/csar-make @@ -0,0 +1,11 @@ +#!/bin/bash +# run this script (no args required) in order to (re)pack all csars +pushd "$(dirname "$0")" > /dev/null +for CSAR_DIR in $(find -mindepth 3 -maxdepth 3 -type d); do + pushd $CSAR_DIR > /dev/null + NAME=$(basename $CSAR_DIR) + zip -r ../${NAME}.csar * > /dev/null + echo Packaged $NAME as ${NAME}.csar + popd > /dev/null +done +popd > /dev/null diff --git a/server/src/test/resources/csars/yaml/invalid/dependencies_missing.csar b/server/src/test/resources/csars/yaml/invalid/dependencies_missing.csar index b1444e29d9747c963acae34d3991bc3b97461416..4d2ca9a70ea2d8ef7797bda234aae5c19062bcfb 100644 GIT binary patch delta 1450 zcmca=Fjs$qs!V7ICj)be^Xo_{Z`r8Q3T_5QmKV$n3}9lSqZLFxQsQ;w4=)V)$+ax< z6SukJS0l+d1+Rk5CmCZI@v4~Y#9V`4!7b)?{0eGWlJG0|%~A?cFjE|>S2y>tmN6lW zz!F%Kaz>yvsB^wn7#AuPeH7vUOwuMOD_w^PRrpL}mu?p}yc{?uc zrPIQtmoK#k^(4(bk|g7)E$gp7<==O?Sf$$=(=#K?^fxXo{#?HAy+=xoa(z~(^-@vI z#kGGM&V4@2rjb`!x$vwtm{^g?>Mj_YLp6SJEH%8oU<+@87kQuP8c#h+_E ze*B)gK}>E6L*}gNk^tEWEg~vrq6|+3wu-Ue@wqeU=c^P$Gcnt($2MAiy*4vcC$xK` z>(8FqUq7$9?-fj2fk1^Z6tJO;l>-R8Ue|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s}<{SGp{|VI?2{1-RiXLeWz~|nxs_Ch3>3u ztoHwA;c;;CW0T&6iou`n{CCn@dBy(lw}lew4Q4Gb1gl?6YZBhCvNJ#+>??!iv;*5& zj~9nXXhodwuwJ)h#om`O#S=oltxXr(t+<*!;m7oqZYxwPw?Al8^3u+bS{&B=EvI6+ zM`W~1b^QjT!y84rpNm(nEnc-v=CSftX;^Oz#7l(;F)X_c| z*?BDQ#`@+Y-?|Lrdz@3;21zI)pI(&g|QH-QZH+%;v>src5v^{QJ8iW#kPX7j!2DX3S%580{`&@EEX;@ZqAWX;NlS}08R6IWwWE1K*mq^O8$wFJmT k42(ehwvk7O0pyU$8^xqVSlK}00zi10m4TrID8s-205ZB~?f?J) diff --git a/server/src/test/resources/csars/yaml/valid/simple-task-csar/docker/dockerapp_create.sh b/server/src/test/resources/csars/yaml/invalid/dependencies_missing/docker/dockerapp_create.sh old mode 100644 new mode 100755 similarity index 100% rename from server/src/test/resources/csars/yaml/valid/simple-task-csar/docker/dockerapp_create.sh rename to server/src/test/resources/csars/yaml/invalid/dependencies_missing/docker/dockerapp_create.sh diff --git a/server/src/test/resources/csars/yaml/valid/simple-task-csar/docker/dockerapp_delete.sh b/server/src/test/resources/csars/yaml/invalid/dependencies_missing/docker/dockerapp_delete.sh old mode 100644 new mode 100755 similarity index 100% rename from server/src/test/resources/csars/yaml/valid/simple-task-csar/docker/dockerapp_delete.sh rename to server/src/test/resources/csars/yaml/invalid/dependencies_missing/docker/dockerapp_delete.sh diff --git a/server/src/test/resources/csars/yaml/valid/simple-task-csar/docker/dockerapp_start.sh b/server/src/test/resources/csars/yaml/invalid/dependencies_missing/docker/dockerapp_start.sh old mode 100644 new mode 100755 similarity index 100% rename from server/src/test/resources/csars/yaml/valid/simple-task-csar/docker/dockerapp_start.sh rename to server/src/test/resources/csars/yaml/invalid/dependencies_missing/docker/dockerapp_start.sh diff --git a/server/src/test/resources/csars/yaml/valid/simple-task-csar/docker/dockerapp_stop.sh b/server/src/test/resources/csars/yaml/invalid/dependencies_missing/docker/dockerapp_stop.sh old mode 100644 new mode 100755 similarity index 100% rename from server/src/test/resources/csars/yaml/valid/simple-task-csar/docker/dockerapp_stop.sh rename to server/src/test/resources/csars/yaml/invalid/dependencies_missing/docker/dockerapp_stop.sh diff --git a/server/src/test/resources/csars/yaml/valid/simple-task-csar/docker/dockerengine_create.sh b/server/src/test/resources/csars/yaml/invalid/dependencies_missing/docker/dockerengine_create.sh old mode 100644 new mode 100755 similarity index 100% rename from server/src/test/resources/csars/yaml/valid/simple-task-csar/docker/dockerengine_create.sh rename to server/src/test/resources/csars/yaml/invalid/dependencies_missing/docker/dockerengine_create.sh diff --git a/server/src/test/resources/csars/yaml/valid/simple-task-csar/docker/dockerengine_start.sh b/server/src/test/resources/csars/yaml/invalid/dependencies_missing/docker/dockerengine_start.sh old mode 100644 new mode 100755 similarity index 100% rename from server/src/test/resources/csars/yaml/valid/simple-task-csar/docker/dockerengine_start.sh rename to server/src/test/resources/csars/yaml/invalid/dependencies_missing/docker/dockerengine_start.sh diff --git a/server/src/test/resources/csars/yaml/valid/simple-task-csar/docker/dockerengine_stop.sh b/server/src/test/resources/csars/yaml/invalid/dependencies_missing/docker/dockerengine_stop.sh old mode 100644 new mode 100755 similarity index 100% rename from server/src/test/resources/csars/yaml/valid/simple-task-csar/docker/dockerengine_stop.sh rename to server/src/test/resources/csars/yaml/invalid/dependencies_missing/docker/dockerengine_stop.sh diff --git a/server/src/test/resources/csars/yaml/invalid/dependencies_missing/docker/dockertypes.yaml b/server/src/test/resources/csars/yaml/invalid/dependencies_missing/docker/dockertypes.yaml new file mode 100644 index 000000000..19bf4f55a --- /dev/null +++ b/server/src/test/resources/csars/yaml/invalid/dependencies_missing/docker/dockertypes.yaml @@ -0,0 +1,67 @@ +tosca_definitions_version: tosca_simple_yaml_1_0 +node_types: + DockerEngine: + derived_from: tosca.nodes.Root + # needs capability: DockerHost or similar.. + capabilities: + host: + type: DockerHost + requirements: + - os: + type: linux + distribution: ubuntu + architecture: x86_64 + interfaces: + Standard: + create: + implementation: dockerengine_create.sh + start: + implementation: dockerengine_start.sh + stop: + implementation: dockerengine_stop.sh + DockerApp: + derived_from: tosca.nodes.Root + requirements: + - host: + capability: DockerHost + node: DockerEngine + relationship: tosca.relationships.HostedOn + - network: + capability: SimplePublicWebEndpoint + attributes: + tag: + type: string + description: the tag for the docker image + identifier: + type: string + description: the identifier (name) for the docker container + endpoint: { get_operation_output: [ SELF, Standard, create, endpoint ] } + interfaces: + Standard: + inputs: + tag: { get_attribute: [ SELF, tag ] } + identifier: { get_attribute: [ SELF, identifier ] } + create: + implementation: dockerapp_create.sh + start: + implementation: dockerapp_create.sh + stop: + implementation: dockerapp_stop.sh + delete: + implementation: dockerapp_delete.sh +capability_types: + DockerHost: + derived_from: tosca.capabilities.Root + type: tosca.capabilities.Root + sources: [ DockerApp ] + SimplePublicWebEndpoint: + derived_from: tosca.capabilities.Endpoint + properties: + protocol: + value: http + port: + value: 80 + url_path: + value: / + network_name: + value: PUBLIC diff --git a/server/src/test/resources/csars/yaml/valid/simple-task-csar/simple-task-app/Dockerfile b/server/src/test/resources/csars/yaml/invalid/dependencies_missing/simple-task-app/Dockerfile similarity index 100% rename from server/src/test/resources/csars/yaml/valid/simple-task-csar/simple-task-app/Dockerfile rename to server/src/test/resources/csars/yaml/invalid/dependencies_missing/simple-task-app/Dockerfile diff --git a/server/src/test/resources/csars/yaml/valid/simple-task-csar/simple-task-app/createdb.sql b/server/src/test/resources/csars/yaml/invalid/dependencies_missing/simple-task-app/createdb.sql similarity index 100% rename from server/src/test/resources/csars/yaml/valid/simple-task-csar/simple-task-app/createdb.sql rename to server/src/test/resources/csars/yaml/invalid/dependencies_missing/simple-task-app/createdb.sql diff --git a/server/src/test/resources/csars/yaml/valid/simple-task-csar/simple-task-app/index.php b/server/src/test/resources/csars/yaml/invalid/dependencies_missing/simple-task-app/index.php similarity index 100% rename from server/src/test/resources/csars/yaml/valid/simple-task-csar/simple-task-app/index.php rename to server/src/test/resources/csars/yaml/invalid/dependencies_missing/simple-task-app/index.php diff --git a/server/src/test/resources/csars/yaml/valid/simple-task-csar/simple-task-app/mysql-credentials.php b/server/src/test/resources/csars/yaml/invalid/dependencies_missing/simple-task-app/mysql-credentials.php similarity index 100% rename from server/src/test/resources/csars/yaml/valid/simple-task-csar/simple-task-app/mysql-credentials.php rename to server/src/test/resources/csars/yaml/invalid/dependencies_missing/simple-task-app/mysql-credentials.php diff --git a/server/src/test/resources/csars/yaml/invalid/dependencies_missing/template.yaml b/server/src/test/resources/csars/yaml/invalid/dependencies_missing/template.yaml new file mode 100644 index 000000000..dd10c12c1 --- /dev/null +++ b/server/src/test/resources/csars/yaml/invalid/dependencies_missing/template.yaml @@ -0,0 +1,99 @@ +tosca_definitions_version: tosca_simple_yaml_1_1 +description: Template for deploying the simple-task-app via docker +metadata: + template_name: simple-task-docker-template + template_author: stupro-toscana + template_version: 1.0 + +node_types: + DockerEngine: + derived_from: tosca.nodes.Root + # needs capability: DockerHost or similar.. + capabilities: + host: + type: DockerHost + requirements: + - os: + type: linux + distribution: ubuntu + architecture: x86_64 + interfaces: + Standard: + create: + implementation: docker/dockerengine_create.sh + start: + implementation: docker/dockerengine_start.sh + stop: + implementation: docker/dockerengine_stop.sh + DockerApp: + derived_from: tosca.nodes.Root + requirements: + - host: + capability: DockerHost + node: DockerEngine + relationship: tosca.relationships.HostedOn + - network: + capability: SimplePublicWebEndpoint + attributes: + tag: + type: string + description: the tag for the docker image + identifier: + type: string + description: the identifier (name) for the docker container + interfaces: + Standard: + create: + implementation: docker/dockerapp_create.sh + start: + implementation: docker/dockerapp_create.sh + stop: + implementation: docker/dockerapp_stop.sh + delete: + implementation: docker/dockerapp_delete.sh +capability_types: + DockerHost: + derived_from: tosca.capabilities.Root + valid_source_types: [ DockerApp ] + SimplePublicWebEndpoint: + derived_from: tosca.capabilities.Endpoint + properties: + protocol: http + port: 80 + url_path: / + network_name: PUBLIC + +topology_template: + node_templates: + myDockerEngine: + type: DockerEngine + + simpleTaskApp: + type: DockerApp + attributes: + tag: + description: tag for docker image + value: simple-task-app + identifier: + description: identifier of docker container + value: simple-task-app-1 + endpoint: + value: { get_operation_output: [ SELF, Standard, create, endpoint ] } + interfaces: + Standard: + inputs: + tag: { get_attribute: [ SELF, tag ] } + identifier: { get_attribute: [ SELF, identifier ] } + create: + implementation: + primary: simple-task-app/create.sh + # dependencies will get copied by orchestrator to the same location + # as create.sh, before create.sh is executed + + + outputs: + endpoint: + description: the endpoint of the simple-task-app + value: { get_attribute: [ simpleTaskApp, endpoint ] } + type: string + diff --git a/server/src/test/resources/csars/yaml/invalid/dockerapp_missing.csar b/server/src/test/resources/csars/yaml/invalid/dockerapp_missing.csar index 76619132d12a367472c577cf66010b5650a3b734..1ab62b908f796a2eed72da77f313590d092bc50b 100644 GIT binary patch delta 607 zcmbQK|3Y_ys!V7ICj)be^Xo_}Z`r8Q3T_5QmKV$n3}9lSqZLFxQUa^|*)jlZ>&9cvVbxVy?lj;1+W`eg(BGN%$4~W+{azm?@6ctDAdR%b4&RA;)2k zSHb2&j#6g)Dwud=2n2-{?@qi%Oy=i{v)!0mkv@49Ule2NW>$V*rp>zqEm=8WrcM4WrlW~PLx49c8v_vV O17Q;@14Doyhz9@!%aoG< delta 744 zcmaE%J5zsxs!VAGHv=Qf3uXoeFcBKU$-tcA{5rDN>viNrM=PxIkrJ;XL3na4i~PiG z?)cS6GETv(VDm}FSVp`mCOa|L;8$>qxgEcPT9zdI3VyScVpT9x{B#;<~jM}|O9Sn=+}Ys6%JzBpU&+z9W~AD*_$m>3w;I2ags8Dtnr zQgaJ(5=&C`Did>autmCB(d$SMp1g`LiZN|7E59#O8Z!$Q0|m> z(7>w90&K>>fuo-C%rq*gRJP)J-Gm+cZDM=>x0@!Q4#K?aapCjSwY5@BTni3 /dev/null && +echo "started $identifier" + diff --git a/server/src/test/resources/csars/yaml/invalid/dockerapp_missing/docker/dockerapp_stop.sh b/server/src/test/resources/csars/yaml/invalid/dockerapp_missing/docker/dockerapp_stop.sh new file mode 100755 index 000000000..c9d606fef --- /dev/null +++ b/server/src/test/resources/csars/yaml/invalid/dockerapp_missing/docker/dockerapp_stop.sh @@ -0,0 +1,3 @@ +#!/bin/bash +docker stop -t0 simple-task-app-1 > /dev/null && +echo 'stopped simple-task-app' diff --git a/server/src/test/resources/csars/yaml/invalid/dockerapp_missing/docker/dockerengine_create.sh b/server/src/test/resources/csars/yaml/invalid/dockerapp_missing/docker/dockerengine_create.sh new file mode 100755 index 000000000..f54500b53 --- /dev/null +++ b/server/src/test/resources/csars/yaml/invalid/dockerapp_missing/docker/dockerengine_create.sh @@ -0,0 +1,4 @@ +#!/bin/bash +sudo apt-get update && sudo apt-get install -y docker-ce +sudo groupadd docker +sudo usermod -aG docker $USER diff --git a/server/src/test/resources/csars/yaml/invalid/dockerapp_missing/docker/dockerengine_start.sh b/server/src/test/resources/csars/yaml/invalid/dockerapp_missing/docker/dockerengine_start.sh new file mode 100755 index 000000000..a7d0ed4dc --- /dev/null +++ b/server/src/test/resources/csars/yaml/invalid/dockerapp_missing/docker/dockerengine_start.sh @@ -0,0 +1,2 @@ +#!/bin/bash +sudo systemctl start dockerd diff --git a/server/src/test/resources/csars/yaml/invalid/dockerapp_missing/docker/dockerengine_stop.sh b/server/src/test/resources/csars/yaml/invalid/dockerapp_missing/docker/dockerengine_stop.sh new file mode 100755 index 000000000..83d30db99 --- /dev/null +++ b/server/src/test/resources/csars/yaml/invalid/dockerapp_missing/docker/dockerengine_stop.sh @@ -0,0 +1,2 @@ +#!/bin/bash +sudo systemctl stop dockerd diff --git a/server/src/test/resources/csars/yaml/invalid/dockerapp_missing/docker/dockertypes.yaml b/server/src/test/resources/csars/yaml/invalid/dockerapp_missing/docker/dockertypes.yaml new file mode 100644 index 000000000..19bf4f55a --- /dev/null +++ b/server/src/test/resources/csars/yaml/invalid/dockerapp_missing/docker/dockertypes.yaml @@ -0,0 +1,67 @@ +tosca_definitions_version: tosca_simple_yaml_1_0 +node_types: + DockerEngine: + derived_from: tosca.nodes.Root + # needs capability: DockerHost or similar.. + capabilities: + host: + type: DockerHost + requirements: + - os: + type: linux + distribution: ubuntu + architecture: x86_64 + interfaces: + Standard: + create: + implementation: dockerengine_create.sh + start: + implementation: dockerengine_start.sh + stop: + implementation: dockerengine_stop.sh + DockerApp: + derived_from: tosca.nodes.Root + requirements: + - host: + capability: DockerHost + node: DockerEngine + relationship: tosca.relationships.HostedOn + - network: + capability: SimplePublicWebEndpoint + attributes: + tag: + type: string + description: the tag for the docker image + identifier: + type: string + description: the identifier (name) for the docker container + endpoint: { get_operation_output: [ SELF, Standard, create, endpoint ] } + interfaces: + Standard: + inputs: + tag: { get_attribute: [ SELF, tag ] } + identifier: { get_attribute: [ SELF, identifier ] } + create: + implementation: dockerapp_create.sh + start: + implementation: dockerapp_create.sh + stop: + implementation: dockerapp_stop.sh + delete: + implementation: dockerapp_delete.sh +capability_types: + DockerHost: + derived_from: tosca.capabilities.Root + type: tosca.capabilities.Root + sources: [ DockerApp ] + SimplePublicWebEndpoint: + derived_from: tosca.capabilities.Endpoint + properties: + protocol: + value: http + port: + value: 80 + url_path: + value: / + network_name: + value: PUBLIC diff --git a/server/src/test/resources/csars/yaml/invalid/dockerapp_missing/simple-task-app/Dockerfile b/server/src/test/resources/csars/yaml/invalid/dockerapp_missing/simple-task-app/Dockerfile new file mode 100644 index 000000000..95abd426a --- /dev/null +++ b/server/src/test/resources/csars/yaml/invalid/dockerapp_missing/simple-task-app/Dockerfile @@ -0,0 +1,14 @@ +FROM janes/alpine-lamp +MAINTAINER hnicke +COPY index.php /www +COPY mysql-credentials.php /www +COPY createdb.sql / + +EXPOSE 80 + +RUN nohup mysqld --skip-grant-tables --bind-address 0.0.0.0 --user mysql > /dev/null 2>&1 & \ + sleep 10 && mysql -u root < /createdb.sql + +ENTRYPOINT httpd && \ + nohup mysqld --skip-grant-tables --bind-address 0.0.0.0 --user mysql > /dev/null 2>&1 & \ + tail -f /dev/null diff --git a/server/src/test/resources/csars/yaml/invalid/dockerapp_missing/simple-task-app/createdb.sql b/server/src/test/resources/csars/yaml/invalid/dockerapp_missing/simple-task-app/createdb.sql new file mode 100644 index 000000000..4a62e2720 --- /dev/null +++ b/server/src/test/resources/csars/yaml/invalid/dockerapp_missing/simple-task-app/createdb.sql @@ -0,0 +1,7 @@ +CREATE database mydb; +create table mydb.tasks + (id int not null unique auto_increment, + task varchar(255), + primary key (id) + ); + diff --git a/server/src/test/resources/csars/yaml/invalid/dockerapp_missing/simple-task-app/index.php b/server/src/test/resources/csars/yaml/invalid/dockerapp_missing/simple-task-app/index.php new file mode 100644 index 000000000..0065fa98f --- /dev/null +++ b/server/src/test/resources/csars/yaml/invalid/dockerapp_missing/simple-task-app/index.php @@ -0,0 +1,79 @@ +query("INSERT INTO tasks(task) VALUES('".$task."')")) { + echo("Creating task failed"); + } + $conn->close(); +} +/** +* reads from db and prints it in html +*/ +function readFromDb() +{ + $sql = "select * from tasks"; + $conn = newDbConnection(); + $result = $conn->query($sql); + $conn->close(); + if ($result->num_rows > 0) { + // output data for each row + while ($row = $result->fetch_assoc()) { + echo htmlspecialchars("id: " . $row['id']. " - Task: " . $row['task'])."
"; + } + return; + } + echo "0 results"; +} + +/** +* generates new DB connection with given credentials +*/ +function newDbConnection() +{ + extract($GLOBALS); + $conn = new mysqli($host, $username, $password, $database, $port); + if ($conn->connect_error) { + die("Connection failed: " . $conn->connect_error); + } + return $conn; +} +?> + + + + + SimpleTaskApp + + + +

SimpleTaskApp

+ +
+ + +
+ + + diff --git a/server/src/test/resources/csars/yaml/invalid/dockerapp_missing/simple-task-app/mysql-credentials.php b/server/src/test/resources/csars/yaml/invalid/dockerapp_missing/simple-task-app/mysql-credentials.php new file mode 100644 index 000000000..5196befdb --- /dev/null +++ b/server/src/test/resources/csars/yaml/invalid/dockerapp_missing/simple-task-app/mysql-credentials.php @@ -0,0 +1,7 @@ + diff --git a/server/src/test/resources/csars/yaml/invalid/dockerapp_missing/template.yaml b/server/src/test/resources/csars/yaml/invalid/dockerapp_missing/template.yaml new file mode 100644 index 000000000..4f5b2af0d --- /dev/null +++ b/server/src/test/resources/csars/yaml/invalid/dockerapp_missing/template.yaml @@ -0,0 +1,82 @@ +tosca_definitions_version: tosca_simple_yaml_1_1 +description: Template for deploying the simple-task-app via docker +metadata: + template_name: simple-task-docker-template + template_author: stupro-toscana + template_version: 1.0 + +node_types: + DockerEngine: + derived_from: tosca.nodes.Root + # needs capability: DockerHost or similar.. + capabilities: + host: + type: DockerHost + requirements: + - os: + type: linux + distribution: ubuntu + architecture: x86_64 + interfaces: + Standard: + create: + implementation: docker/dockerengine_create.sh + start: + implementation: docker/dockerengine_start.sh + stop: + implementation: docker/dockerengine_stop.sh + DockerApp: + derived_from: tosca.nodes.Root + requirements: + - host: + capability: DockerHost + node: DockerEngine + relationship: tosca.relationships.HostedOn + - network: + capability: SimplePublicWebEndpoint + attributes: + tag: + type: string + description: the tag for the docker image + identifier: + type: string + description: the identifier (name) for the docker container + interfaces: + Standard: + create: + implementation: docker/dockerapp_create.sh + start: + implementation: docker/dockerapp_create.sh + stop: + implementation: docker/dockerapp_stop.sh + delete: + implementation: docker/dockerapp_delete.sh +capability_types: + DockerHost: + derived_from: tosca.capabilities.Root + valid_source_types: [ DockerApp ] + SimplePublicWebEndpoint: + derived_from: tosca.capabilities.Endpoint + properties: + protocol: + default: http + port: + default: 80 + url_path: + default: / + network_name: + default: PUBLIC + +topology_template: + node_templates: + myDockerEngine: + type: DockerEngine + + + + + outputs: + endpoint: + description: the endpoint of the simple-task-app + value: { get_attribute: [ simpleTaskApp, endpoint ] } + diff --git a/server/src/test/resources/csars/yaml/invalid/entrypoint_ambiguous.csar b/server/src/test/resources/csars/yaml/invalid/entrypoint_ambiguous.csar index 1d6975a4e5b77893c19df26286b3f14bde839c48..fa1dce20de52138b546f6b58ba2625b16d7a16b2 100644 GIT binary patch delta 570 zcmZ1|dq`9`z?+#xgn@y9gJD^2jdy`y!->qv&zWsF!lPuP;(&OvHj7kT*opjQ8YK+M zPsA5Jif{~Ky1Q@P|GwSc+z*2`W?v6^9Vl19b3-GY%XWR+r>C2zZe8Q;+VOg7F=xkD zug;GJO=YYd@Tk%EY)!j`2#N8vwoqg9cj@m z5WTVW$b0_6yB@}q#awqJU0%2HTC;vn#RKP`t1euY{xNOy$3v$>0tHi7JfFR$Vu?z| zW=GL`Z?5eNu56LX0*Tsy0Qz1br>XoBm)B@5HD#2 z5|ckN>$9^mFoVK;G9?i!autc_L3eI;tN6oqN_r~YWS-9NtPd7pE>?|II9p6B~{u$iO6AQ5431pok$ zK+Rb)F<#H_LkbK4x}*U>22cjVeNNL(QNn%nqbR3Ok)5Rg*m0YAx1J;OZV{2v00ce@ zdOs~C$A*)Y&17R1%4FYb#^)~U!>Kd)>oORuR|O^t$?K~M?!s|+db6dK`#2?Yu0g@txHyFZ+jxWoqf zoD|SV6(SgB<+!Vj=&EZf0ZsKx&(DIQ7zus1kM4D%N=nLWu3GN$d(oMfk2B`p-1n#e zzEUljc4*mwCaUQ&Ea3c>{_Y`+S|+BOp{Mq^o?#V z34Rn~dChKM&lyeIsmJ3(T^GF>sX|IV@?AoIDcaOY%OOZQ*it?K;Skgx>v&y5jiDgZ ziRtqo`3`XsBI!AU61SDQ%7>fldx*~*UfyyOSgn5)ta-*3>jq{Vo!Q^^*oDx{ThlO@ z?q6G4Rb}4t~^d2CIhDc)9w6r z+vdJ!v9%e2?8@))SivRTv@^%5=`8a*qwFTt^7?n{?Y$>pS^YSK@%Iix+dSo_nN=X2cqxS9!_#@0G_zL>fV&&(a^o#J zk5j0Wgow!QoEvzMSQCAB`f7nQ4Pows!&HllOXG;0)4%d_8=%AaFS}I`NhQ;r_8x|3 zFXPW1%RCM z!G}}Ag7m3jlu#T#6sL18xJr-#sIX!vFvP diff --git a/server/src/test/resources/csars/yaml/invalid/entrypoint_ambiguous/second_entrypoint_this_will_cause_error.yaml b/server/src/test/resources/csars/yaml/invalid/entrypoint_ambiguous/second_entrypoint_this_will_cause_error.yaml new file mode 100644 index 000000000..fef6c0ce7 --- /dev/null +++ b/server/src/test/resources/csars/yaml/invalid/entrypoint_ambiguous/second_entrypoint_this_will_cause_error.yaml @@ -0,0 +1,2 @@ +tosca_definitions_version: tosca_simple_yaml_1_1 +description: second template file that should cause the ParserService to reject the csar diff --git a/server/src/test/resources/csars/yaml/invalid/entrypoint_ambiguous/template.yaml b/server/src/test/resources/csars/yaml/invalid/entrypoint_ambiguous/template.yaml new file mode 100644 index 000000000..5871c834a --- /dev/null +++ b/server/src/test/resources/csars/yaml/invalid/entrypoint_ambiguous/template.yaml @@ -0,0 +1,2 @@ +tosca_definitions_version: tosca_simple_yaml_1_1 +description: Template for deploying the simple-task-app via docker diff --git a/server/src/test/resources/csars/yaml/invalid/entrypoint_missing.csar b/server/src/test/resources/csars/yaml/invalid/entrypoint_missing.csar index f9626f4ad512f7abbf566b757695f85ce412c773..c13f345a484cdd080a02ac8ca1a9bbe171426b24 100644 GIT binary patch delta 306 zcmbQPzE)#`9?Jx8*{F#|L121v9*f?@Z2=HA7vmZ*WAiS?Qbvf-8y3~c5zP4z&S~cP z5JnzL6->Gp%-CGZTFV3x`p51M5enq!WrnaGahpJmlj6MyQT3iT)r6Uaiva`<UsJ%IlPn0#4kx7mjmwpMjaZ4J5 p_!v-4V}+PjTEWf0$nt`jfdNbec(byBbnydW11kf=bf7i{1_0Z4OT_>H delta 168 zcmZ3hFUAC&haaqUt?w>gJhz`m7?XYz#oa O2ZZ{p3=BbhARYkpN;~BM diff --git a/server/src/test/resources/csars/yaml/invalid/entrypoint_missing/nothing.txt b/server/src/test/resources/csars/yaml/invalid/entrypoint_missing/nothing.txt new file mode 100644 index 000000000..e69de29bb diff --git a/server/src/test/resources/csars/yaml/valid/entrypoint_is_yml.csar b/server/src/test/resources/csars/yaml/valid/entrypoint_is_yml.csar index 1efaa7030d24db1048e8374a03eff6ae75b35f25..d793d46d8030d31ca49ff5bb6e93ec8274e896e7 100644 GIT binary patch delta 369 zcmZqCIj*^3CR_caoEq!5P6peUA?_t>*56KSQkmAKX1L<+i?`yp)_!qyv43(s zg87$6@v4(T;a~HG-kueH6OpN`6#Ji<9ZMWTgEmi|5Tzfx;3D@ewce?9pU*pO zn{Z&qbe`f1^pMR(H#U34IqY@0qQu zGxzqjmb(-8KZ=dn@B29U2h#+p%||$Pp%cqsk13aZ z@>wBo=5_20li%}*PnPH8m>eUbHaS69idmlnBqlm}9w+zYxxx-ik2ogZ7mj0!;hJnO x63g@zM2Suo5mlaiO+Y5VRU6Kd2MV}R0#kB zIW+27IW+27b$AN^0R-p+000E&0{{SxQ_F7LFbur=D+u%&JK3vyD$ssGb1MpiE75Bq zvZP9M5~Ik!hnBqFR}SlgZBWA@ha9m_3Oh}`afXd|se7fE0XdFy@WydL zRj^TZ4o9IYJ=BcprPf}(P^^!Lb1+Uk_$Y9mLiBa+-{Co8)3$4#Dk1feQ!9WP3T?Z7 zAIpd5K&e@zS5<$-K6vX7b9ZE05}nty1u_-DIRDJqzudt%DlzFnxLP`|SQ{$_LB*F%)WBkgi$j1A&4_Wnsr^{EnlxM`d;?8^oOG>>xaEJ%SPKVYP(B#(%6pfD}OnZ4dwe0094L BA;ACu diff --git a/server/src/test/resources/csars/yaml/valid/entrypoint_is_yml/template.yml b/server/src/test/resources/csars/yaml/valid/entrypoint_is_yml/template.yml new file mode 100644 index 000000000..e2b3b588d --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/entrypoint_is_yml/template.yml @@ -0,0 +1,5 @@ +tosca_definitions_version: tosca_simple_yaml_1_1 +description: test template; purpose: test whether .yml files are also accepted as entrypoint files + template_name: simple-task-docker-template + template_author: stupro-toscana + template_version: 1.0 diff --git a/server/src/test/resources/csars/yaml/valid/lamp-input.csar b/server/src/test/resources/csars/yaml/valid/lamp-input.csar new file mode 100644 index 0000000000000000000000000000000000000000..58400b6d4c0de1f344afdee872c7c952c1571673 GIT binary patch literal 3502 zcmb7{c{r5oAI4{_MTW{UkzLj-6_G>secy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zQDc;`c8`V-@tp1h;P9!fgJ7&_(uoEf5Y!p=5O&u z)L-%cpwmC=;m6a=v}c;FXtsO!Mqqyi+@0#Z^7`$N)As^*+24unzxVUMQub{>DM04@ cov;DOABY-Kp9c681fl~jJfMo&4BJnC14~hqga7~l literal 0 HcmV?d00001 diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/my_app/create_myphpapp.sh b/server/src/test/resources/csars/yaml/valid/lamp-noinput/my_app/create_myphpapp.sh similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/my_app/create_myphpapp.sh rename to server/src/test/resources/csars/yaml/valid/lamp-noinput/my_app/create_myphpapp.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/my_app/myphpapp.php b/server/src/test/resources/csars/yaml/valid/lamp-noinput/my_app/myphpapp.php similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/my_app/myphpapp.php rename to server/src/test/resources/csars/yaml/valid/lamp-noinput/my_app/myphpapp.php diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/my_app/mysql-credentials.php b/server/src/test/resources/csars/yaml/valid/lamp-noinput/my_app/mysql-credentials.php similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/my_app/mysql-credentials.php rename to server/src/test/resources/csars/yaml/valid/lamp-noinput/my_app/mysql-credentials.php diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/mysql_dbms/mysql_dbms_configure.sh b/server/src/test/resources/csars/yaml/valid/lamp-noinput/mysql_dbms/mysql_dbms_configure.sh similarity index 100% rename from server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/mysql_dbms/mysql_dbms_configure.sh rename to server/src/test/resources/csars/yaml/valid/lamp-noinput/mysql_dbms/mysql_dbms_configure.sh diff --git a/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/template.yaml b/server/src/test/resources/csars/yaml/valid/lamp-noinput/template.yaml similarity index 97% rename from server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/template.yaml rename to server/src/test/resources/csars/yaml/valid/lamp-noinput/template.yaml index 1e10cf600..c59c91d14 100644 --- a/server/src/test/resources/csars/yaml/valid/lamp-csar_noinput/template.yaml +++ b/server/src/test/resources/csars/yaml/valid/lamp-noinput/template.yaml @@ -1,4 +1,4 @@ -tosca_definitions_version: tosca_simple_yaml_1_0 +tosca_definitions_version: tosca_simple_yaml_1_1 description: Template for deploying a LAMP stack. metadata: template_name: lamp-stack-template diff --git a/server/src/test/resources/csars/yaml/valid/lamp_input.csar b/server/src/test/resources/csars/yaml/valid/lamp_input.csar deleted file mode 100644 index be8c8ea754a568ec1b3065dde713d21888bd073a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3502 zcmb7{c|4SBAI4|Q*cp^9BiUjkTM@5AmTY5*v9ICS62q7oF=r|nYcyo6oscE6WJ&f& z_T-c-Lza?8lA@Sw3GdMPD7~Fd@ALWG&&>Sse1G?K-_LzrzcDicfmr}s*HSIsX#30G zH%5RU0Eu&UMWN)ZESUkIvde<@TO%--6#xWJg8+c-n;8wjO?!lC8!%=k5tK&zB@G17 z9^V1D`TKc#dj+CBoRK)xX%vkqi#h!>DlyK4l_1Z5@%;vi!zpA?cI!heEpL_V+=l92 zu*Tr?-stJ3p@2}vko(lzr+TZQ-mC?==i4!-2K3MFanQc*Qn;LXM)@N)cp}%--x{t| z5BXz^A8EjyO$r!k2j592`*wo;A$bLNCS{tNdx`|qv)9~%_DF_?KpNylN zc6A131ZH;X(e;8t*V-KA zSx~3N*=J;@q)?h6Y*;&8r-3#<*wa44n$nt0p6;Z;SxQ+h;sti$(&{qdyRTiTgJOsy?vLx z_FQrECM#17yk}zQT=8tPZV-D>3K|wI=EDViq=~Hh*hsOGoUukkI%u zH9&Vlb znMzI4mgYFJ@nE?s4)~h;?sNTN@-xcpd|CYRJyaz}2>9`tnaOojz@TVgv>a??|6648 z=N5@vp6cdxtxBh`(jsN2)Vv8)I6od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B-voU##rkL9?MKA-;8tc1_Z9rJ1LL3Jw=47a z_zLhh{9owwuX_0TG;?j6W@pxo9=;RUUjetKdb_-SKjf_Kz%BL( e=KO=OF_AwJHA@p#=BEGvgn1E}s%Xfu@$_H2I;EQc diff --git a/server/src/test/resources/csars/yaml/valid/simple-task-csar/zip b/server/src/test/resources/csars/yaml/valid/simple-task-csar/zip deleted file mode 100644 index 1ad436c94..000000000 --- a/server/src/test/resources/csars/yaml/valid/simple-task-csar/zip +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -zip ../simple-task.csar -r * diff --git a/server/src/test/resources/csars/yaml/valid/simple-task.csar b/server/src/test/resources/csars/yaml/valid/simple-task.csar index 075dcbe789db0d9eb3fcb07c276aa24694cb0463..ccb5b7cfd27d13e4878419469f2e15ef765da752 100644 GIT binary patch delta 1907 zcmZWpc|25m9KB<%bqq3=VaAfBS7bM2$zFJ)2?=Mk*y+aQt_#VLcM#b7;iqGGk=_WzUTKl-}|{IORskg)|re3MF8Zdbub|xtDq*c z5l^kRCQ@S)FaQdCiw1!CKVBV0UkK4*EfuIx7^t0pS(Xo;?lM?pMNo0rg9&68vw`AO zC;)hdf^LGcGJa73w3q4&$IYrCwx5$Nob_iDw>MnBQ;1=OO$)I7uRr8OKXpp#&JR;W=S~%{rh61(DSI7g6kXJDa z9ta72#>^tzr09~on%F#qyN)%RH$-$Su~3GQe+rp%%`5v5ys?r$@2lSYX;sxw1(uMmRWLUa&fc+ksoRS$uoeNpVkW3lJzSK7N7Wb|m%Du4cv0#?M1^))?k4naaRIZu{t|Aq@cSbP}lbf<# zFRO1uS)%wr;WpRj#fBA}lv|zaT<0tRtO-)%^ zH?)R69m{SC_?F2k-&;W$VP)Sx9FhA9P9%ra3;p0ym?M+qTSs%z2 zH9%;Do(k7Zi{Im!T45f}JqIvRVtx|I?XA=;*{P~}vXOOqGBD!9Zg%ZW`@oBv*BUFjG6nJr$&&HdDJ~N%=8JM)Hj5O)(0oz^@^oVH;~V)Z4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$_8JkPH? zloIC$D%6{OezLoi-G=j2HR>`ju1oUOJ!-7hYDZ5I<{j3*a(?H9S2aF6?+$iEYQ9K4 zd%T3upf?b7XMddURV&562G33Jyo-CEx}&kygr%3&p+nkRG!R!C_==B~5x|Rhl~bsb zjJCR+Xsoo$zs;mvybLiS$xAW~+dz3?iEVfmn9)2!8{U?Yt+>^Nf_DTC5Mqx^vU4%7 zledK)%ky@p)JYy33($u-lPYFjlF`~pJ8<0cXHUJcQ936_D2T9jFO8FwKbOv%MEH?U z2iBbT$qR7az|S!Yp6>Tl^{@>Or`{Qc>8&|DhE0Rc#>TLocyJg z{iPLo%&9QABw}?G0Q31t$mR1QTL2GE^K(f /dev/null && +echo "started $identifier" + diff --git a/server/src/test/resources/csars/yaml/valid/simple-task/docker/dockerapp_stop.sh b/server/src/test/resources/csars/yaml/valid/simple-task/docker/dockerapp_stop.sh new file mode 100644 index 000000000..c9d606fef --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/simple-task/docker/dockerapp_stop.sh @@ -0,0 +1,3 @@ +#!/bin/bash +docker stop -t0 simple-task-app-1 > /dev/null && +echo 'stopped simple-task-app' diff --git a/server/src/test/resources/csars/yaml/valid/simple-task/docker/dockerengine_create.sh b/server/src/test/resources/csars/yaml/valid/simple-task/docker/dockerengine_create.sh new file mode 100644 index 000000000..f54500b53 --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/simple-task/docker/dockerengine_create.sh @@ -0,0 +1,4 @@ +#!/bin/bash +sudo apt-get update && sudo apt-get install -y docker-ce +sudo groupadd docker +sudo usermod -aG docker $USER diff --git a/server/src/test/resources/csars/yaml/valid/simple-task/docker/dockerengine_start.sh b/server/src/test/resources/csars/yaml/valid/simple-task/docker/dockerengine_start.sh new file mode 100644 index 000000000..a7d0ed4dc --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/simple-task/docker/dockerengine_start.sh @@ -0,0 +1,2 @@ +#!/bin/bash +sudo systemctl start dockerd diff --git a/server/src/test/resources/csars/yaml/valid/simple-task/docker/dockerengine_stop.sh b/server/src/test/resources/csars/yaml/valid/simple-task/docker/dockerengine_stop.sh new file mode 100644 index 000000000..83d30db99 --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/simple-task/docker/dockerengine_stop.sh @@ -0,0 +1,2 @@ +#!/bin/bash +sudo systemctl stop dockerd diff --git a/server/src/test/resources/csars/yaml/valid/simple-task/simple-task-app/Dockerfile b/server/src/test/resources/csars/yaml/valid/simple-task/simple-task-app/Dockerfile new file mode 100644 index 000000000..95abd426a --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/simple-task/simple-task-app/Dockerfile @@ -0,0 +1,14 @@ +FROM janes/alpine-lamp +MAINTAINER hnicke +COPY index.php /www +COPY mysql-credentials.php /www +COPY createdb.sql / + +EXPOSE 80 + +RUN nohup mysqld --skip-grant-tables --bind-address 0.0.0.0 --user mysql > /dev/null 2>&1 & \ + sleep 10 && mysql -u root < /createdb.sql + +ENTRYPOINT httpd && \ + nohup mysqld --skip-grant-tables --bind-address 0.0.0.0 --user mysql > /dev/null 2>&1 & \ + tail -f /dev/null diff --git a/server/src/test/resources/csars/yaml/valid/simple-task/simple-task-app/createdb.sql b/server/src/test/resources/csars/yaml/valid/simple-task/simple-task-app/createdb.sql new file mode 100644 index 000000000..4a62e2720 --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/simple-task/simple-task-app/createdb.sql @@ -0,0 +1,7 @@ +CREATE database mydb; +create table mydb.tasks + (id int not null unique auto_increment, + task varchar(255), + primary key (id) + ); + diff --git a/server/src/test/resources/csars/yaml/valid/simple-task/simple-task-app/index.php b/server/src/test/resources/csars/yaml/valid/simple-task/simple-task-app/index.php new file mode 100644 index 000000000..0065fa98f --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/simple-task/simple-task-app/index.php @@ -0,0 +1,79 @@ +query("INSERT INTO tasks(task) VALUES('".$task."')")) { + echo("Creating task failed"); + } + $conn->close(); +} +/** +* reads from db and prints it in html +*/ +function readFromDb() +{ + $sql = "select * from tasks"; + $conn = newDbConnection(); + $result = $conn->query($sql); + $conn->close(); + if ($result->num_rows > 0) { + // output data for each row + while ($row = $result->fetch_assoc()) { + echo htmlspecialchars("id: " . $row['id']. " - Task: " . $row['task'])."
"; + } + return; + } + echo "0 results"; +} + +/** +* generates new DB connection with given credentials +*/ +function newDbConnection() +{ + extract($GLOBALS); + $conn = new mysqli($host, $username, $password, $database, $port); + if ($conn->connect_error) { + die("Connection failed: " . $conn->connect_error); + } + return $conn; +} +?> + + + + + SimpleTaskApp + + + +

SimpleTaskApp

+ +
+ + +
+ + + diff --git a/server/src/test/resources/csars/yaml/valid/simple-task/simple-task-app/mysql-credentials.php b/server/src/test/resources/csars/yaml/valid/simple-task/simple-task-app/mysql-credentials.php new file mode 100644 index 000000000..5196befdb --- /dev/null +++ b/server/src/test/resources/csars/yaml/valid/simple-task/simple-task-app/mysql-credentials.php @@ -0,0 +1,7 @@ + diff --git a/server/src/test/resources/csars/yaml/valid/simple-task-csar/template.yaml b/server/src/test/resources/csars/yaml/valid/simple-task/template.yaml similarity index 93% rename from server/src/test/resources/csars/yaml/valid/simple-task-csar/template.yaml rename to server/src/test/resources/csars/yaml/valid/simple-task/template.yaml index 403400252..0482789cf 100644 --- a/server/src/test/resources/csars/yaml/valid/simple-task-csar/template.yaml +++ b/server/src/test/resources/csars/yaml/valid/simple-task/template.yaml @@ -1,4 +1,4 @@ -tosca_definitions_version: tosca_simple_yaml_1_0 +tosca_definitions_version: tosca_simple_yaml_1_1 description: Template for deploying the simple-task-app via docker metadata: template_name: simple-task-docker-template @@ -58,14 +58,10 @@ capability_types: SimplePublicWebEndpoint: derived_from: tosca.capabilities.Endpoint properties: - protocol: - default: http - port: - default: 80 - url_path: - default: / - network_name: - default: PUBLIC + protocol: http + port: 80 + url_path: / + network_name: PUBLIC topology_template: node_templates: @@ -104,4 +100,5 @@ topology_template: endpoint: description: the endpoint of the simple-task-app value: { get_attribute: [ simpleTaskApp, endpoint ] } + type: string From e860c2afc836a2df489ad78720d240eb4d5d026f Mon Sep 17 00:00:00 2001 From: Heiko Nickerl Date: Tue, 28 Nov 2017 15:02:22 +0100 Subject: [PATCH 52/52] Fix simple-task csar --- .../test/resources/csars/yaml/valid/simple-task/template.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/test/resources/csars/yaml/valid/simple-task/template.yaml b/server/src/test/resources/csars/yaml/valid/simple-task/template.yaml index 0482789cf..6eb687794 100644 --- a/server/src/test/resources/csars/yaml/valid/simple-task/template.yaml +++ b/server/src/test/resources/csars/yaml/valid/simple-task/template.yaml @@ -46,7 +46,7 @@ node_types: create: implementation: docker/dockerapp_create.sh start: - implementation: docker/dockerapp_create.sh + implementation: docker/dockerapp_start.sh stop: implementation: docker/dockerapp_stop.sh delete: