From 0875ce0faad191c21b32cc9c95ffc20ebd57d586 Mon Sep 17 00:00:00 2001 From: Yuli Shlosberg Date: Thu, 25 Jan 2018 13:53:36 +0200 Subject: Cassandra OOM Alignment Change-Id: If9792919dba17936965b45361888a44a12a76b67 Issue-ID: SDC-911 Signed-off-by: Yuli Shlosberg --- .gitignore | 5 +- asdctool/pom.xml | 342 +++++++++--- asdctool/sdc-cassandra-init/Dockerfile | 12 + .../cassandra-actions/attributes/default.rb | 1 + .../cassandra-actions/recipes/01-createCsUser.rb | 18 + .../recipes/02-createDoxKeyspace.rb | 38 ++ .../cassandra-actions/recipes/03-schemaCreation.rb | 72 +++ .../recipes/04-importComformance.rb | 20 + .../templates/default/configuration.yaml.erb | 611 +++++++++++++++++++++ .../templates/default/create_cassandra_user.sh.erb | 33 ++ .../templates/default/create_dox_keyspace.sh.erb | 35 ++ .../templates/default/elasticsearch.yml.erb | 11 + .../templates/default/titan.properties.erb | 29 + asdctool/sdc-cassandra-init/chef-solo/LICENSE | 201 +++++++ asdctool/sdc-cassandra-init/chef-solo/README.md | 37 ++ asdctool/sdc-cassandra-init/chef-solo/chefignore | 11 + .../chef-solo/cookbooks/README.md | 54 ++ .../chef-solo/data_bags/README.md | 63 +++ .../chef-solo/environments/README.md | 5 + .../sdc-cassandra-init/chef-solo/roles/README.md | 16 + .../chef-solo/roles/cassandra-actions.json | 24 + asdctool/sdc-cassandra-init/chef-solo/solo.json | 6 + asdctool/sdc-cassandra-init/chef-solo/solo.rb | 16 + asdctool/sdc-cassandra-init/startup.sh | 6 + .../vsp_0_1_component_process1 | 1 - pom.xml | 4 + sdc-os-chef/pom.xml | 60 +- sdc-os-chef/scripts/docker_run.sh | 66 ++- .../recipes/01-configureCassandra.rb | 2 +- .../cassandra-actions/recipes/02-changeCSpass.rb | 16 + .../cassandra-actions/recipes/02-createCsUser.rb | 17 - .../recipes/03-createDoxKeyspace.rb | 38 -- .../recipes/03-prepareProbeFile.rb | 9 + .../cassandra-actions/recipes/04-schemaCreation.rb | 65 --- .../recipes/05-titanSchemaCreation.rb | 68 --- .../recipes/06-migrateZusammenFromDox.rb | 14 - .../recipes/07-importComformance.rb | 28 - .../templates/default/change_cassandra_pass.sh.erb | 31 ++ .../templates/default/configuration.yaml.erb | 611 --------------------- .../templates/default/create_cassandra_user.sh.erb | 57 -- .../templates/default/create_dox_keyspace.sh.erb | 34 -- .../templates/default/elasticsearch.yml.erb | 11 - .../templates/default/ready-probe.sh.erb | 16 + .../templates/default/titan.properties.erb | 29 - .../chef-solo/roles/cassandra-actions.json | 7 +- sdc-os-chef/sdc-cassandra/startup.sh | 20 +- sdc-os-chef/sdc-sanity/startup.sh | 13 +- 47 files changed, 1729 insertions(+), 1154 deletions(-) create mode 100644 asdctool/sdc-cassandra-init/Dockerfile create mode 100644 asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/attributes/default.rb create mode 100644 asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/01-createCsUser.rb create mode 100644 asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/02-createDoxKeyspace.rb create mode 100644 asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/03-schemaCreation.rb create mode 100644 asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/04-importComformance.rb create mode 100644 asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/configuration.yaml.erb create mode 100644 asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/create_cassandra_user.sh.erb create mode 100644 asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/create_dox_keyspace.sh.erb create mode 100644 asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/elasticsearch.yml.erb create mode 100644 asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/titan.properties.erb create mode 100644 asdctool/sdc-cassandra-init/chef-solo/LICENSE create mode 100644 asdctool/sdc-cassandra-init/chef-solo/README.md create mode 100644 asdctool/sdc-cassandra-init/chef-solo/chefignore create mode 100644 asdctool/sdc-cassandra-init/chef-solo/cookbooks/README.md create mode 100644 asdctool/sdc-cassandra-init/chef-solo/data_bags/README.md create mode 100644 asdctool/sdc-cassandra-init/chef-solo/environments/README.md create mode 100644 asdctool/sdc-cassandra-init/chef-solo/roles/README.md create mode 100644 asdctool/sdc-cassandra-init/chef-solo/roles/cassandra-actions.json create mode 100644 asdctool/sdc-cassandra-init/chef-solo/solo.json create mode 100644 asdctool/sdc-cassandra-init/chef-solo/solo.rb create mode 100644 asdctool/sdc-cassandra-init/startup.sh delete mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/vsp_0_1_component_process1 create mode 100644 sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/02-changeCSpass.rb delete mode 100644 sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/02-createCsUser.rb delete mode 100644 sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/03-createDoxKeyspace.rb create mode 100644 sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/03-prepareProbeFile.rb delete mode 100644 sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/04-schemaCreation.rb delete mode 100644 sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/05-titanSchemaCreation.rb delete mode 100644 sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/06-migrateZusammenFromDox.rb delete mode 100644 sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/07-importComformance.rb create mode 100644 sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/change_cassandra_pass.sh.erb delete mode 100644 sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/configuration.yaml.erb delete mode 100644 sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/create_cassandra_user.sh.erb delete mode 100644 sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/create_dox_keyspace.sh.erb delete mode 100644 sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/elasticsearch.yml.erb create mode 100644 sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/ready-probe.sh.erb delete mode 100644 sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/titan.properties.erb diff --git a/.gitignore b/.gitignore index 192a6cda34..1ba0e6fbb1 100644 --- a/.gitignore +++ b/.gitignore @@ -170,7 +170,6 @@ sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/files/default/error-c sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/files/default/logback.xml sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-normatives/files/default/normatives.tar.gz sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/attributes/default.rb -sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/files/default sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/files/default/SDC-*.zip sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/files/default/sdctool.tar sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/files/default/tools/* @@ -217,3 +216,7 @@ sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/testSuites/* sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/testSuites/* /sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/attributes/default.rb + +/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/files/default/* +/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/attributes/default.rb +/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/vsp_* diff --git a/asdctool/pom.xml b/asdctool/pom.xml index d8603d189d..1950a3b048 100644 --- a/asdctool/pom.xml +++ b/asdctool/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 asdctool @@ -55,10 +55,10 @@ ${project.version} - classes + classes - - + + org.openecomp.ecompsdkos epsdk-fw @@ -77,9 +77,9 @@ org.openecomp.sdc.common openecomp-common-lib - + - compile + compile @@ -217,14 +217,14 @@ ch.qos.logback logback-classic - ${logback.version} + ${logback.version} compile ch.qos.logback logback-core - ${logback.version} + ${logback.version} compile @@ -232,7 +232,7 @@ org.codehaus.groovy groovy-all - ${groovy.version} + ${groovy.version} compile @@ -270,13 +270,13 @@ org.openecomp.sdc.sdc-titan-cassandra - sdc-titan-cassandra + sdc-titan-cassandra ${titan.version} compile - org.slf4j - slf4j-log4j12 + org.slf4j + slf4j-log4j12 @@ -303,8 +303,8 @@ compile - org.slf4j - slf4j-log4j12 + org.slf4j + slf4j-log4j12 @@ -317,8 +317,8 @@ compile - org.slf4j - slf4j-log4j12 + org.slf4j + slf4j-log4j12 @@ -327,14 +327,14 @@ commons-logging commons-logging - ${commons-logging} + ${commons-logging} compile commons-codec commons-codec - ${commons-codec} + ${commons-codec} compile @@ -368,14 +368,14 @@ org.apache.httpcomponents httpclient - ${httpclient.version} + ${httpclient.version} compile org.apache.httpcomponents httpcore - ${httpcore.version} + ${httpcore.version} compile @@ -442,7 +442,7 @@ org.elasticsearch elasticsearch - ${elastic-search.version} + ${elastic-search.version} compile @@ -507,12 +507,12 @@ test - - org.testng - testng - ${testng.version} - test - + + org.testng + testng + ${testng.version} + test + org.mockito @@ -525,7 +525,7 @@ - ${project.artifactId}-${project.version}-jar-with-dependencies + ${project.artifactId}-${project.version}-jar-with-dependencies @@ -540,7 +540,7 @@ org.apache.maven.plugins maven-assembly-plugin - + sdctool @@ -548,7 +548,7 @@ ${project.basedir}/tarball.xml assemble-file - install + verify single @@ -563,35 +563,35 @@ 3.1.0 - package - - shade - - - - - org.openecomp.sdc:* - - **/elasticsearch.yml - - - - *:* - - META-INF/*.SF - META-INF/*.DSA - META-INF/*.RSA - - - - - - - + package + + shade + + + + + org.openecomp.sdc:* + + **/elasticsearch.yml + + + + *:* + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + + + + + - + maven-clean-plugin 3.0.0 @@ -609,38 +609,214 @@ ${project.parent.basedir}/asdctool/tosca false + + ${project.basedir}/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/attributes/ + false + + **/default.rb + + + + ${project.basedir}/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/files/default/tools + false + + + ${project.basedir}/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/files/default + false + + **/sdctool.tar + + - - - org.apache.maven.plugins - maven-resources-plugin - 3.0.2 - - - - copy-tosca-folder - - compile - - copy-resources - - - ${project.parent.basedir}/asdctool/tosca - - - ${project.parent.basedir}/catalog-be/src/main/resources/import/tosca - true - - - - - - - + + ru.yaal.maven + write-text-files-maven-plugin + 1.1 + + UTF-8 + + + + ${project.basedir}\sdc-cassandra-init\chef-repo\cookbooks\cassandra-actions\attributes\default.rb + + + normal['version'] ="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}" + + + + + + + write-text-files + prepare-package + + write-text-files + + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.0.2 + + + + copy-tosca-folder + + compile + + copy-resources + + + ${project.parent.basedir}/asdctool/tosca + + + ${project.parent.basedir}/catalog-be/src/main/resources/import/tosca + true + + + + + + + + + + docker-staging + + ${project.version}-STAGING-${maven.build.timestamp} + ${project.version}-STAGING-latest + + + + docker + + false + + + + + maven-resources-plugin + 3.0.2 + + + copy-dox-files + verify + + copy-resources + + + ${basedir}/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/files/default + + + ${project.parent.basedir}/openecomp-be + + tools/build/** + + + + ${project.parent.basedir}/openecomp-be + + tools/install/** + + + + + + + copy-sdctool + verify + + copy-resources + + + ${basedir}/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/files/default + + + ${project.parent.basedir}/asdctool/target + + sdctool.tar + + + + + + + + + io.fabric8 + docker-maven-plugin + 0.23.0 + + + true + 1.23 + nexus3.onap.org:10001 + + + docker + docker + + + + + + onap/sdc-cassandra-init + sdc-cassandra-init + + try + ${project.basedir}/sdc-cassandra-init + + ${docker.tag} + ${docker.latest.tag} + ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-latest + + + + + + + + clean-images + pre-clean + + remove + + + true + onap/sdc-cassandra-init + + + + + generate-images + install + + build + + + + + push-images + deploy + + push + + + onap/sdc-cassandra-init + + + + + + + + diff --git a/asdctool/sdc-cassandra-init/Dockerfile b/asdctool/sdc-cassandra-init/Dockerfile new file mode 100644 index 0000000000..c91358d563 --- /dev/null +++ b/asdctool/sdc-cassandra-init/Dockerfile @@ -0,0 +1,12 @@ +FROM onap/base_sdc-cqlsh:1.2.0-SNAPSHOT-latest + +COPY chef-solo /root/chef-solo/ + +COPY chef-repo/cookbooks /root/chef-solo/cookbooks/ + +COPY startup.sh /root/ + +RUN chmod 770 /root/startup.sh + +ENTRYPOINT [ "/root/startup.sh" ] + diff --git a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/attributes/default.rb b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/attributes/default.rb new file mode 100644 index 0000000000..6bac10e196 --- /dev/null +++ b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/attributes/default.rb @@ -0,0 +1 @@ +normal['version'] ="1.2.0" diff --git a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/01-createCsUser.rb b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/01-createCsUser.rb new file mode 100644 index 0000000000..2eb6d58cc3 --- /dev/null +++ b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/01-createCsUser.rb @@ -0,0 +1,18 @@ +template "/tmp/create_cassandra_user.sh" do + source "create_cassandra_user.sh.erb" + sensitive true + mode 0755 + variables({ + :cassandra_ip => node['Nodes']['CS'], + :cassandra_pwd => ENV['CS_PASSWORD'], + :sdc_usr => ENV['SDC_USER'], + :sdc_pwd => ENV['SDC_PASSWORD'] + }) +end + + +bash "create-sdc-user" do + code <<-EOH + cd /tmp ; /tmp/create_cassandra_user.sh + EOH +end diff --git a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/02-createDoxKeyspace.rb b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/02-createDoxKeyspace.rb new file mode 100644 index 0000000000..87edf8c358 --- /dev/null +++ b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/02-createDoxKeyspace.rb @@ -0,0 +1,38 @@ +template "/tmp/create_dox_keyspace.sh" do + source "create_dox_keyspace.sh.erb" + sensitive true + mode 0755 + variables({ + :cassandra_ip => node['Nodes']['CS'], + :DC_NAME => node['cassandra'][:cluster_name]+node.chef_environment, + :cassandra_pwd => node['cassandra'][:cassandra_password], + :cassandra_usr => node['cassandra'][:cassandra_user] + }) +end + + +remote_directory '/tmp/tools' do + source 'tools' + mode '0755' + files_mode '0755' + action :create +end + + +bash "onboard-db-schema-creation" do + ignore_failure true + code <<-EOH + cd /tmp/tools/build/scripts + chmod +x onboard-db-schema-creation.sh + bash /tmp/tools/build/scripts/onboard-db-schema-creation.sh + EOH +end + +bash "create-DOX-schema" do + ignore_failure true + code <<-EOH + cd /tmp + chmod +x /tmp/create_dox_keyspace.sh + /tmp/create_dox_keyspace.sh + EOH +end diff --git a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/03-schemaCreation.rb b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/03-schemaCreation.rb new file mode 100644 index 0000000000..ea8daf02ec --- /dev/null +++ b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/03-schemaCreation.rb @@ -0,0 +1,72 @@ +cookbook_file "/tmp/sdctool.tar" do + source "sdctool.tar" + mode 0755 +end + +## extract sdctool.tar +bash "install tar" do + cwd "/tmp" + code <<-EOH + /bin/tar xf /tmp/sdctool.tar -C /tmp + EOH +end + + +template "titan.properties" do + sensitive true + path "/tmp/sdctool/config/titan.properties" + source "titan.properties.erb" + mode "0755" + variables({ + :DC_NAME => node['cassandra'][:cluster_name]+node.chef_environment, + :cassandra_ip => node['Nodes']['CS'], + :cassandra_pwd => node['cassandra'][:cassandra_password], + :cassandra_usr => node['cassandra'][:cassandra_user], + :titan_connection_timeout => node['cassandra']['titan_connection_timeout'] + }) +end + + +template "/tmp/sdctool/config/configuration.yaml" do + sensitive true + source "configuration.yaml.erb" + mode 0755 + variables({ + :host_ip => node['Nodes']['BE'], + :catalog_port => node['BE'][:http_port], + :ssl_port => node['BE'][:https_port], + :cassandra_ip => node['Nodes']['CS'], + :rep_factor => 1, + :DC_NAME => node['cassandra'][:cluster_name]+node.chef_environment, + :titan_Path => "/tmp/sdctool/config/", + :socket_connect_timeout => node['cassandra']['socket_connect_timeout'], + :socket_read_timeout => node['cassandra']['socket_read_timeout'], + :cassandra_pwd => node['cassandra'][:cassandra_password], + :cassandra_usr => node['cassandra'][:cassandra_user] + }) +end + + +template "/tmp/sdctool/config/elasticsearch.yml" do + sensitive true + source "elasticsearch.yml.erb" + mode 0755 + variables({ + :elastic_ip => node['Nodes']['ES'] + }) +end + +bash "excuting-schema-creation" do + code <<-EOH + cd /tmp + chmod +x /tmp/sdctool/scripts/schemaCreation.sh + /tmp/sdctool/scripts/schemaCreation.sh /tmp/sdctool/config + EOH +end + +bash "excuting-titanSchemaCreation.sh" do + code <<-EOH + chmod +x /tmp/sdctool/scripts/titanSchemaCreation.sh + /tmp/sdctool/scripts/titanSchemaCreation.sh /tmp/sdctool/config + EOH +end diff --git a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/04-importComformance.rb b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/04-importComformance.rb new file mode 100644 index 0000000000..3b293e88b9 --- /dev/null +++ b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/04-importComformance.rb @@ -0,0 +1,20 @@ +working_directory = "/tmp" +cl_release=node['version'].split('.')[0..2].join('.').split('-')[0] +printf("\033[33mcl_release=[%s]\n\033[0m", cl_release) + + + +bash "import-Comformance" do + cwd "#{working_directory}" + code <<-EOH + conf_dir=/tmp/sdctool/config + tosca_dir=/tmp/sdctool/tosca + + cl_version=`grep 'toscaConformanceLevel:' $conf_dir/configuration.yaml |awk '{print $2}'` + + cd /tmp/sdctool/scripts + /bin/chmod +x sdcSchemaFileImport.sh + echo "execute /tmp/sdctool/scripts/sdcSchemaFileImport.sh ${tosca_dir} #{cl_release} ${cl_version} ${conf_dir} " + ./sdcSchemaFileImport.sh ${tosca_dir} #{cl_release} ${cl_version} ${conf_dir} + EOH +end \ No newline at end of file diff --git a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/configuration.yaml.erb b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/configuration.yaml.erb new file mode 100644 index 0000000000..e16cb1a8e8 --- /dev/null +++ b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/configuration.yaml.erb @@ -0,0 +1,611 @@ +identificationHeaderFields: + - HTTP_IV_USER + - HTTP_CSP_FIRSTNAME + - HTTP_CSP_LASTNAME + - HTTP_IV_REMOTE_ADDRESS + - HTTP_CSP_WSTYPE + + +# catalog backend hostname +beFqdn: <%= @host_ip %> + +# catalog backend http port +beHttpPort: <%= @catalog_port %> + +# catalog backend http context +beContext: /sdc/rest/config/get + +# catalog backend protocol +beProtocol: http + +# catalog backend ssl port +beSslPort: <%= @ssl_port %> +version: 1.0 +released: 2012-11-30 +toscaConformanceLevel: 5.0 +minToscaConformanceLevel: 3.0 + +titanCfgFile: <%= @titan_Path %>/titan.properties +titanInMemoryGraph: false +titanLockTimeout: 1800 +# The interval to try and reconnect to titan DB when it is down during ASDC startup: +titanReconnectIntervalInSeconds: 3 + +# The read timeout towards Titan DB when health check is invoked: +titanHealthCheckReadTimeout: 1 + +# The interval to try and reconnect to Elasticsearch when it is down during ASDC startup: + +esReconnectIntervalInSeconds: 3 +uebHealthCheckReconnectIntervalInSeconds: 15 +uebHealthCheckReadTimeout: 4 + +# Protocols +protocols: + - http + - https + +# Default imports +defaultImports: + - nodes: + file: nodes.yml + - datatypes: + file: data.yml + - capabilities: + file: capabilities.yml + - relationships: + file: relationships.yml + - groups: + file: groups.yml + - policies: + file: policies.yml + +# Users +users: + tom: passwd + bob: passwd + + +cassandraConfig: + cassandraHosts: [<%= @cassandra_ip %>] + localDataCenter: <%= @DC_NAME %> + reconnectTimeout : 30000 + socketReadTimeout: <%= @socket_read_timeout %> + socketConnectTimeout: <%= @socket_connect_timeout %> + authenticate: true + username: asdc_user + password: Aa1234%^! + ssl: false + truststorePath : /config/.truststore + truststorePassword : Aa123456 + keySpaces: + - { name: dox, replicationStrategy: NetworkTopologyStrategy, replicationInfo: ['<%= @DC_NAME %>','<%= @rep_factor %>']} + - { name: sdcaudit, replicationStrategy: NetworkTopologyStrategy, replicationInfo: ['<%= @DC_NAME %>','<%= @rep_factor %>']} + - { name: sdcartifact, replicationStrategy: NetworkTopologyStrategy, replicationInfo: ['<%= @DC_NAME %>','<%= @rep_factor %>']} + - { name: sdccomponent, replicationStrategy: NetworkTopologyStrategy, replicationInfo: ['<%= @DC_NAME %>','<%= @rep_factor %>']} + - { name: sdcrepository, replicationStrategy: NetworkTopologyStrategy, replicationInfo: ['<%= @DC_NAME %>','<%= @rep_factor %>']} + +#Application-specific settings of ES +elasticSearch: + # Mapping of index prefix to time-based frame. For example, if below is configured: + # + # - indexPrefix: auditingevents + # creationPeriod: minute + # + # then ES object of type which is mapped to "auditingevents-*" template, and created on 2015-12-23 13:24:54, will enter "auditingevents-2015-12-23-13-24" index. + # Another object created on 2015-12-23 13:25:54, will enter "auditingevents-2015-12-23-13-25" index. + # If creationPeriod: month, both of the above will enter "auditingevents-2015-12" index. + # + # PLEASE NOTE: the timestamps are created in UTC/GMT timezone! This is needed so that timestamps will be correctly presented in Kibana. + # + # Legal values for creationPeriod - year, month, day, hour, minute, none (meaning no time-based behaviour). + # + # If no creationPeriod is configured for indexPrefix, default behavour is creationPeriod: month. + + indicesTimeFrequency: + - indexPrefix: auditingevents + creationPeriod: month + - indexPrefix: monitoring_events + creationPeriod: month +artifactTypes: + - CHEF + - PUPPET + - SHELL + - YANG + - YANG_XML + - HEAT + - BPEL + - DG_XML + - MURANO_PKG + - WORKFLOW + - NETWORK_CALL_FLOW + - TOSCA_TEMPLATE + - TOSCA_CSAR + - AAI_SERVICE_MODEL + - AAI_VF_MODEL + - AAI_VF_MODULE_MODEL + - AAI_VF_INSTANCE_MODEL + - OTHER + - SNMP_POLL + - SNMP_TRAP + - GUIDE + +licenseTypes: + - User + - Installation + - CPU + +#Deployment artifacts placeHolder +resourceTypes: &allResourceTypes + - VFC + - CP + - VL + - VF + - VFCMT + - Abstract + +# validForResourceTypes usage +# validForResourceTypes: +# - VF +# - VL +deploymentResourceArtifacts: + + +deploymentResourceInstanceArtifacts: + heatEnv: + displayName: "HEAT ENV" + type: HEAT_ENV + description: "Auto-generated HEAT Environment deployment artifact" + fileExtension: "env" + VfHeatEnv: + displayName: "VF HEAT ENV" + type: HEAT_ENV + description: "VF Auto-generated HEAT Environment deployment artifact" + fileExtension: "env" + +#tosca artifacts placeholders +toscaArtifacts: + assetToscaTemplate: + artifactName: -template.yml + displayName: Tosca Template + type: TOSCA_TEMPLATE + description: TOSCA representation of the asset + assetToscaCsar: + artifactName: -csar.csar + displayName: Tosca Model + type: TOSCA_CSAR + description: TOSCA definition package of the asset + +#Informational artifacts placeHolder +excludeResourceCategory: + - Generic +informationalResourceArtifacts: + features: + displayName: Features + type: OTHER + capacity: + displayName: Capacity + type: OTHER + vendorTestResult: + displayName: Vendor Test Result + type: OTHER + testScripts: + displayName: Test Scripts + type: OTHER + CloudQuestionnaire: + displayName: Cloud Questionnaire (completed) + type: OTHER + HEATTemplateFromVendor: + displayName: HEAT Template from Vendor + type: HEAT + resourceSecurityTemplate: + displayName: Resource Security Template + type: OTHER + +excludeServiceCategory: + +informationalServiceArtifacts: + serviceArtifactPlan: + displayName: Service Artifact Plan + type: OTHER + summaryOfImpactsToECOMPElements: + displayName: Summary of impacts to ECOMP elements,OSSs, BSSs + type: OTHER + controlLoopFunctions: + displayName: Control Loop Functions + type: OTHER + dimensioningInfo: + displayName: Dimensioning Info + type: OTHER + affinityRules: + displayName: Affinity Rules + type: OTHER + operationalPolicies: + displayName: Operational Policies + type: OTHER + serviceSpecificPolicies: + displayName: Service-specific Policies + type: OTHER + engineeringRules: + displayName: Engineering Rules (ERD) + type: OTHER + distributionInstructions: + displayName: Distribution Instructions + type: OTHER + certificationTestResults: + displayName: TD Certification Test Results + type: OTHER + deploymentVotingRecord: + displayName: Deployment Voting Record + type: OTHER + serviceQuestionnaire: + displayName: Service Questionnaire + type: OTHER + serviceSecurityTemplate: + displayName: Service Security Template + type: OTHER + +serviceApiArtifacts: + configuration: + displayName: Configuration + type: OTHER + instantiation: + displayName: Instantiation + type: OTHER + monitoring: + displayName: Monitoring + type: OTHER + reporting: + displayName: Reporting + type: OTHER + logging: + displayName: Logging + type: OTHER + testing: + displayName: Testing + type: OTHER + + +additionalInformationMaxNumberOfKeys: 50 + +systemMonitoring: + enabled: true + isProxy: false + probeIntervalInSeconds: 15 +defaultHeatArtifactTimeoutMinutes: 60 + +serviceDeploymentArtifacts: + YANG_XML: + acceptedTypes: + - xml + VNF_CATALOG: + acceptedTypes: + - xml + MODEL_INVENTORY_PROFILE: + acceptedTypes: + - xml + MODEL_QUERY_SPEC: + acceptedTypes: + - xml + AAI_SERVICE_MODEL: + acceptedTypes: + - xml + AAI_VF_MODULE_MODEL: + acceptedTypes: + - xml + AAI_VF_INSTANCE_MODEL: + acceptedTypes: + - xml + OTHER: + acceptedTypes: + + +resourceDeploymentArtifacts: + HEAT: + acceptedTypes: + - yaml + - yml + validForResourceTypes: *allResourceTypes + HEAT_VOL: + acceptedTypes: + - yaml + - yml + validForResourceTypes: *allResourceTypes + HEAT_NET: + acceptedTypes: + - yaml + - yml + validForResourceTypes: *allResourceTypes + HEAT_NESTED: + acceptedTypes: + - yaml + - yml + validForResourceTypes: *allResourceTypes + HEAT_ARTIFACT: + acceptedTypes: + validForResourceTypes: *allResourceTypes + YANG_XML: + acceptedTypes: + - xml + validForResourceTypes: *allResourceTypes + VNF_CATALOG: + acceptedTypes: + - xml + validForResourceTypes: *allResourceTypes + VF_LICENSE: + acceptedTypes: + - xml + validForResourceTypes: *allResourceTypes + VENDOR_LICENSE: + acceptedTypes: + - xml + validForResourceTypes: *allResourceTypes + MODEL_INVENTORY_PROFILE: + acceptedTypes: + - xml + validForResourceTypes: *allResourceTypes + MODEL_QUERY_SPEC: + acceptedTypes: + - xml + validForResourceTypes: *allResourceTypes + LIFECYCLE_OPERATIONS: + acceptedTypes: + - yaml + - yml + validForResourceTypes: + - VF + - VFC + VES_EVENTS: + acceptedTypes: + - yaml + - yml + validForResourceTypes: *allResourceTypes + PERFORMANCE_COUNTER: + acceptedTypes: + - csv + validForResourceTypes: *allResourceTypes + APPC_CONFIG: + acceptedTypes: + validForResourceTypes: + - VF + DCAE_TOSCA: + acceptedTypes: + - yml + - yaml + validForResourceTypes: + - VF + - VFCMT + DCAE_JSON: + acceptedTypes: + - json + validForResourceTypes: + - VF + - VFCMT + DCAE_POLICY: + acceptedTypes: + - emf + validForResourceTypes: + - VF + - VFCMT + DCAE_DOC: + acceptedTypes: + validForResourceTypes: + - VF + - VFCMT + DCAE_EVENT: + acceptedTypes: + validForResourceTypes: + - VF + - VFCMT + AAI_VF_MODEL: + acceptedTypes: + - xml + validForResourceTypes: + - VF + AAI_VF_MODULE_MODEL: + acceptedTypes: + - xml + validForResourceTypes: + - VF + OTHER: + acceptedTypes: + validForResourceTypes: *allResourceTypes + SNMP_POLL: + acceptedTypes: + validForResourceTypes: *allResourceTypes + SNMP_TRAP: + acceptedTypes: + validForResourceTypes: *allResourceTypes + +resourceInstanceDeploymentArtifacts: + HEAT_ENV: + acceptedTypes: + - env + VF_MODULES_METADATA: + acceptedTypes: + - json + VES_EVENTS: + acceptedTypes: + - yaml + - yml + PERFORMANCE_COUNTER: + acceptedTypes: + - csv + DCAE_INVENTORY_TOSCA: + acceptedTypes: + - yml + - yaml + DCAE_INVENTORY_JSON: + acceptedTypes: + - json + DCAE_INVENTORY_POLICY: + acceptedTypes: + - emf + DCAE_INVENTORY_DOC: + acceptedTypes: + DCAE_INVENTORY_BLUEPRINT: + acceptedTypes: + DCAE_INVENTORY_EVENT: + acceptedTypes: + SNMP_POLL: + acceptedTypes: + validForResourceTypes: *allResourceTypes + SNMP_TRAP: + acceptedTypes: + validForResourceTypes: *allResourceTypes + +resourceInformationalArtifacts: + CHEF: + acceptedTypes: + validForResourceTypes: *allResourceTypes + PUPPET: + acceptedTypes: + validForResourceTypes: *allResourceTypes + SHELL: + acceptedTypes: + validForResourceTypes: *allResourceTypes + YANG: + acceptedTypes: + validForResourceTypes: *allResourceTypes + YANG_XML: + acceptedTypes: + validForResourceTypes: *allResourceTypes + HEAT: + acceptedTypes: + validForResourceTypes: *allResourceTypes + BPEL: + acceptedTypes: + validForResourceTypes: *allResourceTypes + DG_XML: + acceptedTypes: + validForResourceTypes: *allResourceTypes + MURANO_PKG: + acceptedTypes: + validForResourceTypes: *allResourceTypes + OTHER: + acceptedTypes: + validForResourceTypes: *allResourceTypes + SNMP_POLL: + acceptedTypes: + validForResourceTypes: *allResourceTypes + SNMP_TRAP: + acceptedTypes: + validForResourceTypes: *allResourceTypes + GUIDE: + acceptedTypes: + validForResourceTypes: + - VF + - VFC + +resourceInformationalDeployedArtifacts: + + +requirementsToFulfillBeforeCert: + +capabilitiesToConsumeBeforeCert: + +unLoggedUrls: + - /sdc2/rest/healthCheck + +cleanComponentsConfiguration: + cleanIntervalInMinutes: 1440 + componentsToClean: + - Resource + - Service + +artifactsIndex: resources + +heatEnvArtifactHeader: "" +heatEnvArtifactFooter: "" + +onboarding: + protocol: http + host: <%= @host_ip %> + port: <%= @catalog_port %> + downloadCsarUri: "/onboarding-api/v1.0/vendor-software-products/packages" + healthCheckUri: "/onboarding-api/v1.0/healthcheck" + +dcae: + protocol: http + host: <%= @host_ip %> + port: <%= @catalog_port %> + healthCheckUri: "/dcae/healthCheck" + +# #GSS IDNS +switchoverDetector: + gBeFqdn: + gFeFqdn: + beVip: 1.2.3.4 + feVip: 1.2.3.4 + beResolveAttempts: 3 + feResolveAttempts: 3 + enabled: false + interval: 60 + changePriorityUser: ecompasdc + changePriorityPassword: ecompasdc123 + publishNetworkUrl: + publishNetworkBody: '{"note":"comment"}' + groups: + beSet: { changePriorityUrl: "", changePriorityBody: '{"name":"","uri":"","no_ad_redirection":false,"v4groups":{"failover_groups":["","","failover_policy":["FAILALL"]},"comment":"","intended_app_proto":"DNS"}'} + feSet: { changePriorityUrl: "", changePriorityBody: '{"name":"","uri":"","no_ad_redirection":false,"v4groups":{"failover_groups":["",""],"failover_policy":["FAILALL"]},"comment":"","intended_app_proto":"DNS"}'} + +applicationL1Cache: + datatypes: + enabled: true + firstRunDelay: 10 + pollIntervalInSec: 60 + +applicationL2Cache: + enabled: true + catalogL1Cache: + enabled: true + resourcesSizeInCache: 300 + servicesSizeInCache: 200 + productsSizeInCache: 100 + queue: + syncIntervalInSecondes: 43200 + waitOnShutDownInMinutes: 10 + numberOfCacheWorkers: 4 + +toscaValidators: + stringMaxLength: 2500 + +disableAudit: false +vfModuleProperties: + min_vf_module_instances: + forBaseModule: 1 + forNonBaseModule: 0 + max_vf_module_instances: + forBaseModule: 1 + forNonBaseModule: + initial_count: + forBaseModule: 1 + forNonBaseModule: 0 + vf_module_type: + forBaseModule: Base + forNonBaseModule: Expansion + +genericAssetNodeTypes: + VFC: org.openecomp.resource.abstract.nodes.VFC + VF : org.openecomp.resource.abstract.nodes.VF + Service: org.openecomp.resource.abstract.nodes.service + +workloadContext: Production + +environmentContext: + defaultValue: General_Revenue-Bearing + validValues: + - Critical_Revenue-Bearing + - Vital_Revenue-Bearing + - Essential_Revenue-Bearing + - Important_Revenue-Bearing + - Needed_Revenue-Bearing + - Useful_Revenue-Bearing + - General_Revenue-Bearing + - Critical_Non-Revenue + - Vital_Non-Revenue + - Essential_Non-Revenue + - Important_Non-Revenue + - Needed_Non-Revenue + - Useful_Non-Revenue + - General_Non-Revenue \ No newline at end of file diff --git a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/create_cassandra_user.sh.erb b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/create_cassandra_user.sh.erb new file mode 100644 index 0000000000..df4a55e34b --- /dev/null +++ b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/create_cassandra_user.sh.erb @@ -0,0 +1,33 @@ +#!/bin/bash + +CASSANDRA_IP=<%= @cassandra_ip %> +CS_PASSWORD=<%= @cassandra_pwd %> +SDC_USER=<%= @sdc_usr %> +SDC_PASSWORD=<%= @sdc_pwd %> + + +pass_changed=99 +retry_num=1 +is_up=0 +while [ $is_up -eq 0 -a $retry_num -le 100 ]; do + + echo "exit" | cqlsh -u cassandra -p $CS_PASSWORD $CASSANDRA_IP > /dev/null 2>&1 + res1=$? + + if [ $res1 -eq 0 ]; then + echo "`date` --- cqlsh is enabled to connect." + is_up=1 + else + echo "`date` --- cqlsh is NOT enabled to connect yet. sleep 5" + sleep 5 + fi + let "retry_num++" +done + +cassandra_user_exist=`echo "list users;" | cqlsh -u cassandra -p $CS_PASSWORD $CASSANDRA_IP |grep -c $SDC_USER` + if [ $cassandra_user_exist -eq 1 ] ; then + echo "cassandra user $SDC_USER already exist" + else + echo "Going to create $SDC_USER" + echo "create user $SDC_USER with password '$SDC_PASSWORD' nosuperuser;" | cqlsh -u cassandra -p $CS_PASSWORD $CASSANDRA_IP + fi \ No newline at end of file diff --git a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/create_dox_keyspace.sh.erb b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/create_dox_keyspace.sh.erb new file mode 100644 index 0000000000..c350704191 --- /dev/null +++ b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/create_dox_keyspace.sh.erb @@ -0,0 +1,35 @@ +#!/bin/bash + +CASSANDRA_USER='<%= @cassandra_usr %>' +CASSANDRA_PASS='<%= @cassandra_pwd %>' +CASSANDRA_IP='<%= @cassandra_ip %>' + +KEYSPACE="CREATE KEYSPACE IF NOT EXISTS dox WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', '<%= @DC_NAME %>': '1'};" +KEYSPACE1="CREATE KEYSPACE IF NOT EXISTS zusammen_dox WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', '<%= @DC_NAME %>': '1'};" + +echo "run create_dox_keyspace.cql" +echo -e "$KEYSPACE\n$KEYSPACE1" > /tmp/create_dox_keyspace.cql + +chmod 755 /tmp/create_dox_keyspace.cql +cqlsh -u $CASSANDRA_USER -p $CASSANDRA_PASS $CASSANDRA_IP -f /tmp/create_dox_keyspace.cql > /dev/null 2>&1 + + +res=`echo "select keyspace_name from system.schema_keyspaces ;" | cqlsh -u $CASSANDRA_USER -p $CASSANDRA_PASS $CASSANDRA_IP |grep -c dox 2>/dev/null` + +if [ $res -gt 0 ]; then + echo "`date` --- dox keyspace was created " +else + echo "`date` --- Failed to create dox keyspace" +fi + + +echo "run create_dox_db.cql" +chmod 755 /tmp/tools/build/scripts/create_dox_db.cql +cqlsh -u $CASSANDRA_USER -p $CASSANDRA_PASS $CASSANDRA_IP -f /tmp/tools/build/scripts/create_dox_db.cql > /dev/null 2>&1 + +sleep 10 + +echo "run alter_dox_db.cql" +chmod 755 /tmp/tools/build/scripts/alter_dox_db.cql +cqlsh -u $CASSANDRA_USER -p $CASSANDRA_PASS $CASSANDRA_IP -f /tmp/tools/build/scripts/alter_dox_db.cql > /dev/null 2>&1 + diff --git a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/elasticsearch.yml.erb b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/elasticsearch.yml.erb new file mode 100644 index 0000000000..79d11f4610 --- /dev/null +++ b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/elasticsearch.yml.erb @@ -0,0 +1,11 @@ +discovery.zen.ping.multicast.enabled: false +discovery.zen.ping.unicast.enabled: true +node.name: asdc-01 +cluster.name: elasticsearch +node.master: false +node.data: false +http.cors.enabled: true +path.home: "/var/lib/jetty/config" +elasticSearch.transportclient: true +transport.client.initial_nodes: + - <%= @elastic_ip %>:9300 diff --git a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/titan.properties.erb b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/titan.properties.erb new file mode 100644 index 0000000000..0f31341d40 --- /dev/null +++ b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/titan.properties.erb @@ -0,0 +1,29 @@ +storage.backend=cassandra +storage.hostname=<%= @cassandra_ip %> +storage.port=9160 +storage.username=<%= @cassandra_usr %> +storage.password=<%= @cassandra_pwd %> +storage.connection-timeout=<%= @titan_connection_timeout %> +storage.cassandra.keyspace=sdctitan + + +storage.cassandra.ssl.enabled=false +storage.cassandra.ssl.truststore.location=/var/lib/jetty/config/.truststore +storage.cassandra.ssl.truststore.password=Aa123456 + +storage.cassandra.read-consistency-level=LOCAL_QUORUM +storage.cassandra.write-consistency-level=LOCAL_QUORUM +storage.cassandra.replication-strategy-class=org.apache.cassandra.locator.NetworkTopologyStrategy +storage.cassandra.replication-strategy-options=<%= @DC_NAME %>,1 +storage.cassandra.astyanax.local-datacenter=<%= @DC_NAME %> + +cache.db-cache = false +cache.db-cache-clean-wait = 20 +cache.db-cache-time = 180000 +cache.db-cache-size = 0.5 + +cache.tx-cache-size = 1000000 + +storage.lock.retries=5 +storage.lock.wait-time=500 + diff --git a/asdctool/sdc-cassandra-init/chef-solo/LICENSE b/asdctool/sdc-cassandra-init/chef-solo/LICENSE new file mode 100644 index 0000000000..11069edd79 --- /dev/null +++ b/asdctool/sdc-cassandra-init/chef-solo/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +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. diff --git a/asdctool/sdc-cassandra-init/chef-solo/README.md b/asdctool/sdc-cassandra-init/chef-solo/README.md new file mode 100644 index 0000000000..ddb0fda830 --- /dev/null +++ b/asdctool/sdc-cassandra-init/chef-solo/README.md @@ -0,0 +1,37 @@ +Deprecated +========== + +Use of this repository is deprecated. We recommend using the `chef generate repo` command that comes with [ChefDK](http://downloads.chef.io/chef-dk/). + +Overview +======== + +Every Chef installation needs a Chef Repository. This is the place where cookbooks, roles, config files and other artifacts for managing systems with Chef will live. We strongly recommend storing this repository in a version control system such as Git and treat it like source code. + +While we prefer Git, and make this repository available via GitHub, you are welcome to download a tar or zip archive and use your favorite version control system to manage the code. + +Repository Directories +====================== + +This repository contains several directories, and each directory contains a README file that describes what it is for in greater detail, and how to use it for managing your systems with Chef. + +* `cookbooks/` - Cookbooks you download or create. +* `data_bags/` - Store data bags and items in .json in the repository. +* `roles/` - Store roles in .rb or .json in the repository. +* `environments/` - Store environments in .rb or .json in the repository. + +Configuration +============= + +The repository contains a knife configuration file. + +* .chef/knife.rb + +The knife configuration file `.chef/knife.rb` is a repository specific configuration file for knife. If you're using Hosted Chef, you can download one for your organization from the management console. If you're using the Open Source Chef Server, you can generate a new one with `knife configure`. For more information about configuring Knife, see the Knife documentation. + +https://docs.chef.io/knife.html + +Next Steps +========== + +Read the README file in each of the subdirectories for more information about what goes in those directories. diff --git a/asdctool/sdc-cassandra-init/chef-solo/chefignore b/asdctool/sdc-cassandra-init/chef-solo/chefignore new file mode 100644 index 0000000000..ba30af6cff --- /dev/null +++ b/asdctool/sdc-cassandra-init/chef-solo/chefignore @@ -0,0 +1,11 @@ +# Put files/directories that should be ignored in this file. +# Lines that start with '# ' are comments. + +# emacs +*~ + +# vim +*.sw[a-z] + +# subversion +*/.svn/* diff --git a/asdctool/sdc-cassandra-init/chef-solo/cookbooks/README.md b/asdctool/sdc-cassandra-init/chef-solo/cookbooks/README.md new file mode 100644 index 0000000000..86ea46bfbb --- /dev/null +++ b/asdctool/sdc-cassandra-init/chef-solo/cookbooks/README.md @@ -0,0 +1,54 @@ +This directory contains the cookbooks used to configure systems in your infrastructure with Chef. + +Knife needs to be configured to know where the cookbooks are located with the `cookbook_path` setting. If this is not set, then several cookbook operations will fail to work properly. + + cookbook_path ["./cookbooks"] + +This setting tells knife to look for the cookbooks directory in the present working directory. This means the knife cookbook subcommands need to be run in the `chef-repo` directory itself. To make sure that the cookbooks can be found elsewhere inside the repository, use an absolute path. This is a Ruby file, so something like the following can be used: + + current_dir = File.dirname(__FILE__) + cookbook_path ["#{current_dir}/../cookbooks"] + +Which will set `current_dir` to the location of the knife.rb file itself (e.g. `~/chef-repo/.chef/knife.rb`). + +Configure knife to use your preferred copyright holder, email contact and license. Add the following lines to `.chef/knife.rb`. + + cookbook_copyright "Example, Com." + cookbook_email "cookbooks@example.com" + cookbook_license "apachev2" + +Supported values for `cookbook_license` are "apachev2", "mit","gplv2","gplv3", or "none". These settings are used to prefill comments in the default recipe, and the corresponding values in the metadata.rb. You are free to change the the comments in those files. + +Create new cookbooks in this directory with Knife. + + knife cookbook create COOKBOOK + +This will create all the cookbook directory components. You don't need to use them all, and can delete the ones you don't need. It also creates a README file, metadata.rb and default recipe. + +You can also download cookbooks directly from the Opscode Cookbook Site. There are two subcommands to help with this depending on what your preference is. + +The first and recommended method is to use a vendor branch if you're using Git. This is automatically handled with Knife. + + knife cookbook site install COOKBOOK + +This will: + +* Download the cookbook tarball from cookbooks.opscode.com. +* Ensure its on the git master branch. +* Checks for an existing vendor branch, and creates if it doesn't. +* Checks out the vendor branch (chef-vendor-COOKBOOK). +* Removes the existing (old) version. +* Untars the cookbook tarball it downloaded in the first step. +* Adds the cookbook files to the git index and commits. +* Creates a tag for the version downloaded. +* Checks out the master branch again. +* Merges the cookbook into master. +* Repeats the above for all the cookbooks dependencies, downloading them from the community site + +The last step will ensure that any local changes or modifications you have made to the cookbook are preserved, so you can keep your changes through upstream updates. + +If you're not using Git, use the site download subcommand to download the tarball. + + knife cookbook site download COOKBOOK + +This creates the COOKBOOK.tar.gz from in the current directory (e.g., `~/chef-repo`). We recommend following a workflow similar to the above for your version control tool. diff --git a/asdctool/sdc-cassandra-init/chef-solo/data_bags/README.md b/asdctool/sdc-cassandra-init/chef-solo/data_bags/README.md new file mode 100644 index 0000000000..0c15a391fa --- /dev/null +++ b/asdctool/sdc-cassandra-init/chef-solo/data_bags/README.md @@ -0,0 +1,63 @@ +Data Bags +--------- + +This directory contains directories of the various data bags you create for your infrastructure. Each subdirectory corresponds to a data bag on the Chef Server, and contains JSON files of the items that go in the bag. + +First, create a directory for the data bag. + + mkdir data_bags/BAG + +Then create the JSON files for items that will go into that bag. + + $EDITOR data_bags/BAG/ITEM.json + +The JSON for the ITEM must contain a key named "id" with a value equal to "ITEM". For example, + + { + "id": "foo" + } + +Next, create the data bag on the Chef Server. + + knife data bag create BAG + +Then upload the items in the data bag's directory to the Chef Server. + + knife data bag from file BAG ITEM.json + + +Encrypted Data Bags +------------------- + +Added in Chef 0.10, encrypted data bags allow you to encrypt the contents of your data bags. The content of attributes will no longer be searchable. To use encrypted data bags, first you must have or create a secret key. + + openssl rand -base64 512 > secret_key + +You may use this secret_key to add items to a data bag during a create. + + knife data bag create --secret-file secret_key passwords mysql + +You may also use it when adding ITEMs from files, + + knife data bag create passwords + knife data bag from file passwords data_bags/passwords/mysql.json --secret-file secret_key + +The JSON for the ITEM must contain a key named "id" with a value equal to "ITEM" and the contents will be encrypted when uploaded. For example, + + { + "id": "mysql", + "password": "abc123" + } + +Without the secret_key, the contents are encrypted. + + knife data bag show passwords mysql + id: mysql + password: 2I0XUUve1TXEojEyeGsjhw== + +Use the secret_key to view the contents. + + knife data bag show passwords mysql --secret-file secret_key + id: mysql + password: abc123 + diff --git a/asdctool/sdc-cassandra-init/chef-solo/environments/README.md b/asdctool/sdc-cassandra-init/chef-solo/environments/README.md new file mode 100644 index 0000000000..50ac48db2b --- /dev/null +++ b/asdctool/sdc-cassandra-init/chef-solo/environments/README.md @@ -0,0 +1,5 @@ +Requires Chef 0.10.0+. + +This directory is for Ruby DSL and JSON files for environments. For more information see the Chef wiki page: + +http://docs.chef.io/environments.html diff --git a/asdctool/sdc-cassandra-init/chef-solo/roles/README.md b/asdctool/sdc-cassandra-init/chef-solo/roles/README.md new file mode 100644 index 0000000000..b0ee0b4d21 --- /dev/null +++ b/asdctool/sdc-cassandra-init/chef-solo/roles/README.md @@ -0,0 +1,16 @@ +Create roles here, in either the Role Ruby DSL (.rb) or JSON (.json) files. To install roles on the server, use knife. + +For example, create `roles/base_example.rb`: + + name "base_example" + description "Example base role applied to all nodes." + # List of recipes and roles to apply. Requires Chef 0.8, earlier versions use 'recipes()'. + #run_list() + # Attributes applied if the node doesn't have it set already. + #default_attributes() + # Attributes applied no matter what the node has set already. + #override_attributes() + +Then upload it to the Chef Server: + + knife role from file roles/base_example.rb diff --git a/asdctool/sdc-cassandra-init/chef-solo/roles/cassandra-actions.json b/asdctool/sdc-cassandra-init/chef-solo/roles/cassandra-actions.json new file mode 100644 index 0000000000..11aba44a3f --- /dev/null +++ b/asdctool/sdc-cassandra-init/chef-solo/roles/cassandra-actions.json @@ -0,0 +1,24 @@ +{ + "name": "cassandra-actions", + "description": "cassandra-actions", + "json_class": "Chef::Role", + "default_attributes": { + + }, + "override_attributes": { + + }, + "chef_type": "role", + "run_list": [ + "recipe[cassandra-actions::01-createCsUser]", + "recipe[cassandra-actions::02-createDoxKeyspace]", + "recipe[cassandra-actions::03-schemaCreation]", + "recipe[cassandra-actions::04-importComformance]" + ], + + "env_run_lists": { + + } +} + + diff --git a/asdctool/sdc-cassandra-init/chef-solo/solo.json b/asdctool/sdc-cassandra-init/chef-solo/solo.json new file mode 100644 index 0000000000..97b1efe282 --- /dev/null +++ b/asdctool/sdc-cassandra-init/chef-solo/solo.json @@ -0,0 +1,6 @@ +{ + "run_list": [ + "role[cassandra-actions]" + ] +} + diff --git a/asdctool/sdc-cassandra-init/chef-solo/solo.rb b/asdctool/sdc-cassandra-init/chef-solo/solo.rb new file mode 100644 index 0000000000..06c1af4592 --- /dev/null +++ b/asdctool/sdc-cassandra-init/chef-solo/solo.rb @@ -0,0 +1,16 @@ +root = File.absolute_path(File.dirname(__FILE__)) +file_cache_path root +cookbook_path root + '/cookbooks' +json_attribs root + '/solo.json' +checksum_path root + '/checksums' +data_bag_path root + '/data_bags' +environment_path root + '/environments' +file_backup_path root + '/backup' +file_cache_path root + '/cache' +log_level :info +log_location STDOUT +rest_timeout 300 +role_path root + '/roles' +syntax_check_cache_path +umask 0022 +verbose_logging nil diff --git a/asdctool/sdc-cassandra-init/startup.sh b/asdctool/sdc-cassandra-init/startup.sh new file mode 100644 index 0000000000..13c882ab09 --- /dev/null +++ b/asdctool/sdc-cassandra-init/startup.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +cd /root/chef-solo +chef-solo -c solo.rb -E ${ENVNAME} +rc=$? +if [[ $rc != 0 ]]; then exit $rc; fi \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/vsp_0_1_component_process1 b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/vsp_0_1_component_process1 deleted file mode 100644 index 58e6f9e5e2..0000000000 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/vsp_0_1_component_process1 +++ /dev/null @@ -1 +0,0 @@ -bla bla \ No newline at end of file diff --git a/pom.xml b/pom.xml index 5e249f01d5..77b678d8bc 100644 --- a/pom.xml +++ b/pom.xml @@ -126,6 +126,10 @@ 176c31dfe190a yyyyMMdd'T'HHmm + + ${project.version}-${maven.build.timestamp} + ${project.version}-latest + diff --git a/sdc-os-chef/pom.xml b/sdc-os-chef/pom.xml index 542a58ea7f..7052e31176 100644 --- a/sdc-os-chef/pom.xml +++ b/sdc-os-chef/pom.xml @@ -14,12 +14,6 @@ - - ${project.version}-${maven.build.timestamp} - ${project.version}-latest - true - - @@ -75,10 +69,6 @@ **/default.rb - - ${project.basedir}/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/files/default/tools - false - ${project.basedir}/sdc-sanity @@ -278,34 +268,7 @@ - - - - - copy-dox-files - validate - - copy-resources - - - ${basedir}/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/files/default - - - ${project.parent.basedir}/openecomp-be - - tools/build/** - - - - ${project.parent.basedir}/openecomp-be - - tools/install/** - - - - - - + copy-normatives validate @@ -323,26 +286,7 @@ - - - - copy-sdctool - validate - - copy-resources - - - ${project.parent.basedir}/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/files/default - - - ${project.parent.basedir}/asdctool/target - - sdctool.tar - - - - - + diff --git a/sdc-os-chef/scripts/docker_run.sh b/sdc-os-chef/scripts/docker_run.sh index 7e5498e765..5307a9cd7a 100755 --- a/sdc-os-chef/scripts/docker_run.sh +++ b/sdc-os-chef/scripts/docker_run.sh @@ -1,5 +1,8 @@ #!/bin/bash +CS_PASSWORD="onap123#@!" +SDC_USER="asdc_user" +SDC_PASSWORD="Aa1234%^!" function usage { echo "usage: docker_run.sh [ -r|--release ] [ -e|--environment ] [ -p|--port ] [ -l|--local ] [ -t|--runTests ] [ -h|--help ]" @@ -21,7 +24,29 @@ function dir_perms { mkdir -p ${WORKSPACE}/data/logs/FE/SDC/SDC-FE chmod -R 777 ${WORKSPACE}/data/logs } +function probe_cs { + +cs_stat=false +docker exec -it $1 /var/lib/ready-probe.sh > /dev/null 2>&1 +rc=$? +if [[ $rc == 0 ]]; then + echo DOCKER start finished in $2 seconds + cs_stat=true +fi + +} + +function probe_docker { + +match_result=false +MATCH=`docker logs --tail 30 $1 | grep "DOCKER STARTED"` +echo MATCH is -- $MATCH +if [ -n "$MATCH" ]; then + echo DOCKER start finished in $2 seconds + match_result=true +fi +} function monitor_docker { echo monitor $1 Docker @@ -30,15 +55,13 @@ function monitor_docker { INTERVAL=20 TIME=0 while [ "$TIME" -lt "$TIME_OUT" ]; do - - MATCH=`docker logs --tail 30 $1 | grep "DOCKER STARTED"` - echo MATCH is -- $MATCH - - if [ -n "$MATCH" ]; then - echo DOCKER start finished in $TIME seconds - break + if [ "$1" == "sdc-cs" ]; then + probe_cs $1 $TIME + if [[ $cs_stat == true ]]; then break; fi + else + probe_docker $1 $TIME + if [[ $match_result == true ]]; then break; fi fi - echo Sleep: $INTERVAL seconds before testing if $1 DOCKER is up. Total wait time up now is: $TIME seconds. Timeout is: $TIME_OUT seconds sleep $INTERVAL TIME=$(($TIME+$INTERVAL)) @@ -76,7 +99,7 @@ function healthCheck { function elasticHealthCheck { echo "Elastic Health-Check:" - + COUNTER=0 while [ $COUNTER -lt 20 ]; do echo "Waiting ES docker to start" @@ -85,10 +108,10 @@ function elasticHealthCheck { then break fi - let COUNTER=COUNTER+1 + let COUNTER=COUNTER+1 sleep 4 done - + healthCheck_http_code=$(curl -o /dev/null -w '%{http_code}' http://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=120s) if [[ "$health_Check_http_code" != 200 ]] then @@ -141,7 +164,7 @@ while [ $# -gt 0 ]; do done -[ -f /opt/config/env_name.txt ] && DEP_ENV=$(cat /opt/config/env_name.txt) || DEP_ENV=__ENV-NAME__ +[ -f /opt/config/env_name.txt ] && DEP_ENV=$(cat /opt/config/env_name.txt) || echo ${DEP_ENV} [ -f /opt/config/nexus_username.txt ] && NEXUS_USERNAME=$(cat /opt/config/nexus_username.txt) || NEXUS_USERNAME=release [ -f /opt/config/nexus_password.txt ] && NEXUS_PASSWD=$(cat /opt/config/nexus_password.txt) || NEXUS_PASSWD=sfWU3DFVdBr7GVxB85mTYgAW [ -f /opt/config/nexus_docker_repo.txt ] && NEXUS_DOCKER_REPO=$(cat /opt/config/nexus_docker_repo.txt) || NEXUS_DOCKER_REPO=nexus3.onap.org:${PORT} @@ -176,7 +199,7 @@ if [ ${LOCAL} = false ]; then echo "pulling code" docker pull ${PREFIX}/sdc-init-elasticsearch:${RELEASE} fi -docker run --name sdc-init-es --env ENVNAME="${DEP_ENV}" --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --memory 750m --ulimit memlock=-1:-1 --ulimit nofile=4096:100000 --volume /etc/localtime:/etc/localtime:ro --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments ${PREFIX}/sdc-init-elasticsearch:${RELEASE} +docker run --name sdc-init-es --env ENVNAME="${DEP_ENV}" --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --memory 750m --ulimit memlock=-1:-1 --ulimit nofile=4096:100000 --volume /etc/localtime:/etc/localtime:ro --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments ${PREFIX}/sdc-init-elasticsearch:${RELEASE} # Checking Elastic-Search-Init chef status if [ ! $? -eq 0 ]; then @@ -189,12 +212,23 @@ echo "docker run sdc-cassandra..." if [ ${LOCAL} = false ]; then docker pull ${PREFIX}/sdc-cassandra:${RELEASE} fi -docker run --detach --name sdc-cs --env RELEASE="${RELEASE}" --env ENVNAME="${DEP_ENV}" --env HOST_IP=${IP} --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --ulimit memlock=-1:-1 --ulimit nofile=4096:100000 --volume /etc/localtime:/etc/localtime:ro --volume ${WORKSPACE}/data/CS:/var/lib/cassandra --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments --publish 9042:9042 --publish 9160:9160 ${PREFIX}/sdc-cassandra:${RELEASE} +docker run -dit --name sdc-cs --env RELEASE="${RELEASE}" --env CS_PASSWORD="${CS_PASSWORD}" --env ENVNAME="${DEP_ENV}" --env HOST_IP=${IP} --env JVM_OPTS="-Xms1024m -Xmx1024m" --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --ulimit memlock=-1:-1 --ulimit nofile=4096:100000 --volume /etc/localtime:/etc/localtime:ro --volume ${WORKSPACE}/data/CS:/var/lib/cassandra --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments --publish 9042:9042 --publish 9160:9160 ${PREFIX}/sdc-cassandra:${RELEASE} /bin/sh echo "please wait while CS is starting..." monitor_docker sdc-cs + +# cassandra-init +echo "docker run sdc-cassandra-init..." +if [ ${LOCAL} = false ]; then + docker pull ${PREFIX}/sdc-cassandra-init:${RELEASE} +fi +docker run --name sdc-cs-init --env RELEASE="${RELEASE}" --env SDC_USER="${SDC_USER}" --env SDC_PASSWORD="${SDC_PASSWORD}" --env CS_PASSWORD="${CS_PASSWORD}" --env ENVNAME="${DEP_ENV}" --env HOST_IP=${IP} --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --ulimit memlock=-1:-1 --ulimit nofile=4096:100000 --volume /etc/localtime:/etc/localtime:ro --volume ${WORKSPACE}/data/CS:/var/lib/cassandra --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments --volume ${WORKSPACE}/data/CS-Init:/root/chef-solo/cache ${PREFIX}/sdc-cassandra-init:${RELEASE} > /dev/null 2>&1 +rc=$? +if [[ $rc != 0 ]]; then exit $rc; fi + + # kibana echo "docker run sdc-kibana..." if [ ${LOCAL} = false ]; then @@ -241,7 +275,7 @@ healthCheck if [[ (${RUNTESTS} = true) && (${healthCheck_http_code} == 200) ]]; then echo "docker run sdc-sanity..." echo "Triger sanity docker, please wait..." - + if [ ${LOCAL} = false ]; then docker pull ${PREFIX}/sdc-sanity:${RELEASE} fi @@ -250,4 +284,4 @@ docker run --detach --name sdc-sanity --env HOST_IP=${IP} --env ENVNAME="${DEP_E echo "please wait while SANITY is starting....." monitor_docker sdc-sanity -fi +fi \ No newline at end of file diff --git a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/01-configureCassandra.rb b/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/01-configureCassandra.rb index f167c3ec8d..32e89c9b21 100644 --- a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/01-configureCassandra.rb +++ b/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/01-configureCassandra.rb @@ -47,4 +47,4 @@ template "cassandra-rackdc.properties" do :dc => cluster_name, :rack => "Rack"+"#{rackNum}-"+node.chef_environment }) -end +end \ No newline at end of file diff --git a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/02-changeCSpass.rb b/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/02-changeCSpass.rb new file mode 100644 index 0000000000..22ef07907d --- /dev/null +++ b/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/02-changeCSpass.rb @@ -0,0 +1,16 @@ +template "/tmp/change_cassandra_pass.sh" do + source "change_cassandra_pass.sh.erb" + sensitive true + mode 0755 + variables({ + :cassandra_ip => node['Nodes']['CS'], + :cassandra_pwd => ENV['CS_PASSWORD'] + }) +end + + +bash "change-cassandra-pass" do + code <<-EOH + cd /tmp ; /tmp/change_cassandra_pass.sh + EOH +end \ No newline at end of file diff --git a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/02-createCsUser.rb b/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/02-createCsUser.rb deleted file mode 100644 index d9041f2841..0000000000 --- a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/02-createCsUser.rb +++ /dev/null @@ -1,17 +0,0 @@ -template "/tmp/create_cassandra_user.sh" do - source "create_cassandra_user.sh.erb" - sensitive true - mode 0755 - variables({ - :cassandra_ip => "HOSTIP", - :cassandra_pwd => node['cassandra'][:cassandra_password], - :cassandra_usr => node['cassandra'][:cassandra_user] - }) -end - - -bash "create-sdc-user" do - code <<-EOH - cd /tmp ; /tmp/create_cassandra_user.sh - EOH -end diff --git a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/03-createDoxKeyspace.rb b/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/03-createDoxKeyspace.rb deleted file mode 100644 index 4e37d49ee0..0000000000 --- a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/03-createDoxKeyspace.rb +++ /dev/null @@ -1,38 +0,0 @@ -template "/tmp/create_dox_keyspace.sh" do - source "create_dox_keyspace.sh.erb" - sensitive true - mode 0755 - variables({ - :cassandra_ip => "HOSTIP", - :DC_NAME => node['cassandra'][:cluster_name]+node.chef_environment, - :cassandra_pwd => node['cassandra'][:cassandra_password], - :cassandra_usr => node['cassandra'][:cassandra_user] - }) -end - - -remote_directory '/tmp/tools' do - source 'tools' - mode '0755' - files_mode '0755' - action :create -end - - -bash "onboard-db-schema-creation" do - ignore_failure true - code <<-EOH - cd /tmp/tools/build/scripts - chmod +x onboard-db-schema-creation.sh - bash /tmp/tools/build/scripts/onboard-db-schema-creation.sh - EOH -end - -bash "create-DOX-schema" do - ignore_failure true - code <<-EOH - cd /tmp - chmod +x /tmp/create_dox_keyspace.sh - /tmp/create_dox_keyspace.sh - EOH -end diff --git a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/03-prepareProbeFile.rb b/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/03-prepareProbeFile.rb new file mode 100644 index 0000000000..0eb9800fe5 --- /dev/null +++ b/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/03-prepareProbeFile.rb @@ -0,0 +1,9 @@ +template "/var/lib/ready-probe.sh" do + source "ready-probe.sh.erb" + sensitive true + mode 0755 + variables({ + :cassandra_ip => node['Nodes']['CS'], + :cassandra_pwd => ENV['CS_PASSWORD'] + }) +end \ No newline at end of file diff --git a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/04-schemaCreation.rb b/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/04-schemaCreation.rb deleted file mode 100644 index 0bb0027325..0000000000 --- a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/04-schemaCreation.rb +++ /dev/null @@ -1,65 +0,0 @@ -cookbook_file "/tmp/sdctool.tar" do - source "sdctool.tar" - mode 0755 -end - -## extract sdctool.tar -bash "install tar" do - cwd "/tmp" - code <<-EOH - /bin/tar xf /tmp/sdctool.tar -C /tmp - EOH -end - - -template "titan.properties" do - sensitive true - path "/tmp/sdctool/config/titan.properties" - source "titan.properties.erb" - mode "0755" - variables({ - :DC_NAME => node['cassandra'][:cluster_name]+node.chef_environment, - :cassandra_pwd => node['cassandra'][:cassandra_password], - :cassandra_usr => node['cassandra'][:cassandra_user], - :titan_connection_timeout => node['cassandra']['titan_connection_timeout'] - }) -end - - -template "/tmp/sdctool/config/configuration.yaml" do - sensitive true - source "configuration.yaml.erb" - mode 0755 - variables({ - :host_ip => node['HOST_IP'], - :catalog_port => node['BE'][:http_port], - :ssl_port => node['BE'][:https_port], - :cassandra_ip => node['Nodes']['CS'], - :rep_factor => 1, - :DC_NAME => node['cassandra'][:cluster_name]+node.chef_environment, - :titan_Path => "/tmp/sdctool/config/", - :socket_connect_timeout => node['cassandra']['socket_connect_timeout'], - :socket_read_timeout => node['cassandra']['socket_read_timeout'], - :cassandra_pwd => node['cassandra'][:cassandra_password], - :cassandra_usr => node['cassandra'][:cassandra_user] - }) -end - - -template "/tmp/sdctool/config/elasticsearch.yml" do - sensitive true - source "elasticsearch.yml.erb" - mode 0755 - variables({ - :elastic_ip => "HOSTIP" - }) -end - - -bash "excuting-schema-creation" do - code <<-EOH - cd /tmp - chmod +x /tmp/sdctool/scripts/schemaCreation.sh - /tmp/sdctool/scripts/schemaCreation.sh /tmp/sdctool/config - EOH -end diff --git a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/05-titanSchemaCreation.rb b/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/05-titanSchemaCreation.rb deleted file mode 100644 index fa9ae79690..0000000000 --- a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/05-titanSchemaCreation.rb +++ /dev/null @@ -1,68 +0,0 @@ -cookbook_file "/tmp/sdctool.tar" do - sensitive true - source "sdctool.tar" - mode 0755 -end - -## extract sdctool.tar -bash "install tar" do - cwd "/tmp" - code <<-EOH - /bin/tar xf /tmp/sdctool.tar -C /tmp - EOH -end - - -template "titan.properties" do - sensitive true - path "/tmp/sdctool/config/titan.properties" - source "titan.properties.erb" - mode "0755" - variables({ - :DC_NAME => node['cassandra'][:cluster_name]+node.chef_environment, - :cassandra_pwd => node['cassandra'][:cassandra_password], - :cassandra_usr => node['cassandra'][:cassandra_user], - :titan_connection_timeout => node['cassandra']['titan_connection_timeout'] - }) -end - - -template "/tmp/sdctool/config/configuration.yaml" do - sensitive true - source "configuration.yaml.erb" - mode 0755 - variables({ - :host_ip => node['HOST_IP'], - :catalog_port => node['BE'][:http_port], - :ssl_port => node['BE'][:https_port], - :cassandra_ip => node['Nodes']['CS'], - :rep_factor => 1, - :DC_NAME => node['cassandra'][:cluster_name]+node.chef_environment, - :titan_Path => "/tmp/sdctool/config", - :socket_connect_timeout => node['cassandra']['socket_connect_timeout'], - :socket_read_timeout => node['cassandra']['socket_read_timeout'], - :cassandra_pwd => node['cassandra'][:cassandra_password], - :cassandra_usr => node['cassandra'][:cassandra_user] - }) -end - -template "/tmp/sdctool/config/elasticsearch.yml" do - sensitive true - source "elasticsearch.yml.erb" - mode 0755 - variables({ - :elastic_ip => "HOSTIP" - }) -end - - -bash "excuting-titanSchemaCreation.sh" do - code <<-EOH - echo "XXXXXXXXXXXX executing /tmp/sdctool/scripts/titanSchemaCreation.sh XXXXXXXXXXXX" - chmod +x /tmp/sdctool/scripts/titanSchemaCreation.sh - /tmp/sdctool/scripts/titanSchemaCreation.sh /tmp/sdctool/config - EOH -end - - - diff --git a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/06-migrateZusammenFromDox.rb b/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/06-migrateZusammenFromDox.rb deleted file mode 100644 index e1fcf4f556..0000000000 --- a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/06-migrateZusammenFromDox.rb +++ /dev/null @@ -1,14 +0,0 @@ -#onboarding_version = "#{node['onboarding'][:version]}" -#GROUP_ID = "com/att/asdc/onboarding/#{onboarding_version}" -#NEXUS_IP = "#{node['nexus_ip']}" - -bash "Excuting openecomp-zusammen-migration-1707.0.0-SNAPSHOT.jar" do - code <<-EOH - [ -d /var/tmp/onboarding/migration ] && rm -rf /var/tmp/onboarding || mkdir -p /var/tmp/onboarding/migration - cd /var/tmp/onboarding/migration - /bin/tar -xzf /root/chef-solo/cookbooks/cassandra-actions/files/default/zusammen.tgz -C /var/tmp/onboarding/migration - cd /var/tmp/onboarding/migration - java -Dlog.home=/var/tmp/onboarding/migration/logs -Dconfiguration.yaml=/tmp/sdctool/config/configuration.yaml -jar openecomp-zusammen-migration-1707.0.0-SNAPSHOT.jar org.openecomp.core.migration.MigrationMain - EOH -end - diff --git a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/07-importComformance.rb b/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/07-importComformance.rb deleted file mode 100644 index ce1d50b8ea..0000000000 --- a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/07-importComformance.rb +++ /dev/null @@ -1,28 +0,0 @@ -working_directory = "/tmp" -cl_release=node['version'].split('.')[0..2].join('.').split('-')[0] -printf("\033[33mcl_release=[%s]\n\033[0m", cl_release) - - - -bash "import-Comformance" do - cwd "#{working_directory}" - code <<-EOH - conf_dir=/tmp/sdctool/config - tosca_dir=/tmp/sdctool/tosca - - cl_version=`grep 'toscaConformanceLevel:' $conf_dir/configuration.yaml |awk '{print $2}'` - - cd /tmp/sdctool/scripts - /bin/chmod +x sdcSchemaFileImport.sh - echo "execute /tmp/sdctool/scripts/sdcSchemaFileImport.sh ${tosca_dir} #{cl_release} ${cl_version} ${conf_dir} " - ./sdcSchemaFileImport.sh ${tosca_dir} #{cl_release} ${cl_version} ${conf_dir} - EOH -end -bash "echo status" do - code <<-EOH - echo "DOCKER STARTED" - EOH -end - - - diff --git a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/change_cassandra_pass.sh.erb b/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/change_cassandra_pass.sh.erb new file mode 100644 index 0000000000..d1fdcf3c2c --- /dev/null +++ b/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/change_cassandra_pass.sh.erb @@ -0,0 +1,31 @@ +#!/bin/bash + +CASSANDRA_PASS=<%= @cassandra_pwd %> +CASSANDRA_IP=<%= @cassandra_ip %> + +pass_changed=99 +retry_num=1 +is_up=0 +while [ $is_up -eq 0 -a $retry_num -le 100 ]; do + echo "exit" | cqlsh -u cassandra -p cassandra $CASSANDRA_IP > /dev/null 2>&1 + res1=$? + echo "exit" | cqlsh -u cassandra -p $CASSANDRA_PASS $CASSANDRA_IP > /dev/null 2>&1 + res2=$? + + if [ $res1 -eq 0 -o $res2 -eq 0 ]; then + echo "`date` --- cqlsh is enabled to connect." + is_up=1 + else + echo "`date` --- cqlsh is NOT enabled to connect yet. sleep 5" + sleep 5 + fi + let "retry_num++" +done + +if [ $res1 -eq 0 -a $res2 -eq 1 -a $is_up -eq 1 ]; then + echo "Modify cassandra password" + echo "ALTER USER cassandra WITH PASSWORD '$CASSANDRA_PASS';" | cqlsh -u cassandra -p cassandra $CASSANDRA_IP +elif [ $res1 -eq 1 -a $res2 -eq 0 -a $is_up -eq 1 ]; then + echo "cassandra password already modified" +else exit 1 +fi \ No newline at end of file diff --git a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/configuration.yaml.erb b/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/configuration.yaml.erb deleted file mode 100644 index f99737b0f9..0000000000 --- a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/configuration.yaml.erb +++ /dev/null @@ -1,611 +0,0 @@ -identificationHeaderFields: - - HTTP_IV_USER - - HTTP_CSP_FIRSTNAME - - HTTP_CSP_LASTNAME - - HTTP_IV_REMOTE_ADDRESS - - HTTP_CSP_WSTYPE - - -# catalog backend hostname -beFqdn: <%= @host_ip %> - -# catalog backend http port -beHttpPort: <%= @catalog_port %> - -# catalog backend http context -beContext: /sdc/rest/config/get - -# catalog backend protocol -beProtocol: http - -# catalog backend ssl port -beSslPort: <%= @ssl_port %> -version: 1.0 -released: 2012-11-30 -toscaConformanceLevel: 5.0 -minToscaConformanceLevel: 3.0 - -titanCfgFile: <%= @titan_Path %>/titan.properties -titanInMemoryGraph: false -titanLockTimeout: 1800 -# The interval to try and reconnect to titan DB when it is down during ASDC startup: -titanReconnectIntervalInSeconds: 3 - -# The read timeout towards Titan DB when health check is invoked: -titanHealthCheckReadTimeout: 1 - -# The interval to try and reconnect to Elasticsearch when it is down during ASDC startup: - -esReconnectIntervalInSeconds: 3 -uebHealthCheckReconnectIntervalInSeconds: 15 -uebHealthCheckReadTimeout: 4 - -# Protocols -protocols: - - http - - https - -# Default imports -defaultImports: - - nodes: - file: nodes.yml - - datatypes: - file: data.yml - - capabilities: - file: capabilities.yml - - relationships: - file: relationships.yml - - groups: - file: groups.yml - - policies: - file: policies.yml - -# Users -users: - tom: passwd - bob: passwd - - -cassandraConfig: - cassandraHosts: [<%= @cassandra_ip %>] - localDataCenter: <%= @DC_NAME %> - reconnectTimeout : 30000 - socketReadTimeout: <%= @socket_read_timeout %> - socketConnectTimeout: <%= @socket_connect_timeout %> - authenticate: true - username: asdc_user - password: Aa1234%^! - ssl: false - truststorePath : /config/.truststore - truststorePassword : Aa123456 - keySpaces: - - { name: dox, replicationStrategy: NetworkTopologyStrategy, replicationInfo: ['<%= @DC_NAME %>','<%= @rep_factor %>']} - - { name: sdcaudit, replicationStrategy: NetworkTopologyStrategy, replicationInfo: ['<%= @DC_NAME %>','<%= @rep_factor %>']} - - { name: sdcartifact, replicationStrategy: NetworkTopologyStrategy, replicationInfo: ['<%= @DC_NAME %>','<%= @rep_factor %>']} - - { name: sdccomponent, replicationStrategy: NetworkTopologyStrategy, replicationInfo: ['<%= @DC_NAME %>','<%= @rep_factor %>']} - - { name: sdcrepository, replicationStrategy: NetworkTopologyStrategy, replicationInfo: ['<%= @DC_NAME %>','<%= @rep_factor %>']} - -#Application-specific settings of ES -elasticSearch: - # Mapping of index prefix to time-based frame. For example, if below is configured: - # - # - indexPrefix: auditingevents - # creationPeriod: minute - # - # then ES object of type which is mapped to "auditingevents-*" template, and created on 2015-12-23 13:24:54, will enter "auditingevents-2015-12-23-13-24" index. - # Another object created on 2015-12-23 13:25:54, will enter "auditingevents-2015-12-23-13-25" index. - # If creationPeriod: month, both of the above will enter "auditingevents-2015-12" index. - # - # PLEASE NOTE: the timestamps are created in UTC/GMT timezone! This is needed so that timestamps will be correctly presented in Kibana. - # - # Legal values for creationPeriod - year, month, day, hour, minute, none (meaning no time-based behaviour). - # - # If no creationPeriod is configured for indexPrefix, default behavour is creationPeriod: month. - - indicesTimeFrequency: - - indexPrefix: auditingevents - creationPeriod: month - - indexPrefix: monitoring_events - creationPeriod: month -artifactTypes: - - CHEF - - PUPPET - - SHELL - - YANG - - YANG_XML - - HEAT - - BPEL - - DG_XML - - MURANO_PKG - - WORKFLOW - - NETWORK_CALL_FLOW - - TOSCA_TEMPLATE - - TOSCA_CSAR - - AAI_SERVICE_MODEL - - AAI_VF_MODEL - - AAI_VF_MODULE_MODEL - - AAI_VF_INSTANCE_MODEL - - OTHER - - SNMP_POLL - - SNMP_TRAP - - GUIDE - -licenseTypes: - - User - - Installation - - CPU - -#Deployment artifacts placeHolder -resourceTypes: &allResourceTypes - - VFC - - CP - - VL - - VF - - VFCMT - - Abstract - -# validForResourceTypes usage -# validForResourceTypes: -# - VF -# - VL -deploymentResourceArtifacts: - - -deploymentResourceInstanceArtifacts: - heatEnv: - displayName: "HEAT ENV" - type: HEAT_ENV - description: "Auto-generated HEAT Environment deployment artifact" - fileExtension: "env" - VfHeatEnv: - displayName: "VF HEAT ENV" - type: HEAT_ENV - description: "VF Auto-generated HEAT Environment deployment artifact" - fileExtension: "env" - -#tosca artifacts placeholders -toscaArtifacts: - assetToscaTemplate: - artifactName: -template.yml - displayName: Tosca Template - type: TOSCA_TEMPLATE - description: TOSCA representation of the asset - assetToscaCsar: - artifactName: -csar.csar - displayName: Tosca Model - type: TOSCA_CSAR - description: TOSCA definition package of the asset - -#Informational artifacts placeHolder -excludeResourceCategory: - - Generic -informationalResourceArtifacts: - features: - displayName: Features - type: OTHER - capacity: - displayName: Capacity - type: OTHER - vendorTestResult: - displayName: Vendor Test Result - type: OTHER - testScripts: - displayName: Test Scripts - type: OTHER - CloudQuestionnaire: - displayName: Cloud Questionnaire (completed) - type: OTHER - HEATTemplateFromVendor: - displayName: HEAT Template from Vendor - type: HEAT - resourceSecurityTemplate: - displayName: Resource Security Template - type: OTHER - -excludeServiceCategory: - -informationalServiceArtifacts: - serviceArtifactPlan: - displayName: Service Artifact Plan - type: OTHER - summaryOfImpactsToECOMPElements: - displayName: Summary of impacts to ECOMP elements,OSSs, BSSs - type: OTHER - controlLoopFunctions: - displayName: Control Loop Functions - type: OTHER - dimensioningInfo: - displayName: Dimensioning Info - type: OTHER - affinityRules: - displayName: Affinity Rules - type: OTHER - operationalPolicies: - displayName: Operational Policies - type: OTHER - serviceSpecificPolicies: - displayName: Service-specific Policies - type: OTHER - engineeringRules: - displayName: Engineering Rules (ERD) - type: OTHER - distributionInstructions: - displayName: Distribution Instructions - type: OTHER - certificationTestResults: - displayName: TD Certification Test Results - type: OTHER - deploymentVotingRecord: - displayName: Deployment Voting Record - type: OTHER - serviceQuestionnaire: - displayName: Service Questionnaire - type: OTHER - serviceSecurityTemplate: - displayName: Service Security Template - type: OTHER - -serviceApiArtifacts: - configuration: - displayName: Configuration - type: OTHER - instantiation: - displayName: Instantiation - type: OTHER - monitoring: - displayName: Monitoring - type: OTHER - reporting: - displayName: Reporting - type: OTHER - logging: - displayName: Logging - type: OTHER - testing: - displayName: Testing - type: OTHER - - -additionalInformationMaxNumberOfKeys: 50 - -systemMonitoring: - enabled: true - isProxy: false - probeIntervalInSeconds: 15 -defaultHeatArtifactTimeoutMinutes: 60 - -serviceDeploymentArtifacts: - YANG_XML: - acceptedTypes: - - xml - VNF_CATALOG: - acceptedTypes: - - xml - MODEL_INVENTORY_PROFILE: - acceptedTypes: - - xml - MODEL_QUERY_SPEC: - acceptedTypes: - - xml - AAI_SERVICE_MODEL: - acceptedTypes: - - xml - AAI_VF_MODULE_MODEL: - acceptedTypes: - - xml - AAI_VF_INSTANCE_MODEL: - acceptedTypes: - - xml - OTHER: - acceptedTypes: - - -resourceDeploymentArtifacts: - HEAT: - acceptedTypes: - - yaml - - yml - validForResourceTypes: *allResourceTypes - HEAT_VOL: - acceptedTypes: - - yaml - - yml - validForResourceTypes: *allResourceTypes - HEAT_NET: - acceptedTypes: - - yaml - - yml - validForResourceTypes: *allResourceTypes - HEAT_NESTED: - acceptedTypes: - - yaml - - yml - validForResourceTypes: *allResourceTypes - HEAT_ARTIFACT: - acceptedTypes: - validForResourceTypes: *allResourceTypes - YANG_XML: - acceptedTypes: - - xml - validForResourceTypes: *allResourceTypes - VNF_CATALOG: - acceptedTypes: - - xml - validForResourceTypes: *allResourceTypes - VF_LICENSE: - acceptedTypes: - - xml - validForResourceTypes: *allResourceTypes - VENDOR_LICENSE: - acceptedTypes: - - xml - validForResourceTypes: *allResourceTypes - MODEL_INVENTORY_PROFILE: - acceptedTypes: - - xml - validForResourceTypes: *allResourceTypes - MODEL_QUERY_SPEC: - acceptedTypes: - - xml - validForResourceTypes: *allResourceTypes - LIFECYCLE_OPERATIONS: - acceptedTypes: - - yaml - - yml - validForResourceTypes: - - VF - - VFC - VES_EVENTS: - acceptedTypes: - - yaml - - yml - validForResourceTypes: *allResourceTypes - PERFORMANCE_COUNTER: - acceptedTypes: - - csv - validForResourceTypes: *allResourceTypes - APPC_CONFIG: - acceptedTypes: - validForResourceTypes: - - VF - DCAE_TOSCA: - acceptedTypes: - - yml - - yaml - validForResourceTypes: - - VF - - VFCMT - DCAE_JSON: - acceptedTypes: - - json - validForResourceTypes: - - VF - - VFCMT - DCAE_POLICY: - acceptedTypes: - - emf - validForResourceTypes: - - VF - - VFCMT - DCAE_DOC: - acceptedTypes: - validForResourceTypes: - - VF - - VFCMT - DCAE_EVENT: - acceptedTypes: - validForResourceTypes: - - VF - - VFCMT - AAI_VF_MODEL: - acceptedTypes: - - xml - validForResourceTypes: - - VF - AAI_VF_MODULE_MODEL: - acceptedTypes: - - xml - validForResourceTypes: - - VF - OTHER: - acceptedTypes: - validForResourceTypes: *allResourceTypes - SNMP_POLL: - acceptedTypes: - validForResourceTypes: *allResourceTypes - SNMP_TRAP: - acceptedTypes: - validForResourceTypes: *allResourceTypes - -resourceInstanceDeploymentArtifacts: - HEAT_ENV: - acceptedTypes: - - env - VF_MODULES_METADATA: - acceptedTypes: - - json - VES_EVENTS: - acceptedTypes: - - yaml - - yml - PERFORMANCE_COUNTER: - acceptedTypes: - - csv - DCAE_INVENTORY_TOSCA: - acceptedTypes: - - yml - - yaml - DCAE_INVENTORY_JSON: - acceptedTypes: - - json - DCAE_INVENTORY_POLICY: - acceptedTypes: - - emf - DCAE_INVENTORY_DOC: - acceptedTypes: - DCAE_INVENTORY_BLUEPRINT: - acceptedTypes: - DCAE_INVENTORY_EVENT: - acceptedTypes: - SNMP_POLL: - acceptedTypes: - validForResourceTypes: *allResourceTypes - SNMP_TRAP: - acceptedTypes: - validForResourceTypes: *allResourceTypes - -resourceInformationalArtifacts: - CHEF: - acceptedTypes: - validForResourceTypes: *allResourceTypes - PUPPET: - acceptedTypes: - validForResourceTypes: *allResourceTypes - SHELL: - acceptedTypes: - validForResourceTypes: *allResourceTypes - YANG: - acceptedTypes: - validForResourceTypes: *allResourceTypes - YANG_XML: - acceptedTypes: - validForResourceTypes: *allResourceTypes - HEAT: - acceptedTypes: - validForResourceTypes: *allResourceTypes - BPEL: - acceptedTypes: - validForResourceTypes: *allResourceTypes - DG_XML: - acceptedTypes: - validForResourceTypes: *allResourceTypes - MURANO_PKG: - acceptedTypes: - validForResourceTypes: *allResourceTypes - OTHER: - acceptedTypes: - validForResourceTypes: *allResourceTypes - SNMP_POLL: - acceptedTypes: - validForResourceTypes: *allResourceTypes - SNMP_TRAP: - acceptedTypes: - validForResourceTypes: *allResourceTypes - GUIDE: - acceptedTypes: - validForResourceTypes: - - VF - - VFC - -resourceInformationalDeployedArtifacts: - - -requirementsToFulfillBeforeCert: - -capabilitiesToConsumeBeforeCert: - -unLoggedUrls: - - /sdc2/rest/healthCheck - -cleanComponentsConfiguration: - cleanIntervalInMinutes: 1440 - componentsToClean: - - Resource - - Service - -artifactsIndex: resources - -heatEnvArtifactHeader: "" -heatEnvArtifactFooter: "" - -onboarding: - protocol: http - host: <%= @host_ip %> - port: <%= @catalog_port %> - downloadCsarUri: "/onboarding-api/v1.0/vendor-software-products/packages" - healthCheckUri: "/onboarding-api/v1.0/healthcheck" - -dcae: - protocol: http - host: <%= @host_ip %> - port: <%= @catalog_port %> - healthCheckUri: "/dcae/healthCheck" - -# #GSS IDNS -switchoverDetector: - gBeFqdn: - gFeFqdn: - beVip: 1.2.3.4 - feVip: 1.2.3.4 - beResolveAttempts: 3 - feResolveAttempts: 3 - enabled: false - interval: 60 - changePriorityUser: ecompasdc - changePriorityPassword: ecompasdc123 - publishNetworkUrl: - publishNetworkBody: '{"note":"comment"}' - groups: - beSet: { changePriorityUrl: "", changePriorityBody: '{"name":"","uri":"","no_ad_redirection":false,"v4groups":{"failover_groups":["","","failover_policy":["FAILALL"]},"comment":"","intended_app_proto":"DNS"}'} - feSet: { changePriorityUrl: "", changePriorityBody: '{"name":"","uri":"","no_ad_redirection":false,"v4groups":{"failover_groups":["",""],"failover_policy":["FAILALL"]},"comment":"","intended_app_proto":"DNS"}'} - -applicationL1Cache: - datatypes: - enabled: true - firstRunDelay: 10 - pollIntervalInSec: 60 - -applicationL2Cache: - enabled: true - catalogL1Cache: - enabled: true - resourcesSizeInCache: 300 - servicesSizeInCache: 200 - productsSizeInCache: 100 - queue: - syncIntervalInSecondes: 43200 - waitOnShutDownInMinutes: 10 - numberOfCacheWorkers: 4 - -toscaValidators: - stringMaxLength: 2500 - -disableAudit: false -vfModuleProperties: - min_vf_module_instances: - forBaseModule: 1 - forNonBaseModule: 0 - max_vf_module_instances: - forBaseModule: 1 - forNonBaseModule: - initial_count: - forBaseModule: 1 - forNonBaseModule: 0 - vf_module_type: - forBaseModule: Base - forNonBaseModule: Expansion - -genericAssetNodeTypes: - VFC: org.openecomp.resource.abstract.nodes.VFC - VF : org.openecomp.resource.abstract.nodes.VF - Service: org.openecomp.resource.abstract.nodes.service - -workloadContext: Production - -environmentContext: - defaultValue: General_Revenue-Bearing - validValues: - - Critical_Revenue-Bearing - - Vital_Revenue-Bearing - - Essential_Revenue-Bearing - - Important_Revenue-Bearing - - Needed_Revenue-Bearing - - Useful_Revenue-Bearing - - General_Revenue-Bearing - - Critical_Non-Revenue - - Vital_Non-Revenue - - Essential_Non-Revenue - - Important_Non-Revenue - - Needed_Non-Revenue - - Useful_Non-Revenue - - General_Non-Revenue diff --git a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/create_cassandra_user.sh.erb b/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/create_cassandra_user.sh.erb deleted file mode 100644 index 9fcf165f44..0000000000 --- a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/create_cassandra_user.sh.erb +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash - -CASSANDRA_USER=<%= @cassandra_usr %> -CASSANDRA_PASS=<%= @cassandra_pwd %> -CASSANDRA_IP=<%= @cassandra_ip %> - -pass_changed=99 -retry_num=1 -is_up=0 -while [ $is_up -eq 0 -a $retry_num -le 100 ]; do - echo "exit" | cqlsh -u cassandra -p cassandra $CASSANDRA_IP > /dev/null 2>&1 - res1=$? - echo "exit" | cqlsh -u cassandra -p $CASSANDRA_PASS $CASSANDRA_IP > /dev/null 2>&1 - res2=$? - - if [ $res1 -eq 0 -o $res2 -eq 0 ]; then - echo "`date` --- cqlsh is enabled to connect." - is_up=1 - [ $res1 -eq 0 ] && pass_changed=0 - [ $res2 -eq 0 ] && pass_changed=1 - else - echo "`date` --- cqlsh is NOT enabled to connect yet. sleep 5" - sleep 5 - fi - let "retry_num++" -done - - -echo "pass_changed=[$pass_changed]" -case $pass_changed in - 0) - cassandra_user_exist=`echo "list users;" | cqlsh -u cassandra -p cassandra $CASSANDRA_IP |grep -c $CASSANDRA_USER` - if [ $cassandra_user_exist -eq 1 ] ; then - echo "cassandra user $CASSANDRA_USER already exist" - echo "alter user $CASSANDRA_USER with password '$CASSANDRA_PASS' nosuperuser;" | cqlsh -u cassandra -p cassandra $CASSANDRA_IP - else - echo "Going to create $CASSANDRA_USER" - echo "create user $CASSANDRA_USER with password '$CASSANDRA_PASS' nosuperuser;" | cqlsh -u cassandra -p cassandra $CASSANDRA_IP - fi - echo "Modify cassandra password" - echo "ALTER USER cassandra WITH PASSWORD '$CASSANDRA_PASS';" | cqlsh -u cassandra -p cassandra $CASSANDRA_IP - ;; - 1) - cassandra_user_exist=`echo "list users;" | cqlsh -u cassandra -p $CASSANDRA_PASS $CASSANDRA_IP |grep -c $CASSANDRA_USER` - if [ $cassandra_user_exist -eq 1 ] ; then - echo "cassandra user $CASSANDRA_USER already exist" - echo "alter user $CASSANDRA_USER with password '$CASSANDRA_PASS' nosuperuser;" | cqlsh -u cassandra -p $CASSANDRA_PASS $CASSANDRA_IP - else - echo "Going to create $CASSANDRA_USER" - echo "create user $CASSANDRA_USER with password '$CASSANDRA_PASS' nosuperuser;" | cqlsh -u cassandra -p $CASSANDRA_PASS $CASSANDRA_IP - fi - ;; - *) - echo "pass_changed doen't have value" - ;; -esac - diff --git a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/create_dox_keyspace.sh.erb b/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/create_dox_keyspace.sh.erb deleted file mode 100644 index e316234d1e..0000000000 --- a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/create_dox_keyspace.sh.erb +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -CASSANDRA_USER='<%= @cassandra_usr %>' -CASSANDRA_PASS='<%= @cassandra_pwd %>' - -KEYSPACE="CREATE KEYSPACE IF NOT EXISTS dox WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', '<%= @DC_NAME %>': '1'};" -KEYSPACE1="CREATE KEYSPACE IF NOT EXISTS zusammen_dox WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', '<%= @DC_NAME %>': '1'};" - -echo "run create_dox_keyspace.cql" -echo -e "$KEYSPACE\n$KEYSPACE1" > /tmp/create_dox_keyspace.cql - -chmod 755 /tmp/create_dox_keyspace.cql -cqlsh -u $CASSANDRA_USER -p $CASSANDRA_PASS -f /tmp/create_dox_keyspace.cql > /dev/null 2>&1 - - -res=`echo "select keyspace_name from system.schema_keyspaces ;" | cqlsh -u $CASSANDRA_USER -p $CASSANDRA_PASS |grep -c dox 2>/dev/null` - -if [ $res -gt 0 ]; then - echo "`date` --- dox keyspace was created " -else - echo "`date` --- Failed to create dox keyspace" -fi - - -echo "run create_dox_db.cql" -chmod 755 /tmp/tools/build/scripts/create_dox_db.cql -cqlsh -u $CASSANDRA_USER -p $CASSANDRA_PASS -f /tmp/tools/build/scripts/create_dox_db.cql > /dev/null 2>&1 - -sleep 10 - -echo "run alter_dox_db.cql" -chmod 755 /tmp/tools/build/scripts/alter_dox_db.cql -cqlsh -u $CASSANDRA_USER -p $CASSANDRA_PASS -f /tmp/tools/build/scripts/alter_dox_db.cql > /dev/null 2>&1 - diff --git a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/elasticsearch.yml.erb b/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/elasticsearch.yml.erb deleted file mode 100644 index 79d11f4610..0000000000 --- a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/elasticsearch.yml.erb +++ /dev/null @@ -1,11 +0,0 @@ -discovery.zen.ping.multicast.enabled: false -discovery.zen.ping.unicast.enabled: true -node.name: asdc-01 -cluster.name: elasticsearch -node.master: false -node.data: false -http.cors.enabled: true -path.home: "/var/lib/jetty/config" -elasticSearch.transportclient: true -transport.client.initial_nodes: - - <%= @elastic_ip %>:9300 diff --git a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/ready-probe.sh.erb b/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/ready-probe.sh.erb new file mode 100644 index 0000000000..2f97d0768e --- /dev/null +++ b/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/ready-probe.sh.erb @@ -0,0 +1,16 @@ +#!/bin/bash + +CASSANDRA_PASS=<%= @cassandra_pwd %> +CASSANDRA_IP=<%= @cassandra_ip %> + +if [[ $(nodetool status |tail -n2 | grep -Ev "^$"a) == *"UN"* ]]; then + echo "exit" | cqlsh -u cassandra -p $CASSANDRA_PASS $CASSANDRA_IP > /dev/null 2>&1 + rc=$? + if [[ $rc != 0 ]]; then exit $rc; fi + fi + exit 0; +else + echo "Not Up"; + exit 1; +fi + diff --git a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/titan.properties.erb b/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/titan.properties.erb deleted file mode 100644 index 6f7859e184..0000000000 --- a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/titan.properties.erb +++ /dev/null @@ -1,29 +0,0 @@ -storage.backend=cassandra -storage.hostname=localhost -storage.port=9160 -storage.username=<%= @cassandra_usr %> -storage.password=<%= @cassandra_pwd %> -storage.connection-timeout=<%= @titan_connection_timeout %> -storage.cassandra.keyspace=sdctitan - - -storage.cassandra.ssl.enabled=false -storage.cassandra.ssl.truststore.location=/var/lib/jetty/config/.truststore -storage.cassandra.ssl.truststore.password=Aa123456 - -storage.cassandra.read-consistency-level=LOCAL_QUORUM -storage.cassandra.write-consistency-level=LOCAL_QUORUM -storage.cassandra.replication-strategy-class=org.apache.cassandra.locator.NetworkTopologyStrategy -storage.cassandra.replication-strategy-options=<%= @DC_NAME %>,1 -storage.cassandra.astyanax.local-datacenter=<%= @DC_NAME %> - -cache.db-cache = false -cache.db-cache-clean-wait = 20 -cache.db-cache-time = 180000 -cache.db-cache-size = 0.5 - -cache.tx-cache-size = 1000000 - -storage.lock.retries=5 -storage.lock.wait-time=500 - diff --git a/sdc-os-chef/sdc-cassandra/chef-solo/roles/cassandra-actions.json b/sdc-os-chef/sdc-cassandra/chef-solo/roles/cassandra-actions.json index d8155e2068..cd8478c5ca 100644 --- a/sdc-os-chef/sdc-cassandra/chef-solo/roles/cassandra-actions.json +++ b/sdc-os-chef/sdc-cassandra/chef-solo/roles/cassandra-actions.json @@ -10,11 +10,8 @@ }, "chef_type": "role", "run_list": [ - "recipe[cassandra-actions::02-createCsUser]", - "recipe[cassandra-actions::03-createDoxKeyspace]", - "recipe[cassandra-actions::04-schemaCreation]", - "recipe[cassandra-actions::05-titanSchemaCreation]", - "recipe[cassandra-actions::07-importComformance]" + "recipe[cassandra-actions::02-changeCSpass]", + "recipe[cassandra-actions::03-prepareProbeFile]" ], "env_run_lists": { diff --git a/sdc-os-chef/sdc-cassandra/startup.sh b/sdc-os-chef/sdc-cassandra/startup.sh index 49edc26130..0daa82ff88 100755 --- a/sdc-os-chef/sdc-cassandra/startup.sh +++ b/sdc-os-chef/sdc-cassandra/startup.sh @@ -1,26 +1,16 @@ #!/bin/bash cd /root/chef-solo -echo "normal['HOST_IP'] = \"${HOST_IP}\"" >> /root/chef-solo/cookbooks/cassandra-actions/attributes/default.rb - -export CHEFNAME=${ENVNAME} - -sed -i "s/HOSTIP/${HOST_IP}/g" /root/chef-solo/cookbooks/cassandra-actions/recipes/02-createCsUser.rb -sed -i "s/HOSTIP/${HOST_IP}/g" /root/chef-solo/cookbooks/cassandra-actions/recipes/03-createDoxKeyspace.rb -sed -i "s/HOSTIP/${HOST_IP}/g" /root/chef-solo/cookbooks/cassandra-actions/recipes/04-schemaCreation.rb - -chef-solo -c solo.rb -o recipe[cassandra-actions::01-configureCassandra] -E ${CHEFNAME} +chef-solo -c solo.rb -o recipe[cassandra-actions::01-configureCassandra] -E ${ENVNAME} rc=$? - if [[ $rc != 0 ]]; then exit $rc; fi + echo "########### starting cassandra ###########" # start cassandra /docker-entrypoint.sh cassandra -f & -sleep 10 - -chef-solo -c solo.rb -E ${CHEFNAME} -rc=$? +chef-solo -c solo.rb -E ${ENVNAME} if [[ $rc != 0 ]]; then exit $rc; fi -while true; do sleep 2; done + +exec "$@"; diff --git a/sdc-os-chef/sdc-sanity/startup.sh b/sdc-os-chef/sdc-sanity/startup.sh index 3a56a302f6..349741c353 100644 --- a/sdc-os-chef/sdc-sanity/startup.sh +++ b/sdc-os-chef/sdc-sanity/startup.sh @@ -1,5 +1,14 @@ #!/bin/bash -export CHEFNAME=${ENVNAME} cd /root/chef-solo -chef-solo -c solo.rb -E ${CHEFNAME} \ No newline at end of file +chef-solo -c solo.rb -E ${ENVNAME} + +rc=$? + +if [[ $rc != 0 ]]; then + echo "Sanity failed !!!" + exit $rc +else + echo "completed successfully :-)" + exit 0 +fi \ No newline at end of file -- cgit 1.2.3-korg