Skip to content

Recreate OWLS-86115 work #2344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 28 additions & 6 deletions operator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,36 @@
<goal>java</goal>
</goals>
<phase>package</phase>
<configuration>
<mainClass>oracle.kubernetes.operator.helpers.CrdHelper</mainClass>
<arguments>
<argument>${project.basedir}/../kubernetes/crd/domain-crd.yaml</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>test-python-scripts</id>
<phase>test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<skip>${skip.unit.tests}</skip>
<executable>python</executable>
<workingDirectory>src/test/python</workingDirectory>
<environmentVariables>
<PYTHONPATH>${project.basedir}/src/main/resources/scripts</PYTHONPATH>
<DOMAIN_UID>sample-domain1</DOMAIN_UID>
</environmentVariables>
<arguments>
<arugument>-B</arugument>
<arugument>-m</arugument>
<argument>unittest</argument>
<argument>discover</argument>
</arguments>
</configuration>
</execution>
</executions>
<configuration>
<mainClass>oracle.kubernetes.operator.helpers.CrdHelper</mainClass>
<arguments>
<argument>${project.basedir}/../kubernetes/crd/domain-crd.yaml</argument>
</arguments>
</configuration>
</plugin>

</plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ List<V1EnvVar> getConfiguredEnvVars(TuningParameters tuningParameters) {
Long.toString(getDomain().getWDTSetServerGroupsTimeoutMillis()));
}


String dataHome = getDataHome();
if (dataHome != null && !dataHome.isEmpty()) {
addEnvVar(vars, ServerEnvVars.DATA_HOME, dataHome);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
import oracle.kubernetes.operator.work.Step;
import oracle.kubernetes.weblogic.domain.model.Domain;
import oracle.kubernetes.weblogic.domain.model.DomainStatus;
import oracle.kubernetes.weblogic.domain.model.IntrospectorJobEnvVars;
import oracle.kubernetes.weblogic.domain.model.ServerEnvVars;
import oracle.kubernetes.weblogic.domain.model.ServerSpec;
import oracle.kubernetes.weblogic.domain.model.Shutdown;
Expand Down Expand Up @@ -631,6 +632,11 @@ private void updateEnv(List<V1EnvVar> env) {
updateEnvForShutdown(env);
updateEnvForStartupMode(env);
defineConfigOverride(env);
updateEnvWithDomainSourceType(env);
}

private void updateEnvWithDomainSourceType(List<V1EnvVar> env) {
addDefaultEnvVarIfMissing(env, IntrospectorJobEnvVars.DOMAIN_SOURCE_TYPE, getDomainHomeSourceType().toString());
}

private void updateEnvForShutdown(List<V1EnvVar> env) {
Expand Down
9 changes: 7 additions & 2 deletions operator/src/main/resources/scripts/introspectDomain.py
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,10 @@ def addNetworkAccessPoint(self, server, nap, is_server_template):
nap_protocol = getNAPProtocol(nap, server, self.env.getDomain(), is_server_template)

if istio_enabled == 'true':
name = nap.getName()
if name.startswith('http-') or name.startswith('tcp-') or name.startswith('tls-') or name.startswith('https-'):
# skip istio ports already defined by WDT filtering for MII
return
http_protocol = [ 'http' ]
https_protocol = ['https','admin']
tcp_protocol = [ 't3', 'snmp', 'ldap', 'cluster-broadcast', 'iiop', 'sip']
Expand Down Expand Up @@ -1606,10 +1610,11 @@ def introspect(self):
tg = TopologyGenerator(self.env)

if tg.validate():
SitConfigGenerator(self.env).generate()
DOMAIN_SOURCE_TYPE = self.env.getEnvOrDef("DOMAIN_SOURCE_TYPE", None)
if DOMAIN_SOURCE_TYPE != "FromModel":
SitConfigGenerator(self.env).generate()
BootPropertiesGenerator(self.env).generate()
UserConfigAndKeyGenerator(self.env).generate()
DOMAIN_SOURCE_TYPE = self.env.getEnvOrDef("DOMAIN_SOURCE_TYPE", None)

if DOMAIN_SOURCE_TYPE == "FromModel":
trace("cfgmap write primordial_domain")
Expand Down
10 changes: 6 additions & 4 deletions operator/src/main/resources/scripts/livenessProbe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,11 @@ if [ $? != 0 ]; then
exit $RETVAL
fi

copySitCfgWhileRunning /weblogic-operator/introspector ${DOMAIN_HOME}/optconfig 'Sit-Cfg-CFG--'
copySitCfgWhileRunning /weblogic-operator/introspector ${DOMAIN_HOME}/optconfig/jms 'Sit-Cfg-JMS--'
copySitCfgWhileRunning /weblogic-operator/introspector ${DOMAIN_HOME}/optconfig/jdbc 'Sit-Cfg-JDBC--'
copySitCfgWhileRunning /weblogic-operator/introspector ${DOMAIN_HOME}/optconfig/diagnostics 'Sit-Cfg-WLDF--'
if [ ${DOMAIN_SOURCE_TYPE} != "FromModel" ]; then
copySitCfgWhileRunning /weblogic-operator/introspector ${DOMAIN_HOME}/optconfig 'Sit-Cfg-CFG--'
copySitCfgWhileRunning /weblogic-operator/introspector ${DOMAIN_HOME}/optconfig/jms 'Sit-Cfg-JMS--'
copySitCfgWhileRunning /weblogic-operator/introspector ${DOMAIN_HOME}/optconfig/jdbc 'Sit-Cfg-JDBC--'
copySitCfgWhileRunning /weblogic-operator/introspector ${DOMAIN_HOME}/optconfig/diagnostics 'Sit-Cfg-WLDF--'
fi

exit 0
4 changes: 4 additions & 0 deletions operator/src/main/resources/scripts/model-filters.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@
"discover": [
],
"update": [
{ "name": "update_mii_filter", "path": "/u01/wdt/weblogic-deploy/lib/model_wdt_mii_filter.py" }
],
"validate": [
{ "name": "validate_mii_filter", "path": "/u01/wdt/weblogic-deploy/lib/model_wdt_mii_filter.py" }
]
}
34 changes: 27 additions & 7 deletions operator/src/main/resources/scripts/modelInImage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ WDT_OUTPUT="/tmp/wdt_output.log"
WDT_BINDIR="${WDT_ROOT}/bin"
WDT_FILTER_JSON="/weblogic-operator/scripts/model-filters.json"
WDT_CREATE_FILTER="/weblogic-operator/scripts/model-wdt-create-filter.py"
WDT_MII_FILTER="/weblogic-operator/scripts/model_wdt_mii_filter.py"
UPDATE_RCUPWD_FLAG=""
WLSDEPLOY_PROPERTIES="${WLSDEPLOY_PROPERTIES} -Djava.security.egd=file:/dev/./urandom"
ARCHIVE_ZIP_CHANGED=0
Expand Down Expand Up @@ -319,9 +320,9 @@ function createWLDomain() {
fi

# copy the filter related files to the wdt lib

cp ${WDT_FILTER_JSON} ${WDT_ROOT}/lib/model_filters.json
cp ${WDT_CREATE_FILTER} ${WDT_ROOT}/lib
cp ${WDT_FILTER_JSON} ${WDT_ROOT}/lib/model_filters.json || logSevereAndExit ${WDT_FILTER_JSON}
cp ${WDT_CREATE_FILTER} ${WDT_ROOT}/lib || logSevereAndExit ${WDT_CREATE_FILTER}
cp ${WDT_MII_FILTER} ${WDT_ROOT}/lib || logSevereAndExit ${WDT_MII_FILTER}

# check to see if any model including changed (or first model in image deploy)
# if yes. then run create domain again
Expand Down Expand Up @@ -793,8 +794,14 @@ function generateMergedModel() {

export __WLSDEPLOY_STORE_MODEL__="${NEW_MERGED_MODEL}"

${WDT_BINDIR}/validateModel.sh -oracle_home ${ORACLE_HOME} ${model_list} \
${archive_list} ${variable_list} -domain_type ${WDT_DOMAIN_TYPE} > ${WDT_OUTPUT} 2>&1
local wdtArgs=""
wdtArgs+=" -oracle_home ${ORACLE_HOME}"
wdtArgs+=" ${model_list} ${archive_list} ${variable_list}"
wdtArgs+=" -domain_type ${WDT_DOMAIN_TYPE}"

trace "About to call '${WDT_BINDIR}/validateModel.sh ${wdtArgs}'."

${WDT_BINDIR}/validateModel.sh ${wdtArgs} > ${WDT_OUTPUT} 2>&1
ret=$?
if [ $ret -ne 0 ]; then
trace SEVERE "Model in Image: the WDT validate model tool detected an error with the fully merged model:"
Expand Down Expand Up @@ -917,8 +924,16 @@ function wdtUpdateModelDomain() {
# make sure wdt create write out the merged model to a file in the root of the domain
export __WLSDEPLOY_STORE_MODEL__=1

${WDT_BINDIR}/updateDomain.sh -oracle_home ${ORACLE_HOME} -domain_home ${DOMAIN_HOME} $model_list \
${archive_list} ${variable_list} -domain_type ${WDT_DOMAIN_TYPE} ${UPDATE_RCUPWD_FLAG} > ${WDT_OUTPUT} 2>&1
local wdtArgs=""
wdtArgs+=" -oracle_home ${ORACLE_HOME}"
wdtArgs+=" -domain_home ${DOMAIN_HOME}"
wdtArgs+=" ${model_list} ${archive_list} ${variable_list}"
wdtArgs+=" -domain_type ${WDT_DOMAIN_TYPE}"
wdtArgs+=" ${UPDATE_RCUPWD_FLAG}"

trace "About to call '${WDT_BINDIR}/updateDomain.sh ${wdtArgs}'."

${WDT_BINDIR}/updateDomain.sh ${wdtArgs} > ${WDT_OUTPUT} 2>&1
ret=$?

if [ $ret -ne 0 ]; then
Expand Down Expand Up @@ -1271,3 +1286,8 @@ function stop_trap() {
function cleanup_mii() {
rm -f /tmp/*.md5 /tmp/*.gz /tmp/*.ini /tmp/*.json
}

function logSevereAndExit() {
trace SEVERE "cp '$1' failed"
exitOrLoop
}
Loading