Skip to content
This repository has been archived by the owner on Apr 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request #47 from chirangaalwis/cf-is-pattern-2-package-ref…
Browse files Browse the repository at this point in the history
…inements

Refinements to packages of WSO2 Identity Server deployment patterns
  • Loading branch information
chamithkumarage authored Feb 15, 2018
2 parents 8bd64fd + 5dcbedb commit a30a1b4
Show file tree
Hide file tree
Showing 25 changed files with 269 additions and 338 deletions.
2 changes: 2 additions & 0 deletions pattern-1/bosh-release/jobs/wso2is_1/spec
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ properties:

wso2is.user_ds.url:
description: Connection URL of the user data source
wso2is.bps_ds.url:
description: Connection URL of the BPS data source
wso2is.registry_ds.url:
description: Connection URL of the registry data source
wso2is.identity_ds.url:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</jndiConfig>
<definition type="RDBMS">
<configuration>
<url><%=properties.wso2is.identity_ds.url%></url>
<url><%=properties.wso2is.bps_ds.url%></url>
<username><%=properties.wso2is.db.username%></username>
<password><%=properties.wso2is.db.password%></password>
<driverClassName><%=properties.wso2is.db.driver%></driverClassName>
Expand Down
2 changes: 1 addition & 1 deletion pattern-1/bosh-release/jobs/wso2is_1/templates/ctl.erb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ case $1 in
cd /var/vcap/packages/${wso2_product}/
archive=`ls ${wso2_product}*zip`
unzip ${archive}
cd wso2is*
cd ${wso2_product}*
wso2_is_home=`pwd`

log_debug "WSO2_IS_HOME: ${wso2_is_home}"
Expand Down
2 changes: 2 additions & 0 deletions pattern-1/bosh-release/jobs/wso2is_2/spec
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ properties:

wso2is.user_ds.url:
description: Connection URL of the user data source
wso2is.bps_ds.url:
description: Connection URL of the BPS data source
wso2is.registry_ds.url:
description: Connection URL of the registry data source
wso2is.identity_ds.url:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</jndiConfig>
<definition type="RDBMS">
<configuration>
<url><%=properties.wso2is.identity_ds.url%></url>
<url><%=properties.wso2is.bps_ds.url%></url>
<username><%=properties.wso2is.db.username%></username>
<password><%=properties.wso2is.db.password%></password>
<driverClassName><%=properties.wso2is.db.driver%></driverClassName>
Expand Down
2 changes: 1 addition & 1 deletion pattern-1/bosh-release/jobs/wso2is_2/templates/ctl.erb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ case $1 in
cd /var/vcap/packages/${wso2_product}/
archive=`ls ${wso2_product}*zip`
unzip ${archive}
cd wso2is*
cd ${wso2_product}*
wso2_is_home=`pwd`

log_debug "WSO2_IS_HOME: ${wso2_is_home}"
Expand Down
8 changes: 0 additions & 8 deletions pattern-1/bosh-release/manifests/wso2is-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,6 @@ properties:
memory:
max_heap: 1024
min_heap: 1024
user_ds:
url: jdbc:mysql://192.168.50.1:3306/wso2is_db?autoReconnect=true
registry_ds:
url: jdbc:mysql://192.168.50.1:3306/wso2is_db?autoReconnect=true
identity_ds:
url: jdbc:mysql://192.168.50.1:3306/wso2is_db?autoReconnect=true
db:
driver: com.mysql.jdbc.Driver
releases:
- name: wso2is-release
version: latest
Expand Down
12 changes: 12 additions & 0 deletions pattern-2/bosh-release/config/blobs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
mysqldriver/mysql-connector-java-5.1.34-bin.jar:
size: 960374
sha: 6df5bcec3970d71eaace2c5589077452c5e9ecfa
oraclejdk/jdk-8u144-linux-x64.tar.gz:
size: 185515842
sha: d4c4f02908d39827393dd77f9eb8da348363efda
wso2is/wso2is-5.4.0.zip:
size: 376088880
sha: 6f1ba157db5f73791fa862adc97586023ed31371
wso2is_analytics/wso2is-analytics-5.4.0.zip:
size: 383665620
sha: 03e114ac4730990418e5f5ea02fb7d8dca1c8ae4
10 changes: 2 additions & 8 deletions pattern-2/bosh-release/jobs/wso2is_1/spec
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,14 @@ properties:

wso2is.user_ds.url:
description: Connection URL of the user data source
wso2is.user_ds.driver:
description: Database driver class name of the user data source
wso2is.identity_ds.url:
description: Connection URL of the identity data source
wso2is.identity_ds.driver:
description: Database driver class name of the identity data source
wso2is.bps_ds.url:
description: Connection URL of the BPS data source
wso2is.bps_ds.driver:
description: Database driver class name of the BPS data source
wso2is.registry_ds.url:
description: Connection URL of the Registry data source
wso2is.registry_ds.driver:
description: Database driver class name of the Registry data source
wso2is.db.driver:
description: Database driver class name of the data source
wso2is.db.username:
description: Username of the WSO2 Identity Server product database user
default: root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<datasources>
<datasource>
<name>BPS_DS</name>
<name>WSO2_BPS_DS</name>
<description></description>
<jndiConfig>
<name>bpsds</name>
Expand All @@ -16,7 +16,7 @@
<url><%=properties.wso2is.bps_ds.url%></url>
<username><%=properties.wso2is.db.username%></username>
<password><%=properties.wso2is.db.password%></password>
<driverClassName><%=properties.wso2is.bps_ds.driver%></driverClassName>
<driverClassName><%=properties.wso2is.db.driver%></driverClassName>
<testOnBorrow>true</testOnBorrow>
<validationQuery>SELECT 1</validationQuery>
<validationInterval>30000</validationInterval>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<datasources>

<datasource>
<name>REGISTRY_LOCAL</name>
<name>WSO2_REGISTRY_LOCAL</name>
<description>The datasource used for registry and user manager</description>
<jndiConfig>
<name>jdbc/WSO2CarbonDB</name>
Expand Down Expand Up @@ -39,7 +39,7 @@
<url><%=properties.wso2is.user_ds.url%></url>
<username><%=properties.wso2is.db.username%></username>
<password><%=properties.wso2is.db.password%></password>
<driverClassName><%=properties.wso2is.user_ds.driver%></driverClassName>
<driverClassName><%=properties.wso2is.db.driver%></driverClassName>
<maxActive>50</maxActive>
<maxWait>60000</maxWait>
<testOnBorrow>true</testOnBorrow>
Expand All @@ -60,7 +60,7 @@
<url><%=properties.wso2is.registry_ds.url%></url>
<username><%=properties.wso2is.db.username%></username>
<password><%=properties.wso2is.db.password%></password>
<driverClassName><%=properties.wso2is.registry_ds.driver%></driverClassName>
<driverClassName><%=properties.wso2is.db.driver%></driverClassName>
<maxActive>50</maxActive>
<maxWait>60000</maxWait>
<testOnBorrow>true</testOnBorrow>
Expand All @@ -81,7 +81,7 @@
<url><%=properties.wso2is.identity_ds.url%></url>
<username><%=properties.wso2is.db.username%></username>
<password><%=properties.wso2is.db.password%></password>
<driverClassName><%=properties.wso2is.identity_ds.driver%></driverClassName>
<driverClassName><%=properties.wso2is.db.driver%></driverClassName>
<maxActive>50</maxActive>
<maxWait>60000</maxWait>
<testOnBorrow>true</testOnBorrow>
Expand Down
115 changes: 54 additions & 61 deletions pattern-2/bosh-release/jobs/wso2is_1/templates/ctl.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,94 +19,87 @@
#
# ----------------------------------------------------------------------------

set +e
set -xv

SCRIPT_DIR=$(dirname $0 )
JOB_DIR=$SCRIPT_DIR/..

RUN_DIR=/var/vcap/sys/run/wso2is
LOG_DIR=/var/vcap/sys/log/wso2is
PIDFILE=${RUN_DIR}/pid

mkdir -p $RUN_DIR $LOG_DIR
chown -R vcap:vcap $RUN_DIR $LOG_DIR

mkdir -p /var/vcap/store/wso2is/data
export WSO2_IS_DATA_DIR=/var/vcap/store/wso2is/data/wso2is

export JDK_HOME=/var/vcap/packages/oraclejdk/
export WSO2_IS_PKG_HOME=/var/vcap/packages/wso2is/
export WSO2_IS_SERVER_PACKAGE=/var/vcap/packages/wso2is/
export WSO2_IS_CONFIG=/var/vcap/packages/config/

# Here set any environment variables for your software
export WSO2_IS_SERVER_PORT=<%=properties.wso2is.listen_port %>
export WSO2_IS_SERVER_RUN_SCRIPT=<%=properties.wso2is.run_script %>
export MIN_HEAP=<%=properties.wso2is.memory.min_heap %>
export MAX_HEAP=<%=properties.wso2is.memory.max_heap %>
export MAX_PERMGEN=<%=properties.wso2is.memory.max_permgen %>
export JAVA_OPTS=" -Xmx${MAX_HEAP}m -Xms${MIN_HEAP}m -XX:MaxPermSize=${MAX_PERMGEN}m"

export DEBUG_LOG=$LOG_DIR/wso2is.log

touch $DEBUG_LOG
chmod -R 755 /var/vcap/sys
chmod 777 $DEBUG_LOG
set -e

# define variables
wso2_product=wso2is
script_dir=$(dirname $0)
job_dir=${script_dir}/..
run_dir=/var/vcap/sys/run/${wso2_product}
log_dir=/var/vcap/sys/log/${wso2_product}
pid_file=${run_dir}/pid

# creates the directories
mkdir -p ${run_dir} ${log_dir}
# provide ownership of the directories 'vcap' user and group
chown -R vcap:vcap ${run_dir} ${log_dir}

# set variables for your software
min_heap=<%=properties.wso2is.memory.min_heap %>
max_heap=<%=properties.wso2is.memory.max_heap %>
max_permgen=<%=properties.wso2is.memory.max_permgen %>
export JAVA_OPTS=" -Xmx${max_heap}m -Xms${min_heap}m -XX:MaxPermSize=${max_permgen}m"

debug_log=${log_dir}/${wso2_product}.log
touch ${debug_log}

function log_debug() {
echo `date` $1 >> $DEBUG_LOG
echo `date` $1 >> ${debug_log}
}

log_debug "Kicking off ctl script as `whoami` with $1"

# includes start command and stop commands
case $1 in

start)
# Kill the previously running instance if any
kill -9 `cat $PIDFILE`
# kill the previously running instance if any
if [ -f ${pid_file} ]; then
kill -9 `cat ${pid_file}`
fi

pushd ${JDK_HOME}
# unpack the JDK distribution and setup the JAVA_HOME
cd /var/vcap/packages/oraclejdk/
archive=`ls jdk*gz`
tar -zxvf $archive
export JAVA_HOME=`pwd`/jdk1.8.0_144/
export JAVA_BINARY=${JAVA_HOME}/bin/java
JAVA_HOME=`pwd`/java
mkdir java
tar -xf ${archive} -C java/ --strip-components=1
export JAVA_HOME

log_debug "JAVA_HOME: ${JAVA_HOME}"
log_debug "JAVA_BINARY: ${JAVA_BINARY}"

pushd ${WSO2_IS_PKG_HOME}
archive=`ls wso2is*zip`
unzip $archive
cd wso2is*
WSO2_IS_HOME=`pwd`
cd /var/vcap/packages/${wso2_product}/
archive=`ls ${wso2_product}*zip`
unzip ${archive}
cd ${wso2_product}*
wso2_is_home=`pwd`

log_debug "WSO2_IS_HOME: ${WSO2_IS_HOME}"
log_debug "WSO2_IS_HOME: ${wso2_is_home}"

# Here copy all the configurations needs to be replaces the application for ex:lib, conf files
cp -r -v $JOB_DIR/config/* ${WSO2_IS_HOME}/repository/
# copy all the configuration files that need to be replaced in <WSO2_PRODUCT_HOME>/repository/conf
cp -r ${job_dir}/config/* ${wso2_is_home}/repository/

# Here add any libraries your application needs:
cp -v /var/vcap/packages/mysqldriver/* ${WSO2_IS_HOME}/repository/components/lib/
# add any external libraries required during runtime
cp /var/vcap/packages/mysqldriver/* ${wso2_is_home}/repository/components/lib/

${WSO2_IS_HOME}/bin/wso2server.sh start
# start the WSO2 product server
${wso2_is_home}/bin/wso2server.sh start

# Sleep for a little while so the server comes up
# sleep until the server starts up
sleep 20
WSO2_IS_PID=`ps -ef | grep java | grep -v grep | awk '{print $2}' `
echo $WSO2_IS_PID > $PIDFILE

cat $PIDFILE
wso2_is_pid=`ps -ef | grep java | grep -v grep | awk '{print $2}' `
echo ${wso2_is_pid} > ${pid_file}

log_debug "Process ID: `cat ${pid_file}`"
;;

stop)

kill -9 `cat $PIDFILE`
rm -f $PIDFILE
kill -9 `cat ${pid_file}`
rm -f ${pid_file}
;;

*)
echo "Usage: ctl {start|stop}" ;;

esac
esac
10 changes: 2 additions & 8 deletions pattern-2/bosh-release/jobs/wso2is_2/spec
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,14 @@ properties:

wso2is.user_ds.url:
description: Connection URL of the user data source
wso2is.user_ds.driver:
description: Database driver class name of the user data source
wso2is.identity_ds.url:
description: Connection URL of the identity data source
wso2is.identity_ds.driver:
description: Database driver class name of the identity data source
wso2is.bps_ds.url:
description: Connection URL of the BPS data source
wso2is.bps_ds.driver:
description: Database driver class name of the BPS data source
wso2is.registry_ds.url:
description: Connection URL of the Registry data source
wso2is.registry_ds.driver:
description: Database driver class name of the Registry data source
wso2is.db.driver:
description: Database driver class name of the data source
wso2is.db.username:
description: Username of the WSO2 Identity Server product database user
default: root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<datasources>
<datasource>
<name>BPS_DS</name>
<name>WSO2_BPS_DS</name>
<description></description>
<jndiConfig>
<name>bpsds</name>
Expand All @@ -16,7 +16,7 @@
<url><%=properties.wso2is.bps_ds.url%></url>
<username><%=properties.wso2is.db.username%></username>
<password><%=properties.wso2is.db.password%></password>
<driverClassName><%=properties.wso2is.bps_ds.driver%></driverClassName>
<driverClassName><%=properties.wso2is.db.driver%></driverClassName>
<testOnBorrow>true</testOnBorrow>
<validationQuery>SELECT 1</validationQuery>
<validationInterval>30000</validationInterval>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<datasources>

<datasource>
<name>REGISTRY_LOCAL_2</name>
<name>WSO2_REGISTRY_LOCAL</name>
<description>The datasource used for registry and user manager</description>
<jndiConfig>
<name>jdbc/WSO2CarbonDB</name>
Expand Down Expand Up @@ -39,7 +39,7 @@
<url><%=properties.wso2is.user_ds.url%></url>
<username><%=properties.wso2is.db.username%></username>
<password><%=properties.wso2is.db.password%></password>
<driverClassName><%=properties.wso2is.user_ds.driver%></driverClassName>
<driverClassName><%=properties.wso2is.db.driver%></driverClassName>
<maxActive>50</maxActive>
<maxWait>60000</maxWait>
<testOnBorrow>true</testOnBorrow>
Expand All @@ -60,7 +60,7 @@
<url><%=properties.wso2is.registry_ds.url%></url>
<username><%=properties.wso2is.db.username%></username>
<password><%=properties.wso2is.db.password%></password>
<driverClassName><%=properties.wso2is.registry_ds.driver%></driverClassName>
<driverClassName><%=properties.wso2is.db.driver%></driverClassName>
<maxActive>50</maxActive>
<maxWait>60000</maxWait>
<testOnBorrow>true</testOnBorrow>
Expand All @@ -81,7 +81,7 @@
<url><%=properties.wso2is.identity_ds.url%></url>
<username><%=properties.wso2is.db.username%></username>
<password><%=properties.wso2is.db.password%></password>
<driverClassName><%=properties.wso2is.identity_ds.driver%></driverClassName>
<driverClassName><%=properties.wso2is.db.driver%></driverClassName>
<maxActive>50</maxActive>
<maxWait>60000</maxWait>
<testOnBorrow>true</testOnBorrow>
Expand Down
Loading

0 comments on commit a30a1b4

Please sign in to comment.