From 7e3cfece4dc9a814e4146755ae8f7f09a7968c3b Mon Sep 17 00:00:00 2001 From: Tal Gitelman Date: Sun, 20 Aug 2017 20:49:00 +0300 Subject: [SDC-154] - sdc-simulator docker task Change-Id: Iaa4c30237a2eef2c40fb4bfda114bc2eca6df9d5 Signed-off-by: Tal Gitelman --- .../scripts/simulator_docker_run.sh | 80 +++++ .../recipes/SDC_Simulator_1_cleanup_jettydir.rb | 40 +-- .../recipes/SDC_Simulator_2_setup_configuration.rb | 11 +- .../recipes/SDC_Simulator_3_errors_config.rb | 7 - .../recipes/SDC_Simulator_3_logback.rb | 10 + .../recipes/SDC_Simulator_4_locate_keystore.rb | 16 + .../recipes/SDC_Simulator_4_logback.rb | 10 - .../SDC_Simulator_5_create_jetty_modules.rb | 14 + .../recipes/SDC_Simulator_5_rest_configuration.rb | 7 - .../recipes/SDC_Simulator_6_locate_keystore.rb | 16 - .../SDC_Simulator_7_create_jetty_modules.rb | 45 --- .../default/SDC-Simulator-configuration.yaml.erb | 85 ----- .../templates/default/SDC-Simulator-http-ini.erb | 32 -- .../templates/default/SDC-Simulator-https-ini.erb | 15 - ...SDC-Simulator-onboarding-configuration.yaml.erb | 5 - .../default/SDC-Simulator-webseal.conf.erb | 49 +++ .../chef-solo/roles/sdc-simulator.json | 6 +- utils/webseal-simulator/sdc-simulator/startup.sh | 10 +- .../src/main/resources/logback.xml | 341 +-------------------- 19 files changed, 201 insertions(+), 598 deletions(-) create mode 100644 utils/webseal-simulator/scripts/simulator_docker_run.sh delete mode 100644 utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_3_errors_config.rb create mode 100644 utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_3_logback.rb create mode 100644 utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_4_locate_keystore.rb delete mode 100644 utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_4_logback.rb create mode 100644 utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_5_create_jetty_modules.rb delete mode 100644 utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_5_rest_configuration.rb delete mode 100644 utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_6_locate_keystore.rb delete mode 100644 utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_7_create_jetty_modules.rb delete mode 100644 utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-configuration.yaml.erb delete mode 100644 utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-http-ini.erb delete mode 100644 utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-https-ini.erb delete mode 100644 utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-onboarding-configuration.yaml.erb create mode 100644 utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-webseal.conf.erb (limited to 'utils/webseal-simulator') diff --git a/utils/webseal-simulator/scripts/simulator_docker_run.sh b/utils/webseal-simulator/scripts/simulator_docker_run.sh new file mode 100644 index 0000000000..bc8cdca09d --- /dev/null +++ b/utils/webseal-simulator/scripts/simulator_docker_run.sh @@ -0,0 +1,80 @@ +#!/bin/bash + + +function usage { + echo "usage: simulator_docker_run.sh [ -r|--release ] [ -e|--environment ] [ -p|--port ] [ -h|--help ]" +} + + +function cleanup { + echo "performing old dockers cleanup" + docker_ids=`docker ps -a | egrep "openecomp/sdc-simulator|Exit" | awk '{print $1}'` + for X in ${docker_ids} + do + docker rm -f ${X} + done +} + + +function dir_perms { + mkdir -p /data/logs/WS/ + chmod -R 777 /data/logs +} + + +RELEASE=latest +LOCAL=true +[ -f /opt/config/env_name.txt ] && DEP_ENV=$(cat /opt/config/env_name.txt) || DEP_ENV=__ENV-NAME__ +[ -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=ecomp-nexus:${PORT} + +while [ "$1" != "" ]; do + case $1 in + -r | --release ) + shift + RELEASE=${1} + ;; + -e | --environment ) + shift + DEP_ENV=${1} + ;; + -p | --port ) + shift + PORT=${1} + ;; + -h | --help ) + usage + exit + ;; + * ) + usage + exit 1 + esac + shift +done + +[ -f /opt/config/nexus_username.txt ] && docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO + + +cleanup + + +export IP=`ifconfig eth0 | awk -F: '/inet addr/ {gsub(/ .*/,"",$2); print $2}'` +export PREFIX=${NEXUS_DOCKER_REPO}'/openecomp' + +PREFIX='openecomp' + +echo "" +echo "${PREFIX}" + +dir_perms + +# SDC-Simulator +docker run --detach --name sdc-simulator --env HOST_IP=${IP} --env ENVNAME="${DEP_ENV}" --env http_proxy=${http_proxy} --env https_proxy=${https_proxy} --env no_proxy=${no_proxy} --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --ulimit memlock=-1:-1 --memory 256m --memory-swap=256m --ulimit nofile=4096:100000 --volume /etc/localtime:/etc/localtime:ro --volume /data/logs/WS/:/var/lib/jetty/logs --volume /data/environments:/root/chef-solo/environments --publish 8285:8080 ${PREFIX}/sdc-simulator:${RELEASE} + + +if [ $? -ne 0 ]; then + exit 1 +fi + diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_1_cleanup_jettydir.rb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_1_cleanup_jettydir.rb index 95b90ca0a2..bb67b8cdbc 100644 --- a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_1_cleanup_jettydir.rb +++ b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_1_cleanup_jettydir.rb @@ -1,5 +1,7 @@ +jetty_base="/var/lib/jetty" + directory "SDC_Simulator_tempdir_creation" do - path "/var/lib/jetty/temp" + path "#{jetty_base}/temp" owner 'jetty' group 'jetty' mode '0755' @@ -8,7 +10,7 @@ end directory "SDC_Simulator_create_config_dir" do - path "/var/lib/jetty/config" + path "#{jetty_base}/config" owner 'jetty' group 'jetty' mode '0755' @@ -17,41 +19,9 @@ end directory "SDC_Simulator_create_sdc-simulator" do - path "/var/lib/jetty/config/sdc-simulator" + path "#{jetty_base}/config/sdc-simulator" owner 'jetty' group 'jetty' mode '0755' action :create end - - -#directory "SDC_Simulator_tempdir_cleanup" do -# path "/var/lib/jetty/tempdir" -# recursive true -# action :delete -#end - - -#directory "SDC_Simulator_webapps_cleanup" do -# path "/var/lib/jetty/webapps" -# recursive true -# action :delete -#end - - -#directory "SDC_Simulator_webapps_creation" do -# path "/var/lib/jetty/webapps" -# owner 'jetty' -# group 'jetty' -# mode '0755' -# action :create -#end - - -#directory "SDC_Simulator_create_catalog-fe" do -# path "/var/lib/jetty/config/onboarding-fe" -# owner 'jetty' -# group 'jetty' -# mode '0755' -# action :create -#end \ No newline at end of file diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_2_setup_configuration.rb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_2_setup_configuration.rb index ca7d23737c..85fedfd9e5 100644 --- a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_2_setup_configuration.rb +++ b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_2_setup_configuration.rb @@ -1,9 +1,14 @@ jetty_base="/var/lib/jetty" -cookbook_file "webseal.conf" do + +template "webseal.conf" do path "#{jetty_base}/config/sdc-simulator/webseal.conf" - source "webseal.conf" + source "SDC-Simulator-webseal.conf.erb" owner "jetty" group "jetty" mode "0755" -end \ No newline at end of file + variables({ + :fe_host_ip => node['HOST_IP'], + :fe_http_port => "#{node['FE'][:http_port]}" + }) +end diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_3_errors_config.rb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_3_errors_config.rb deleted file mode 100644 index 81211866a0..0000000000 --- a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_3_errors_config.rb +++ /dev/null @@ -1,7 +0,0 @@ -#cookbook_file "/var/lib/jetty/config/catalog-fe/ecomp-error-configuration.yaml" do -# source "FE-ecomp-error-configuration.yaml" -# mode 0755 -# owner "jetty" -# group "jetty" -#end - diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_3_logback.rb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_3_logback.rb new file mode 100644 index 0000000000..0d9282b28a --- /dev/null +++ b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_3_logback.rb @@ -0,0 +1,10 @@ +jetty_base="/var/lib/jetty" + + +cookbook_file "logback.xml" do + path "#{jetty_base}/config/sdc-simulator/logback.xml" + source "logback.xml" + owner "jetty" + group "jetty" + mode "0755" +end \ No newline at end of file diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_4_locate_keystore.rb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_4_locate_keystore.rb new file mode 100644 index 0000000000..3bb482d89a --- /dev/null +++ b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_4_locate_keystore.rb @@ -0,0 +1,16 @@ +jetty_base="/var/lib/jetty" + +directory "Jetty_etcdir_creation" do + path "/#{jetty_base}/etc" + owner 'jetty' + group 'jetty' + mode '0755' + action :create +end + +cookbook_file "/#{jetty_base}/etc/keystore" do + source "keystore" + owner "jetty" + group "jetty" + mode 0755 +end \ No newline at end of file diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_4_logback.rb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_4_logback.rb deleted file mode 100644 index 0d9282b28a..0000000000 --- a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_4_logback.rb +++ /dev/null @@ -1,10 +0,0 @@ -jetty_base="/var/lib/jetty" - - -cookbook_file "logback.xml" do - path "#{jetty_base}/config/sdc-simulator/logback.xml" - source "logback.xml" - owner "jetty" - group "jetty" - mode "0755" -end \ No newline at end of file diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_5_create_jetty_modules.rb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_5_create_jetty_modules.rb new file mode 100644 index 0000000000..38b87fa65d --- /dev/null +++ b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_5_create_jetty_modules.rb @@ -0,0 +1,14 @@ +jetty_base="/var/lib/jetty" +jetty_home="/usr/local/jetty" + +###### create Jetty modules +bash "create-jetty-modules" do +cwd "#{jetty_base}" +code <<-EOH + cd "#{jetty_base}" + java -jar "/#{jetty_home}"/start.jar --add-to-start=deploy + java -jar "/#{jetty_home}"/start.jar --add-to-startd=http,https,logging,setuid +EOH +not_if "ls /#{jetty_base}/start.d/https.ini" +end + diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_5_rest_configuration.rb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_5_rest_configuration.rb deleted file mode 100644 index 710286a8dd..0000000000 --- a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_5_rest_configuration.rb +++ /dev/null @@ -1,7 +0,0 @@ -cookbook_file "/var/lib/jetty/config/catalog-fe/rest-configuration-info.yaml" do - source "FE-rest-configuration.yaml" - mode 0755 - owner "jetty" - group "jetty" -end - diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_6_locate_keystore.rb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_6_locate_keystore.rb deleted file mode 100644 index 3bb482d89a..0000000000 --- a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_6_locate_keystore.rb +++ /dev/null @@ -1,16 +0,0 @@ -jetty_base="/var/lib/jetty" - -directory "Jetty_etcdir_creation" do - path "/#{jetty_base}/etc" - owner 'jetty' - group 'jetty' - mode '0755' - action :create -end - -cookbook_file "/#{jetty_base}/etc/keystore" do - source "keystore" - owner "jetty" - group "jetty" - mode 0755 -end \ No newline at end of file diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_7_create_jetty_modules.rb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_7_create_jetty_modules.rb deleted file mode 100644 index b4de469563..0000000000 --- a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/recipes/SDC_Simulator_7_create_jetty_modules.rb +++ /dev/null @@ -1,45 +0,0 @@ -jetty_base="/var/lib/jetty" -jetty_home="/usr/local/jetty" - -###### create Jetty modules -bash "create-jetty-modules" do -cwd "#{jetty_base}" -code <<-EOH - cd "#{jetty_base}" - java -jar "/#{jetty_home}"/start.jar --add-to-start=deploy - java -jar "/#{jetty_home}"/start.jar --add-to-startd=http,https,logging,setuid -EOH -not_if "ls /#{jetty_base}/start.d/https.ini" -end - - -####### configure Jetty modules -#template "SDC-Simulator-http-ini" do -# path "/#{jetty_base}/start.d/http.ini" -# source "SDC-Simulator-http-ini.erb" -# owner "jetty" -# group "jetty" -# mode "0755" -# variables :Simulator_http_port => "#{node['simulator'][:http_port]}" -#end - - -#template "FE-https-ini" do -# path "/#{jetty_base}/start.d/https.ini" -# source "FE-https-ini.erb" -# owner "jetty" -# group "jetty" -# mode "0755" -# variables :FE_https_port => "#{node['FE'][:https_port]}" -#end -# -# -#template "FE-ssl-ini" do -# path "/#{jetty_base}/start.d/ssl.ini" -# source "FE-ssl-ini.erb" -# owner "jetty" -# group "jetty" -# mode "0755" -# variables :FE_https_port => "#{node['FE'][:https_port]}" -#end - diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-configuration.yaml.erb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-configuration.yaml.erb deleted file mode 100644 index 6a6ea29608..0000000000 --- a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-configuration.yaml.erb +++ /dev/null @@ -1,85 +0,0 @@ -# Needed for logging purposes. To be populated by DevOps - currently dummy -feFqdn: <%= @fe_host_ip %> - -# catalog backend hostname -beHost: <%= @be_host_ip %> - -# catalog backend http port -beHttpPort: <%= @catalog_port %> - -# catalog backend http context -beContext: /sdc2/rest/v1/catalog/upload/resources - -# catalog backend protocol -beProtocol: http - -# catalog backend ssl port -beSslPort: <%= @ssl_port %> - -# threadpool size for handling requests -threadpoolSize: 50 - -# request processing timeout (seconds) -requestTimeout: 10 - -healthCheckSocketTimeoutInMs: 5000 - -healthCheckIntervalInSeconds: 5 - -onboarding: - protocol: http - host: <%= @fe_host_ip %> - port: 8181 - healthCheckUri: "/onboarding/v1.0/healthcheck" - -identificationHeaderFields: - - - - &HTTP_IV_USER HTTP_IV_USER - - &iv-user iv-user - - - - &USER_ID USER_ID - - &user-id user-id - - - - &HTTP_CSP_ATTUID HTTP_CSP_ATTUID - - &csp-attuid csp-attuid - - - - &HTTP_CSP_WSTYPE HTTP_CSP_WSTYPE - - &csp-wstype csp-wstype - -optionalHeaderFields: - - - - &HTTP_CSP_FIRSTNAME HTTP_CSP_FIRSTNAME - - &csp-firstname csp-firstname - - - - &HTTP_CSP_LASTNAME HTTP_CSP_LASTNAME - - &csp-lastname csp-lastname - - - - &HTTP_IV_REMOTE_ADDRESS HTTP_IV_REMOTE_ADDRESS - - &iv-remote-address iv-remote-address - - - - &HTTP_CSP_EMAIL HTTP_CSP_EMAIL - - &csp-email csp-email - - -version: 1.0 -released: 2012-11-30 - -# Connection parameters -connection: - url: jdbc:mysql://localhost:3306/db - poolSize: 17 - -# Protocols -protocols: - - http - - https - - -systemMonitoring: - enabled: false - isProxy: true - probeIntervalInSeconds: 15 - -kibanaHost: localhost -kibanaPort: 5601 -kibanaProtocol: http diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-http-ini.erb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-http-ini.erb deleted file mode 100644 index 51b9addd93..0000000000 --- a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-http-ini.erb +++ /dev/null @@ -1,32 +0,0 @@ -# --------------------------------------- -# Module: http ---module=http - -### HTTP Connector Configuration - -## Connector host/address to bind to -# jetty.http.host=0.0.0.0 - -## Connector port to listen on -jetty.http.port=<%= @Simulator_http_port %> - -## Connector idle timeout in milliseconds -jetty.http.idleTimeout=30000 - -## Connector socket linger time in seconds (-1 to disable) -# jetty.http.soLingerTime=-1 - -## Number of acceptors (-1 picks default based on number of cores) -# jetty.http.acceptors=-1 - -## Number of selectors (-1 picks default based on number of cores) -# jetty.http.selectors=-1 - -## ServerSocketChannel backlog (0 picks platform default) -# jetty.http.acceptorQueueSize=0 - -## Thread priority delta to give to acceptor threads -# jetty.http.acceptorPriorityDelta=0 - -## HTTP Compliance: RFC7230, RFC2616, LEGACY -# jetty.http.compliance=RFC7230 diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-https-ini.erb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-https-ini.erb deleted file mode 100644 index f8ca5252b0..0000000000 --- a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-https-ini.erb +++ /dev/null @@ -1,15 +0,0 @@ -# --------------------------------------- -# Module: https ---module=https - -## HTTPS Configuration -# HTTP port to listen on -https.port=<%= @FE_https_port %> - -# HTTPS idle timeout in milliseconds -jetty.https.idleTimeout=300000 - -# HTTPS Socket.soLingerTime in seconds. (-1 to disable) -# https.soLingerTime=-1 - - diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-onboarding-configuration.yaml.erb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-onboarding-configuration.yaml.erb deleted file mode 100644 index 4646661dfb..0000000000 --- a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-onboarding-configuration.yaml.erb +++ /dev/null @@ -1,5 +0,0 @@ -notifications: - pollingIntervalMsec: 2000 - selectionSize: 100 - beHost: <%= @catalog_ip %> - beHttpPort: <%= @catalog_port %> \ No newline at end of file diff --git a/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-webseal.conf.erb b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-webseal.conf.erb new file mode 100644 index 0000000000..d5e2cbeaac --- /dev/null +++ b/utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/templates/default/SDC-Simulator-webseal.conf.erb @@ -0,0 +1,49 @@ +{ + webseal { + fe="http://<%= @fe_host_ip %>:<%= @fe_http_port %>" + users = [ + { + userId="cs0008" + password="123123a" + firstName="Carlos" + lastName="Santana" + role="Designer" + email="csantana@sdc.com" + }, + { + userId="op0001" + password="123123a" + firstName="Aretha" + lastName="Franklin" + role="Ops" + email="afranklin@sdc.com" + }, + { + userId="jh0003" + password="123123a" + firstName="Jimmy" + lastName="Hendrix" + role="Admin" + email="admin@sdc.com" + }, + { + userId="jm0007" + password="123123a" + firstName="Johnny" + lastName="Depp" + role="Tester" + email="tester@sdc.com" + }, + { + userId="gv0001" + password="123123a" + firstName="David" + lastName="Shadmi" + role="Governor" + email="governor@sdc.com" + } + ] + } + +} + diff --git a/utils/webseal-simulator/sdc-simulator/chef-solo/roles/sdc-simulator.json b/utils/webseal-simulator/sdc-simulator/chef-solo/roles/sdc-simulator.json index 36a163708a..457dbad6c4 100644 --- a/utils/webseal-simulator/sdc-simulator/chef-solo/roles/sdc-simulator.json +++ b/utils/webseal-simulator/sdc-simulator/chef-solo/roles/sdc-simulator.json @@ -12,9 +12,9 @@ "run_list": [ "recipe[sdc-simulator::SDC_Simulator_1_cleanup_jettydir]", "recipe[sdc-simulator::SDC_Simulator_2_setup_configuration]", - "recipe[sdc-simulator::SDC_Simulator_4_logback]", - "recipe[sdc-simulator::SDC_Simulator_6_locate_keystore]", - "recipe[sdc-simulator::SDC_Simulator_7_create_jetty_modules]" + "recipe[sdc-simulator::SDC_Simulator_3_logback]", + "recipe[sdc-simulator::SDC_Simulator_4_locate_keystore]", + "recipe[sdc-simulator::SDC_Simulator_5_create_jetty_modules]" ], "env_run_lists": { } diff --git a/utils/webseal-simulator/sdc-simulator/startup.sh b/utils/webseal-simulator/sdc-simulator/startup.sh index d5abda9f1e..aca8b5e984 100644 --- a/utils/webseal-simulator/sdc-simulator/startup.sh +++ b/utils/webseal-simulator/sdc-simulator/startup.sh @@ -1,17 +1,13 @@ #!/bin/sh -#export CHEFNAME=${ENVNAME} +export CHEFNAME=${ENVNAME} cd /root/chef-solo echo "normal['HOST_IP'] = \"${HOST_IP}\"" > /root/chef-solo/cookbooks/sdc-simulator/attributes/default.rb -chef-solo -c solo.rb -#chef-solo -c solo.rb -E ${CHEFNAME} +chef-solo -c solo.rb -E ${CHEFNAME} -sed -i '/^set -e/aJAVA_OPTIONS=\"-Xdebug -Xmx128m -Xms128m -Xss1m -Dconfig.home=${JETTY_BASE}/config/sdc-simulator -Dlog.home=${JETTY_BASE}/logs -Dlogback.configurationFile=${JETTY_BASE}/config/sdc-simulator/logback.xml -Djetty.logging.dir=${JETTY_BASE}/logs -Djetty.base=${JETTY_BASE} \"' /docker-entrypoint.sh -#Moty Default WS startup args -#/usr/bin/java -Dconfig.home=/apps/jetty/base/ws/config -Dlog.home=/apps/jetty/base/ws/logs -Dlogback.configurationFile=/apps/jetty/base/ws/logback.xml -Djetty.logging.dir=/apps/jetty/base/ws/logs -Djetty.home=/apps/jetty/jetty-distribution-9.3.6.v20151106 -Djetty.base=/apps/jetty/base/ws -Djava.io.tmpdir=/tmp -jar /apps/jetty/jetty-distribution-9.3.6.v20151106/start.jar jetty.state=/apps/jetty/base/ws/webseal-simulator.state jetty-logging.xml jetty-started.xml +sed -i '/^set -e/aJAVA_OPTIONS=\"-Xdebug -Xmx128m -Xms128m -Xss1m -Dconfig.home=${JETTY_BASE}/config/sdc-simulator -Dlog.home=${JETTY_BASE}/logs -Dlogback.configurationFile=${JETTY_BASE}/config/sdc-simulator/logback.xml -Djetty.logging.dir=${JETTY_BASE}/logs -Djetty.base=${JETTY_BASE} \"' /docker-entrypoint.sh sed -i '/^set -e/aTMPDIR=${JETTY_BASE}\/temp' /docker-entrypoint.sh cd /var/lib/jetty /docker-entrypoint.sh -#sed -i '/^set -e/aJAVA_OPTIONS=\"-Xdebug -Xmx128m -Xms128m -Xss1m -agentlib:jdwp=transport=dt_socket,address=4002,server=y,suspend=n -Dconfig.home=${JETTY_BASE}/config -Dlog.home=${JETTY_BASE}/logs -Dlogback.configurationFile=${JETTY_BASE}/config/catalog-be/logback.xml -Djetty.logging.dir=${JETTY_BASE}/logs -Djetty.home=/home/vagrant/jetty/jetty-distribution-9.3.6.v20151106 -Djetty.base=${JETTY_BASE} -Djava.io.tmpdir=/home/vagrant/webseal-simulator/tmp -jar /home/vagrant/jetty/jetty-distribution-9.3.6.v20151106/start.jar jetty.state=/home/vagrant/webseal-simulator/webseal-simulator.state jetty-logging.xml jetty-started.xml\"' /docker-entrypoint.sh \ No newline at end of file diff --git a/utils/webseal-simulator/src/main/resources/logback.xml b/utils/webseal-simulator/src/main/resources/logback.xml index ba16783536..58fab30d38 100644 --- a/utils/webseal-simulator/src/main/resources/logback.xml +++ b/utils/webseal-simulator/src/main/resources/logback.xml @@ -1,328 +1,13 @@ - - - - - - - - - - - - - - - - - - - ${log.home}/${ECOMP-component-name}/${ECOMP-subcomponent-name}/all.log - - - - ${log.home}/${ECOMP-component-name}/${ECOMP-subcomponent-name}/all.log.%i - - 1 - 10 - - - - 20MB - - - ${default-log-pattern} - - - - - - - - - - - - ${log.home}/${ECOMP-component-name}/${ECOMP-subcomponent-name}/error.log - - - - - - AUDIT_MARKER - - NEUTRAL - DENY - - - - - - TRANSACTION_MARKER - - NEUTRAL - DENY - - - - - INFO - - - - ${log.home}/${ECOMP-component-name}/${ECOMP-subcomponent-name}/error.log.%i - - 1 - 10 - - - - 20MB - - - ${default-log-pattern} - - - - - - ${log.home}/${ECOMP-component-name}/${ECOMP-subcomponent-name}/debug.log - - - - - - - TRANSACTION_MARKER - - NEUTRAL - DENY - - - - - - - e.level.toInt() <= DEBUG.toInt() - - - DENY - - ACCEPT - - - - ${log.home}/${ECOMP-component-name}/${ECOMP-subcomponent-name}/debug.log.%i - - 1 - 10 - - - - 20MB - - - ${default-log-pattern} - - - - - - - ${log.home}/${ECOMP-component-name}/${ECOMP-subcomponent-name}/debug_by_package.log - - - - - - - TRANSACTION_MARKER - - NEUTRAL - DENY - - - - - - - e.level.toInt() <= DEBUG.toInt() - - - DENY - NEUTRAL - - - - ${log.home}/${ECOMP-component-name}/${ECOMP-subcomponent-name}/debug_by_package.log.%i - - 1 - 10 - - - - 20MB - - - ${asdc-debug-log-pattern} - - - - - - - ${log.home}/${ECOMP-component-name}/${ECOMP-subcomponent-name}/audit.log - - - - - - AUDIT_MARKER - AUDIT - - DENY - ACCEPT - - - - ${log.home}/${ECOMP-component-name}/${ECOMP-subcomponent-name}/audit.log.%i - - 1 - 10 - - - - 20MB - - - ${default-log-pattern} - - - - - - - ${log.home}/${ECOMP-component-name}/${ECOMP-subcomponent-name}/metrics.log - - - - - - METRICS - - DENY - ACCEPT - - - - ${log.home}/${ECOMP-component-name}/${ECOMP-subcomponent-name}/metrics.log.%i - - 1 - 10 - - - - 20MB - - - ${default-log-pattern} - - - - - - - ${log.home}/${ECOMP-component-name}/${ECOMP-subcomponent-name}/transaction.log - - - - - - TRANSACTION_MARKER - - DENY - ACCEPT - - - - ${log.home}/${ECOMP-component-name}/${ECOMP-subcomponent-name}/transaction.log.%i - - 1 - 10 - - - - 20MB - - - ${default-log-pattern} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + %d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n + + + + + + + -- cgit 1.2.3-korg