From c36ccc452171c77c6985d0a511b12e1c9fb1b7dd Mon Sep 17 00:00:00 2001 From: Jerry Flood Date: Wed, 17 Oct 2018 10:31:22 -0400 Subject: Updates to build docker images Issue-ID: OPTFRA-373 Change-Id: I3461fb4df7526412525c1ab9ca318316a53e27e9 Signed-off-by: Jerry Flood --- .../extra/docker/cmso-service/docker-compose.yml | 32 ++++ .../extra/docker/etc/config/cmso.properties | 104 +++++++++++ .../extra/docker/etc/config/liquibase.properties | 54 ++++++ .../extra/docker/etc/config/optimizer.properties | 34 ++++ .../extra/docker/etc/config/ticketmgt.properties | 38 ++++ cmso-service/extra/docker/mariadb/conf1/my.cnf | 194 +++++++++++++++++++++ cmso-service/extra/docker/mariadb/conf2/my.cnf | 193 ++++++++++++++++++++ cmso-service/extra/docker/mariadb/conf3/my.cnf | 193 ++++++++++++++++++++ cmso-service/pom.xml | 188 ++++++++++++-------- cmso-service/src/main/docker/Dockerfile | 36 +++- .../src/main/docker/assembly/cmso-files.xml | 65 +++++++ .../src/main/docker/extra-files/startService.sh | 4 + cmso-service/src/main/docker/startService.sh | 4 - cmso-service/src/main/resources/system.properties | 48 ----- 14 files changed, 1055 insertions(+), 132 deletions(-) create mode 100644 cmso-service/extra/docker/cmso-service/docker-compose.yml create mode 100644 cmso-service/extra/docker/etc/config/cmso.properties create mode 100644 cmso-service/extra/docker/etc/config/liquibase.properties create mode 100644 cmso-service/extra/docker/etc/config/optimizer.properties create mode 100644 cmso-service/extra/docker/etc/config/ticketmgt.properties create mode 100644 cmso-service/extra/docker/mariadb/conf1/my.cnf create mode 100644 cmso-service/extra/docker/mariadb/conf2/my.cnf create mode 100644 cmso-service/extra/docker/mariadb/conf3/my.cnf create mode 100644 cmso-service/src/main/docker/assembly/cmso-files.xml create mode 100644 cmso-service/src/main/docker/extra-files/startService.sh delete mode 100644 cmso-service/src/main/docker/startService.sh delete mode 100644 cmso-service/src/main/resources/system.properties (limited to 'cmso-service') diff --git a/cmso-service/extra/docker/cmso-service/docker-compose.yml b/cmso-service/extra/docker/cmso-service/docker-compose.yml new file mode 100644 index 0000000..d483e55 --- /dev/null +++ b/cmso-service/extra/docker/cmso-service/docker-compose.yml @@ -0,0 +1,32 @@ +version: '2' + +services: + db: + image: mariadb:10.1.11 + volumes: + - "/var/lib/mysql" + - "../mariadb/conf1:/etc/mysql/conf.d:ro" + environment: + - MYSQL_ROOT_PASSWORD=beer + ports: + - "3306:3306" + + db-init: + image: onap/cmso-dbinit + volumes: + - "../etc:/share/etc:rw" + - "../logs:/share/logs:rw" + depends_on: + - db + + cmso-service: + image: onap/cmso-service + volumes: + - "../etc:/share/etc:rw" + - "../logs:/share/logs:rw" + - "../debug-logs:/share/debug-logs:rw" + depends_on: + - db + ports: + - "8080:8080" + diff --git a/cmso-service/extra/docker/etc/config/cmso.properties b/cmso-service/extra/docker/etc/config/cmso.properties new file mode 100644 index 0000000..d7fa819 --- /dev/null +++ b/cmso-service/extra/docker/etc/config/cmso.properties @@ -0,0 +1,104 @@ + +#------------------------------------------------------------------------------- +# Copyright 2017-2018 AT&T Intellectual Property. +# Modifications Copyright 2018 IBM. +# +# 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. +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the ??License?); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# 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. +#------------------------------------------------------------------------------- +### + +### MySQL DB. +spring.datasource.url=jdbc:mariadb://192.168.56.101:3306/cmso +spring.datasource.driver-class-name=org.mariadb.jdbc.Driver +spring.datasource.username=root +spring.datasource.password=beer +cmso.database.password=beer + +spring.datasource.initialize=false +spring.datasource.tomcat.max-wait=10000 +spring.datasource.tomcat.initialSize=5 +spring.datasource.tomcat.max-active=25 +spring.datasource.tomcat.test-on-borrow=true + +spring.jpa.show-sql=true +spring.jpa.hibernate.ddl-auto=none +spring.jpa.hibernate.naming.strategy=org.hibernate.cfg.EJB3NamingStrategy +spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect +spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl +spring.jpa.hibernate.id.new_generator_mappings=false +hibernate.id.new_generator_mappings=false + +logging.level.org.hibernate.SQL=TRACE + +logging.level.org.hibernate=TRACE + +# +cmso.aaf.enabled=false + +# Enable swagger - Enable in development and test only +cmso.swagger.enabled=true + +# Enable schedule immediate to be dispatched without ticket approvals +# Has no effect when in vTM loopback mode as always approved. +cmso.cm.dispatch.immediate.enabled = true + +# NUmber of seconds between sniro dispatch jobs +cmso.optimizer.job.interval.ms=10000 + +# NUmber of seconds between change management cmso polling jobs +# Controls frequenct of polling to the ChangeManagementScheduler table... +cmso.cm.polling.job.interval.ms=10000 +# How many management cmso polling intervals to look ahead to dispatch +# (To account for possible latency of the polling job) +cmso.cm.polling.job.lookahead.intervals=5 +# Lead time before event time to enable dispatcher to +# test that it is safe to dispatch (i.e. meeting reminder lead time) +cmso.cm.dispatcher.lead.time.ms=5000 +# Lead time to prepare and call VID to dispatch work to MSO +# Includes latency from VID call to the start of the workflow +cmso.cm.dispatch.lead.time.ms=1000 + +# Interval between polling to check status of schedules in Notifications Initiated status +cmso.status.job.interval.ms=60000 + +org.quartz.jobStore.class=org.quartz.simpl.RAMJobStore + +loopback.mso.requestId=dummy123 + +so.polling.interval.ms=10000 +#mso.user=cmso@onap.org +#mso.pass=enc:bfodXf8qRfCqMvlxVBYNWQ== + +## loopback settings +so.url=http://localhost:8080/cmso/v1/loopbacktest/onap/so/infra/orchestrationRequests/v7 +so.user=cmso@onap.org +so.pass=enc:bfodXf8qRfCqMvlxVBYNWQ== + +mechid.user=cmso@onap.org +mechid.pass=enc:bfodXf8qRfCqMvlxVBYNWQ== + +cmso.dispatch.url=http://localhost:8089 diff --git a/cmso-service/extra/docker/etc/config/liquibase.properties b/cmso-service/extra/docker/etc/config/liquibase.properties new file mode 100644 index 0000000..c9c804f --- /dev/null +++ b/cmso-service/extra/docker/etc/config/liquibase.properties @@ -0,0 +1,54 @@ +### +# Copyright  2017-2018 AT&T Intellectual Property. +# Modifications Copyright  2018 IBM. +# +# 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. +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the Ãâ?¬Å"LicenseÃâ?¬); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# 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. +### +spring.datasource.jdbcUrl=jdbc:mariadb://192.168.56.101:3306/cmso?createDatabaseIfNotExist=true +spring.datasource.driver-class-name=org.mariadb.jdbc.Driver +spring.datasource.username=root +spring.datasource.password=beer + +spring.datasource.initialize=false +spring.datasource.tomcat.max-wait=10000 +spring.datasource.tomcat.initialSize=5 +spring.datasource.tomcat.max-active=25 +spring.datasource.tomcat.test-on-borrow=true + + +#changeLogFile=calendar-liquibase-changeLog.xml +changeLogFile=cmso-liquibase-changeLog.xml + + +#spring.main.web-environment=false +#outputChangeLogFile=src/main/resources/cmso-output-changelog.xml +#url=jdbc:mariadb://localhost:3306/calendar +#url=jdbc:mysql://localhost:3306/cmso +#username=root +#password=root +#driver=org.mariadb.jdbc.Driver +#driver=com.mysql.jdbc.Driver diff --git a/cmso-service/extra/docker/etc/config/optimizer.properties b/cmso-service/extra/docker/etc/config/optimizer.properties new file mode 100644 index 0000000..b222d7b --- /dev/null +++ b/cmso-service/extra/docker/etc/config/optimizer.properties @@ -0,0 +1,34 @@ +#------------------------------------------------------------------------------- +# Copyright 2017-2018 AT&T Intellectual Property. +# Modifications Copyright 2018 IBM. +# +# 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. +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the ??License?); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# 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. +#------------------------------------------------------------------------------- + +cmso.optimizer.url=http://localhost:8080/cmso/v1/loopbacktest/optimizer +cmso.optimizer.callbackurl=http://localhost:8080/cmso/v1/optimizerCallback + diff --git a/cmso-service/extra/docker/etc/config/ticketmgt.properties b/cmso-service/extra/docker/etc/config/ticketmgt.properties new file mode 100644 index 0000000..bfdaec6 --- /dev/null +++ b/cmso-service/extra/docker/etc/config/ticketmgt.properties @@ -0,0 +1,38 @@ +#------------------------------------------------------------------------------- +# Copyright 2017-2018 AT&T Intellectual Property. +# Modifications Copyright 2018 IBM. +# +# 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. +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the ??License?); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# 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. +#------------------------------------------------------------------------------- + +tm.vnfs.per.ticket=1 +tm.getPath=http://localhost:8080/cmso/v1/tm/getChangeRecord +tm.createPath=http://localhost:8080/cmso/v1/tm/createChangeRecord +tm.closePath=http://localhost:8080/cmso/v1/tm/closeCancelChangeRecord +tm.updatePath=http://localhost:8080/cmso/v1/tm/updateChangeRecord +tm.approvalStatus=Approved|Scheduled,Approved|Assigned +tm.template.folder=data/templates/tm diff --git a/cmso-service/extra/docker/mariadb/conf1/my.cnf b/cmso-service/extra/docker/mariadb/conf1/my.cnf new file mode 100644 index 0000000..c6631fb --- /dev/null +++ b/cmso-service/extra/docker/mariadb/conf1/my.cnf @@ -0,0 +1,194 @@ +# Example MySQL config file for medium systems. +# +# This is for a system with memory 8G where MySQL plays +# an important part, or systems up to 128M where MySQL is used together with +# other programs (such as a web server) +# +# In this file, you can use all long options that a program supports. +# If you want to know which options a program supports, run the program +# with the "--help" option. + +# The following options will be passed to all MySQL clients +##[client] +##user = root +##port = 3306 +##socket = //opt/app/mysql/mysql.sock + +# Here follows entries for some specific programs + +# The MySQL server +[mysqld] +##performance_schema + +slow_query_log =ON +long_query_time =2 +slow_query_log_file =//var/lib/mysql/slow_query.log +##basedir = //opt/app/mysql/product/mariadb-10.1.11-linux-x86_64 +##datadir = //opt/app/mysql/data +##port = 3306 +##socket = //opt/app/mysql/mysql.sock +skip-external-locking +explicit_defaults_for_timestamp = true +skip-symbolic-links +local-infile = 0 +#ignore_db_dir=lost+found +key_buffer_size = 16M +max_allowed_packet = 4M +table_open_cache = 100 +sort_buffer_size = 512K +net_buffer_length = 8K +read_buffer_size = 256K +read_rnd_buffer_size = 512K +myisam_sort_buffer_size = 8M +max_connections = 500 +lower_case_table_names = 1 +thread_stack = 256K +thread_cache_size = 25 +query_cache_size = 8M +query_cache_type = 0 +query_prealloc_size = 512K +query_cache_limit = 1M + +# Password validation +##plugin-load-add=simple_password_check.so +##simple_password_check_other_characters=0 + +# Audit Log settings +plugin-load-add=server_audit.so +server_audit=FORCE_PLUS_PERMANENT +server_audit_file_path=//var/lib/mysql/audit.log +server_audit_file_rotate_size=50M +server_audit_events=CONNECT,QUERY,TABLE +server_audit_logging=on + +# Don't listen on a TCP/IP port at all. This can be a security enhancement, +# if all processes that need to connect to mysqld run on the same host. +# All interaction with mysqld must be made via Unix sockets or named pipes. +# Note that using this option without enabling named pipes on Windows +# (via the "enable-named-pipe" option) will render mysqld useless! +# +#skip-networking + +# Replication Master Server (default) +# binary logging is required for replication +##log-bin=//var/lib/mysql/mysql-bin + +# binary logging format - mixed recommended +binlog_format=row + +# required unique id between 1 and 2^32 - 1 +# defaults to 1 if master-host is not set +# but will not function as a master if omitted + +# Replication Slave (comment out master section to use this) +# +# To configure this host as a replication slave, you can choose between +# two methods : +# +# 1) Use the CHANGE MASTER TO command (fully described in our manual) - +# the syntax is: +# +# CHANGE MASTER TO MASTER_HOST=, MASTER_PORT=, +# MASTER_USER=, MASTER_PASSWORD= ; +# +# where you replace , , by quoted strings and +# by the master's port number (3306 by default). +# +# Example: +# +# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306, +# MASTER_USER='joe', MASTER_PASSWORD='secret'; +# +# OR +# +# 2) Set the variables below. However, in case you choose this method, then +# start replication for the first time (even unsuccessfully, for example +# if you mistyped the password in master-password and the slave fails to +# connect), the slave will create a master.info file, and any later +# change in this file to the variables' values below will be ignored and +# overridden by the content of the master.info file, unless you shutdown +# the slave server, delete master.info and restart the slaver server. +# For that reason, you may want to leave the lines below untouched +# (commented) and instead use CHANGE MASTER TO (see above) +# +# required unique id between 2 and 2^32 - 1 +# (and different from the master) +# defaults to 2 if master-host is set +# but will not function as a slave if omitted +#server-id = 2 +# +# The replication master for this slave - required +#master-host = +# +# The username the slave will use for authentication when connecting +# to the master - required +#master-user = +# +# The password the slave will authenticate with when connecting to +# the master - required +#master-password = +# +# The port the master is listening on. +# optional - defaults to 3306 +#master-port = +# +# binary logging - not required for slaves, but recommended +#log-bin=mysql-bin + +# Uncomment the following if you are using InnoDB tables +##innodb_data_home_dir = //opt/app/mysql/data +##innodb_data_file_path = ibdata1:20M:autoextend:max:32G +##innodb_log_group_home_dir = //opt/app/mysql/iblogs +# You can set .._buffer_pool_size up to 50 - 80 % +# of RAM but beware of setting memory usage too high +innodb_buffer_pool_size = 128M +#innodb_additional_mem_pool_size = 2M +# Set .._log_file_size to 25 % of buffer pool size +innodb_log_file_size = 10M +innodb_log_files_in_group = 3 +innodb_log_buffer_size = 8M +#innodb_flush_log_at_trx_commit = 1 +innodb_lock_wait_timeout = 50 +innodb_autoextend_increment = 100 +expire_logs_days = 8 +open_files_limit = 2000 +transaction-isolation=READ-COMMITTED +####### Galera parameters ####### +## Galera Provider configuration +wsrep_provider=/usr/lib/galera/libgalera_smm.so +wsrep_provider_options="gcache.size=128M; gcache.page_size=10M" +## Galera Cluster configuration +wsrep_cluster_name="MSO-automated-tests-cluster" +wsrep_cluster_address="gcomm://" +#wsrep_cluster_address="gcomm://mariadb1,mariadb2,mariadb3" +##wsrep_cluster_address="gcomm://192.169.3.184,192.169.3.185,192.169.3.186" +## Galera Synchronization configuration +wsrep_sst_method=rsync +#wsrep_sst_method=xtrabackup-v2 +#wsrep_sst_auth="sstuser:Mon#2o!6" +## Galera Node configuration +wsrep_node_name="mariadb1" +##wsrep_node_address="192.169.3.184" +wsrep_on=OFF +## Status notification +#wsrep_notify_cmd=/opt/app/mysql/bin/wsrep_notify +####### + + +[mysqldump] +quick +max_allowed_packet = 16M + +[mysql] +no-auto-rehash +# Remove the next comment character if you are not familiar with SQL +#safe-updates + +[myisamchk] +key_buffer_size = 20971520 + +##[mysqlhotcopy] +##interactive-timeout +##[mysqld_safe] +##malloc-lib=//opt/app/mysql/local/lib/libjemalloc.so.1 +##log-error=//opt/app/mysql/log/mysqld.log \ No newline at end of file diff --git a/cmso-service/extra/docker/mariadb/conf2/my.cnf b/cmso-service/extra/docker/mariadb/conf2/my.cnf new file mode 100644 index 0000000..bf5f9c1 --- /dev/null +++ b/cmso-service/extra/docker/mariadb/conf2/my.cnf @@ -0,0 +1,193 @@ +# Example MySQL config file for medium systems. +# +# This is for a system with memory 8G where MySQL plays +# an important part, or systems up to 128M where MySQL is used together with +# other programs (such as a web server) +# +# In this file, you can use all long options that a program supports. +# If you want to know which options a program supports, run the program +# with the "--help" option. + +# The following options will be passed to all MySQL clients +##[client] +##user = root +##port = 3306 +##socket = //opt/app/mysql/mysql.sock + +# Here follows entries for some specific programs + +# The MySQL server +[mysqld] +##performance_schema + +slow_query_log =ON +long_query_time =2 +slow_query_log_file =//var/lib/mysql/slow_query.log +##basedir = //opt/app/mysql/product/mariadb-10.1.11-linux-x86_64 +##datadir = //opt/app/mysql/data +##port = 3306 +##socket = //opt/app/mysql/mysql.sock +skip-external-locking +explicit_defaults_for_timestamp = true +skip-symbolic-links +local-infile = 0 +#ignore_db_dir=lost+found +key_buffer_size = 16M +max_allowed_packet = 4M +table_open_cache = 100 +sort_buffer_size = 512K +net_buffer_length = 8K +read_buffer_size = 256K +read_rnd_buffer_size = 512K +myisam_sort_buffer_size = 8M +max_connections = 500 +lower_case_table_names = 1 +thread_stack = 256K +thread_cache_size = 25 +query_cache_size = 8M +query_cache_type = 0 +query_prealloc_size = 512K +query_cache_limit = 1M + +# Password validation +##plugin-load-add=simple_password_check.so +##simple_password_check_other_characters=0 + +# Audit Log settings +plugin-load-add=server_audit.so +server_audit=FORCE_PLUS_PERMANENT +server_audit_file_path=//var/lib/mysql/audit.log +server_audit_file_rotate_size=50M +server_audit_events=CONNECT,QUERY,TABLE +server_audit_logging=on + +# Don't listen on a TCP/IP port at all. This can be a security enhancement, +# if all processes that need to connect to mysqld run on the same host. +# All interaction with mysqld must be made via Unix sockets or named pipes. +# Note that using this option without enabling named pipes on Windows +# (via the "enable-named-pipe" option) will render mysqld useless! +# +#skip-networking + +# Replication Master Server (default) +# binary logging is required for replication +##log-bin=//var/lib/mysql/mysql-bin + +# binary logging format - mixed recommended +binlog_format=row + +# required unique id between 1 and 2^32 - 1 +# defaults to 1 if master-host is not set +# but will not function as a master if omitted + +# Replication Slave (comment out master section to use this) +# +# To configure this host as a replication slave, you can choose between +# two methods : +# +# 1) Use the CHANGE MASTER TO command (fully described in our manual) - +# the syntax is: +# +# CHANGE MASTER TO MASTER_HOST=, MASTER_PORT=, +# MASTER_USER=, MASTER_PASSWORD= ; +# +# where you replace , , by quoted strings and +# by the master's port number (3306 by default). +# +# Example: +# +# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306, +# MASTER_USER='joe', MASTER_PASSWORD='secret'; +# +# OR +# +# 2) Set the variables below. However, in case you choose this method, then +# start replication for the first time (even unsuccessfully, for example +# if you mistyped the password in master-password and the slave fails to +# connect), the slave will create a master.info file, and any later +# change in this file to the variables' values below will be ignored and +# overridden by the content of the master.info file, unless you shutdown +# the slave server, delete master.info and restart the slaver server. +# For that reason, you may want to leave the lines below untouched +# (commented) and instead use CHANGE MASTER TO (see above) +# +# required unique id between 2 and 2^32 - 1 +# (and different from the master) +# defaults to 2 if master-host is set +# but will not function as a slave if omitted +#server-id = 2 +# +# The replication master for this slave - required +#master-host = +# +# The username the slave will use for authentication when connecting +# to the master - required +#master-user = +# +# The password the slave will authenticate with when connecting to +# the master - required +#master-password = +# +# The port the master is listening on. +# optional - defaults to 3306 +#master-port = +# +# binary logging - not required for slaves, but recommended +#log-bin=mysql-bin + +# Uncomment the following if you are using InnoDB tables +##innodb_data_home_dir = //opt/app/mysql/data +##innodb_data_file_path = ibdata1:20M:autoextend:max:32G +##innodb_log_group_home_dir = //opt/app/mysql/iblogs +# You can set .._buffer_pool_size up to 50 - 80 % +# of RAM but beware of setting memory usage too high +innodb_buffer_pool_size = 6380M +#innodb_additional_mem_pool_size = 2M +# Set .._log_file_size to 25 % of buffer pool size +innodb_log_file_size = 150M +innodb_log_files_in_group = 3 +innodb_log_buffer_size = 8M +#innodb_flush_log_at_trx_commit = 1 +innodb_lock_wait_timeout = 50 +innodb_autoextend_increment = 100 +expire_logs_days = 8 +open_files_limit = 2000 +transaction-isolation=READ-COMMITTED +####### Galera parameters ####### +## Galera Provider configuration +wsrep_provider=/usr/lib/galera/libgalera_smm.so +wsrep_provider_options="gcache.size=2G; gcache.page_size=1G" +## Galera Cluster configuration +wsrep_cluster_name="MSO-automated-tests-cluster" +wsrep_cluster_address="gcomm://mariadb1,mariadb2,mariadb3" +##wsrep_cluster_address="gcomm://192.169.3.184,192.169.3.185,192.169.3.186" +## Galera Synchronization configuration +wsrep_sst_method=rsync +#wsrep_sst_method=xtrabackup-v2 +#wsrep_sst_auth="sstuser:Mon#2o!6" +## Galera Node configuration +wsrep_node_name="mariadb2" +##wsrep_node_address="192.169.3.184" +wsrep_on=ON +## Status notification +#wsrep_notify_cmd=/opt/app/mysql/bin/wsrep_notify +####### + + +[mysqldump] +quick +max_allowed_packet = 16M + +[mysql] +no-auto-rehash +# Remove the next comment character if you are not familiar with SQL +#safe-updates + +[myisamchk] +key_buffer_size = 20971520 + +##[mysqlhotcopy] +##interactive-timeout +##[mysqld_safe] +##malloc-lib=//opt/app/mysql/local/lib/libjemalloc.so.1 +##log-error=//opt/app/mysql/log/mysqld.log \ No newline at end of file diff --git a/cmso-service/extra/docker/mariadb/conf3/my.cnf b/cmso-service/extra/docker/mariadb/conf3/my.cnf new file mode 100644 index 0000000..74f7a31 --- /dev/null +++ b/cmso-service/extra/docker/mariadb/conf3/my.cnf @@ -0,0 +1,193 @@ +# Example MySQL config file for medium systems. +# +# This is for a system with memory 8G where MySQL plays +# an important part, or systems up to 128M where MySQL is used together with +# other programs (such as a web server) +# +# In this file, you can use all long options that a program supports. +# If you want to know which options a program supports, run the program +# with the "--help" option. + +# The following options will be passed to all MySQL clients +##[client] +##user = root +##port = 3306 +##socket = //opt/app/mysql/mysql.sock + +# Here follows entries for some specific programs + +# The MySQL server +[mysqld] +##performance_schema + +slow_query_log =ON +long_query_time =2 +slow_query_log_file =//var/lib/mysql/slow_query.log +##basedir = //opt/app/mysql/product/mariadb-10.1.11-linux-x86_64 +##datadir = //opt/app/mysql/data +##port = 3306 +##socket = //opt/app/mysql/mysql.sock +skip-external-locking +explicit_defaults_for_timestamp = true +skip-symbolic-links +local-infile = 0 +#ignore_db_dir=lost+found +key_buffer_size = 16M +max_allowed_packet = 4M +table_open_cache = 100 +sort_buffer_size = 512K +net_buffer_length = 8K +read_buffer_size = 256K +read_rnd_buffer_size = 512K +myisam_sort_buffer_size = 8M +max_connections = 500 +lower_case_table_names = 1 +thread_stack = 256K +thread_cache_size = 25 +query_cache_size = 8M +query_cache_type = 0 +query_prealloc_size = 512K +query_cache_limit = 1M + +# Password validation +##plugin-load-add=simple_password_check.so +##simple_password_check_other_characters=0 + +# Audit Log settings +plugin-load-add=server_audit.so +server_audit=FORCE_PLUS_PERMANENT +server_audit_file_path=//var/lib/mysql/audit.log +server_audit_file_rotate_size=50M +server_audit_events=CONNECT,QUERY,TABLE +server_audit_logging=on + +# Don't listen on a TCP/IP port at all. This can be a security enhancement, +# if all processes that need to connect to mysqld run on the same host. +# All interaction with mysqld must be made via Unix sockets or named pipes. +# Note that using this option without enabling named pipes on Windows +# (via the "enable-named-pipe" option) will render mysqld useless! +# +#skip-networking + +# Replication Master Server (default) +# binary logging is required for replication +##log-bin=//var/lib/mysql/mysql-bin + +# binary logging format - mixed recommended +binlog_format=row + +# required unique id between 1 and 2^32 - 1 +# defaults to 1 if master-host is not set +# but will not function as a master if omitted + +# Replication Slave (comment out master section to use this) +# +# To configure this host as a replication slave, you can choose between +# two methods : +# +# 1) Use the CHANGE MASTER TO command (fully described in our manual) - +# the syntax is: +# +# CHANGE MASTER TO MASTER_HOST=, MASTER_PORT=, +# MASTER_USER=, MASTER_PASSWORD= ; +# +# where you replace , , by quoted strings and +# by the master's port number (3306 by default). +# +# Example: +# +# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306, +# MASTER_USER='joe', MASTER_PASSWORD='secret'; +# +# OR +# +# 2) Set the variables below. However, in case you choose this method, then +# start replication for the first time (even unsuccessfully, for example +# if you mistyped the password in master-password and the slave fails to +# connect), the slave will create a master.info file, and any later +# change in this file to the variables' values below will be ignored and +# overridden by the content of the master.info file, unless you shutdown +# the slave server, delete master.info and restart the slaver server. +# For that reason, you may want to leave the lines below untouched +# (commented) and instead use CHANGE MASTER TO (see above) +# +# required unique id between 2 and 2^32 - 1 +# (and different from the master) +# defaults to 2 if master-host is set +# but will not function as a slave if omitted +#server-id = 2 +# +# The replication master for this slave - required +#master-host = +# +# The username the slave will use for authentication when connecting +# to the master - required +#master-user = +# +# The password the slave will authenticate with when connecting to +# the master - required +#master-password = +# +# The port the master is listening on. +# optional - defaults to 3306 +#master-port = +# +# binary logging - not required for slaves, but recommended +#log-bin=mysql-bin + +# Uncomment the following if you are using InnoDB tables +##innodb_data_home_dir = //opt/app/mysql/data +##innodb_data_file_path = ibdata1:20M:autoextend:max:32G +##innodb_log_group_home_dir = //opt/app/mysql/iblogs +# You can set .._buffer_pool_size up to 50 - 80 % +# of RAM but beware of setting memory usage too high +innodb_buffer_pool_size = 6380M +#innodb_additional_mem_pool_size = 2M +# Set .._log_file_size to 25 % of buffer pool size +innodb_log_file_size = 150M +innodb_log_files_in_group = 3 +innodb_log_buffer_size = 8M +#innodb_flush_log_at_trx_commit = 1 +innodb_lock_wait_timeout = 50 +innodb_autoextend_increment = 100 +expire_logs_days = 8 +open_files_limit = 2000 +transaction-isolation=READ-COMMITTED +####### Galera parameters ####### +## Galera Provider configuration +wsrep_provider=/usr/lib/galera/libgalera_smm.so +wsrep_provider_options="gcache.size=2G; gcache.page_size=1G" +## Galera Cluster configuration +wsrep_cluster_name="MSO-automated-tests-cluster" +wsrep_cluster_address="gcomm://mariadb1,mariadb2,mariadb3" +##wsrep_cluster_address="gcomm://192.169.3.184,192.169.3.185,192.169.3.186" +## Galera Synchronization configuration +wsrep_sst_method=rsync +#wsrep_sst_method=xtrabackup-v2 +#wsrep_sst_auth="sstuser:Mon#2o!6" +## Galera Node configuration +wsrep_node_name="mariadb3" +##wsrep_node_address="192.169.3.184" +wsrep_on=ON +## Status notification +#wsrep_notify_cmd=/opt/app/mysql/bin/wsrep_notify +####### + + +[mysqldump] +quick +max_allowed_packet = 16M + +[mysql] +no-auto-rehash +# Remove the next comment character if you are not familiar with SQL +#safe-updates + +[myisamchk] +key_buffer_size = 20971520 + +##[mysqlhotcopy] +##interactive-timeout +##[mysqld_safe] +##malloc-lib=//opt/app/mysql/local/lib/libjemalloc.so.1 +##log-error=//opt/app/mysql/log/mysqld.log \ No newline at end of file diff --git a/cmso-service/pom.xml b/cmso-service/pom.xml index a36cb32..b69e0fd 100644 --- a/cmso-service/pom.xml +++ b/cmso-service/pom.xml @@ -1,33 +1,33 @@ - oparent 1.2.0 + org.onap.optf.cmso cmso-service 0.1.0-SNAPSHOT @@ -113,10 +114,8 @@ org.springframework.boot spring-boot-starter-security - + org.springframework.boot spring-boot-starter-data-jpa @@ -125,10 +124,8 @@ org.springframework.boot spring-boot-starter-tomcat - + org.springframework.boot spring-boot-configuration-processor @@ -138,12 +135,12 @@ org.springframework.boot spring-boot-starter-test test - - - org.mockito - mockito-core - - + + + org.mockito + mockito-core + + org.apache.httpcomponents @@ -198,31 +195,28 @@ com.att.eelf eelf-core ${eelf.version} - - - org.mockito - mockito-core - - - org.powermock - powermock-module - - - org.powermock - powermock-api-mockito - - - org.powermock - powermock-module-junit4 - + + + org.mockito + mockito-core + + + org.powermock + powermock-module + + + org.powermock + powermock-api-mockito + + + org.powermock + powermock-module-junit4 + - + - + javax.ws.rs javax.ws.rs-api @@ -240,7 +234,7 @@ springfox-swagger-ui ${springfox.swagger2.version} - org.quartz-scheduler @@ -273,12 +267,8 @@ - + org.mockito mockito-all @@ -300,7 +290,7 @@ pact-jvm-provider-maven_2.11 ${pact.version} - ${BROKER_URL} pactadmin @@ -372,8 +362,54 @@ + + io.fabric8 + docker-maven-plugin + 0.26.0 + + true + 1.23 + + + onap/cmso-service + onap-cmso-service + + true + + latest + + ${project.basedir}/src/main/docker/Dockerfile + + ${project.basedir}/src/main/docker/assembly/cmso-files.xml + onap-cmso + + + + + + + + generate-images + install + + build + + + + push-images + deploy + + build + push + + + onap/cmso-service:%l + + + + - @@ -410,7 +446,7 @@ - org.eclipse.m2e diff --git a/cmso-service/src/main/docker/Dockerfile b/cmso-service/src/main/docker/Dockerfile index febb406..97b8cba 100644 --- a/cmso-service/src/main/docker/Dockerfile +++ b/cmso-service/src/main/docker/Dockerfile @@ -1,5 +1,33 @@ -FROM anapsix/alpine-java:8_jdk -ADD cmso-0.1.0-SNAPSHOT.jar app.jar -ADD startService.sh /startService.sh -RUN chmod 700 /startService.sh +FROM ubuntu:16.04 + +MAINTAINER "The Onap Team" +LABEL Description="This image contains ubuntu 16.04 with the openjdk installed" Version="16.04-8" +ENV APP_HOME=/opt/app/cmso +ARG http_proxy +ARG https_proxy +ENV HTTP_PROXY=$http_proxy +ENV HTTPS_PROXY=$https_proxy +ENV http_proxy=$HTTP_PROXY +ENV https_proxy=$HTTPS_PROXY + +RUN test -n "$http_proxy" && echo "Acquire::Proxy \"http://$http_proxy\";" > /etc/apt/apt.conf.d/02proxy || true && \ + apt-get update && \ + apt-get -y dist-upgrade && \ + apt-get install -y openjdk-8-jre-headless + +COPY onap-cmso/cmso-service.jar ${APP_HOME}/app.jar + +VOLUME /share/etc +VOLUME /share/logs +VOLUME /share/debug-logs + +COPY onap-cmso/startService.sh ${APP_HOME}/startService.sh +COPY onap-cmso/data ${APP_HOME}/data + +RUN chmod 700 ${APP_HOME}/startService.sh +RUN ln -s /share/etc ${APP_HOME}/etc +RUN ln -s /share/logs ${APP_HOME}/logs +RUN ln -s /share/debug-logs ${APP_HOME}/debug-logs + +WORKDIR ${APP_HOME} ENTRYPOINT ./startService.sh diff --git a/cmso-service/src/main/docker/assembly/cmso-files.xml b/cmso-service/src/main/docker/assembly/cmso-files.xml new file mode 100644 index 0000000..2dd3a16 --- /dev/null +++ b/cmso-service/src/main/docker/assembly/cmso-files.xml @@ -0,0 +1,65 @@ + + + + cmso-files + + + tar.gz + + false + + + + + + + ${project.build.finalName}.jar + + ${project.build.directory} + / + + + + etc/keystore/** + + ${project.build.directory} + / + + + + ** + + src/main/docker/extra-files + / + + + + ** + + data + /data + + + + diff --git a/cmso-service/src/main/docker/extra-files/startService.sh b/cmso-service/src/main/docker/extra-files/startService.sh new file mode 100644 index 0000000..dbd111f --- /dev/null +++ b/cmso-service/src/main/docker/extra-files/startService.sh @@ -0,0 +1,4 @@ +#!/bin/sh +echo "VM_ARGS="${VM_ARGS} + +java -Djava.security.egd=file:/dev/./urandom ${VM_ARGS} -Xms256m -Xmx1024m -jar ./app.jar diff --git a/cmso-service/src/main/docker/startService.sh b/cmso-service/src/main/docker/startService.sh deleted file mode 100644 index e7d3121..0000000 --- a/cmso-service/src/main/docker/startService.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -app_args=-Dspring.config.location=${APP_CONFIG_HOME} -echo "app_args ="${app_args} -java -Djava.security.egd=file:/dev/./urandom ${app_args} -Xms1024m -Xmx1024m -jar /app.jar diff --git a/cmso-service/src/main/resources/system.properties b/cmso-service/src/main/resources/system.properties deleted file mode 100644 index 89954f2..0000000 --- a/cmso-service/src/main/resources/system.properties +++ /dev/null @@ -1,48 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright 2017-2018 AT&T Intellectual Property. -# Modifications Copyright 2018 IBM. -# -# 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. -# -# -# Unless otherwise specified, all documentation contained herein is licensed -# under the Creative Commons License, Attribution 4.0 Intl. (the ??License?); -# you may not use this documentation except in compliance with the License. -# You may obtain a copy of the License at -# -# https://creativecommons.org/licenses/by/4.0/ -# -# Unless required by applicable law or agreed to in writing, documentation -# 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. -#------------------------------------------------------------------------------- - -# If the environment property system_properties_path contains a path to a file, -# System properties created using the file. If the environment variable not present -# system.properties in the class path is used for system property creation - -com.att.eelf.logging.file=logback.xml - -# change as per logback.xml path -com.att.eelf.logging.path= -logging.config= - -spring.config.location=etc/config/ -spring.config.name=application,cmso,optimizer,ticketmgt - -# Default parameters during application startup. -info.build.artifact=@project.artifactId@ -info.build.name=@project.name@ -info.build.version=@project.version@ -- cgit 1.2.3-korg