Tony Hansen | 749bc2d | 2017-10-03 02:51:42 +0000 | [diff] [blame] | 1 | # -*- indent-tabs-mode: nil -*- # vi: set expandtab: |
| 2 | # |
| 3 | # ============LICENSE_START==================================================== |
| 4 | # org.onap.dcae |
| 5 | # ============================================================================= |
| 6 | # Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. |
| 7 | # ============================================================================= |
| 8 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 9 | # you may not use this file except in compliance with the License. |
| 10 | # You may obtain a copy of the License at |
| 11 | # |
| 12 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | # |
| 14 | # Unless required by applicable law or agreed to in writing, software |
| 15 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 17 | # See the License for the specific language governing permissions and |
| 18 | # limitations under the License. |
| 19 | # ============LICENSE_END====================================================== |
| 20 | |
Michael Hwang | c74aad5 | 2017-09-11 13:49:15 -0400 | [diff] [blame] | 21 | tosca_definitions_version: cloudify_dsl_1_3 |
| 22 | |
| 23 | description: > |
| 24 | This blueprint is used to install and to uninstall DCAE inventory and DCAE service change |
| 25 | handler which are platform services. These applications are Docker containers. This blueprint |
| 26 | depends upon the deployment of a Docker host and the deployment of a central postgres that is |
| 27 | registered with Consul. |
| 28 | |
| 29 | imports: |
| 30 | - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml |
Hansen, Tony (th1395) | 68765fc | 2018-04-27 00:37:31 +0000 | [diff] [blame] | 31 | - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml |
Lusheng Ji | 1a5f66b | 2017-10-10 17:02:52 +0000 | [diff] [blame] | 32 | - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml |
Michael Hwang | c74aad5 | 2017-09-11 13:49:15 -0400 | [diff] [blame] | 33 | |
| 34 | inputs: |
| 35 | |
| 36 | location_id: |
| 37 | description: Location of where to deploy to |
| 38 | |
| 39 | docker_host_override: |
| 40 | description: Target docker host to deploy applications to |
Michael Hwang | ae66f94 | 2018-04-05 23:50:26 -0400 | [diff] [blame] | 41 | sdc_address: |
Michael Hwang | c74aad5 | 2017-09-11 13:49:15 -0400 | [diff] [blame] | 42 | description: SDC host |
Michael Hwang | ae66f94 | 2018-04-05 23:50:26 -0400 | [diff] [blame] | 43 | sdc_uri: |
Michael Hwang | c74aad5 | 2017-09-11 13:49:15 -0400 | [diff] [blame] | 44 | description: SDC url |
Michael Hwang | ae66f94 | 2018-04-05 23:50:26 -0400 | [diff] [blame] | 45 | sdc_msg_bus_address: |
| 46 | description: Message router hostname that SDC will send distribution events through |
| 47 | sdc_user: |
Michael Hwang | c74aad5 | 2017-09-11 13:49:15 -0400 | [diff] [blame] | 48 | description: SDC username |
Michael Hwang | ae66f94 | 2018-04-05 23:50:26 -0400 | [diff] [blame] | 49 | sdc_password: |
Michael Hwang | c74aad5 | 2017-09-11 13:49:15 -0400 | [diff] [blame] | 50 | description: SDC password |
Michael Hwang | ae66f94 | 2018-04-05 23:50:26 -0400 | [diff] [blame] | 51 | sdc_environment_name: |
Michael Hwang | c74aad5 | 2017-09-11 13:49:15 -0400 | [diff] [blame] | 52 | description: SDC environment name |
Michael Hwang | ae66f94 | 2018-04-05 23:50:26 -0400 | [diff] [blame] | 53 | sdc_use_secure_https: |
Michael Hwang | 881b4c2 | 2017-10-27 15:50:01 -0400 | [diff] [blame] | 54 | description: Boolean to toggle whether to do certificate validation for https calls to SDC API |
| 55 | type: boolean |
| 56 | default: false |
Michael Hwang | ae66f94 | 2018-04-05 23:50:26 -0400 | [diff] [blame] | 57 | sdc_use_https_dmaap: |
Michael Hwang | 881b4c2 | 2017-10-27 15:50:01 -0400 | [diff] [blame] | 58 | description: Boolean to toggle whether to use https for calls to message router API |
| 59 | type: boolean |
| 60 | default: false |
Michael Hwang | c74aad5 | 2017-09-11 13:49:15 -0400 | [diff] [blame] | 61 | |
| 62 | postgres_user_inventory: |
| 63 | description: Postgres user for inventory |
| 64 | postgres_password_inventory: |
| 65 | description: Postgres password for inventory |
| 66 | |
| 67 | service_change_handler_image: |
| 68 | description: Full uri to service change handler Docker image |
| 69 | inventory_image: |
| 70 | description: Full uri to inventory Docker image |
| 71 | |
| 72 | node_templates: |
| 73 | |
| 74 | service-change-handler: |
| 75 | type: dcae.nodes.DockerContainerForPlatforms |
| 76 | properties: |
| 77 | name: |
| 78 | "service-change-handler" |
| 79 | application_config: |
| 80 | asdcDistributionClient: |
Michael Hwang | ae66f94 | 2018-04-05 23:50:26 -0400 | [diff] [blame] | 81 | asdcAddress: { get_input: sdc_address } |
| 82 | asdcUri: { get_input: sdc_uri } |
| 83 | msgBusAddress: { get_input: sdc_msg_bus_address } |
| 84 | user: { get_input: sdc_user } |
| 85 | password: { get_input: sdc_password } |
Michael Hwang | c74aad5 | 2017-09-11 13:49:15 -0400 | [diff] [blame] | 86 | pollingInterval: 20 |
| 87 | pollingTimeout: 20 |
| 88 | consumerGroup: dcae |
| 89 | consumerId: dcae-sch |
Michael Hwang | ae66f94 | 2018-04-05 23:50:26 -0400 | [diff] [blame] | 90 | environmentName: { get_input: sdc_environment_name } |
Michael Hwang | c74aad5 | 2017-09-11 13:49:15 -0400 | [diff] [blame] | 91 | keyStorePath: |
| 92 | keyStorePassword: |
Michael Hwang | ae66f94 | 2018-04-05 23:50:26 -0400 | [diff] [blame] | 93 | activateServerTLSAuth: { get_input: sdc_use_secure_https } |
| 94 | useHttpsWithDmaap: { get_input: sdc_use_https_dmaap } |
Michael Hwang | c74aad5 | 2017-09-11 13:49:15 -0400 | [diff] [blame] | 95 | isFilterInEmptyResources: false |
| 96 | dcaeInventoryClient: |
| 97 | uri: http://inventory:8080 |
Michael Hwang | 68b32f4 | 2017-10-17 12:14:28 -0400 | [diff] [blame] | 98 | docker_config: |
| 99 | healthcheck: |
| 100 | type: "docker" |
| 101 | interval: "30s" |
| 102 | timeout: "3s" |
| 103 | script: "/opt/health.sh" |
Michael Hwang | c74aad5 | 2017-09-11 13:49:15 -0400 | [diff] [blame] | 104 | image: |
| 105 | { get_input: service_change_handler_image } |
| 106 | relationships: |
| 107 | - type: cloudify.relationships.depends_on |
| 108 | target: inventory |
| 109 | - type: dcae.relationships.component_contained_in |
| 110 | target: docker_host |
| 111 | |
| 112 | inventory: |
| 113 | type: dcae.nodes.DockerContainerForPlatforms |
| 114 | properties: |
| 115 | name: |
| 116 | "inventory" |
| 117 | application_config: |
| 118 | database: |
| 119 | driverClass: org.postgresql.Driver |
| 120 | user: { get_input: postgres_user_inventory } |
| 121 | password: { get_input: postgres_password_inventory } |
Michael Hwang | 7b5d187 | 2017-09-12 15:12:00 -0400 | [diff] [blame] | 122 | # NOTE: The database name here has been changed to the default "postgres" database |
| 123 | # to use the private postgres instance and not the central postgres database. |
| 124 | url: jdbc:postgresql://pstg-write:5432/postgres |
Michael Hwang | c74aad5 | 2017-09-11 13:49:15 -0400 | [diff] [blame] | 125 | properties: |
| 126 | charSet: UTF-8 |
| 127 | maxWaitForConnection: 1s |
| 128 | validationQuery: "/* MyService Health Check */ SELECT 1" |
| 129 | minSize: 2 |
| 130 | maxSize: 8 |
| 131 | initialSize: 2 |
| 132 | checkConnectionWhileIdle: false |
| 133 | evictionInterval: 10s |
| 134 | minIdleTime: 1 minute |
Michael Hwang | c74aad5 | 2017-09-11 13:49:15 -0400 | [diff] [blame] | 135 | databusControllerConnection: |
| 136 | host: databus-controller-hostname |
| 137 | port: 8443 |
| 138 | mechId: |
| 139 | password: |
| 140 | required: false |
| 141 | httpClient: |
| 142 | minThreads: 1 |
| 143 | maxThreads: 128 |
| 144 | gzipEnabled: false |
| 145 | gzipEnabledForRequests: false |
| 146 | timeout: 5000milliseconds |
| 147 | connectionTimeout: 5000milliseconds |
| 148 | docker_config: |
| 149 | healthcheck: |
| 150 | type: "http" |
| 151 | interval: "30s" |
| 152 | timeout: "3s" |
| 153 | endpoint: "/dcae-service-types" |
| 154 | image: |
| 155 | { get_input: inventory_image } |
| 156 | host_port: |
| 157 | 8080 |
| 158 | container_port: |
| 159 | 8080 |
| 160 | relationships: |
| 161 | - type: dcae.relationships.component_contained_in |
| 162 | target: docker_host |
Michael Hwang | 7b5d187 | 2017-09-12 15:12:00 -0400 | [diff] [blame] | 163 | - type: cloudify.relationships.depends_on |
| 164 | target: postgres |
| 165 | |
| 166 | postgres: |
| 167 | type: dcae.nodes.DockerContainer |
| 168 | properties: |
| 169 | name: |
| 170 | "pstg-write" |
| 171 | image: |
| 172 | "postgres:9.5.2" |
| 173 | relationships: |
| 174 | - type: dcae.relationships.component_contained_in |
| 175 | target: docker_host |
| 176 | interfaces: |
| 177 | cloudify.interfaces.lifecycle: |
| 178 | start: |
| 179 | inputs: |
| 180 | envs: |
| 181 | PGDATA: |
| 182 | "/var/lib/postgresql/data/pgdata" |
| 183 | POSTGRES_PASSWORD: |
| 184 | { get_input: postgres_password_inventory } |
| 185 | SERVICE_NAME: |
| 186 | "pstg-write" |
| 187 | ports: |
| 188 | - "5432:5432" |
Michael Hwang | c74aad5 | 2017-09-11 13:49:15 -0400 | [diff] [blame] | 189 | |
| 190 | docker_host: |
| 191 | type: dcae.nodes.SelectedDockerHost |
| 192 | properties: |
| 193 | location_id: |
| 194 | { get_input: location_id } |
| 195 | docker_host_override: |
| 196 | { get_input: docker_host_override } |