From 920402f4ebb61c9f776eee5f08e6edbd205b8784 Mon Sep 17 00:00:00 2001 From: Raj Venkatesan Date: Tue, 31 Oct 2017 14:41:46 -0700 Subject: [PATCH] Update OracleSOASuite for 12.2.1.3 --- OracleSOASuite/README.md | 2 +- .../dockerfiles/12.2.1.3/.gitignore | 1 + .../dockerfiles/12.2.1.3/Dockerfile | 47 ++ .../container-scripts/createDomain.py | 483 ++++++++++++++++++ .../container-scripts/createDomainAndStart.sh | 252 +++++++++ .../12.2.1.3/container-scripts/startAS.sh | 59 +++ .../12.2.1.3/container-scripts/startMS.sh | 101 ++++ .../container-scripts/updListenAddress.py | 48 ++ .../dockerfiles/12.2.1.3/install/oraInst.loc | 2 + .../12.2.1.3/install/soasuite.download | 11 + .../12.2.1.3/install/soasuite.response | 15 + .../dockerfiles/buildDockerImage.sh | 4 +- OracleSOASuite/setenv.sh | 2 +- 13 files changed, 1023 insertions(+), 4 deletions(-) create mode 100644 OracleSOASuite/dockerfiles/12.2.1.3/.gitignore create mode 100644 OracleSOASuite/dockerfiles/12.2.1.3/Dockerfile create mode 100755 OracleSOASuite/dockerfiles/12.2.1.3/container-scripts/createDomain.py create mode 100755 OracleSOASuite/dockerfiles/12.2.1.3/container-scripts/createDomainAndStart.sh create mode 100755 OracleSOASuite/dockerfiles/12.2.1.3/container-scripts/startAS.sh create mode 100755 OracleSOASuite/dockerfiles/12.2.1.3/container-scripts/startMS.sh create mode 100755 OracleSOASuite/dockerfiles/12.2.1.3/container-scripts/updListenAddress.py create mode 100644 OracleSOASuite/dockerfiles/12.2.1.3/install/oraInst.loc create mode 100644 OracleSOASuite/dockerfiles/12.2.1.3/install/soasuite.download create mode 100644 OracleSOASuite/dockerfiles/12.2.1.3/install/soasuite.response diff --git a/OracleSOASuite/README.md b/OracleSOASuite/README.md index 371c68fc04..45c7993991 100644 --- a/OracleSOASuite/README.md +++ b/OracleSOASuite/README.md @@ -1,6 +1,6 @@ Oracle SOA Suite/BPM on Docker ============================== -Sample Docker build file to facilitate installation, configuration, and environment setup for DevOps users for Release 12.2.1.2.0. For more information check out +Sample Docker build file to facilitate installation, configuration, and environment setup for DevOps users for Releases 12.2.1.2.0,12.2.1.3.0. For more information check out [Oracle Fusion Middleware](http://www.oracle.com/technetwork/middleware/fusion-middleware/overview/index.html) specifically the sections on - Service Integration (SOA) - Business Process Management diff --git a/OracleSOASuite/dockerfiles/12.2.1.3/.gitignore b/OracleSOASuite/dockerfiles/12.2.1.3/.gitignore new file mode 100644 index 0000000000..d392f0e82c --- /dev/null +++ b/OracleSOASuite/dockerfiles/12.2.1.3/.gitignore @@ -0,0 +1 @@ +*.jar diff --git a/OracleSOASuite/dockerfiles/12.2.1.3/Dockerfile b/OracleSOASuite/dockerfiles/12.2.1.3/Dockerfile new file mode 100644 index 0000000000..ef466a5f66 --- /dev/null +++ b/OracleSOASuite/dockerfiles/12.2.1.3/Dockerfile @@ -0,0 +1,47 @@ +# +# Copyright (c) 2016-2017 Oracle and/or its affiliates. All rights reserved. +# +# Licensed under the Universal Permissive License v 1.0 as shown at +# http://oss.oracle.com/licenses/upl. +# +# ORACLE DOCKERFILES PROJECT +# -------------------------- +# This is the Dockerfile for Oracle SOA Suite +# +# REQUIRED FILES TO BUILD THIS IMAGE +# ---------------------------------- +# See soasuite.download file in the install directory +# +# Pull base image +# --------------- +FROM oracle/fmw-infrastructure:12.2.1.3 +# +# Maintainer +# ---------- +MAINTAINER Prashanth Nagaraja +# +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +USER root +ENV FMW_JAR1=fmw_12.2.1.3.0_soa.jar \ + FMW_JAR2=fmw_12.2.1.3.0_osb.jar + +# +# Copy files and packages for install +# ----------------------------------- +ADD $FMW_JAR1 $FMW_JAR2 /u01/ +COPY container-scripts/* /u01/oracle/dockertools/ +RUN cd /u01 && chmod 755 *.jar && chmod a+xr /u01/oracle/dockertools/*.* +# +USER oracle +COPY install/* /u01/ +RUN cd /u01 && \ + $JAVA_HOME/bin/java -jar $FMW_JAR1 -silent -responseFile /u01/soasuite.response -invPtrLoc /u01/oraInst.loc -jreLoc $JAVA_HOME -ignoreSysPrereqs -force -novalidation ORACLE_HOME=$ORACLE_HOME && \ + $JAVA_HOME/bin/java -jar $FMW_JAR2 -silent -responseFile /u01/soasuite.response -invPtrLoc /u01/oraInst.loc -jreLoc $JAVA_HOME -ignoreSysPrereqs -force -novalidation ORACLE_HOME=$ORACLE_HOME INSTALL_TYPE="Service Bus" && \ + rm -fr /u01/*.jar /u01/*.response /u01/*.loc + +# +# Define default command to start bash. +# +WORKDIR $ORACLE_HOME +CMD ["/u01/oracle/dockertools/createDomainAndStart.sh"] diff --git a/OracleSOASuite/dockerfiles/12.2.1.3/container-scripts/createDomain.py b/OracleSOASuite/dockerfiles/12.2.1.3/container-scripts/createDomain.py new file mode 100755 index 0000000000..afc3deeb0b --- /dev/null +++ b/OracleSOASuite/dockerfiles/12.2.1.3/container-scripts/createDomain.py @@ -0,0 +1,483 @@ +# +# +# Copyright (c) 2016-2017 Oracle and/or its affiliates. All rights reserved. +# +# Licensed under the Universal Permissive License v 1.0 as shown at +# http://oss.oracle.com/licenses/upl. +# + +import os +import sys + +import com.oracle.cie.domain.script.jython.WLSTException as WLSTException + +class SOA12212Provisioner: + + MACHINES = { + 'machine1' : { + 'NMType': 'SSL', + 'ListenAddress': 'localhost', + 'ListenPort': 5658 + } + } + + SOA_CLUSTERS = { + 'soa_cluster' : {} + } + + OSB_CLUSTERS = { + 'osb_cluster' : {} + } + + SERVERS = { + 'AdminServer' : { + 'ListenAddress': '', + 'ListenPort': 7001, + 'Machine': 'machine1' + } + + } + + SOA_SERVERS = { + 'soa_server1' : { + 'ListenAddress': '', + 'ListenPort': 8001, + 'Machine': 'machine1', + 'Cluster': 'soa_cluster' + } + } + + OSB_SERVERS = { + 'osb_server1' : { + 'ListenAddress': '', + 'ListenPort': 9001, + 'Machine': 'machine1', + 'Cluster': 'osb_cluster' + } + } + + + JRF_12212_TEMPLATES = { + 'baseTemplate' : '@@ORACLE_HOME@@/wlserver/common/templates/wls/wls.jar', + 'extensionTemplates' : [ + '@@ORACLE_HOME@@/oracle_common/common/templates/wls/oracle.jrf_template.jar', + '@@ORACLE_HOME@@/oracle_common/common/templates/wls/oracle.jrf.ws.async_template.jar', + '@@ORACLE_HOME@@/oracle_common/common/templates/wls/oracle.wsmpm_template.jar', + '@@ORACLE_HOME@@/oracle_common/common/templates/wls/oracle.ums_template.jar', + '@@ORACLE_HOME@@/em/common/templates/wls/oracle.em_wls_template.jar' + ], + 'serverGroupsToTarget' : [ 'JRF-MAN-SVR', 'WSMPM-MAN-SVR' ] + } + + SOA_12212_TEMPLATES = { + 'extensionTemplates' : [ + '@@ORACLE_HOME@@/soa/common/templates/wls/oracle.soa_template.jar' + ], + 'serverGroupsToTarget' : [ 'SOA-MGD-SVRS-ONLY' ] + } + + OSB_12212_TEMPLATES = { + 'extensionTemplates' : [ + '@@ORACLE_HOME@@/osb/common/templates/wls/oracle.osb_template.jar' + ], + 'serverGroupsToTarget' : [ 'OSB-MGD-SVRS-ONLY' ] + } + + BPM_12212_TEMPLATES = { + 'extensionTemplates' : [ + '@@ORACLE_HOME@@/soa/common/templates/wls/oracle.bpm_template.jar' + ], + 'serverGroupsToTarget' : [ 'SOA-MGD-SVRS-ONLY' ] + } + + def __init__(self, oracleHome, javaHome, domainParentDir): + self.oracleHome = self.validateDirectory(oracleHome) + self.javaHome = self.validateDirectory(javaHome) + self.domainParentDir = self.validateDirectory(domainParentDir, create=True) + return + + def configureXADataSources(self): + cd('/JDBCSystemResources/SOADataSource/JdbcResource/SOADataSource') + cd('JDBCDriverParams/NO_NAME_0') + set('DriverName', 'oracle.jdbc.xa.client.OracleXADataSource') + cd('/JDBCSystemResources/EDNDataSource/JdbcResource/EDNDataSource') + cd('JDBCDriverParams/NO_NAME_0') + set('DriverName', 'oracle.jdbc.xa.client.OracleXADataSource') + cd('/JDBCSystemResources/OraSDPMDataSource/JdbcResource/OraSDPMDataSource') + cd('JDBCDriverParams/NO_NAME_0') + set('DriverName', 'oracle.jdbc.xa.client.OracleXADataSource') + return + + def createDomain(self, name, user, password, db, dbPrefix, dbPassword,domainType): + domainHome = self.createBaseDomain(name, user, password,domainType) + + if domainType == "soa" or domainType == "soaosb": + self.extendSoaDomain(domainHome, db, dbPrefix, dbPassword) + + if domainType == "osb" or domainType == "soaosb" : + self.extendOsbDomain(domainHome, db, dbPrefix, dbPassword,domainType) + + if domainType == "bpm": + self.extendBpmDomain(domainHome, db, dbPrefix, dbPassword) + + + def createBaseDomain(self, name, user, password,domainType): + baseTemplate = self.replaceTokens(self.JRF_12212_TEMPLATES['baseTemplate']) + + readTemplate(baseTemplate) + setOption('DomainName', name) + setOption('JavaHome', self.javaHome) + setOption('ServerStartMode', 'prod') + set('Name', domainName) + cd('/Security/' + domainName + '/User/weblogic') + set('Name', user) + set('Password', password) + + + print 'INFO: Creating Node Managers...' + for machine in self.MACHINES: + cd('/') + create(machine, 'Machine') + cd('Machine/' + machine) + create(machine, 'NodeManager') + cd('NodeManager/' + machine) + for param in self.MACHINES[machine]: + set(param, self.MACHINES[machine][param]) + + print 'INFO: Creating Admin server...' + + for server in self.SERVERS: + cd('/') + if server == 'AdminServer': + cd('Server/' + server) + for param in self.SERVERS[server]: + set(param, self.SERVERS[server][param]) + continue + create(server, 'Server') + cd('Server/' + server) + for param in self.SERVERS[server]: + set(param, self.SERVERS[server][param]) + + if domainType == "soa" or domainType == "bpm" or domainType == "soaosb": + for cluster in self.SOA_CLUSTERS: + cd('/') + create(cluster, 'Cluster') + cd('Cluster/' + cluster) + for param in self.SOA_CLUSTERS[cluster]: + set(param, self.SOA_CLUSTERS[cluster][param]) + + for server in self.SOA_SERVERS: + cd('/') + create(server, 'Server') + cd('Server/' + server) + for param in self.SOA_SERVERS[server]: + set(param, self.SOA_SERVERS[server][param]) + + print 'INFO: SOA Servers created.....' + + if domainType == 'osb' or domainType == "soaosb": + + print 'INFO: Creating OSB cluster...' + for cluster in self.OSB_CLUSTERS: + cd('/') + create(cluster, 'Cluster') + cd('Cluster/' + cluster) + for param in self.OSB_CLUSTERS[cluster]: + set(param, self.OSB_CLUSTERS[cluster][param]) + + for server in self.OSB_SERVERS: + cd('/') + create(server, 'Server') + cd('Server/' + server) + for param in self.OSB_SERVERS[server]: + set(param, self.OSB_SERVERS[server][param]) + + + print 'INFO: OSB Servers created.....' + setOption('OverwriteDomain', 'true') + domainHome = self.domainParentDir + '/' + name + + print 'INFO: Writing base domain...' + writeDomain(domainHome) + closeTemplate() + print 'INFO: Base domain created at ' + domainHome + return domainHome + + + def readAndApplyJRFTemplates(self, domainHome): + print 'INFO: Extending domain at ' + domainHome + readDomain(domainHome) + setOption('AppDir', self.domainParentDir + '/applications') + + print 'INFO: Applying JRF templates...' + for extensionTemplate in self.JRF_12212_TEMPLATES['extensionTemplates']: + addTemplate(self.replaceTokens(extensionTemplate)) + return + + def applySOATemplates(self): + print 'INFO: Applying SOA templates...' + for extensionTemplate in self.SOA_12212_TEMPLATES['extensionTemplates']: + addTemplate(self.replaceTokens(extensionTemplate)) + return + + def configureJDBCTemplates(self,db,dbPrefix,dbPassword): + print 'INFO: Configuring the Service Table DataSource...' + fmwDb = 'jdbc:oracle:thin:@' + db + cd('/JDBCSystemResource/LocalSvcTblDataSource/JdbcResource/LocalSvcTblDataSource') + cd('JDBCDriverParams/NO_NAME_0') + set('DriverName', 'oracle.jdbc.OracleDriver') + set('URL', fmwDb) + set('PasswordEncrypted', dbPassword) + + stbUser = dbPrefix + '_STB' + cd('Properties/NO_NAME_0/Property/user') + set('Value', stbUser) + + print 'INFO: Getting Database Defaults...' + getDatabaseDefaults() + return + + def targetSOAServers(self,serverGroupsToTarget): + for server in self.SOA_SERVERS: + if not server == 'AdminServer': + setServerGroups(server, serverGroupsToTarget) + print "INFO: Set CoherenceClusterSystemResource to defaultCoherenceCluster for server:" + server + cd('/Servers/' + server) + set('CoherenceClusterSystemResource', 'defaultCoherenceCluster') + return + + def targetSOACluster(self): + for cluster in self.SOA_CLUSTERS: + print "INFO: Set CoherenceClusterSystemResource to defaultCoherenceCluster for cluster:" + cluster + cd('/Cluster/' + cluster) + set('CoherenceClusterSystemResource', 'defaultCoherenceCluster') + return + + + def targetOSBServers(self,serverGroupsToTarget): + for server in self.OSB_SERVERS: + if not server == 'AdminServer': + setServerGroups(server, serverGroupsToTarget) + print "INFO: Set CoherenceClusterSystemResource to defaultCoherenceCluster for server:" + server + cd('/Servers/' + server) + set('CoherenceClusterSystemResource', 'defaultCoherenceCluster') + return + + def targetOSBCluster(self): + for cluster in self.OSB_CLUSTERS: + print "INFO: Set CoherenceClusterSystemResource to defaultCoherenceCluster for cluster:" + cluster + cd('/Cluster/' + cluster) + set('CoherenceClusterSystemResource', 'defaultCoherenceCluster') + return + + def extendSoaDomain(self, domainHome, db, dbPrefix, dbPassword): + self.readAndApplyJRFTemplates(domainHome) + self.applySOATemplates() + + print 'INFO: Extension Templates added' + + self.configureJDBCTemplates(db,dbPrefix,dbPassword) + self.configureXADataSources() + + print 'INFO: Targeting Server Groups...' + serverGroupsToTarget = list(self.JRF_12212_TEMPLATES['serverGroupsToTarget']) + serverGroupsToTarget.extend(self.SOA_12212_TEMPLATES['serverGroupsToTarget']) + + cd('/') + self.targetSOAServers(serverGroupsToTarget) + + cd('/') + self.targetSOACluster() + + print "INFO: Set WLS clusters as target of defaultCoherenceCluster:[" + ",".join(self.SOA_CLUSTERS) + "]" + + cd('/CoherenceClusterSystemResource/defaultCoherenceCluster') + set('Target', ",".join(self.SOA_CLUSTERS)) + print 'INFO: Preparing to update domain...' + updateDomain() + print 'INFO: Domain updated successfully' + closeDomain() + return + + + def extendOsbDomain(self, domainHome, db, dbPrefix, dbPassword,domainType): + self.readAndApplyJRFTemplates(domainHome) + + print 'INFO: Applying OSB templates...' + for extensionTemplate in self.OSB_12212_TEMPLATES['extensionTemplates']: + addTemplate(self.replaceTokens(extensionTemplate)) + + print 'INFO: Extension Templates added' + + self.configureJDBCTemplates(db,dbPrefix,dbPassword) + cd('/JDBCSystemResources/SOADataSource/JdbcResource/SOADataSource') + cd('JDBCDriverParams/NO_NAME_0') + set('DriverName', 'oracle.jdbc.xa.client.OracleXADataSource') + cd('/JDBCSystemResources/OraSDPMDataSource/JdbcResource/OraSDPMDataSource') + cd('JDBCDriverParams/NO_NAME_0') + set('DriverName', 'oracle.jdbc.xa.client.OracleXADataSource') + + + print 'INFO: Targeting Server Groups...' + serverGroupsToTarget = list(self.JRF_12212_TEMPLATES['serverGroupsToTarget']) + serverGroupsToTarget.extend(self.OSB_12212_TEMPLATES['serverGroupsToTarget']) + + cd('/') + self.targetOSBServers(serverGroupsToTarget) + + cd('/') + self.targetOSBCluster() + + print "INFO: Set WLS clusters as target of defaultCoherenceCluster:[" + ",".join(self.OSB_CLUSTERS) + "]" + cd('/CoherenceClusterSystemResource/defaultCoherenceCluster') + set('Target', ",".join(self.OSB_CLUSTERS)) + + print 'INFO: Preparing to update domain...' + updateDomain() + print 'INFO: Domain updated successfully' + closeDomain() + return + + + def extendBpmDomain(self, domainHome, db, dbPrefix, dbPassword): + self.readAndApplyJRFTemplates(domainHome) + + print 'INFO: Applying BPM templates...' + for extensionTemplate in self.BPM_12212_TEMPLATES['extensionTemplates']: + addTemplate(self.replaceTokens(extensionTemplate)) + + print 'INFO: Extension Templates added' + + self.configureJDBCTemplates(db,dbPrefix,dbPassword) + self.configureXADataSources() + + print 'INFO: Targeting Server Groups...' + serverGroupsToTarget = list(self.JRF_12212_TEMPLATES['serverGroupsToTarget']) + serverGroupsToTarget.extend(self.BPM_12212_TEMPLATES['serverGroupsToTarget']) + + cd('/') + self.targetSOAServers(serverGroupsToTarget) + + cd('/') + self.targetSOACluster() + + print "INFO: Set WLS clusters as target of defaultCoherenceCluster:[" + ",".join(self.SOA_CLUSTERS) + "]" + + cd('/CoherenceClusterSystemResource/defaultCoherenceCluster') + set('Target', ",".join(self.SOA_CLUSTERS)) + print 'INFO: Preparing to update domain...' + updateDomain() + print 'INFO: Domain updated successfully' + closeDomain() + return + + + ########################################################################### + # Helper Methods # + ########################################################################### + + def validateDirectory(self, dirName, create=False): + directory = os.path.realpath(dirName) + if not os.path.exists(directory): + if create: + os.makedirs(directory) + else: + message = 'Directory ' + directory + ' does not exist' + raise WLSTException(message) + elif not os.path.isdir(directory): + message = 'Directory ' + directory + ' is not a directory' + raise WLSTException(message) + return self.fixupPath(directory) + + + def fixupPath(self, path): + result = path + if path is not None: + result = path.replace('\\', '/') + return result + + + def replaceTokens(self, path): + result = path + if path is not None: + result = path.replace('@@ORACLE_HOME@@', oracleHome) + return result + +############################# +# Entry point to the script # +############################# + +def usage(): + print sys.argv[0] + ' -oh -jh -parent [-name ] ' + \ + '[-user ] [-password ] ' + \ + '-rcuDb [-rcuPrefix ] [-rcuSchemaPwd ] ' + \ + '-domainType ' + sys.exit(0) + + +print "createDomain.py called with the following inputs:" +for index, arg in enumerate(sys.argv): + print "INFO: sys.argv[" + str(index) + "] = " + str(sys.argv[index]) + +if len(sys.argv) < 6: + usage() + +#oracleHome will be passed by command line parameter -oh. +oracleHome = None +#javaHome will be passed by command line parameter -jh. +javaHome = None +#domainParentDir will be passed by command line parameter -parent. +domainParentDir = None +#domainName is hard-coded to soa_domain. You can change to other name of your choice. Command line parameter -name. +domainName = 'soa_domain' +#domainUser is hard-coded to weblogic. You can change to other name of your choice. Command line paramter -user. +domainUser = 'weblogic' +#domainPassword is hard-coded to welcome1. You can change to other password of your choice. Command line parameter -password. +domainPassword = 'welcome1' +#rcuDb will be passed by command line parameter -rcuDb. +rcuDb = None +#change rcuSchemaPrefix to your soainfra schema prefix. Command line parameter -rcuPrefix. +rcuSchemaPrefix = 'DEV12' +#change rcuSchemaPassword to your soainfra schema password. Command line parameter -rcuSchemaPwd. +rcuSchemaPassword = 'welcome1' + +i = 1 +while i < len(sys.argv): + if sys.argv[i] == '-oh': + oracleHome = sys.argv[i + 1] + i += 2 + elif sys.argv[i] == '-jh': + javaHome = sys.argv[i + 1] + i += 2 + elif sys.argv[i] == '-parent': + domainParentDir = sys.argv[i + 1] + i += 2 + elif sys.argv[i] == '-name': + domainName = sys.argv[i + 1] + i += 2 + elif sys.argv[i] == '-user': + domainUser = sys.argv[i + 1] + i += 2 + elif sys.argv[i] == '-password': + domainPassword = sys.argv[i + 1] + i += 2 + elif sys.argv[i] == '-rcuDb': + rcuDb = sys.argv[i + 1] + i += 2 + elif sys.argv[i] == '-rcuPrefix': + rcuSchemaPrefix = sys.argv[i + 1] + i += 2 + elif sys.argv[i] == '-rcuSchemaPwd': + rcuSchemaPassword = sys.argv[i + 1] + i += 2 + elif sys.argv[i] == '-domainType': + domainType = sys.argv[i + 1] + i += 2 + else: + print 'INFO: Unexpected argument switch at position ' + str(i) + ': ' + str(sys.argv[i]) + usage() + sys.exit(1) + + +provisioner = SOA12212Provisioner(oracleHome, javaHome, domainParentDir) +provisioner.createDomain(domainName, domainUser, domainPassword, rcuDb, rcuSchemaPrefix, rcuSchemaPassword,domainType) diff --git a/OracleSOASuite/dockerfiles/12.2.1.3/container-scripts/createDomainAndStart.sh b/OracleSOASuite/dockerfiles/12.2.1.3/container-scripts/createDomainAndStart.sh new file mode 100755 index 0000000000..b00b1e1ce4 --- /dev/null +++ b/OracleSOASuite/dockerfiles/12.2.1.3/container-scripts/createDomainAndStart.sh @@ -0,0 +1,252 @@ +#!/bin/bash +# +# +# Copyright (c) 2014-2017 Oracle and/or its affiliates. All rights reserved. +# +# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. +# + +export DOMAIN_NAME=${DOMAIN_NAME:-soainfra} +export DOMAIN_ROOT=${DOMAIN_ROOT:-/u01/oracle/user_projects/domains} +export DOMAIN_HOME=${DOMAIN_ROOT}/${DOMAIN_NAME} + +#================================================== +function _int() { + echo "INFO: Stopping container." + echo "INFO: SIGINT received, shutting down Admin Server!" + /u01/oracle/user_projects/domains/base_domain/bin/stopWebLogic.sh + exit; +} + +#================================================== +function _term() { + echo "INFO: Stopping container." + echo "INFO: SIGTERM received, shutting down Admin Server!" + /u01/oracle/user_projects/domains/base_domain/bin/stopWebLogic.sh + exit; +} + +#================================================== +function _kill() { + echo "INFO: SIGKILL received, shutting down Admin Server!" + /u01/oracle/user_projects/domains/base_domain/bin/stopWebLogic.sh + exit; +} + +#================================================== +function rand_pwd(){ + while true; do + s=$(cat /dev/urandom | tr -dc "A-Za-z0-9" | fold -w 8 | head -n 1) + if [[ ${#s} -ge 8 && "$s" = *[A-Z]* && "$s" = *[a-z]* && "$s" = *[0-9]* ]] + then + break + else + echo "INFO: Password does not Match the criteria, re-generating..." >&2 + fi + done + echo "INFO: ${s}" +} + +#================================================== +setupRCU() { + dbType=`echo ${CONNECTION_STRING} | cut -d "/" -f2` + scrName=/u01/oracle/oracle_common/common/sql/iau/scripts/creAuditTabs.sql + + if [ ! -s "${scrName}.orig" ]; then + echo "INFO: Copying RCU backup file" + cp ${scrName} ${scrName}.orig + fi + + if [ "${dbType}" = "XE" -o "${dbType}" = "xe" ]; then + echo "INFO: Setting RCU for XE" + sed -e "s/^@@prepareAuditView.sql/-- @@prepareAuditView.sql/g" ${scrName}.orig > ${scrName} + else + echo "INFO: Setting RCU for ORCL" + cp ${scrName}.orig ${scrName} + fi +} + +#================================================== +updateListenAddress() { + mkdir -p ${DOMAIN_HOME}/logs + + export thehost=`hostname -I` + echo "INFO: Updating the listen address - ${thehost} ${ADMIN_HOST}" + cmd="/u01/oracle/oracle_common/common/bin/wlst.sh -skipWLSModuleScanning /u01/oracle/dockertools/updListenAddress.py $vol_name ${thehost} AdminServer ${ADMIN_HOST}" + echo ${cmd} + ${cmd} > ${DOMAIN_HOME}/logs/aslisten.log 2>&1 +} + +#================================================== +#== MAIN starts here... +#================================================== +trap _int SIGINT +trap _term SIGTERM +trap _kill SIGKILL + +echo "INFO: CONNECTION_STRING = ${CONNECTION_STRING:?"Please set CONNECTION_STRING"}" +echo "INFO: RCUPREFIX = ${RCUPREFIX:?"Please set RCUPREFIX"}" + +if [ -z ${DB_PASSWORD} ] +then + echo "" + echo "FATAL: DB System password is empty. Exiting..." + exit 1 +fi; + +if [ -z ${ADMIN_PASSWORD} ] +then + # Auto generate Oracle WebLogic Server admin password + ADMIN_PASSWORD=$(rand_pwd) + echo "" + echo "INFO: Oracle WebLogic Server Password Auto Generated :" + echo " 'weblogic' admin password: $ADMIN_PASSWORD" + echo "" +fi; + +if [ -z ${DB_SCHEMA_PASSWORD} ] +then + # Auto generate Oracle Database Schema password + temp_pwd=$(rand_pwd) + #Password should not start with a number for database + f_str=`echo $temp_pwd|cut -c1|tr [0-9] [A-Z]` + s_str=`echo $temp_pwd|cut -c2-` + DB_SCHEMA_PASSWORD=${f_str}${s_str} + echo "" + echo "INFO: Database Schema password Auto Generated :" + echo " Database schema password: $DB_SCHEMA_PASSWORD" + echo "" +fi + +export jdbc_url="jdbc:oracle:thin:@"$CONNECTION_STRING +export vol_name=u01 + +echo -e $DB_PASSWORD"\n"$DB_SCHEMA_PASSWORD > /tmp/pwd.txt + +CTR_DIR=/$vol_name/oracle/user_projects/container/${DOMAIN_NAME} + +# +# Creating schemas needed for sample domain #### +#=============================================== +# +RUN_RCU="true" +CONFIGURE_DOMAIN="true" + +if [ -d $CTR_DIR ] +then + # First load the Env Data from the env file... + if [ -e $CTR_DIR/contenv.sh ] + then + . $CTR_DIR/contenv.sh + #reset the JDBC URL + export jdbc_url="jdbc:oracle:thin:@"$CONNECTION_STRING + fi +else + mkdir -p $CTR_DIR +fi + +if [ -e $CTR_DIR/RCU.$RCUPREFIX.suc ] +then + #RCU has already been executed successfully, no need to rerun + RUN_RCU="false" + echo "INFO: SOA RCU has already been loaded. Skipping..." +fi + +if [ "$RUN_RCU" = "true" ] +then + setupRCU + # Run the RCU.. it hasnt been loaded before. If it has + # then drop the prefix and restart. New Domain creation + # scenario + echo "INFO: Dropping Schema $RCUPREFIX..." + /$vol_name/oracle/oracle_common/bin/rcu -silent -dropRepository -databaseType ORACLE -connectString $CONNECTION_STRING -dbUser sys -dbRole sysdba -selectDependentsForComponents true -schemaPrefix $RCUPREFIX -component OPSS -component STB -component SOAINFRA -f < /tmp/pwd.txt + + echo "INFO: Creating Schema $RCUPREFIX..." + /$vol_name/oracle/oracle_common/bin/rcu -silent -createRepository -databaseType ORACLE -connectString $CONNECTION_STRING -dbUser sys -dbRole sysdba -useSamePasswordForAllSchemaUsers true -selectDependentsForComponents true -variables SOA_PROFILE_TYPE=SMALL,HEALTHCARE_INTEGRATION=NO -schemaPrefix $RCUPREFIX -component OPSS -component STB -component SOAINFRA -f < /tmp/pwd.txt + retval=$? + + if [ $retval -ne 0 ]; + then + echo "ERROR: RCU Loading Failed. Check the RCU logs" + exit + else + # Write the rcu suc file... + touch $CTR_DIR/RCU.$RCUPREFIX.suc + + # Write the env file.. such that the passwords etc.. will be saved and we will + # be able to restart from the RCU + cat > $CTR_DIR/contenv.sh <> $CTR_DIR/SOA.DOMAINCFG.suc + + cat > $CTR_DIR/contenv.sh < $DOMAIN_HOME/servers/AdminServer/security/boot.properties +echo "password="$ADMIN_PASSWORD >> $DOMAIN_HOME/servers/AdminServer/security/boot.properties + +# +# Password less Managed Server starting +#====================================== +echo "username=weblogic" > $DOMAIN_HOME/servers/${MANAGED_SERVER}/security/boot.properties +echo "password="$ADMIN_PASSWORD >> $DOMAIN_HOME/servers/${MANAGED_SERVER}/security/boot.properties + +# +# Setting env variables +#======================= +echo ". $DOMAIN_HOME/bin/setDomainEnv.sh" >> /u01/oracle/.bashrc +echo "export PATH=$PATH:/u01/oracle/common/bin:$DOMAIN_HOME/bin" >> /u01/oracle/.bashrc + +# Now we start the Admin server in this container... +/u01/oracle/dockertools/startAS.sh + +sleep infinity diff --git a/OracleSOASuite/dockerfiles/12.2.1.3/container-scripts/startAS.sh b/OracleSOASuite/dockerfiles/12.2.1.3/container-scripts/startAS.sh new file mode 100755 index 0000000000..763924ac66 --- /dev/null +++ b/OracleSOASuite/dockerfiles/12.2.1.3/container-scripts/startAS.sh @@ -0,0 +1,59 @@ +#!/bin/sh +# +# +# +# Copyright (c) 2016-2017 Oracle and/or its affiliates. All rights reserved. +# +# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. +# +# Author: nevin.cleetus@oracle.com +# +# Copyright (c) 2016-2017 Oracle and/or its affiliates. All rights reserved. +# +#************************************************************************* +# script is used to start a WebLogic Admin server. +#************************************************************************* +export DOMAIN_HOME=$DOMAIN_ROOT/$DOMAIN_NAME + +# Start Admin server +LOGDIR=${DOMAIN_HOME}/logs +LOGFILE=${LOGDIR}/as.log +STSFILE=${LOGDIR}/as.status +mkdir -p ${LOGDIR} +rm -f ${LOGFILE} ${STSFILE} + +echo "INFO: Starting the Admin Server..." +echo "INFO: Logs = ${LOGFILE}" +$DOMAIN_HOME/bin/startWebLogic.sh > ${LOGFILE} 2>&1 & + +statusfile=/tmp/notifyfifo.$$ +rm -f "${statusfile}" +mkfifo "${statusfile}" || exit 1 +{ + # run tail in the background so that the shell can kill tail when notified + # that grep has exited + tail -f ${LOGFILE} & + + # remember tail's PID + tailpid=$! + + # wait for notification that grep has exited + read templine <${statusfile} + echo ${templine} + + # grep has exited, time to go + kill "${tailpid}" +} | { + grep -m 1 " " + + # notify the first pipeline stage that grep is done + echo "RUNNING" > ${STSFILE} + echo "INFO: Admin server is running" + echo > ${statusfile} +} + +# clean up +rm -f "${statusfile}" +if [ -f ${STSFILE} ]; then + echo "INFO: Admin server running, ready to start managed server" +fi diff --git a/OracleSOASuite/dockerfiles/12.2.1.3/container-scripts/startMS.sh b/OracleSOASuite/dockerfiles/12.2.1.3/container-scripts/startMS.sh new file mode 100755 index 0000000000..2bd0af000d --- /dev/null +++ b/OracleSOASuite/dockerfiles/12.2.1.3/container-scripts/startMS.sh @@ -0,0 +1,101 @@ +#!/bin/bash +# +# +# +# Copyright (c) 2016-2017 Oracle and/or its affiliates. All rights reserved. +# +# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. +# + +# Author:nevin.cleetus@oracle.com + +export DOMAIN_NAME=${DOMAIN_NAME:-soainfra} +export DOMAIN_ROOT=${DOMAIN_ROOT:-/u01/oracle/user_projects/domains} +export DOMAIN_HOME=${DOMAIN_ROOT}/${DOMAIN_NAME} + +#================================================================= +function _int() { + echo "INFO: Stopping container." + echo "INFO: SIGINT received, shutting down Managed Server!" + $DOMAIN_HOME/bin/stopManagedWebLogic.sh ${MANAGED_SERVER} "http://"${ADMIN_HOST}:${ADMIN_PORT} + exit; +} + +#================================================================= +function _term() { + echo "INFO: Stopping container." + echo "INFO: SIGTERM received, shutting down Managed Server!" + $DOMAIN_HOME/bin/stopManagedWebLogic.sh ${MANAGED_SERVER} "http://"${ADMIN_HOST}:${ADMIN_PORT} + exit; +} + +#================================================================= +function _kill() { + echo "INFO: SIGKILL received, shutting down Managed Server!" + $DOMAIN_HOME/bin/stopManagedWebLogic.sh ${MANAGED_SERVER} "http://"${ADMIN_HOST}:${ADMIN_PORT} + exit; +} + +#================================================================= +#== MAIN Starts here... +#================================================================= +trap _int SIGINT +trap _term SIGTERM +trap _kill SIGKILL + +export vol_name=u01 + +if [ "$DOMAIN_TYPE" = "soa" ] || [ "$DOMAIN_TYPE" = "bpm" ] +then + grepPat="SOA Platform is running and accepting requests" +elif [ "$DOMAIN_TYPE" = "osb" ] +then + grepPat=" " +else + echo "ERROR: Invalid domain type. Cannot start the servers" + exit +fi + +LOGDIR=${DOMAIN_HOME}/logs +LOGFILE=${LOGDIR}/ms.log +mkdir -p ${LOGDIR} + +export thehost=`hostname -I` +echo "INFO: Updating the listen address - ${thehost} ${ADMIN_HOST}" +/u01/oracle/oracle_common/common/bin/wlst.sh -skipWLSModuleScanning /u01/oracle/dockertools/updListenAddress.py $vol_name $thehost ${MANAGED_SERVER} ${ADMIN_HOST} > ${LOGDIR}/mslisten.log 2>&1 + +# Start SOA server +echo "INFO: Starting the managed server ${MANAGED_SERVER}" +$DOMAIN_HOME/bin/startManagedWebLogic.sh ${MANAGED_SERVER} "http://"${ADMIN_HOST}:${ADMIN_PORT} > ${LOGFILE} 2>&1 & +statusfile=/tmp/notifyfifo.$$ + +echo "INFO: Waiting for the Managed Server to accept requests..." +rm -f "${statusfile}" +mkfifo "${statusfile}" || exit 1 +{ + # run tail in the background so that the shell can kill tail when notified + # that grep has exited + tail -f ${LOGFILE} & + # remember tail's PID + tailpid=$! + # wait for notification that grep has exited + read templine <${statusfile} + echo ${templine} + # grep has exited, time to go + kill "${tailpid}" +} | { + grep -m 1 "${grepPat}" + # notify the first pipeline stage that grep is done + echo "RUNNING"> ${LOGDIR}/ms.status + echo "INFO: Managed Server is running" + echo >${statusfile} +} + +# clean up +rm -f "${statusfile}" +if [ -f ${LOGDIR}/ms.status ]; then + echo "INFO: Managed server has been started" +fi + +childPID=$! +wait $childPID diff --git a/OracleSOASuite/dockerfiles/12.2.1.3/container-scripts/updListenAddress.py b/OracleSOASuite/dockerfiles/12.2.1.3/container-scripts/updListenAddress.py new file mode 100755 index 0000000000..8451097c7d --- /dev/null +++ b/OracleSOASuite/dockerfiles/12.2.1.3/container-scripts/updListenAddress.py @@ -0,0 +1,48 @@ +#!/usr/bin/python +# +# Copyright (c) 2016-2017 Oracle and/or its affiliates. All rights reserved. +# +# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. +# +# Updates the listen address for managed server with the IP address of the host. +# ============================================== +# +import sys + +# +# Assigning values to variables +# ============================= +domain_name = os.environ.get("DOMAIN_NAME", "soainfra") +domain_root = os.environ.get("DOMAIN_ROOT", "/u01/oracle/user_projects/domains") + +# +# Reading db details and schema prefix passed from parent script +# ============================================================== +vol_name=sys.argv[1] +manserver_host=sys.argv[2] +server=sys.argv[3] +exthost=sys.argv[4] + +# +# Setting domain path +# =================== +domain_path = domain_root + '/' + domain_name + +# +# Read domain for updates +# ======================= +readDomain(domain_path) + +# +# Set listen address +# ================== +cd('/') +cd('/Server/'+server) +cmo.setListenAddress(manserver_host) +cmo.setExternalDNSName(exthost) + +# Creating domain +# =============== +updateDomain() +closeDomain() +exit() diff --git a/OracleSOASuite/dockerfiles/12.2.1.3/install/oraInst.loc b/OracleSOASuite/dockerfiles/12.2.1.3/install/oraInst.loc new file mode 100644 index 0000000000..01f1964a55 --- /dev/null +++ b/OracleSOASuite/dockerfiles/12.2.1.3/install/oraInst.loc @@ -0,0 +1,2 @@ +inventory_loc=/u01/oracle/.inventory +inst_group=oracle diff --git a/OracleSOASuite/dockerfiles/12.2.1.3/install/soasuite.download b/OracleSOASuite/dockerfiles/12.2.1.3/install/soasuite.download new file mode 100644 index 0000000000..70f969d739 --- /dev/null +++ b/OracleSOASuite/dockerfiles/12.2.1.3/install/soasuite.download @@ -0,0 +1,11 @@ +# +# Oracle SOA Suite for Oracle Middleware (BPM, FMW, SOA) +# OTN : http://www.oracle.com/technetwork/middleware/soasuite/overview +# Download : http://edelivery.oracle.com +# +# - V886440-01.zip - Oracle Fusion Middleware 12c (12.2.1.3.0) SOA Suite +# and Business Process Management +# - V886445-01.zip - Oracle Fusion Middleware 12c (12.2.1.3.0) Service Bus +# +0028f065488979dccea599d56b4db458 fmw_12.2.1.3.0_soa.jar +9d53300c41d7c47873be515b80df6e87 fmw_12.2.1.3.0_osb.jar diff --git a/OracleSOASuite/dockerfiles/12.2.1.3/install/soasuite.response b/OracleSOASuite/dockerfiles/12.2.1.3/install/soasuite.response new file mode 100644 index 0000000000..b0e9954993 --- /dev/null +++ b/OracleSOASuite/dockerfiles/12.2.1.3/install/soasuite.response @@ -0,0 +1,15 @@ +# LICENSE UPL 1.0 +# +# Copyright (c) 2016-2017 Oracle and/or its affiliates. All rights reserved. +[ENGINE] + +#DO NOT CHANGE THIS. +Response File Version=1.0.0.0.0 + +[GENERIC] +#INSTALL_TYPE=JDeveloper with Business Process Management +#INSTALL_TYPE=Service Bus +INSTALL_TYPE=BPM + +DECLINE_SECURITY_UPDATES=true +SECURITY_UPDATES_VIA_MYORACLESUPPORT=false diff --git a/OracleSOASuite/dockerfiles/buildDockerImage.sh b/OracleSOASuite/dockerfiles/buildDockerImage.sh index 015b964591..4a8ecc88bb 100755 --- a/OracleSOASuite/dockerfiles/buildDockerImage.sh +++ b/OracleSOASuite/dockerfiles/buildDockerImage.sh @@ -18,7 +18,7 @@ Builds a Docker Image for Oracle SOA/OSB/BPM Parameters: -h: view usage -v: Release version to build. Required. Allowed values are - 12.2.1.2 + 12.2.1.2, 12.2.1.3 -s: Skip checksum verification LICENSE Universal Permissive License (UPL), Version 1.0 @@ -102,7 +102,7 @@ fi . ../setenv.sh versionOK=false -if [ ${VERSION} = 12.2.1.2 ] +if [ ${VERSION} = 12.2.1.2 -o ${VERSION} = 12.2.1.3 ] then IMAGE_NAME="${DC_REGISTRY_SOA}/oracle/soasuite:$VERSION" DOCKERFILE_NAME=Dockerfile diff --git a/OracleSOASuite/setenv.sh b/OracleSOASuite/setenv.sh index 90c2794080..c7fab765ad 100644 --- a/OracleSOASuite/setenv.sh +++ b/OracleSOASuite/setenv.sh @@ -54,7 +54,7 @@ exportComposeEnv() { # # Default version to use for compose images # - export DC_SOA_VERSION=12.2.1.2 + export DC_SOA_VERSION=12.2.1.3 } #===============================================