diff options
54 files changed, 2195 insertions, 607 deletions
diff --git a/LICENSE.txt b/LICENSE.txt index 69d5fc1..9536f0b 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,11 +1,11 @@ /* * ============LICENSE_START========================================== * =================================================================== -* Copyright © 2017 AT&T Intellectual Property. All rights reserved. +* Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed -* under the Apache License, Version 2.0 (the “License”); +* under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -20,7 +20,7 @@ * * * Unless otherwise specified, all documentation contained herein is licensed -* under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +* under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * diff --git a/blueprints/DeploymentHandler.yaml-template b/blueprints/DeploymentHandler.yaml-template index 4a8bb0c..2aa8373 100644 --- a/blueprints/DeploymentHandler.yaml-template +++ b/blueprints/DeploymentHandler.yaml-template @@ -18,7 +18,7 @@ # limitations under the License. # ============LICENSE_END============================================ # -# ECOMP and OpenECOMP are trademarks +# ECOMP and OpenECOMP are trademarks # and service marks of AT&T Intellectual Property. # @@ -30,26 +30,26 @@ description: > imports: - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/relationshipplugin/1/relationshipplugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml inputs: location_id: description: Deployment location - + docker_host_override: description: Target docker host default: 'platform_dockerhost' - + deployment_handler_image: description: Docker image for deployment handler - default: '{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.deployment-handler:v1.1.0' - + default: '{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.deployment-handler:2.2.0' + application_config: description: deployment handler application configuration (to override defaults) default: {} - + host_log_root: description: root directory for logs in the Docker host file system default: '/opt/onap/log' @@ -91,7 +91,7 @@ node_templates: #container: #bind: /opt/app/dh/log #mode: rw - + # Docker host docker_host: type: dcae.nodes.SelectedDockerHost diff --git a/blueprints/DockerBP.yaml-template b/blueprints/DockerBP.yaml-template index 1a5f025..e655063 100644 --- a/blueprints/DockerBP.yaml-template +++ b/blueprints/DockerBP.yaml-template @@ -26,7 +26,7 @@ imports: - http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/sshkeyshare/sshkey_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/relationshipplugin/1/relationshipplugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml diff --git a/blueprints/cdap-sdk.yaml-template b/blueprints/cdap-sdk.yaml-template new file mode 100644 index 0000000..cd1244f --- /dev/null +++ b/blueprints/cdap-sdk.yaml-template @@ -0,0 +1,71 @@ +# ============LICENSE_START==================================================== +# org.onap.dcae +# ============================================================================= +# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END====================================================== + + +tosca_definitions_version: cloudify_dsl_1_3 +imports: + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml + +inputs: + dh_override: + type: string + default: "component_dockerhost" + dh_location_id: + type: string + default: "dcaeams" + cdap_cluster_name: + type: string + default: "cdap" +node_templates: + docker_cdap_host: + properties: + docker_host_override: + get_input: dh_override + location_id: + get_input: dh_location_id + type: dcae.nodes.SelectedDockerHost + cdapdocker: + interfaces: + cloudify.interfaces.lifecycle: + stop: + inputs: + cleanup_image: true + start: + inputs: + ports: + - '11011:11011' + envs: + SERVICE_11015_NAME: { get_input: cdap_cluster_name } + SERVICE_11011_IGNORE: 'true' + properties: + host_port: 11015 + container_port: 11015 + docker_config: + healthcheck: + endpoint: "/status" + interval: "15s" + timeout: "15s" + type: "http" + name: 'cdap_docker' + image: "caskdata/cdap-standalone:4.1.2" + relationships: + - type: dcae.relationships.component_contained_in + target: docker_cdap_host + type: dcae.nodes.DockerContainerForPlatforms + diff --git a/blueprints/cdap_broker.yaml-template b/blueprints/cdap_broker.yaml-template index c4d02c8..3c29634 100644 --- a/blueprints/cdap_broker.yaml-template +++ b/blueprints/cdap_broker.yaml-template @@ -27,7 +27,7 @@ imports: - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/cdapcloudify/14/cdapcloudify_types.yaml - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/relationshipplugin/1/relationshipplugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml inputs: location_id: diff --git a/blueprints/config_binding_service.yaml-template b/blueprints/config_binding_service.yaml-template index 0bc5148..28dfb43 100644 --- a/blueprints/config_binding_service.yaml-template +++ b/blueprints/config_binding_service.yaml-template @@ -1,16 +1,15 @@ # -*- indent-tabs-mode: nil -*- # vi: set expandtab: # # ============LICENSE_START==================================================== -# org.onap.dcae # ============================================================================= -# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. # ============================================================================= # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -26,7 +25,7 @@ description: > imports: - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/relationshipplugin/1/relationshipplugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml inputs: location_id: type: string @@ -35,7 +34,7 @@ inputs: docker_host_override: description: Target docker host to deploy applications to default: 'platform_dockerhost' - + node_templates: # Config binding service service-config-binding: @@ -44,7 +43,7 @@ node_templates: name: 'config_binding_service' host_port: 10000 container_port: 10000 - image: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.configbinding:v1.2.0" + image: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.configbinding:2.1.5" docker_config: healthcheck: type: "http" diff --git a/blueprints/heartbeat-service.yaml-template b/blueprints/heartbeat-service.yaml-template new file mode 100644 index 0000000..2654c71 --- /dev/null +++ b/blueprints/heartbeat-service.yaml-template @@ -0,0 +1,61 @@ +tosca_definitions_version: cloudify_dsl_1_3 +imports: +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" +inputs: + dcae_CL_publish_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.DCAE_CL_OUTPUT" + ves_heartbeat_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.SEC_HEARTBEAT_OUTPUT" + docker_host_override: + type: string + default: "component_dockerhost" + dh_location_id: + type: string + default: "zone1" + tag_version: + type: string + default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.platform.heartbeat:2.0" + +node_templates: + docker_service_host: + type: dcae.nodes.SelectedDockerHost + properties: + docker_host_override: + get_input: docker_host_override + location_id: + get_input: dh_location_id + heartbeatService: + type: dcae.nodes.DockerContainerForComponentsUsingDmaap + properties: + application_config: + heartbeat_config: '{"vnfs":[{"heartbeatcountmissed":3, "heartbeatinterval": 60, "closedLoopControlName":"ControlLoopEvent1"},{"heartbeatcountmissed":3, "heartbeatinterval": 60, "closedLoopControlName":"ControlLoopEvent1"},{"heartbeatcountmissed":3, "heartbeatinterval": 60, "closedLoopControlName":"ControlLoopEvent1"}]}' + streams_publishes: + dcae_cl_out: + dmaap_info: + topic_url: + get_input: dcae_CL_publish_url + type: message_router + streams_subscribes: + heartbeat_input: + dmaap_info: + topic_url: + get_input: ves_heartbeat_url + type: message_router + docker_config: + healthcheck: + script: /app/bin/check_health.py + interval: 18s + timeout: 30s + type: docker + image: + get_input: tag_version + location_id: + get_input: dh_location_id + service_component_type: dcaegen2-services-heartbeat + relationships: + - target: docker_service_host + type: dcae.relationships.component_contained_in + diff --git a/blueprints/holmes-engine.yaml-template b/blueprints/holmes-engine.yaml-template index b2dc0bf..4661299 100644 --- a/blueprints/holmes-engine.yaml-template +++ b/blueprints/holmes-engine.yaml-template @@ -2,8 +2,8 @@ tosca_definitions_version: cloudify_dsl_1_3 imports: - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml" - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dcaepolicyplugin/1/dcaepolicyplugin_types.yaml" -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/relationshipplugin/1/relationshipplugin_types.yaml" -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/pgaas_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" inputs: dcae_CL_publish_url: type: string diff --git a/blueprints/holmes-rules.yaml-template b/blueprints/holmes-rules.yaml-template index 49c9a91..dc0ab7d 100644 --- a/blueprints/holmes-rules.yaml-template +++ b/blueprints/holmes-rules.yaml-template @@ -2,8 +2,8 @@ tosca_definitions_version: cloudify_dsl_1_3 imports: - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml" - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dcaepolicyplugin/1/dcaepolicyplugin_types.yaml" -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/relationshipplugin/1/relationshipplugin_types.yaml" -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/pgaas_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" inputs: docker_host_override: type: string diff --git a/blueprints/inventory.yaml-template b/blueprints/inventory.yaml-template index 4da253c..c427f8c 100644 --- a/blueprints/inventory.yaml-template +++ b/blueprints/inventory.yaml-template @@ -28,7 +28,7 @@ description: > imports: - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/relationshipplugin/1/relationshipplugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml inputs: @@ -38,21 +38,23 @@ inputs: docker_host_override: description: Target docker host to deploy applications to - asdc_address: + sdc_address: description: SDC host - asdc_uri: + sdc_uri: description: SDC url - asdc_user: + sdc_msg_bus_address: + description: Message router hostname that SDC will send distribution events through + sdc_user: description: SDC username - asdc_password: + sdc_password: description: SDC password - asdc_environment_name: + sdc_environment_name: description: SDC environment name - asdc_use_secure_https: + sdc_use_secure_https: description: Boolean to toggle whether to do certificate validation for https calls to SDC API type: boolean default: false - asdc_use_https_dmaap: + sdc_use_https_dmaap: description: Boolean to toggle whether to use https for calls to message router API type: boolean default: false @@ -76,19 +78,20 @@ node_templates: "service-change-handler" application_config: asdcDistributionClient: - asdcAddress: { get_input: asdc_address } - asdcUri: { get_input: asdc_uri } - user: { get_input: asdc_user } - password: { get_input: asdc_password } + asdcAddress: { get_input: sdc_address } + asdcUri: { get_input: sdc_uri } + msgBusAddress: { get_input: sdc_msg_bus_address } + user: { get_input: sdc_user } + password: { get_input: sdc_password } pollingInterval: 20 pollingTimeout: 20 consumerGroup: dcae consumerId: dcae-sch - environmentName: { get_input: asdc_environment_name } + environmentName: { get_input: sdc_environment_name } keyStorePath: keyStorePassword: - activateServerTLSAuth: { get_input: asdc_use_secure_https } - useHttpsWithDmaap: { get_input: asdc_use_https_dmaap } + activateServerTLSAuth: { get_input: sdc_use_secure_https } + useHttpsWithDmaap: { get_input: sdc_use_https_dmaap } isFilterInEmptyResources: false dcaeInventoryClient: uri: http://inventory:8080 @@ -129,13 +132,6 @@ node_templates: checkConnectionWhileIdle: false evictionInterval: 10s minIdleTime: 1 minute - dcaeControllerConnection: - host: dcae-controller-hostname - port: 9998 - basePath: resources - user: - password: - required: false databusControllerConnection: host: databus-controller-hostname port: 8443 diff --git a/blueprints/k8s-config_binding_service.yaml-template b/blueprints/k8s-config_binding_service.yaml-template new file mode 100644 index 0000000..aeeceb9 --- /dev/null +++ b/blueprints/k8s-config_binding_service.yaml-template @@ -0,0 +1,53 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# ============================================================================= +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END====================================================== + +tosca_definitions_version: cloudify_dsl_1_3 + +description: > + This blueprint installs the config binding service + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/k8splugin/1.1.0/k8splugin_types.yaml + +inputs: + + cbs_image: + description: Docker image for config binding service + default: {{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.configbinding:2.1.5 + replicas: + description: Number of instances to launch + type: integer + default: 1 + +node_templates: + # Config binding service + service-config-binding: + type: dcae.nodes.ContainerizedPlatformComponent + properties: + name: 'config-binding-service' + container_port: 10000 + image: { get_input: cbs_image } + docker_config: + healthcheck: + type: "http" + endpoint: "/healthcheck" + replicas: {get_input: replicas} + log_info: + log_directory: "/opt/logs" diff --git a/blueprints/k8s-deployment_handler.yaml-template b/blueprints/k8s-deployment_handler.yaml-template new file mode 100644 index 0000000..7bffebf --- /dev/null +++ b/blueprints/k8s-deployment_handler.yaml-template @@ -0,0 +1,84 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START========================================== +# org.onap.dcae +# =================================================================== +# Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END============================================ + +tosca_definitions_version: cloudify_dsl_1_3 + +description: > + This blueprint deploys/manages the DCAE deployment handler as a Docker container + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/k8splugin/1.1.0/k8splugin_types.yaml + +inputs: + + deployment_handler_image: + description: Docker image for deployment handler + default: {{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.deployment-handler:2.2.0 + application_config: + description: deployment handler application configuration (to override defaults) + default: {} + host_port: + description: port on Kubernetes host where DH API will be exposed + default: 0 + host_log_root: + description: root directory for logs in the Docker host file system + default: '/opt/onap/log' + +node_templates: + + # Deployment Handler + deployment-handler: + type: dcae.nodes.ContainerizedPlatformComponent + properties: + name: + 'deployment_handler' + dns_name: + 'deployment-handler' + image: + { get_input: deployment_handler_image } + application_config: + { get_input: application_config } + host_port: + { get_input: host_port } + container_port: + 8443 + docker_config: + healthcheck: + type: 'http' + interval: '300s' + timeout: '5s' + endpoint: '/' + msb_registration: + port: '8443' + url_path: '/' + version: 'v4' + log_info: + log_directory: '/opt/app/dh/log' + # Inject CM password through environment variable + # so that it does not appear in Consul + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + envs: + CLOUDIFY_PASSWORD: { get_secret: cmpass } + CLOUDIFY_USER: admin + diff --git a/blueprints/k8s-holmes-engine.yaml-template b/blueprints/k8s-holmes-engine.yaml-template new file mode 100644 index 0000000..696052f --- /dev/null +++ b/blueprints/k8s-holmes-engine.yaml-template @@ -0,0 +1,106 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# ============================================================================= +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END===================================================== + +tosca_definitions_version: cloudify_dsl_1_3 +imports: +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/k8splugin/1.1.0/k8splugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/dcaepolicyplugin/2.3.0/dcaepolicyplugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" +inputs: + dcae_CL_publish_url: + type: string + default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.DCAE_CL_OUTPUT" + #default: "http://10.0.11.1:3904/events/unauthenticated.DCAE_CL_OUTPUT" + ves_fault_publish_url: + type: string + default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.SEC_FAULT_OUTPUT" + #default: "http://10.0.11.1:3904/events/unauthenticated.SEC_FAULT_OUTPUT" + msb_hostname: + type: string + default: "msb-discovery.onap.svc.cluster.local" + pgaas_cluster_name: + type: string + default: "dcae-postgres.onap.svc.cluster.local" + # use the single-VM PG instance + #default: pgvm + database_name: + type: string + default: holmes + he_image: + type: string + default: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/holmes/engine-management:v1.0.0" + +node_templates: + pgaasvm: + type: dcae.nodes.pgaas.database + properties: + #writerfqdn: { concat: [ { get_input: pgaas_cluster_name }, '-write.' ] } + writerfqdn: { get_input: pgaas_cluster_name } + name: { get_input: database_name } + use_existing: true + + holmesengine: + type: dcae.nodes.ContainerizedPlatformComponent + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + envs: + URL_JDBC: + { get_attribute: [ pgaasvm, admin, host ] } + JDBC_PASSWORD: + { get_attribute: [ pgaasvm, admin, password ] } + JDBC_USERNAME: + { get_attribute: [ pgaasvm, admin, user ] } + MSB_ADDR: + get_input: msb_hostname + properties: + name: 'holmes-engine-mgmt' + dns_name: 'holmes-engine-mgmt' + application_config: + msb.hostname: + get_input: msb_hostname + msb.uri: /api/microservices/v1/services + services_calls: {} + streams_publishes: + dcae_cl_out: + dmaap_info: + topic_url: + get_input: dcae_CL_publish_url + type: message_router + streams_subscribes: + ves_fault: + dmaap_info: + topic_url: + get_input: ves_fault_publish_url + type: message_router + docker_config: + healthcheck: + endpoint: /api/holmes-engine-mgmt/v1/healthcheck + interval: 15s + timeout: 1s + type: http + ports: + - 9102:0 + image: { get_input: he_image } + # need to use truncated name!! + #service_component_type: dcae-analytics-holmes-engin-management + relationships: + - type: cloudify.relationships.depends_on + target: pgaasvm diff --git a/blueprints/k8s-holmes-rules.yaml-template b/blueprints/k8s-holmes-rules.yaml-template new file mode 100644 index 0000000..351452e --- /dev/null +++ b/blueprints/k8s-holmes-rules.yaml-template @@ -0,0 +1,85 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# ============================================================================= +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END===================================================== + +tosca_definitions_version: cloudify_dsl_1_3 +imports: +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/k8splugin/1.1.0/k8splugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/dcaepolicyplugin/2.3.0/dcaepolicyplugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" +inputs: + msb_hostname: + type: string + default: "msb-discovery.onap.svc.cluster.local" + pgaas_cluster_name: + type: string + default: "dcae-postgres.onap.svc.cluster.local" + # use the single-VM PG instance + #default: pgvm + database_name: + type: string + default: holmes + hr_image: + type: string + default: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/holmes/rule-management:v1.0.0" +node_templates: + pgaasvm: + type: dcae.nodes.pgaas.database + properties: + #writerfqdn: { concat: [ { get_input: pgaas_cluster_name }, '-write.' ] } + writerfqdn: { get_input: pgaas_cluster_name } + name: { get_input: database_name } + holmesrules: + type: dcae.nodes.ContainerizedPlatformComponent + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + envs: + URL_JDBC: + { get_attribute: [ pgaasvm, admin, host ] } + JDBC_PASSWORD: + { get_attribute: [ pgaasvm, admin, password ] } + JDBC_USERNAME: + { get_attribute: [ pgaasvm, admin, user ] } + MSB_ADDR: + get_input: msb_hostname + properties: + name: 'holmes-rule-mgmt' + dns_name: 'holmes-rule-mgmt' + application_config: + holmes.default.rule.volte.scenario1: "ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b$$$package org.onap.holmes.droolsRule;\n\nimport org.onap.holmes.common.dmaap.DmaapService;\nimport org.onap.holmes.common.api.stat.VesAlarm;\nimport org.onap.holmes.common.aai.CorrelationUtil;\nimport org.onap.holmes.common.dmaap.entity.PolicyMsg;\nimport org.onap.holmes.common.dropwizard.ioc.utils.ServiceLocatorHolder;\nimport org.onap.holmes.common.utils.DroolsLog;\n \n\nrule \"Relation_analysis_Rule\"\nsalience 200\nno-loop true\n when\n $root : VesAlarm(alarmIsCleared == 0,\n $sourceId: sourceId, sourceId != null && !sourceId.equals(\"\"),\n\t\t\t$sourceName: sourceName, sourceName != null && !sourceName.equals(\"\"),\n\t\t\t$startEpochMicrosec: startEpochMicrosec,\n eventName in (\"Fault_MultiCloud_VMFailure\"),\n $eventId: eventId)\n $child : VesAlarm( eventId != $eventId, parentId == null,\n CorrelationUtil.getInstance().isTopologicallyRelated(sourceId, $sourceId, $sourceName),\n eventName in (\"Fault_MME_eNodeB out of service alarm\"),\n startEpochMicrosec < $startEpochMicrosec + 60000 && startEpochMicrosec > $startEpochMicrosec - 60000 )\n then\n\t\tDroolsLog.printInfo(\"===========================================================\");\n\t\tDroolsLog.printInfo(\"Relation_analysis_Rule: rootId=\" + $root.getEventId() + \", childId=\" + $child.getEventId());\n\t\t$child.setParentId($root.getEventId());\n\t\tupdate($child);\n\t\t\nend\n\nrule \"root_has_child_handle_Rule\"\nsalience 150\nno-loop true\n\twhen\n\t\t$root : VesAlarm(alarmIsCleared == 0, rootFlag == 0, $eventId: eventId)\n\t\t$child : VesAlarm(eventId != $eventId, parentId == $eventId)\n\tthen\n\t\tDroolsLog.printInfo(\"===========================================================\");\n\t\tDroolsLog.printInfo(\"root_has_child_handle_Rule: rootId=\" + $root.getEventId() + \", childId=\" + $child.getEventId());\n\t\tDmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);\n\t\tPolicyMsg policyMsg = dmaapService.getPolicyMsg($root, $child, \"org.onap.holmes.droolsRule\");\n dmaapService.publishPolicyMsg(policyMsg, \"unauthenticated.DCAE_CL_OUTPUT\");\n\t\t$root.setRootFlag(1);\n\t\tupdate($root);\nend\n\nrule \"root_no_child_handle_Rule\"\nsalience 100\nno-loop true\n when\n $root : VesAlarm(alarmIsCleared == 0, rootFlag == 0,\n sourceId != null && !sourceId.equals(\"\"),\n\t\t\tsourceName != null && !sourceName.equals(\"\"),\n eventName in (\"Fault_MultiCloud_VMFailure\"))\n then\n\t\tDroolsLog.printInfo(\"===========================================================\");\n\t\tDroolsLog.printInfo(\"root_no_child_handle_Rule: rootId=\" + $root.getEventId());\n\t\tDmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);\n\t\tPolicyMsg policyMsg = dmaapService.getPolicyMsg($root, null, \"org.onap.holmes.droolsRule\");\n dmaapService.publishPolicyMsg(policyMsg, \"unauthenticated.DCAE_CL_OUTPUT\");\n\t\t$root.setRootFlag(1);\n\t\tupdate($root);\nend\n\nrule \"root_cleared_handle_Rule\"\nsalience 100\nno-loop true\n when\n $root : VesAlarm(alarmIsCleared == 1, rootFlag == 1)\n then\n\t\tDroolsLog.printInfo(\"===========================================================\");\n\t\tDroolsLog.printInfo(\"root_cleared_handle_Rule: rootId=\" + $root.getEventId());\n\t\tDmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);\n\t\tPolicyMsg policyMsg = dmaapService.getPolicyMsg($root, null, \"org.onap.holmes.droolsRule\");\n dmaapService.publishPolicyMsg(policyMsg, \"unauthenticated.DCAE_CL_OUTPUT\");\n\t\tretract($root);\nend\n\nrule \"child_handle_Rule\"\nsalience 100\nno-loop true\n when\n $child : VesAlarm(alarmIsCleared == 1, rootFlag == 0)\n then\n\t\tDroolsLog.printInfo(\"===========================================================\");\n\t\tDroolsLog.printInfo(\"child_handle_Rule: childId=\" + $child.getEventId());\n\t\tretract($child);\nend" + msb.hostname: + get_input: msb_hostname + msb.uri: /api/microservices/v1/services + services_calls: {} + streams_publishes: {} + streams_subscribes: {} + docker_config: + healthcheck: + endpoint: /api/holmes-rule-mgmt/v1/healthcheck + interval: 15s + timeout: 1s + type: http + ports: + - 9101:0 + image: { get_input: hr_image } + #service_component_type: dcae-analytics-holmes-rule-management + relationships: + - type: cloudify.relationships.depends_on + target: pgaasvm diff --git a/blueprints/k8s-inventory.yaml-template b/blueprints/k8s-inventory.yaml-template new file mode 100644 index 0000000..bd65ef1 --- /dev/null +++ b/blueprints/k8s-inventory.yaml-template @@ -0,0 +1,180 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# org.onap.dcae +# ============================================================================= +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END====================================================== + +tosca_definitions_version: cloudify_dsl_1_3 + +description: > + This blueprint is used to install and to uninstall DCAE inventory and DCAE service change + handler which are platform services. These applications are Docker containers. This blueprint + depends upon the deployment of a Docker host and the deployment of a central postgres that is + registered with Consul. + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/k8splugin/1.1.0/k8splugin_types.yaml + +inputs: + + sdc_address: + description: SDC host + sdc_uri: + description: SDC url + sdc_msg_bus_address: + description: Message router hostname that SDC will send distribution events through + sdc_user: + description: SDC username + sdc_password: + description: SDC password + sdc_environment_name: + description: SDC environment name + sdc_use_secure_https: + description: Boolean to toggle whether to do certificate validation for https calls to SDC API + type: boolean + default: false + sdc_use_https_dmaap: + description: Boolean to toggle whether to use https for calls to message router API + type: boolean + default: false + + postgres_user_inventory: + description: Postgres user for inventory + postgres_password_inventory: + description: Postgres password for inventory + + service_change_handler_image: + description: Full uri to service change handler Docker image + default: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.servicechange-handler:1.1.4" + inventory_image: + description: Full uri to inventory Docker image + default: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.inventory-api:3.0.1" + +node_templates: + + service-change-handler: + type: dcae.nodes.ContainerizedPlatformComponent + properties: + name: + "service-change-handler" + application_config: + asdcDistributionClient: + asdcAddress: { get_input: sdc_address } + asdcUri: { get_input: sdc_uri } + msgBusAddress: { get_input: sdc_msg_bus_address } + user: { get_input: sdc_user } + password: { get_input: sdc_password } + pollingInterval: 20 + pollingTimeout: 20 + consumerGroup: dcae + consumerId: dcae-sch + environmentName: { get_input: sdc_environment_name } + keyStorePath: + keyStorePassword: + activateServerTLSAuth: { get_input: sdc_use_secure_https } + useHttpsWithDmaap: { get_input: sdc_use_https_dmaap } + isFilterInEmptyResources: false + dcaeInventoryClient: + uri: http://inventory:8080 + docker_config: + healthcheck: + type: "docker" + interval: "30s" + timeout: "3s" + script: "/opt/health.sh" + image: + { get_input: service_change_handler_image } + relationships: + - type: cloudify.relationships.depends_on + target: inventory + + inventory: + type: dcae.nodes.ContainerizedPlatformComponent + properties: + name: + "inventory" + application_config: + database: + driverClass: org.postgresql.Driver + user: { get_input: postgres_user_inventory } + password: { get_input: postgres_password_inventory } + # NOTE: The database name here has been changed to the default "postgres" database + # to use the private postgres instance and not the central postgres database. + url: jdbc:postgresql://pstg-write:5432/postgres + properties: + charSet: UTF-8 + maxWaitForConnection: 1s + validationQuery: "/* MyService Health Check */ SELECT 1" + minSize: 2 + maxSize: 8 + initialSize: 2 + checkConnectionWhileIdle: false + evictionInterval: 10s + minIdleTime: 1 minute + databusControllerConnection: + host: databus-controller-hostname + port: 8443 + mechId: + password: + required: false + httpClient: + minThreads: 1 + maxThreads: 128 + gzipEnabled: false + gzipEnabledForRequests: false + timeout: 5000milliseconds + connectionTimeout: 5000milliseconds + docker_config: + healthcheck: + type: "http" + interval: "30s" + timeout: "3s" + endpoint: "/dcae-service-types" + image: + { get_input: inventory_image } + container_port: + 8080 + relationships: + - type: cloudify.relationships.depends_on + target: postgres + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + max_wait: 900 + + postgres: + type: dcae.nodes.ContainerizedApplication + properties: + name: + "pstg-write" + image: + "postgres:9.5.2" + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + envs: + PGDATA: + "/var/lib/postgresql/data/pgdata" + POSTGRES_PASSWORD: + { get_input: postgres_password_inventory } + SERVICE_NAME: + "pstg-write" + ports: + - "5432:0" diff --git a/blueprints/k8s-pgaas-database.yaml-template b/blueprints/k8s-pgaas-database.yaml-template new file mode 100644 index 0000000..309c962 --- /dev/null +++ b/blueprints/k8s-pgaas-database.yaml-template @@ -0,0 +1,57 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# org.onap.dcae +# ============================================================================= +# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END====================================================== + +tosca_definitions_version: cloudify_dsl_1_3 + +description: |- + This blueprint is used to install and to uninstall a persistent database into the central postgres as a platform service. + This blueprint depends upon the deployment of the pgaas_plugin and the PGaaS service. + This blueprint is part of a suite of three blueprints: + k8s-pgaas-initdb takes control of the postgres server instance. + k8s-pgaas-database creates a database, roles and credentials associated with the database. + k8s-pgaas-getdbinfo shows how an application can access a database (including its roles and credentials) that was already created with k8s-pgaas-database. + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" + +inputs: + blueprint_version: + type: string + default: '2018-03-29T14:28:59+0000' + + # pgaas-specific info + k8s_pgaas_instance_fqdn: + type: string + + database_description: + type: string + default: 'This is a sample database' + + database_name: + type: string + default: sample + +node_templates: + pgaasdbtest: + type: dcae.nodes.pgaas.database + properties: + writerfqdn: { get_input: k8s_pgaas_instance_fqdn } + name: { get_input: database_name } diff --git a/blueprints/k8s-pgaas-getdbinfo.yaml-template b/blueprints/k8s-pgaas-getdbinfo.yaml-template new file mode 100644 index 0000000..6869f2c --- /dev/null +++ b/blueprints/k8s-pgaas-getdbinfo.yaml-template @@ -0,0 +1,99 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# org.onap.dcae +# ============================================================================= +# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END====================================================== + +tosca_definitions_version: cloudify_dsl_1_3 + +description: |- + This blueprint is an example of how an application can access the needed information about + a persistent database created as part of a PGaaS cluster. + + For a given database "dbname" on a given PGaaS cluster "PGCLUSTERNAME", + there are three roles created: + admin role: has complete administrative control over that database + user role: has complete read and write access on that database + viewer role: only has read access on that database + The various attributes will return the appropriate information + that can be used with that role: host fqdn, role name and password. + + This blueprint is part of a suite of three blueprints: + k8s-pgaas-initdb takes control of the postgres server instance. + k8s-pgaas-database creates a database, roles and credentials associated with the database. + k8s-pgaas-getdbinfo shows how an application can access a database (including its roles and credentials) that was already created with k8s-pgaas-database. + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" + +inputs: + k8s_pgaas_instance_fqdn: + type: string + database_name: + type: string + +node_templates: + pgclustername_dbname: + type: dcae.nodes.pgaas.database + properties: + writerfqdn: { get_input: k8s_pgaas_instance_fqdn } + name: { get_input: database_name } + use_existing: true + +outputs: + # admin role has control over table/index/view creation/dropping + pgclustername_dbname_admin_host: + description: Hostname for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, admin, host ] } + pgclustername_dbname_admin_port: + description: Portname for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, admin, port ] } + pgclustername_dbname_admin_user: + description: Admin Username for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, admin, user ] } + pgclustername_dbname_admin_password: + description: Admin Password for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, admin, password ] } + + # user role can read and write the tables + pgclustername_dbname_user_host: + description: Hostname for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, user, host ] } + pgclustername_dbname_user_port: + description: Portname for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, user, port ] } + pgclustername_dbname_user_user: + description: User Username for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, user, user ] } + pgclustername_dbname_user_password: + description: User Password for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, user, password ] } + + # viewer role can only read from the tables + pgclustername_dbname_viewer_host: + description: Hostname for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, viewer, host ] } + pgclustername_dbname_viewer_port: + description: Portname for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, viewer, port ] } + pgclustername_dbname_viewer_user: + description: Viewer Username for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, viewer, user ] } + pgclustername_dbname_viewer_password: + description: Viewer Password for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, viewer, password ] } diff --git a/blueprints/k8s-pgaas-initdb.yaml-template b/blueprints/k8s-pgaas-initdb.yaml-template new file mode 100644 index 0000000..7dd7037 --- /dev/null +++ b/blueprints/k8s-pgaas-initdb.yaml-template @@ -0,0 +1,72 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# org.onap.dcae +# ============================================================================= +# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END====================================================== + +tosca_definitions_version: cloudify_dsl_1_3 + +description: |- + This blueprint is used to take control of a postgres server instance for use by cloudify-managed applications. + This blueprint depends upon the deployment of the pgaas_plugin and an existing postgres server instance. + This blueprint is part of a suite of three blueprints: + k8s-pgaas-initdb takes control of the postgres server instance. + k8s-pgaas-database creates a database, roles and credentials associated with the database. + k8s-pgaas-getdbinfo shows how an application can access a database (including its roles and credentials) that was already created with k8s-pgaas-database. + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/sshkeyshare/sshkey_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" + +inputs: + blueprint_version: + type: string + default: '2018-04-27T00:31:38+0000' + + pgaas_cluster_name: + type: string + default: pghelm + + k8s_pgaas_instance_fqdn: + type: string + + k8s_initial_password: + type: string + default: '' + +node_templates: + + # tie to pgaas_plugin database + pgaas_cluster: + type: dcae.nodes.pgaas.cluster + properties: + writerfqdn: { get_input: k8s_pgaas_instance_fqdn } + readerfqdn: { get_input: k8s_pgaas_instance_fqdn } + initialpassword: { get_input: k8s_initial_password } + relationships: + - type: dcae.relationships.pgaas_cluster_uses_sshkeypair + target: sharedsshkey_pgrs + + sharedsshkey_pgrs: + type: ccsdk.nodes.ssh.keypair + + +outputs: + blueprint_version: + value: { get_input: blueprint_version } diff --git a/blueprints/k8s-policy_handler.yaml-template b/blueprints/k8s-policy_handler.yaml-template new file mode 100644 index 0000000..ebb1ecd --- /dev/null +++ b/blueprints/k8s-policy_handler.yaml-template @@ -0,0 +1,57 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START======================================================= +# org.onap.dcae +# ================================================================================ +# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= + +tosca_definitions_version: cloudify_dsl_1_3 + +description: > + This blueprint deploys/manages the DCAE policy-handler as a Docker container + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/k8splugin/1.1.0/k8splugin_types.yaml + + +inputs: + + policy_handler_image: + description: Docker image for policy_handler + default: '{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.policy-handler:3.0.1' + + application_config: + description: policy handler application configuration - requires info on policy-engine + default: {} + +node_templates: + policy_handler: + type: dcae.nodes.ContainerizedPlatformComponent + properties: + name: 'policy_handler' + dns_name: 'policy-handler' + image: { get_input: policy_handler_image } + application_config: { get_input: application_config } + docker_config: + healthcheck: + type: 'http' + interval: '300s' + timeout: '25s' + endpoint: '/healthcheck' + log_info: + log_directory: '/opt/app/policy_handler/logs' + container_port: 25577 diff --git a/blueprints/k8s-prh.yaml-template b/blueprints/k8s-prh.yaml-template new file mode 100644 index 0000000..86be236 --- /dev/null +++ b/blueprints/k8s-prh.yaml-template @@ -0,0 +1,107 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# ============================================================================= +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END====================================================== + +tosca_definitions_version: cloudify_dsl_1_3 + +imports: + - "http://www.getcloudify.org/spec/cloudify/3.4/types.yaml" + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/k8splugin/1.1.0/k8splugin_types.yaml + +inputs: + aaiEnrichmentHost: + type: string + default: "aai.onap.svc.cluster.local" + aaiEnrichmentPort: + type: integer + default: 8443 + aaiEnrichmentUser: + type: string + description: aai user name + default: "admin" + aaiEnrichmentPasswd: + type: string + description: aai password + default: "admin" + dmaap_host: + type: string + description: dmaap host + default: message-router.onap.svc.cluster.local + dmaap_port: + type: integer + description: dmaap port + default: 3904 + dmaap_user: + type: string + description: dmap user name + default: "admin" + dmaap_passwd: + type: string + description: dmap password + default: "admin" + tag_version: + type: string + default: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/g.onap.dcaegen2.services.prh.prh-app-server:latest" + replicas: + type: integer + description: number of instances + default: 1 +node_templates: + prh: + properties: + application_config: + dmaap.dmaapConsumerConfiguration.dmaapHostName: { get_input: dmaap_host } + dmaap.dmaapConsumerConfiguration.dmaapPortNumber: { get_input: dmaap_port } + dmaap.dmaapConsumerConfiguration.dmaapTopicName: "/events/unauthenticated.SEC_OTHER_OUTPUT" + dmaap.dmaapConsumerConfiguration.dmaapProtocol: "http" + dmaap.dmaapConsumerConfiguration.dmaapUserName: { get_input: dmaap_user } + dmaap.dmaapConsumerConfiguration.dmaapUserPassword: { get_input: dmaap_passwd } + dmaap.dmaapConsumerConfiguration.dmaapContentType: "application/json" + dmaap.dmaapConsumerConfiguration.consumerId: "c12" + dmaap.dmaapConsumerConfiguration.consumerGroup: "OpenDCAE-c12" + dmaap.dmaapConsumerConfiguration.timeoutMS: -1 + dmaap.dmaapConsumerConfiguration.messageLimit: -1 + dmaap.dmaapProducerConfiguration.dmaapHostName: { get_input: dmaap_host } + dmaap.dmaapProducerConfiguration.dmaapPortNumber: { get_input: dmaap_port } + dmaap.dmaapProducerConfiguration.dmaapTopicName: "/events/unauthenticated.PNF_READY" + dmaap.dmaapProducerConfiguration.dmaapProtocol: "http" + dmaap.dmaapProducerConfiguration.dmaapUserName: { get_input: dmaap_user } + dmaap.dmaapProducerConfiguration.dmaapUserPassword: { get_input: dmaap_passwd } + dmaap.dmaapProducerConfiguration.dmaapContentType: "application/json" + aai.aaiClientConfiguration.aaiHost: { get_input: aaiEnrichmentHost } + aai.aaiClientConfigurationaaiHostPortNumber: { get_input: aaiEnrichmentPort } + aai.aaiClientConfigurationaaiProtocol: "https" + aai.aaiClientConfigurationaaiUserName: { get_input: aaiEnrichmentUser } + aai.aaiClientConfigurationaaiUserPassword: { get_input: aaiEnrichmentPasswd } + aai.aaiClientConfigurationaaiIgnoreSSLCertificateErrors: true + aai.aaiClientConfigurationaaiBasePath: "/aai/v12" + aai.aaiClientConfigurationaaiPnfPath: "/network/pnfs/pnf" + docker_config: + healthcheck: + endpoint: /heartbeat + interval: 15s + timeout: 1s + type: http + image: + get_input: tag_version + replicas: {get_input: replicas} + name: 'dcae-prh' + dns_name: 'dcae-prh' + log_info: + log_directory: "/opt/app/prh/logs" + type: dcae.nodes.ContainerizedServiceComponent diff --git a/blueprints/k8s-tca-policy.yaml-template b/blueprints/k8s-tca-policy.yaml-template new file mode 100644 index 0000000..bb161c3 --- /dev/null +++ b/blueprints/k8s-tca-policy.yaml-template @@ -0,0 +1,171 @@ +# +# ============LICENSE_START==================================================== +# ============================================================================= +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END====================================================== + +tosca_definitions_version: cloudify_dsl_1_3 + +description: > + This blueprint deploys/manages the TCA module as a Docker container + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/k8splugin/1.1.0/k8splugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/dcaepolicyplugin/2.3.0/dcaepolicyplugin_types.yaml +inputs: + aaiEnrichmentHost: + type: string + default: "aai.onap.svc.cluster.local" + aaiEnrichmentPort: + type: string + default: "8443" + enableAAIEnrichment: + type: string + default: true + dmaap_host: + type: string + default: message-router.onap.svc.cluster.local + dmaap_port: + type: string + default: "3904" + enableRedisCaching: + type: string + default: false + redisHosts: + type: string + default: dcae-redis.onap.svc.cluster.local:6379 + tag_version: + type: string + default: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.deployments.tca-cdap-container:1.0.0" + consul_host: + type: string + default: consul-server.onap.svc.cluster.local + consul_port: + type: string + default: "8500" + cbs_host: + type: string + default: "config-binding-service.dcae.svc.cluster.local" + cbs_port: + type: string + default: "10000" + policy_id: + type: string + default: "none" + external_port: + type: string + description: Kubernetes node port on which CDAPgui is exposed + default: "32010" + +node_templates: + tca_k8s: + type: dcae.nodes.ContainerizedServiceComponent + relationships: + - target: tca_policy + type: cloudify.relationships.depends_on + properties: + service_component_type: 'dcaegen2-analytics-tca' + application_config: {} + docker_config: {} + image: + get_input: tag_version + log_info: + log_directory: "/opt/app/TCAnalytics/logs" + application_config: + app_config: + appDescription: DCAE Analytics Threshold Crossing Alert Application + appName: dcae-tca + tcaAlertsAbatementTableName: TCAAlertsAbatementTable + tcaAlertsAbatementTableTTLSeconds: '1728000' + tcaSubscriberOutputStreamName: TCASubscriberOutputStream + tcaVESAlertsTableName: TCAVESAlertsTable + tcaVESAlertsTableTTLSeconds: '1728000' + tcaVESMessageStatusTableName: TCAVESMessageStatusTable + tcaVESMessageStatusTableTTLSeconds: '86400' + thresholdCalculatorFlowletInstances: '2' + app_preferences: + aaiEnrichmentHost: + get_input: aaiEnrichmentHost + aaiEnrichmentIgnoreSSLCertificateErrors: 'true' + aaiEnrichmentPortNumber: '8443' + aaiEnrichmentProtocol: https + aaiEnrichmentUserName: DCAE + aaiEnrichmentUserPassword: DCAE + aaiVMEnrichmentAPIPath: /aai/v11/search/nodes-query + aaiVNFEnrichmentAPIPath: /aai/v11/network/generic-vnfs/generic-vnf + enableAAIEnrichment: + get_input: enableAAIEnrichment + enableRedisCaching: + get_input: enableRedisCaching + redisHosts: + get_input: redisHosts + enableAlertCEFFormat: 'false' + publisherContentType: application/json + publisherHostName: + get_input: dmaap_host + publisherHostPort: + get_input: dmaap_port + publisherMaxBatchSize: '1' + publisherMaxRecoveryQueueSize: '100000' + publisherPollingInterval: '20000' + publisherProtocol: http + publisherTopicName: unauthenticated.DCAE_CL_OUTPUT + subscriberConsumerGroup: OpenDCAE-c12 + subscriberConsumerId: c12 + subscriberContentType: application/json + subscriberHostName: + get_input: dmaap_host + subscriberHostPort: + get_input: dmaap_port + subscriberMessageLimit: '-1' + subscriberPollingInterval: '30000' + subscriberProtocol: http + subscriberTimeoutMS: '-1' + subscriberTopicName: unauthenticated.VES_MEASUREMENT_OUTPUT + tca_policy: '{"domain":"measurementsForVfScaling","metricsPerEventName":[{"eventName":"vFirewallBroadcastPackets","controlLoopSchemaType":"VNF","policyScope":"DCAE","policyName":"DCAE.Config_tca-hi-lo","policyVersion":"v0.0.1","thresholds":[{"closedLoopControlName":"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta","thresholdValue":300,"direction":"LESS_OR_EQUAL","severity":"MAJOR","closedLoopEventStatus":"ONSET"},{"closedLoopControlName":"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta","thresholdValue":700,"direction":"GREATER_OR_EQUAL","severity":"CRITICAL","closedLoopEventStatus":"ONSET"}]},{"eventName":"vLoadBalancer","controlLoopSchemaType":"VM","policyScope":"DCAE","policyName":"DCAE.Config_tca-hi-lo","policyVersion":"v0.0.1","thresholds":[{"closedLoopControlName":"ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta","thresholdValue":300,"direction":"GREATER_OR_EQUAL","severity":"CRITICAL","closedLoopEventStatus":"ONSET"}]},{"eventName":"Measurement_vGMUX","controlLoopSchemaType":"VNF","policyScope":"DCAE","policyName":"DCAE.Config_tca-hi-lo","policyVersion":"v0.0.1","thresholds":[{"closedLoopControlName":"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value","thresholdValue":0,"direction":"EQUAL","severity":"MAJOR","closedLoopEventStatus":"ABATED"},{"closedLoopControlName":"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value","thresholdValue":0,"direction":"GREATER","severity":"CRITICAL","closedLoopEventStatus":"ONSET"}]}]}' + service_component_type: dcaegen2-analytics_tca + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + envs: + DMAAPHOST: + { get_input: dmaap_host } + DMAAPPORT: + { get_input: dmaap_port } + DMAAPPUBTOPIC: "unauthenticated.DCAE_CL_OUTPUT" + DMAAPSUBTOPIC: "unauthenticated.VES_MEASUREMENT_OUTPUT" + AAIHOST: + { get_input: aaiEnrichmentHost } + AAIPORT: + { get_input: aaiEnrichmentPort } + CONSUL_HOST: + { get_input: consul_host } + CONSUL_PORT: + { get_input: consul_port } + CBS_HOST: + { get_input: cbs_host } + CBS_PORT: + { get_input: cbs_port } + CONFIG_BINDING_SERVICE: "config_binding_service" + ports: + - concat: ["11011:", { get_input: external_port }] + tca_policy: + type: dcae.nodes.policy + properties: + policy_id: + get_input: policy_id + diff --git a/blueprints/k8s-tca.yaml-template b/blueprints/k8s-tca.yaml-template new file mode 100644 index 0000000..09debd2 --- /dev/null +++ b/blueprints/k8s-tca.yaml-template @@ -0,0 +1,160 @@ +# +# ============LICENSE_START==================================================== +# ============================================================================= +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END====================================================== + +tosca_definitions_version: cloudify_dsl_1_3 + +description: > + This blueprint deploys/manages the TCA module as a Docker container + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/k8splugin/1.1.0/k8splugin_types.yaml +inputs: + aaiEnrichmentHost: + type: string + default: "aai.onap.svc.cluster.local" + aaiEnrichmentPort: + type: string + default: "8443" + enableAAIEnrichment: + type: string + default: true + dmaap_host: + type: string + default: message-router.onap.svc.cluster.local + dmaap_port: + type: string + default: "3904" + enableRedisCaching: + type: string + default: false + redisHosts: + type: string + default: dcae-redis.onap.svc.cluster.local:6379 + tag_version: + type: string + default: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.deployments.tca-cdap-container:1.0.0" + consul_host: + type: string + default: consul-server.onap.svc.cluster.local + consul_port: + type: string + default: "8500" + cbs_host: + type: string + default: "config-binding-service.dcae.svc.cluster.local" + cbs_port: + type: string + default: "10000" + policy_id: + type: string + default: "none" + external_port: + type: string + description: Kubernetes node port on which CDAPgui is exposed + default: "32010" + +node_templates: + tca_k8s: + type: dcae.nodes.ContainerizedPlatformComponent + properties: + name: 'dcae-tca-analytics' + dns_name: 'dcae-tca-analytics' + image: + get_input: tag_version + log_info: + log_directory: "/opt/app/TCAnalytics/logs" + application_config: + app_config: + appDescription: DCAE Analytics Threshold Crossing Alert Application + appName: dcae-tca + tcaAlertsAbatementTableName: TCAAlertsAbatementTable + tcaAlertsAbatementTableTTLSeconds: '1728000' + tcaSubscriberOutputStreamName: TCASubscriberOutputStream + tcaVESAlertsTableName: TCAVESAlertsTable + tcaVESAlertsTableTTLSeconds: '1728000' + tcaVESMessageStatusTableName: TCAVESMessageStatusTable + tcaVESMessageStatusTableTTLSeconds: '86400' + thresholdCalculatorFlowletInstances: '2' + app_preferences: + aaiEnrichmentHost: + get_input: aaiEnrichmentHost + aaiEnrichmentIgnoreSSLCertificateErrors: 'true' + aaiEnrichmentPortNumber: '8443' + aaiEnrichmentProtocol: https + aaiEnrichmentUserName: DCAE + aaiEnrichmentUserPassword: DCAE + aaiVMEnrichmentAPIPath: /aai/v11/search/nodes-query + aaiVNFEnrichmentAPIPath: /aai/v11/network/generic-vnfs/generic-vnf + enableAAIEnrichment: + get_input: enableAAIEnrichment + enableRedisCaching: + get_input: enableRedisCaching + redisHosts: + get_input: redisHosts + enableAlertCEFFormat: 'false' + publisherContentType: application/json + publisherHostName: + get_input: dmaap_host + publisherHostPort: + get_input: dmaap_port + publisherMaxBatchSize: '1' + publisherMaxRecoveryQueueSize: '100000' + publisherPollingInterval: '20000' + publisherProtocol: http + publisherTopicName: unauthenticated.DCAE_CL_OUTPUT + subscriberConsumerGroup: OpenDCAE-c12 + subscriberConsumerId: c12 + subscriberContentType: application/json + subscriberHostName: + get_input: dmaap_host + subscriberHostPort: + get_input: dmaap_port + subscriberMessageLimit: '-1' + subscriberPollingInterval: '30000' + subscriberProtocol: http + subscriberTimeoutMS: '-1' + subscriberTopicName: unauthenticated.VES_MEASUREMENT_OUTPUT + tca_policy: '{"domain":"measurementsForVfScaling","metricsPerEventName":[{"eventName":"vFirewallBroadcastPackets","controlLoopSchemaType":"VNF","policyScope":"DCAE","policyName":"DCAE.Config_tca-hi-lo","policyVersion":"v0.0.1","thresholds":[{"closedLoopControlName":"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta","thresholdValue":300,"direction":"LESS_OR_EQUAL","severity":"MAJOR","closedLoopEventStatus":"ONSET"},{"closedLoopControlName":"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta","thresholdValue":700,"direction":"GREATER_OR_EQUAL","severity":"CRITICAL","closedLoopEventStatus":"ONSET"}]},{"eventName":"vLoadBalancer","controlLoopSchemaType":"VM","policyScope":"DCAE","policyName":"DCAE.Config_tca-hi-lo","policyVersion":"v0.0.1","thresholds":[{"closedLoopControlName":"ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta","thresholdValue":300,"direction":"GREATER_OR_EQUAL","severity":"CRITICAL","closedLoopEventStatus":"ONSET"}]},{"eventName":"Measurement_vGMUX","controlLoopSchemaType":"VNF","policyScope":"DCAE","policyName":"DCAE.Config_tca-hi-lo","policyVersion":"v0.0.1","thresholds":[{"closedLoopControlName":"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value","thresholdValue":0,"direction":"EQUAL","severity":"MAJOR","closedLoopEventStatus":"ABATED"},{"closedLoopControlName":"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value","thresholdValue":0,"direction":"GREATER","severity":"CRITICAL","closedLoopEventStatus":"ONSET"}]}]}' + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + envs: + DMAAPHOST: + { get_input: dmaap_host } + DMAAPPORT: + { get_input: dmaap_port } + DMAAPPUBTOPIC: "unauthenticated.DCAE_CL_OUTPUT" + DMAAPSUBTOPIC: "unauthenticated.VES_MEASUREMENT_OUTPUT" + AAIHOST: + { get_input: aaiEnrichmentHost } + AAIPORT: + { get_input: aaiEnrichmentPort } + CONSUL_HOST: + { get_input: consul_host } + CONSUL_PORT: + { get_input: consul_port } + CBS_HOST: + { get_input: cbs_host } + CBS_PORT: + { get_input: cbs_port } + CONFIG_BINDING_SERVICE: "config_binding_service" + ports: + - concat: ["11011:", { get_input: external_port }] + diff --git a/blueprints/k8s-ves.yaml-template b/blueprints/k8s-ves.yaml-template new file mode 100644 index 0000000..56eef34 --- /dev/null +++ b/blueprints/k8s-ves.yaml-template @@ -0,0 +1,114 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# ============================================================================= +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END====================================================== + +tosca_definitions_version: cloudify_dsl_1_3 + +imports: + - "http://www.getcloudify.org/spec/cloudify/3.4/types.yaml" + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/k8splugin/1.1.0/k8splugin_types.yaml + +inputs: + ves_other_publish_url: + type: string + default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.SEC_OTHER_OUTPUT" + #default: "http://10.0.11.1:3904/events/unauthenticated.SEC_OTHER_OUTPUT" + ves_heartbeat_publish_url: + type: string + default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.SEC_HEARTBEAT_OUTPUT" + #default: "http://10.0.11.1:3904/events/unauthenticated.SEC_HEARTBEAT_OUTPUT" + ves_fault_publish_url: + type: string + default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.SEC_FAULT_OUTPUT" + #default: "http://10.0.11.1:3904/events/unauthenticated.SEC_FAULT_OUTPUT" + ves_measurement_publish_url: + type: string + default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.VES_MEASUREMENT_OUTPUT" + #default: "http://10.0.11.1:3904/events/unauthenticated.VES_MEASUREMENT_OUTPUT" + tag_version: + type: string + default: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.collectors.ves.vescollector:1.2.0" + external_port: + type: string + description: Kubernetes node port on which collector is exposed + default: "30235" + replicas: + type: integer + description: number of instances + default: 1 +node_templates: + ves: + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + ports: + - concat: ["8080:", { get_input: external_port }] + properties: + application_config: + collector.dmaap.streamid: fault=ves_fault|syslog=ves_syslog|heartbeat=ves_heartbeat|measurementsForVfScaling=ves_measurement|mobileFlow=ves_mobileflow|other=ves_other|stateChange=ves_statechange|thresholdCrossingAlert=ves_thresholdCrossingAlert|voiceQuality=ves_voicequality|sipSignaling=ves_sipsignaling + collector.inputQueue.maxPending: "8096" + collector.keystore.alias: "dynamically generated" + collector.keystore.file.location: /opt/app/VESCollector/etc/keystore + collector.keystore.passwordfile: /opt/app/VESCollector/etc/passwordfile + collector.schema.checkflag: "1" + collector.schema.file: "{\"v1\":\"./etc/CommonEventFormat_27.2.json\",\"v2\":\"./etc/CommonEventFormat_27.2.json\",\"v3\":\"./etc/CommonEventFormat_27.2.json\",\"v4\":\"./etc/CommonEventFormat_27.2.json\",\"v5\":\"./etc/CommonEventFormat_28.4.1.json\"}" + collector.service.port: "8080" + collector.service.secure.port: "8443" + event.transform.flag: "0" + header.authflag: "0" + header.authlist: "userid1,base64encodepwd1|userid2,base64encodepwd2" + services_calls: [] + streams_publishes: + ves_fault: + dmaap_info: + topic_url: + get_input: ves_fault_publish_url + type: message_router + ves_measurement: + dmaap_info: + topic_url: + get_input: ves_measurement_publish_url + type: message_router + ves_heartbeat: + dmaap_info: + topic_url: + get_input: ves_heartbeat_publish_url + type: message_router + ves_other: + dmaap_info: + topic_url: + get_input: ves_other_publish_url + type: message_router + tomcat.maxthreads: "200" + docker_config: + healthcheck: + endpoint: /healthcheck + interval: 15s + timeout: 1s + type: http + image: + get_input: tag_version + replicas: {get_input: replicas} + name: 'dcae-ves-collector' + dns_name: 'dcae-ves-collector' + log_info: + log_directory: "/opt/app/VESCollector/logs/ecomp" + type: dcae.nodes.ContainerizedPlatformComponent + + diff --git a/blueprints/pgaas-cluster.yaml-template b/blueprints/pgaas-cluster.yaml-template index a08df40..d7b0cd0 100644 --- a/blueprints/pgaas-cluster.yaml-template +++ b/blueprints/pgaas-cluster.yaml-template @@ -38,13 +38,13 @@ imports: - http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/relationshipplugin/1/relationshipplugin_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/pgaas_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" inputs: blueprint_version: type: string - default: 'VERSION-STAMP-GOES-HERE' + default: '2018-04-27T00:31:38+0000' # pgaas-specific info pgaas_cluster_name: diff --git a/blueprints/pgaas-database.yaml-template b/blueprints/pgaas-database.yaml-template index d3e58e3..a89d638 100644 --- a/blueprints/pgaas-database.yaml-template +++ b/blueprints/pgaas-database.yaml-template @@ -35,12 +35,12 @@ description: |- imports: - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/pgaas_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" inputs: blueprint_version: type: string - default: 'VERSION-STAMP-GOES-HERE' + default: '2018-03-29T14:28:59+0000' # pgaas-specific info pgaas_cluster_name: diff --git a/blueprints/pgaas-disk.yaml-template b/blueprints/pgaas-disk.yaml-template index fc97893..3f96bae 100644 --- a/blueprints/pgaas-disk.yaml-template +++ b/blueprints/pgaas-disk.yaml-template @@ -40,13 +40,13 @@ imports: - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml" - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/sshkeyshare/sshkey_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/relationshipplugin/1/relationshipplugin_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/pgaas_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" inputs: blueprint_version: type: string - default: 'VERSION-STAMP-GOES-HERE' + default: '2018-04-27T00:31:38+0000' # pgaas-specific info pgaas_cluster_name: diff --git a/blueprints/pgaas-getdbinfo.yaml-template b/blueprints/pgaas-getdbinfo.yaml-template index e37c604..8672f04 100644 --- a/blueprints/pgaas-getdbinfo.yaml-template +++ b/blueprints/pgaas-getdbinfo.yaml-template @@ -35,7 +35,7 @@ description: |- imports: - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/pgaas_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" inputs: location_domain: diff --git a/blueprints/pgaas-onevm.yaml-template b/blueprints/pgaas-onevm.yaml-template index 213a35f..be2d044 100644 --- a/blueprints/pgaas-onevm.yaml-template +++ b/blueprints/pgaas-onevm.yaml-template @@ -31,13 +31,13 @@ imports: - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml" - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/sshkeyshare/sshkey_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/relationshipplugin/1/relationshipplugin_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/pgaas_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" inputs: blueprint_version: type: string - default: 'VERSION-STAMP-GOES-HERE' + default: '2018-04-27T00:31:38+0000' # pgaas-specific info pgaas_cluster_name: diff --git a/blueprints/pgaas.yaml-template b/blueprints/pgaas.yaml-template index 845ba72..4a7e16a 100644 --- a/blueprints/pgaas.yaml-template +++ b/blueprints/pgaas.yaml-template @@ -31,13 +31,13 @@ imports: - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml" - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/sshkeyshare/sshkey_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/relationshipplugin/1/relationshipplugin_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/pgaas_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" inputs: blueprint_version: type: string - default: 'VERSION-STAMP-GOES-HERE' + default: '2018-04-27T00:31:38+0000' # pgaas-specific info pgaas_cluster_name: diff --git a/blueprints/policy_handler.yaml-template b/blueprints/policy_handler.yaml-template index 7e28cc2..5827e31 100644 --- a/blueprints/policy_handler.yaml-template +++ b/blueprints/policy_handler.yaml-template @@ -1,9 +1,7 @@ # -*- indent-tabs-mode: nil -*- # vi: set expandtab: # # ============LICENSE_START======================================================= -# org.onap.dcae -# ================================================================================ -# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -27,8 +25,8 @@ description: > imports: - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/relationshipplugin/1/relationshipplugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/3/dockerplugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml inputs: @@ -41,7 +39,7 @@ inputs: policy_handler_image: description: Docker image for policy_handler - default: '{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.policy-handler:v1.1.0' + default: '{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.policy-handler:3.0.1' application_config: description: policy handler application configuration - requires info on policy-engine @@ -54,6 +52,12 @@ node_templates: name: 'policy_handler' image: { get_input: policy_handler_image } application_config: { get_input: application_config } + docker_config: + healthcheck: + type: 'http' + interval: '300s' + timeout: '25s' + endpoint: '/healthcheck' relationships: - type: dcae.relationships.component_contained_in target: docker_host diff --git a/blueprints/policy_handler_sample_app_config.yaml b/blueprints/policy_handler_sample_app_config.yaml deleted file mode 100644 index acfc645..0000000 --- a/blueprints/policy_handler_sample_app_config.yaml +++ /dev/null @@ -1,57 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START======================================================= -# org.onap.dcae -# ================================================================================ -# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. -# ================================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END========================================================= -# -# ECOMP is a trademark and service mark of AT&T Intellectual Property. - -# File: policy_handler_sample_app_config.yaml contains sample application config for policy-handler of DCAE Controller - -application_config: - policy_handler : - # parallelize the getConfig queries to policy-engine on each policy-update notification - thread_pool_size : 4 - - # parallelize requests to policy-engine and keep them alive - pool_connections : 20 - - # list of policyName prefixes (filters) that DCAE-Controller handles (=ignores any other policyName values) - scope_prefixes : ["DCAE.Config_"] - - # retry to getConfig from policy-engine on policy-update notification - policy_retry_count : 5 - policy_retry_sleep : 5 - - # policy-engine config - # These are the url of and the auth for the external system, namely the policy-engine (PDP). - # We obtain that info manually from PDP folks at the moment. - # In long run we should figure out a way of bringing that info into consul record - # related to policy-engine itself. - policy_engine : - url : "{{ YOUR_POLICY_ENGINE_URL }}" - path_pdp : "/pdp/" - path_api : "/pdp/api/" - headers : - Accept : "application/json" - "Content-Type" : "application/json" - ClientAuth : "Basic {{ YOUR_POLICY_ENGINE_CLIENT_AUTH }}" - Authorization : "Basic {{ YOUR_POLICY_ENGINE_AUTHORIZATION }}" - Environment : "{{ YOUR_POLICY_ENGINE_ENVIRONMENT }}" - target_entity : "policy_engine" - # name of deployment-handler service in consul for policy-handler to direct the policy-updates to - deploy_handler : "deployment_handler" diff --git a/blueprints/prh-service.yaml-template b/blueprints/prh-service.yaml-template new file mode 100644 index 0000000..797cac0 --- /dev/null +++ b/blueprints/prh-service.yaml-template @@ -0,0 +1,61 @@ +tosca_definitions_version: cloudify_dsl_1_3 +imports: +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" +inputs: + prh_publish_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.SO_OUTPUT" + prh_subscribe_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.SEC_OTHER_OUTPUT" + docker_host_override: + type: string + default: "component_dockerhost" + dh_location_id: + type: string + default: "zone1" + tag_version: + type: string + default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.prh:1.0" + + +node_templates: + docker_service_host: + type: dcae.nodes.SelectedDockerHost + properties: + docker_host_override: + get_input: docker_host_override + location_id: + get_input: dh_location_id + heartbeatService: + type: dcae.nodes.DockerContainerForComponentsUsingDmaap + properties: + application_config: + streams_publishes: + dcae_cl_out: + dmaap_info: + topic_url: + get_input: prh_publish_url + type: message_router + streams_subscribes: + heartbeat_fault: + dmaap_info: + topic_url: + get_input: prh_subcribe_url + type: message_router + docker_config: + healthcheck: + script: /app/bin/check_health.py + interval: 18s + timeout: 30s + type: docker + image: + get_input: tag_version + location_id: + get_input: dh_location_id + service_component_type: dcaegen2-services-prh + relationships: + - target: docker_service_host + type: dcae.relationships.component_contained_in + diff --git a/blueprints/snmptrap-collector.yaml-template b/blueprints/snmptrap-collector.yaml-template new file mode 100644 index 0000000..694fde5 --- /dev/null +++ b/blueprints/snmptrap-collector.yaml-template @@ -0,0 +1,95 @@ +tosca_definitions_version: cloudify_dsl_1_3 +imports: +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" +inputs: + snmp_publish_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.ONAP-COLLECTOR-SNMPTRAP" + docker_host_override: + type: string + default: "component_dockerhost" + dh_location_id: + type: string + default: "zone1" + tag_version: + type: string + default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.snmptrap:1.3" + +node_templates: + docker_service_host: + type: dcae.nodes.SelectedDockerHost + properties: + docker_host_override: + get_input: docker_host_override + location_id: + get_input: dh_location_id + heartbeatService: + type: dcae.nodes.DockerContainerForComponentsUsingDmaap + properties: + application_config: + streams_publishes: + dcae_cl_out: + dmaap_info: + topic_url: + get_input: snmp_publish_url + type: message_router + snmptrap.version: "1.3.0" + snmptrap.title: "ONAP SNMP Trap Receiver" + protocols.transport: "udp" + protocols.ipv4_interface: "0.0.0.0" + protocols.ipv4_port: 162 + protocols.ipv6_interface: "::1" + protocols.ipv6_port: 162 + cache.dns_cache_ttl_seconds: 60 + publisher.http_timeout_milliseconds: 1500 + publisher.http_retries: 3 + publisher.http_milliseconds_between_retries: 750 + publisher.http_primary_publisher: "true" + publisher.http_peer_publisher: "unavailable" + publisher.max_traps_between_publishes: 10 + publisher.max_milliseconds_between_publishes: 10000 + files.runtime_base_dir: "/opt/app/snmptrap" + files.log_dir: "logs" + files.data_dir: "data" + files.pid_dir: "tmp" + files.arriving_traps_log: "snmptrapd_arriving_traps.log" + files.snmptrapd_diag: "snmptrapd_prog_diag.log" + files.traps_stats_log: "snmptrapd_stats.csv" + files.perm_status_file: "snmptrapd_status.log" + files.eelf_base_dir: "/opt/app/snmptrap/logs" + files.eelf_error: "error.log" + files.eelf_debug: "debug.log" + files.eelf_audit: "audit.log" + files.eelf_metrics: "metrics.log" + files.roll_frequency: "hour" + files.minimum_severity_to_log: 2 + trap_def.1.trap_oid" : ".1.3.6.1.4.1.74.2.46.12.1.1" + trap_def.1.trap_category: "DCAE-SNMP-TRAPS" + trap_def.2.trap_oid" : "*" + trap_def.2.trap_category: "DCAE-SNMP-TRAPS" + stormwatch.1.stormwatch_oid" : ".1.3.6.1.4.1.74.2.46.12.1.1" + stormwatch.1.low_water_rearm_per_minute" : "5" + stormwatch.1.high_water_arm_per_minute" : "100" + stormwatch.2.stormwatch_oid" : ".1.3.6.1.4.1.74.2.46.12.1.2" + stormwatch.2.low_water_rearm_per_minute" : "2" + stormwatch.2.high_water_arm_per_minute" : "200" + stormwatch.3.stormwatch_oid" : ".1.3.6.1.4.1.74.2.46.12.1.2" + stormwatch.3.low_water_rearm_per_minute" : "2" + stormwatch.3.high_water_arm_per_minute" : "200" + docker_config: + healthcheck: + script: /app/bin/check_health.py + interval: 18s + timeout: 30s + type: docker + image: + get_input: tag_version + + location_id: + get_input: dh_location_id + service_component_type: dcaegen2-collectors-snmptrap + relationships: + - target: docker_service_host + type: dcae.relationships.component_contained_in + diff --git a/blueprints/tca.yaml-template b/blueprints/tca.yaml-template index e48434d..9699456 100644 --- a/blueprints/tca.yaml-template +++ b/blueprints/tca.yaml-template @@ -3,7 +3,7 @@ imports: - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/cdapcloudify/14/cdapcloudify_types.yaml - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dcaepolicyplugin/1/dcaepolicyplugin_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/relationshipplugin/1/relationshipplugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml inputs: connected_broker_dns_name: @@ -65,7 +65,7 @@ node_templates: subscriberPollingInterval: '30000' subscriberProtocol: http subscriberTimeoutMS: '-1' - subscriberTopicName: unauthenticated.SEC_MEASUREMENT_OUTPUT + subscriberTopicName: unauthenticated.VES_MEASUREMENT_OUTPUT tca_policy: '{"domain":"measurementsForVfScaling","metricsPerEventName":[{"eventName":"vFirewallBroadcastPackets","controlLoopSchemaType":"VNF","policyScope":"DCAE","policyName":"DCAE.Config_tca-hi-lo","policyVersion":"v0.0.1","thresholds":[{"closedLoopControlName":"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta","thresholdValue":300,"direction":"LESS_OR_EQUAL","severity":"MAJOR","closedLoopEventStatus":"ONSET"},{"closedLoopControlName":"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta","thresholdValue":700,"direction":"GREATER_OR_EQUAL","severity":"CRITICAL","closedLoopEventStatus":"ONSET"}]},{"eventName":"vLoadBalancer","controlLoopSchemaType":"VM","policyScope":"DCAE","policyName":"DCAE.Config_tca-hi-lo","policyVersion":"v0.0.1","thresholds":[{"closedLoopControlName":"ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta","thresholdValue":300,"direction":"GREATER_OR_EQUAL","severity":"CRITICAL","closedLoopEventStatus":"ONSET"}]},{"eventName":"Measurement_vGMUX","controlLoopSchemaType":"VNF","policyScope":"DCAE","policyName":"DCAE.Config_tca-hi-lo","policyVersion":"v0.0.1","thresholds":[{"closedLoopControlName":"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value","thresholdValue":0,"direction":"EQUAL","severity":"MAJOR","closedLoopEventStatus":"ABATED"},{"closedLoopControlName":"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value","thresholdValue":0,"direction":"GREATER","severity":"CRITICAL","closedLoopEventStatus":"ONSET"}]}]}' artifact_name: dcae-analytics-cdap-tca artifact_version: 2.0.0 diff --git a/blueprints/tcadocker-service.yaml-template b/blueprints/tcadocker-service.yaml-template new file mode 100644 index 0000000..6e536e2 --- /dev/null +++ b/blueprints/tcadocker-service.yaml-template @@ -0,0 +1,192 @@ +# +# ============LICENSE_START==================================================== +# org.onap.dcae +# ============================================================================= +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END====================================================== + +tosca_definitions_version: cloudify_dsl_1_3 + + +imports: + - "http://www.getcloudify.org/spec/cloudify/3.4/types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/dockerplugin/3.2.0/dockerplugin_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/dcaepolicyplugin/2.3.0/dcaepolicyplugin_types.yaml" +inputs: + aaiEnrichmentHost: + default: none + type: string + aaiEnrichmentPort: + default: 8443 + type: string + cbs_host: + default: config-binding-service.dcae + type: string + cbs_port: + default: "10000" + type: string + consul_host: + default: consul-server.onap-consul + type: string + consul_port: + default: "8500" + type: string + dh_location_id: + default: zone1 + type: string + dh_override: + default: component_dockerhost + type: string + dmaap_host: + default: dmaap.onap-message-router + type: string + dmaap_port: + default: 3904 + type: string + enableAAIEnrichment: + default: false + type: string + enableRedisCaching: + default: false + type: string + external_port: + default: "32016" + description: "Port for CDAPgui to be exposed" + type: string + policy_id: + default: none + type: string + redisHosts: + type: string + tag_version: + default: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.deployments.tca-cdap-container:1.0.0" + type: string +node_templates: + docker_service_host: + properties: + docker_host_override: + get_input: dh_override + location_id: + get_input: dh_location_id + type: dcae.nodes.SelectedDockerHost + tca_docker: + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + envs: + AAIHOST: + get_input: aaiEnrichmentHost + AAIPORT: + get_input: aaiEnrichmentPort + CBS_HOST: + get_input: cbs_host + CBS_PORT: + get_input: cbs_port + CONFIG_BINDING_SERVICE: config_binding_service + CONSUL_HOST: + get_input: consul_host + CONSUL_PORT: + get_input: consul_port + DMAAPHOST: + get_input: dmaap_host + DMAAPPORT: + get_input: dmaap_port + DMAAPPUBTOPIC: unauthenticated.DCAE_CL_OUTPUT + DMAAPSUBTOPIC: unauthenticated.VES_MEASUREMENT_OUTPUT +# SERVICE_11011_IGNORE: "true" + SERVICE_11015_IGNORE: "true" + ports: + - concat: ["11011:", { get_input: external_port }] + stop: + inputs: + cleanup_image: true + properties: + application_config: + app_config: + appDescription: "DCAE Analytics Threshold Crossing Alert Application" + appName: dcae-tca + tcaAlertsAbatementTableName: TCAAlertsAbatementTable + tcaAlertsAbatementTableTTLSeconds: "1728000" + tcaSubscriberOutputStreamName: TCASubscriberOutputStream + tcaVESAlertsTableName: TCAVESAlertsTable + tcaVESAlertsTableTTLSeconds: "1728000" + tcaVESMessageStatusTableName: TCAVESMessageStatusTable + tcaVESMessageStatusTableTTLSeconds: "86400" + thresholdCalculatorFlowletInstances: "2" + app_preferences: + aaiEnrichmentHost: + get_input: aaiEnrichmentHost + aaiEnrichmentIgnoreSSLCertificateErrors: "true" + aaiEnrichmentPortNumber: "8443" + aaiEnrichmentProtocol: https + aaiEnrichmentUserName: DCAE + aaiEnrichmentUserPassword: DCAE + aaiVMEnrichmentAPIPath: /aai/v11/search/nodes-query + aaiVNFEnrichmentAPIPath: /aai/v11/network/generic-vnfs/generic-vnf + enableAAIEnrichment: + get_input: enableAAIEnrichment + enableAlertCEFFormat: "false" + enableRedisCaching: + get_input: enableRedisCaching + publisherContentType: application/json + publisherHostName: + get_input: dmaap_host + publisherHostPort: + get_input: dmaap_port + publisherMaxBatchSize: "1" + publisherMaxRecoveryQueueSize: "100000" + publisherPollingInterval: "20000" + publisherProtocol: http + publisherTopicName: unauthenticated.DCAE_CL_OUTPUT + redisHosts: + get_input: redisHosts + subscriberConsumerGroup: OpenDCAE-c12 + subscriberConsumerId: c12 + subscriberContentType: application/json + subscriberHostName: + get_input: dmaap_host + subscriberHostPort: + get_input: dmaap_port + subscriberMessageLimit: "-1" + subscriberPollingInterval: "30000" + subscriberProtocol: http + subscriberTimeoutMS: "-1" + subscriberTopicName: unauthenticated.VES_MEASUREMENT_OUTPUT + tca_policy: "{\"domain\":\"measurementsForVfScaling\",\"metricsPerEventName\":[{\"eventName\":\"vFirewallBroadcastPackets\",\"controlLoopSchemaType\":\"VNF\",\"policyScope\":\"DCAE\",\"policyName\":\"DCAE.Config_tca-hi-lo\",\"policyVersion\":\"v0.0.1\",\"thresholds\":[{\"closedLoopControlName\":\"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a\",\"version\":\"1.0.2\",\"fieldPath\":\"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\",\"thresholdValue\":300,\"direction\":\"LESS_OR_EQUAL\",\"severity\":\"MAJOR\",\"closedLoopEventStatus\":\"ONSET\"},{\"closedLoopControlName\":\"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a\",\"version\":\"1.0.2\",\"fieldPath\":\"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\",\"thresholdValue\":700,\"direction\":\"GREATER_OR_EQUAL\",\"severity\":\"CRITICAL\",\"closedLoopEventStatus\":\"ONSET\"}]},{\"eventName\":\"vLoadBalancer\",\"controlLoopSchemaType\":\"VM\",\"policyScope\":\"DCAE\",\"policyName\":\"DCAE.Config_tca-hi-lo\",\"policyVersion\":\"v0.0.1\",\"thresholds\":[{\"closedLoopControlName\":\"ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3\",\"version\":\"1.0.2\",\"fieldPath\":\"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\",\"thresholdValue\":300,\"direction\":\"GREATER_OR_EQUAL\",\"severity\":\"CRITICAL\",\"closedLoopEventStatus\":\"ONSET\"}]},{\"eventName\":\"Measurement_vGMUX\",\"controlLoopSchemaType\":\"VNF\",\"policyScope\":\"DCAE\",\"policyName\":\"DCAE.Config_tca-hi-lo\",\"policyVersion\":\"v0.0.1\",\"thresholds\":[{\"closedLoopControlName\":\"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e\",\"version\":\"1.0.2\",\"fieldPath\":\"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value\",\"thresholdValue\":0,\"direction\":\"EQUAL\",\"severity\":\"MAJOR\",\"closedLoopEventStatus\":\"ABATED\"},{\"closedLoopControlName\":\"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e\",\"version\":\"1.0.2\",\"fieldPath\":\"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value\",\"thresholdValue\":0,\"direction\":\"GREATER\",\"severity\":\"CRITICAL\",\"closedLoopEventStatus\":\"ONSET\"}]}]}" + docker_config: + healthcheck: + endpoint: / + interval: 15s + timeout: 1s + type: http + image: + get_input: tag_version + service_component_type: dcaegen2-analytics_tca + relationships: + - + target: docker_service_host + type: dcae.relationships.component_contained_in + - + target: tca_policy + type: cloudify.relationships.depends_on + type: dcae.nodes.DockerContainerForComponentsUsingDmaap + tca_policy: + properties: + policy_id: + get_input: policy_id + type: dcae.nodes.policy + diff --git a/blueprints/ves.yaml-template b/blueprints/ves.yaml-template index ef65f9a..4b5a5a5 100644 --- a/blueprints/ves.yaml-template +++ b/blueprints/ves.yaml-template @@ -24,21 +24,30 @@ tosca_definitions_version: cloudify_dsl_1_3 imports: - "http://www.getcloudify.org/spec/cloudify/3.4/types.yaml" - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/relationshipplugin/1/relationshipplugin_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" inputs: + ves_other_publish_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.SEC_OTHER_OUTPUT" + ves_heartbeat_publish_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.SEC_HEARTBEAT_OUTPUT" ves_fault_publish_url: type: string default: "http://10.0.11.1:3904/events/unauthenticated.SEC_FAULT_OUTPUT" ves_measurement_publish_url: type: string - default: "http://10.0.11.1:3904/events/unauthenticated.SEC_MEASUREMENT_OUTPUT" + default: "http://10.0.11.1:3904/events/unauthenticated.VES_MEASUREMENT_OUTPUT" dh_override: type: string default: "component_dockerhost" dh_location_id: type: string default: "zone1" + tag_version: + type: string + default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.ves.vescollector:1.1-latest" node_templates: docker_collector_host: @@ -91,7 +100,8 @@ node_templates: interval: 15s timeout: 1s type: http - image: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.collectors.ves.vescollector:v1.1.0" + image: + get_input: tag_version service_component_type: dcaegen2-collectors-ves relationships: - type: dcae.relationships.component_contained_in diff --git a/check-blueprint-vs-input/lib/sample-inputs.yaml b/check-blueprint-vs-input/lib/sample-inputs.yaml index 6e888b0..a56652b 100644 --- a/check-blueprint-vs-input/lib/sample-inputs.yaml +++ b/check-blueprint-vs-input/lib/sample-inputs.yaml @@ -1,3 +1,20 @@ +# ================================================================================ +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. centos7image_id: 'some-value-in-guid-format' ubuntu1604image_id: 'another-value-in-guid-format' flavor_id: '4' diff --git a/input-templates/cdap-sdk-inputs.yaml b/input-templates/cdap-sdk-inputs.yaml new file mode 100644 index 0000000..e55c796 --- /dev/null +++ b/input-templates/cdap-sdk-inputs.yaml @@ -0,0 +1,22 @@ +# ================================================================================ +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +{ + "dh_location_id": "{{ dcae_zone }}", + "dh_override": "component_dockerhost", + "cdap_cluster_name": "cdap" +} diff --git a/input-templates/cdapinputs.yaml b/input-templates/cdapinputs.yaml index 496a922..879b59c 100644 --- a/input-templates/cdapinputs.yaml +++ b/input-templates/cdapinputs.yaml @@ -1,3 +1,20 @@ +# ================================================================================ +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. ubuntu1604image_id: '{{ ubuntu_1604_image }}' centos7image_id: '{{ centos_7_image }}' flavor_id: '{{ flavor_id_cdap }}' diff --git a/input-templates/dhinputs.yaml b/input-templates/dhinputs.yaml index ad51a25..9014ac6 100644 --- a/input-templates/dhinputs.yaml +++ b/input-templates/dhinputs.yaml @@ -1,3 +1,20 @@ +# ================================================================================ +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. application_config: cloudify: protocol: "http" diff --git a/input-templates/he-ip.yaml b/input-templates/he-ip.yaml index 509b0ee..284aa2d 100644 --- a/input-templates/he-ip.yaml +++ b/input-templates/he-ip.yaml @@ -1,3 +1,20 @@ +# ================================================================================ +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. { "dh_location_id": "{{ dcae_zone }}", "docker_host_override": "component_dockerhost", diff --git a/input-templates/heartbeat-input.json b/input-templates/heartbeat-input.json new file mode 100644 index 0000000..eaf13a3 --- /dev/null +++ b/input-templates/heartbeat-input.json @@ -0,0 +1,7 @@ +{ + "dh_location_id": "{{ dcae_zone }}", + "docker_host_override": "component_dockerhost", + "dcae_CL_publish_url": "http://{{ mr_ip_addr }}:3904/events/unauthenticated.DCAE_CL_OUTPUT/", + "ves_heartbeat_url": "http://{{ mr_ip_addr }}:3904/events/unauthenticated.SEC_HEARTBEAT_OUTPUT/", + "tag_version": "nexus3.onap.org:10001/onap/org.onap.dcaegen2.platform.heartbeat:2.0" +} diff --git a/input-templates/hr-ip.yaml b/input-templates/hr-ip.yaml index f3ca7bc..10c65e0 100644 --- a/input-templates/hr-ip.yaml +++ b/input-templates/hr-ip.yaml @@ -1,3 +1,20 @@ +# ================================================================================ +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. { "dh_location_id": "{{ dcae_zone }}", "docker_host_override": "component_dockerhost", diff --git a/input-templates/inputs.yaml b/input-templates/inputs.yaml index f6cb432..b87a760 100644 --- a/input-templates/inputs.yaml +++ b/input-templates/inputs.yaml @@ -1,3 +1,20 @@ +# ================================================================================ +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. ubuntu1604image_id: '{{ ubuntu_1604_image }}' centos7image_id: '{{ centos_7_image }}' flavor_id: '{{ flavor_id }}' diff --git a/input-templates/invinputs.yaml b/input-templates/invinputs.yaml index 260b3a2..9701b9b 100644 --- a/input-templates/invinputs.yaml +++ b/input-templates/invinputs.yaml @@ -1,3 +1,20 @@ +# ================================================================================ +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. docker_host_override: "platform_dockerhost" asdc_address: '{{ sdc_ip_addr }}:8443' asdc_uri: 'https://{{ sdc_ip_addr }}:8443' diff --git a/input-templates/phinputs.yaml b/input-templates/phinputs.yaml index 07ba828..d79511d 100644 --- a/input-templates/phinputs.yaml +++ b/input-templates/phinputs.yaml @@ -1,3 +1,21 @@ +# ================================================================================ +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. + application_config: policy_handler : # parallelize the getConfig queries to policy-engine on each policy-update notification @@ -7,12 +25,27 @@ application_config: pool_connections : 20 # list of policyName prefixes (filters) that DCAE-Controller handles (=ignores any other policyName values) - scope_prefixes : ["DCAE.Config_"] + scope_prefixes : ["DCAE.Config_", "CLAMP"] # retry to getConfig from policy-engine on policy-update notification policy_retry_count : 5 policy_retry_sleep : 5 + # config of automatic catch_up for resiliency + catch_up : + # interval in seconds on how often to call automatic catch_up + # example: 1200 is 20*60 seconds that is 20 minutes + interval : 1200 + # max_skips is the maximal number of times the auto catch_up can be skipped + # to reduce sending of identically the same messages to the deployment-handler + # example: if nothing changes in policy-engine + # the policy-handler will still send the identicall cathc_up message + # to deployment handler roughly every (max_skips + 1) * interval seconds + # instead of sending the changed message every interval seconds + # in this case of max_skips = 5 the catch_up message will be sent + # roughly every 2 hours = (5+1) * 1200 = 6 * 20 * 60 seconds = 2 * 60 * 60 + max_skips : 5 + # policy-engine config # These are the url of and the auth for the external system, namely the policy-engine (PDP). # We obtain that info manually from PDP folks at the moment. @@ -29,5 +62,11 @@ application_config: Authorization : "Basic dGVzdHBkcDphbHBoYTEyMw==" Environment : "TEST" target_entity : "policy_engine" - # name of deployment-handler service in consul for policy-handler to direct the policy-updates to - deploy_handler : "deployment_handler" + # deploy_handler config + # changed from string "deployment_handler" in 2.3.1 to structure in 2.4.0 + deploy_handler : + # name of deployment-handler service used by policy-handler for logging + target_entity : "deployment_handler" + # url of the deployment-handler service for policy-handler to direct the policy-updates to + # - expecting dns to resolve the hostname deployment-handler to ip address + url : "http://deployment-handler:8188" diff --git a/input-templates/prh-input.json b/input-templates/prh-input.json new file mode 100644 index 0000000..0207309 --- /dev/null +++ b/input-templates/prh-input.json @@ -0,0 +1,7 @@ +{ + "dh_location_id": "{{ dcae_zone }}", + "docker_host_override": "component_dockerhost", + "prh_publish_url": "http://{{ mr_ip_addr }}:3904/events/unauthenticated.unauthenticated.PNF_READY/", + "prh_subscribe_url": "http://{{ mr_ip_addr }}:3904/events/unauthenticated.SEC_OTHER_OUTPUT/", + "tag_version": "nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.prh:1.0" +} diff --git a/input-templates/prh-input.yaml b/input-templates/prh-input.yaml new file mode 100644 index 0000000..6b54630 --- /dev/null +++ b/input-templates/prh-input.yaml @@ -0,0 +1,26 @@ +# ================================================================================ +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= + +#aaiEnrichmentHost: '{{ aaiEnrichmentHost }}' +#aaiEnrichmentPort: '{{ aaiEnrichmentPort }}' +#aaiEnrichmentUser: '{{ aaiEnrichmentUser }}' +#aaiEnrichmentPasswd: '{{ aaiEnrichmentPasswd }}' +#dmaap_host: '{{ dmaap_host }}' +#dmaap_port: '{{ dmaap_port }}' +#dmaap_user: '{{ dmaap_user }}' +#dmaap_passwd: '{{ dmaap_passwd }}' +#tag_version: '{{ tag_version }}' +#replicas: '{{ replicas }}'
\ No newline at end of file diff --git a/input-templates/snmptrap-input.json b/input-templates/snmptrap-input.json new file mode 100644 index 0000000..b3be3df --- /dev/null +++ b/input-templates/snmptrap-input.json @@ -0,0 +1,7 @@ + +{ + "dh_location_id": "{{ dcae_zone }}", + "docker_host_override": "component_dockerhost", + "snmp_publish_url": "http://{{ mr_ip_addr }}:3904/events/unauthenticated.ONAP-COLLECTOR-SNMPTRAP/", + "tag_version": "nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.snmptrap:1.3" +} diff --git a/input-templates/tcadocker-input.json b/input-templates/tcadocker-input.json new file mode 100644 index 0000000..56a1681 --- /dev/null +++ b/input-templates/tcadocker-input.json @@ -0,0 +1,11 @@ +{ + "aaiEnrichmentHost": "{{ aai1_ip_addr }}", + "enableAAIEnrichment": true, + "subscriberHostName": "{{ mr_ip_addr }}", + "publisherHostName": "{{ mr_ip_addr }}", + "dh_location_id": "{{ dcae_zone }}", + "dh_override": "component_dockerhost", + "redisHosts": "{{ redis_ip_port_addr }}", + "enableRedisCaching": true, + "tag_version": "nexus3.onap.org:10001/onap/tca-cdap-container:1.0" +} diff --git a/input-templates/tcainputs.yaml b/input-templates/tcainputs.yaml index ecd6407..a4d3828 100644 --- a/input-templates/tcainputs.yaml +++ b/input-templates/tcainputs.yaml @@ -1,4 +1,21 @@ +# ================================================================================ +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. aaiEnrichmentHost: '{{ aai1_ip_addr }}' enableAAIEnrichment: true subscriberHostName: '{{ mr_ip_addr }}' -publisherHostName: '{{ mr_ip_addr }}'
\ No newline at end of file +publisherHostName: '{{ mr_ip_addr }}' diff --git a/input-templates/vesinput.yaml b/input-templates/vesinput.yaml index cb5c542..d11e630 100644 --- a/input-templates/vesinput.yaml +++ b/input-templates/vesinput.yaml @@ -1,6 +1,25 @@ +# ================================================================================ +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. { "dh_location_id": "{{ dcae_zone }}", "dh_override": "component_dockerhost", + "ves_other_publish_url": "http://{{ mr_ip_addr }}:3904/events/unauthenticated.SEC_OTHER_OUTPUT/", + "ves_heartbeat_publish_url": "http://{{ mr_ip_addr }}:3904/events/unauthenticated.SEC_HEARTBEAT_OUTPUT/", "ves_fault_publish_url": "http://{{ mr_ip_addr }}:3904/events/unauthenticated.SEC_FAULT_OUTPUT/", "ves_measurement_publish_url": "http://{{ mr_ip_addr }}:3904/events/unauthenticated.SEC_MEASUREMENT_OUTPUT/" } diff --git a/mvn-phase-lib.sh b/mvn-phase-lib.sh deleted file mode 100755 index d855abc..0000000 --- a/mvn-phase-lib.sh +++ /dev/null @@ -1,470 +0,0 @@ -#!/bin/bash - -# ================================================================================ -# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. -# ================================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END========================================================= -# -# ECOMP is a trademark and service mark of AT&T Intellectual Property. - - -#MVN_PROJECT_MODULEID="$1" -#MVN_PHASE="$2" -#PROJECT_ROOT=$(dirname $0) - -FQDN="${MVN_PROJECT_GROUPID}.${MVN_PROJECT_ARTIFACTID}" -if [ "$MVN_PROJECT_MODULEID" == "__" ]; then - MVN_PROJECT_MODULEID="" -fi - -if [[ "$MVN_PROJECT_VERSION" == *SNAPSHOT ]]; then - echo "=> for SNAPSHOT artifact build" - MVN_DEPLOYMENT_TYPE='SNAPSHOT' -else - echo "=> for STAGING/RELEASE artifact build" - MVN_DEPLOYMENT_TYPE='STAGING' -fi -echo "MVN_DEPLOYMENT_TYPE is [$MVN_DEPLOYMENT_TYPE]" - - -TIMESTAMP=$(date +%C%y%m%dT%H%M%S) - -# expected environment variables -if [ -z "${MVN_NEXUSPROXY}" ]; then - echo "MVN_NEXUSPROXY environment variable not set. Cannot proceed" - exit -fi -MVN_NEXUSPROXY_HOST=$(echo "$MVN_NEXUSPROXY" |cut -f3 -d'/' | cut -f1 -d':') -echo "=> Nexus Proxy at $MVN_NEXUSPROXY_HOST, $MVN_NEXUSPROXY" - -if [ -z "$WORKSPACE" ]; then - WORKSPACE=$(pwd) -fi - -if [ -z "$SETTINGS_FILE" ]; then - echo "SETTINGS_FILE environment variable not set. Cannot proceed" - exit -fi - - - -# mvn phase in life cycle -MVN_PHASE="$2" - -echo "MVN_PROJECT_MODULEID is [$MVN_PROJECT_MODULEID]" -echo "MVN_PHASE is [$MVN_PHASE]" -echo "MVN_PROJECT_GROUPID is [$MVN_PROJECT_GROUPID]" -echo "MVN_PROJECT_ARTIFACTID is [$MVN_PROJECT_ARTIFACTID]" -echo "MVN_PROJECT_VERSION is [$MVN_PROJECT_VERSION]" -echo "MVN_NEXUSPROXY is [$MVN_NEXUSPROXY]" -echo "MVN_RAWREPO_BASEURL_UPLOAD is [$MVN_RAWREPO_BASEURL_UPLOAD]" -echo "MVN_RAWREPO_BASEURL_DOWNLOAD is [$MVN_RAWREPO_BASEURL_DOWNLOAD]" -MVN_RAWREPO_HOST=$(echo "$MVN_RAWREPO_BASEURL_UPLOAD" | cut -f3 -d'/' |cut -f1 -d':') -echo "MVN_RAWREPO_HOST is [$MVN_RAWREPO_HOST]" -echo "MVN_RAWREPO_SERVERID is [$MVN_RAWREPO_SERVERID]" -echo "MVN_DOCKERREGISTRY_SNAPSHOT is [$MVN_DOCKERREGISTRY_SNAPSHOT]" -echo "MVN_DOCKERREGISTRY_PUBLIC is [$MVN_DOCKERREGISTRY_PUBLIC]" -echo "MVN_DOCKERREGISTRY_RELEASE is [$MVN_DOCKERREGISTRY_RELEASE]" - -echo "MVN_PYPISERVER_SERVERID [$MVN_PYPISERVER_SERVERID]" -echo "MVN_PYPISERVER_BASEURL is [$MVN_PYPISERVER_BASEURL]" - - - -clean_templated_files() -{ - TEMPLATE_FILES=$(find . -name "*-template") - for F in $TEMPLATE_FILES; do - F2=$(echo "$F" | sed 's/-template$//') - rm -f "$F2" - done -} -clean_tox_files() -{ - TOX_FILES=$(find . -name ".tox") - TOX_FILES="$TOX_FILES $(find . -name 'venv-tox')" - for F in $TOX_FILES; do - rm -rf "$F" - done -} - -expand_templates() -{ - set +x - # set up env variables, get ready for template resolution - # NOTE: CCSDK artifacts do not distinguish REALESE vs SNAPSHOTs - export ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases="$MVN_RAWREPO_BASEURL_DOWNLOAD/org.onap.ccsdk.platform.plugins" - export ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_snapshots="$MVN_RAWREPO_BASEURL_DOWNLOAD/org.onap.ccsdk.platform.plugins" - export ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_blueprints_releases="$MVN_RAWREPO_BASEURL_DOWNLOAD/org.onap.ccsdk.platform.blueprints" - export ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_blueprints_snapshots="$MVN_RAWREPO_BASEURL_DOWNLOAD/org.onap.ccsdk.platform.blueprints" - export ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_storage_pgaas_debs_snapshots="$MVN_RAWREPO_BASEURL_DOWNLOAD/org.onap.ccsdk.storage.pgaas/snapshots" - export ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_storage_pgaas_debs_releases="$MVN_RAWREPO_BASEURL_DOWNLOAD/org.onap.ccsdk.storage.pgaas/releases" - - export ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_releases="$MVN_RAWREPO_BASEURL_DOWNLOAD/org.onap.dcaegen2/releases" - export ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_snapshots="$MVN_RAWREPO_BASEURL_DOWNLOAD/org.onap.dcaegen2/snapshots" - export ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases="$MVN_RAWREPO_BASEURL_DOWNLOAD/org.onap.dcaegen2.platform.plugins/releases" - export ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_snapshots="$MVN_RAWREPO_BASEURL_DOWNLOAD/org.onap.dcaegen2.platform.plugins/snapshots" - export ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_blueprints_releases="$MVN_RAWREPO_BASEURL_DOWNLOAD/org.onap.dcaegen2.platform.blueprints/releases" - export ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_blueprints_snapshots="$MVN_RAWREPO_BASEURL_DOWNLOAD/org.onap.dcaegen2.platform.blueprints/snapshots" - - export ONAPTEMPLATE_PYPIURL_org_onap_dcaegen2="${MVN_PYPISERVER_BASEURL}" - - # docker registry templates are for poll, so use PUBLIC registry - export ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases="$MVN_DOCKERREGISTRY_PUBLIC" - export ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_snapshots="${MVN_DOCKERREGISTRY_PUBLIC}/snapshots" - - # Mvn repo - export ONAPTEMPLATE_MVN_org_onap_dcaegen2_analytics_tca_snapshots="${MVN_NEXUSPROXY}/service/local/repositories/snapshots/content/org/onap/dcaegen2/analytics/tca" - export ONAPTEMPLATE_MVN_org_onap_dcaegen2_analytics_tca_staging="${MVN_NEXUSPROXY}/service/local/repositories/staging/content/org/onap/dcaegen2/analytics/tca" - export ONAPTEMPLATE_MVN_org_onap_dcaegen2_analytics_tca_releases="${MVN_NEXUSPROXY}/service/local/repositories/releases/content/org/onap/dcaegen2/analytics/tca" - - - export ONAPTEMPLATE_STANDARD_INPUTS_TYPES=" # standard inputs list - centos7image_id: - type: string - ubuntu1604image_id: - type: string - flavor_id: - type: string - security_group: - type: string - public_net: - type: string - private_net: - type: string - openstack: {} - keypair: - type: string - key_filename: - type: string - location_prefix: - type: string - location_domain: - type: string - codesource_url: - type: string - codesource_version: - type: string" - - - TEMPLATES=$(env |grep ONAPTEMPLATE | sed 's/=.*//' | sort -u) - if [ -z "$TEMPLATES" ]; then - echo "No template variables found!" - return 0 - fi - - TEMPLATE_FILES=$(find . -name "*-template") - for F in $TEMPLATE_FILES; do - F2=$(echo "$F" | sed 's/-template$//') - cp -p "$F" "$F2" - chmod u+w "$F2" - - echo "====> Resolving the following template from environment variables " - echo "$TEMPLATES" - for KEY in $TEMPLATES; do - VALUE1=$(eval 'echo "$'"$KEY"'"' | sed 1q) - VALUE2=$(eval 'echo "$'"$KEY"'"' | sed -e 's/\//\\\//g' -e 's/$/\\/' -e '$s/\\$//') - if [ -z "$VALUE2" ];then echo "WARNING WARNING WARNING: $KEY found with no expansion"; fi - - echo "======> Resolving template $KEY to value $VALUE1 for file $F2" - sed -i "s/{{[[:space:]]*$KEY[[:space:]]*}}/$VALUE2/g" "$F2" - done - done - echo "====> Done template resolving" -} - -test_templates() -{ - # make certain that the type references exist - TMP=$(mktemp) - trap 'rm -f $TMP' 0 1 2 3 15 - - echo Verify that all of the import URLs are correct - find . -name '*-template' | sed -e 's/-template$//' | - while read file - do - egrep '^ - .?https?://' < $file - done | awk '{print $2}' | sed -e 's/"//g' | sort -u | - while read url - do - curl -L -w '%{http_code}' -s -o /dev/null "$url" > $TMP - case $(< $TMP) in - 2* ) ;; - * ) echo ">>>>>>>>>>>>>>>> $url not found <<<<<<<<<<<<<<<<" ;; - esac - done - - echo Verify that the inputs are correct - PATH=$PATH:$PROJECT_ROOT/check-blueprint-vs-input/bin - find . -name '*-template' | sed -e 's/-template$//' | - while read blueprint - do - check-blueprint-vs-input -b $blueprint -i $PROJECT_ROOT/check-blueprint-vs-input/lib/sample-inputs.yaml || true - done | - sed -e 's/^/WARNING WARNING WARNING: /' -} - - -run_tox_test() -{ - set -x - CURDIR=$(pwd) - TOXINIS=$(find . -name "tox.ini") - for TOXINI in "${TOXINIS[@]}"; do - DIR=$(echo "$TOXINI" | rev | cut -f2- -d'/' | rev) - cd "${CURDIR}/${DIR}" - rm -rf ./venv-tox ./.tox - virtualenv ./venv-tox - source ./venv-tox/bin/activate - pip install --upgrade pip - pip install --upgrade tox argparse - pip freeze - tox - deactivate - rm -rf ./venv-tox ./.tox - done -} - -build_wagons() -{ - rm -rf ./*.wgn venv-pkg - SETUPFILES=$(find . -name "setup.py") - - virtualenv ./venv-pkg - source ./venv-pkg/bin/activate - pip install --upgrade pip - pip install wagon - - CURDIR=$(pwd) - for SETUPFILE in $SETUPFILES; do - PLUGIN_DIR=$(dirname "$SETUPFILE") - PLUGIN_NAME=$(grep 'name' "$SETUPFILE" | cut -f2 -d'=' | sed 's/[^0-9a-zA-Z\.]*//g') - PLUGIN_VERSION=$(grep 'version' "$SETUPFILE" | cut -f2 -d'=' | sed 's/[^0-9\.]*//g') - - echo "In $PLUGIN_DIR, build plugin $PLUGIN_NAME, version $PLUGIN_VERSION" - - wagon create --format tar.gz "${PLUGIN_DIR}" - - PKG_FILE_NAMES=( "${PLUGIN_NAME}-${PLUGIN_VERSION}"*.wgn ) - echo Built package: "${PKG_FILE_NAMES[@]}" - cd $CURDIR - done - - deactivate - rm -rf venv-pkg -} - - -upload_raw_file() -{ - # Extract the username and password to the nexus repo from the settings file - USER=$(xpath -q -e "//servers/server[id='$MVN_RAWREPO_SERVERID']/username/text()" "$SETTINGS_FILE") - PASS=$(xpath -q -e "//servers/server[id='$MVN_RAWREPO_SERVERID']/password/text()" "$SETTINGS_FILE") - NETRC=$(mktemp) - echo "machine $MVN_RAWREPO_HOST login $USER password $PASS" > "$NETRC" - - REPO="$MVN_RAWREPO_BASEURL_UPLOAD" - - OUTPUT_FILE=$1 - EXT=$(echo "$OUTPUT_FILE" | rev |cut -f1 -d '.' |rev) - if [ "$EXT" == 'yaml' ]; then - OUTPUT_FILE_TYPE='text/x-yaml' - elif [ "$EXT" == 'sh' ]; then - OUTPUT_FILE_TYPE='text/x-shellscript' - elif [ "$EXT" == 'gz' ]; then - OUTPUT_FILE_TYPE='application/gzip' - elif [ "$EXT" == 'wgn' ]; then - OUTPUT_FILE_TYPE='application/gzip' - else - OUTPUT_FILE_TYPE='application/octet-stream' - fi - - # for multi module projects, the raw repo path must match with project name, not project + module - # FQDN is project + module - # GROUPID is project name - if [ "$MVN_PROJECT_ARTIFACTID" == "$MVN_PROJECT_MODULEID" ]; then - PROJECT_NAME=${MVN_PROJECT_GROUPID} - else - PROJECT_NAME=${FQDN} - fi - if [ "$MVN_DEPLOYMENT_TYPE" == 'SNAPSHOT' ]; then - SEND_TO="${REPO}/${PROJECT_NAME}/snapshots" - elif [ "$MVN_DEPLOYMENT_TYPE" == 'STAGING' ]; then - SEND_TO="${REPO}/${PROJECT_NAME}/releases" - else - echo "Unreconfnized deployment type, quit" - exit - fi - #if [ ! -z "$MVN_PROJECT_MODULEID" ]; then - # SEND_TO="$SEND_TO/$MVN_PROJECT_MODULEID" - #fi - if [ ! -z "$2" ]; then - SEND_TO="$SEND_TO/$2" - fi - - echo "Sending ${OUTPUT_FILE} to Nexus: ${SEND_TO}" - curl -vkn --netrc-file "${NETRC}" --upload-file "${OUTPUT_FILE}" -X PUT -H "Content-Type: $OUTPUT_FILE_TYPE" "${SEND_TO}/${OUTPUT_FILE}-${TIMESTAMP}" - curl -vkn --netrc-file "${NETRC}" --upload-file "${OUTPUT_FILE}" -X PUT -H "Content-Type: $OUTPUT_FILE_TYPE" "${SEND_TO}/${OUTPUT_FILE}" -} - - - -upload_wagons_and_type_yamls() -{ - SETUPFILES=$(find . -name "setup.py") - - CURDIR=$(pwd) - for SETUPFILE in $SETUPFILES; do - PLUGIN_DIR=$(dirname "$SETUPFILE") - PLUGIN_NAME=$(grep 'name' "$SETUPFILE" | cut -f2 -d'=' | sed 's/[^0-9a-zA-Z\.]*//g') - PLUGIN_VERSION=$(grep 'version' "$SETUPFILE" | cut -f2 -d'=' | sed 's/[^0-9\.]*//g') - PLUGIN_VERSION_MAJOR=$(echo "$PLUGIN_VERSION" | cut -f1 -d'.') - PLUGIN_VERSION_MAJOR_MINOR=$(echo "$PLUGIN_VERSION" | cut -f1-2 -d'.') - - echo "Found setup file in $PLUGIN_DIR, for plugin $PLUGIN_NAME version $PLUGIN_VERSION" - - TYPEFILE_NAME=$(grep -R "package_name:[[:space:]]*${PLUGIN_NAME}" | cut -f1 -d ':') - if [ -z "$TYPEFILE_NAME" ]; then - echo "!!! No typefile found with matching package name $PLUGIN_NAME" - exit -1 - fi - NEWFILENAME="${PLUGIN_NAME}"_types.yaml - if [ "$TYPEFILE_NAME" != "$NEWFILENAME" ]; then - echo "copy typefile to standard naming" - cp -f "$TYPEFILE_NAME" "$NEWFILENAME" - fi - - TYPEFILE_PACKAGE_VERSION=$(grep -R 'package_version' $TYPEFILE_NAME |cut -f2 -d ':' |sed -r 's/\s+//g') - WAGONFILE_NAME=$(ls -1 $PLUGIN_NAME-$TYPEFILE_PACKAGE_VERSION-*.wgn) - if [ -z "$WAGONFILE_NAME" ]; then - echo "!!! No wagonfile found with matching package name and version as required in typefile: " - echo " $TYPEFILE_NAME plugin $PLUGIN_NAME package version ${TYPEFILE_PACKAGE_VERSION}" - exit -1 - fi - - upload_raw_file "$NEWFILENAME" type_files/${PLUGIN_NAME}/${PLUGIN_VERSION_MAJOR} - upload_raw_file "$NEWFILENAME" type_files/${PLUGIN_NAME}/${PLUGIN_VERSION_MAJOR_MINOR} - upload_raw_file "${WAGONFILE_NAME}" "plugins/${PLUGIN_NAME}" - - rm -r $WAGONFILE_NAME - if [ "$TYPEFILE_NAME" != "$NEWFILENAME" ]; then - rm -f "$NEWFILENAME" - fi - done -} - -upload_files_of_extension() -{ - FILES=$(ls -1 ./*."$1") - for F in $FILES ; do - upload_raw_file "$F" "$2" - done -} - - -generate_pypirc_then_publish() -{ - set +x - USER=$(xpath -e "//servers/server[id='$MVN_PYPISERVER_SERVERID']/username/text()" "$SETTINGS_FILE") - PASS=$(xpath -e "//servers/server[id='$MVN_PYPISERVER_SERVERID']/password/text()" "$SETTINGS_FILE") - - if [[ "$MVN_PYPISERVER_BASEURL" != */ ]]; then - MVN_PYPISERVER_BASEURL="${MVN_PYPISERVER_BASEURL}/" - fi - - - cat > ~/.pypirc <<EOL -[distutils] -index-servers = - $MVN_PYPISERVER_SERVERID - -[$MVN_PYPISERVER_SERVERID] -repository: $MVN_PYPISERVER_BASEURL -username: $USER -password: $PASS -EOL - - # this may fail if a package of same version exists - python setup.py sdist register -r "$MVN_PYPISERVER_SERVERID" upload -r "$MVN_PYPISERVER_SERVERID" - set -x -} - - - -build_and_push_docker() -{ - IMAGENAME="onap/${FQDN}.${MVN_PROJECT_MODULEID}" - IMAGENAME=$(echo "$IMAGENAME" | sed -e 's/_*$//g' -e 's/\.*$//g') - IMAGENAME=$(echo "$IMAGENAME" | tr '[:upper:]' '[:lower:]') - - # use the major and minor version of the MVN artifact version as docker image version - VERSION="${MVN_PROJECT_VERSION//[^0-9.]/}" - VERSION2=$(echo "$VERSION" | cut -f1-2 -d'.') - - LFQI="${IMAGENAME}:${VERSION}-${TIMESTAMP}" - # build a docker image - docker build --rm -f ./Dockerfile -t "${LFQI}" ./ - - REPO="" - if [ $MVN_DEPLOYMENT_TYPE == "SNAPSHOT" ]; then - REPO=$MVN_DOCKERREGISTRY_SNASHOT - elif [ $MVN_DEPLOYMENT_TYPE == "STAGING" ]; then - # there seems to be no staging docker registry? set to use SNAPSHOT also - REPO=$MVN_DOCKERREGISTRY_RELEASE - else - echo "Fail to determine DEPLOYMENT_TYPE" - REPO=$MVN_DOCKERREGISTRY_SNAPSHOT - fi - echo "DEPLOYMENT_TYPE is: $MVN_DEPLOYMENT_TYPE, repo is $REPO" - - if [ ! -z "$REPO" ]; then - USER=$(xpath -e "//servers/server[id='$REPO']/username/text()" "$SETTINGS_FILE") - PASS=$(xpath -e "//servers/server[id='$REPO']/password/text()" "$SETTINGS_FILE") - if [ -z "$USER" ]; then - echo "Error: no user provided" - fi - if [ -z "$PASS" ]; then - echo "Error: no password provided" - fi - [ -z "$PASS" ] && PASS_PROVIDED="<empty>" || PASS_PROVIDED="<password>" - echo docker login "$REPO" -u "$USER" -p "$PASS_PROVIDED" - docker login "$REPO" -u "$USER" -p "$PASS" - - if [ $MVN_DEPLOYMENT_TYPE == "SNAPSHOT" ]; then - REPO="$REPO/snapshots" - elif [ $MVN_DEPLOYMENT_TYPE == "STAGING" ]; then - # there seems to be no staging docker registry? set to use SNAPSHOT also - #REPO=$MVN_DOCKERREGISTRY_RELEASE - REPO="$REPO" - else - echo "Fail to determine DEPLOYMENT_TYPE" - REPO="$REPO/unknown" - fi - - OLDTAG="${LFQI}" - PUSHTAGS="${REPO}/${IMAGENAME}:${VERSION2}-${TIMESTAMP} ${REPO}/${IMAGENAME}:${VERSION2} ${REPO}/${IMAGENAME}:${VERSION2}-latest" - for NEWTAG in ${PUSHTAGS} - do - echo "tagging ${OLDTAG} to ${NEWTAG}" - docker tag "${OLDTAG}" "${NEWTAG}" - echo "pushing ${NEWTAG}" - docker push "${NEWTAG}" - OLDTAG="${NEWTAG}" - done - fi - -} - - - diff --git a/mvn-phase-script.sh b/mvn-phase-script.sh index afbe961..08b0148 100755 --- a/mvn-phase-script.sh +++ b/mvn-phase-script.sh @@ -1,7 +1,7 @@ #!/bin/bash # ================================================================================ -# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,8 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============LICENSE_END========================================================= -# -# ECOMP is a trademark and service mark of AT&T Intellectual Property. set -ex @@ -69,6 +67,7 @@ fi MVN_PHASE="$2" +echo "MVN_RELEASE_TAG is [$MVN_RELEASE_TAG]" echo "MVN_PROJECT_MODULEID is [$MVN_PROJECT_MODULEID]" echo "MVN_PHASE is [$MVN_PHASE]" echo "MVN_PROJECT_GROUPID is [$MVN_PROJECT_GROUPID]" @@ -86,7 +85,15 @@ echo "MVN_DOCKERREGISTRY_PUBLIC is [$MVN_DOCKERREGISTRY_PUBLIC]" echo "HOME is [$HOME]" echo "PROJECT_ROOT is [$PROJECT_ROOT]" -source "${PROJECT_ROOT}"/mvn-phase-lib.sh +MVN_RELEASE_TAG="${MVN_RELEASE_TAG:-R3}" + + +if ! wget -O ${PROJECT_ROOT}/mvn-phase-lib.sh \ + "$MVN_RAWREPO_BASEURL_DOWNLOAD"/org.onap.dcaegen2.utils/${MVN_RELEASE_TAG}/scripts/mvn-phase-lib.sh; then + echo "Fail to download mvn-phase-lib.sh" + exit 1 +fi +source "${PROJECT_ROOT}"/mvn-phase-lib.sh # Customize the section below for each project |