Skip to content

Commit 507349f

Browse files
jshum2479rjeberhard
authored andcommitted
Add support for show merged model when aux image is used.
1 parent 28b720b commit 507349f

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

operator/integration-tests/bash/decrypt_model.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright (c) 2020, 2022, Oracle and/or its affiliates.
2+
# Copyright (c) 2020, 2024, Oracle and/or its affiliates.
33
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
#
55
# This script is to be run inside a model in image pod that has JDK, WebLogic and WDT in it.
@@ -18,11 +18,16 @@ encrypt_decrypt_model() {
1818

1919
local ORACLE_SERVER_DIR=${ORACLE_HOME}/wlserver
2020
local WDT_OUTPUT=/tmp/output.log
21-
local WDT_BINDIR=/u01/wdt/weblogic-deploy/bin
21+
if [ -d /tmp/weblogic-deploy ] ; then
22+
local WDT_HOME=/tmp/weblogic-deploy
23+
else
24+
local WDT_HOME=/u01/wdt
25+
fi
26+
2227
local JAVA_PROPS="${JAVA_PROPS} -Dpython.cachedir.skip=true"
2328
local JAVA_PROPS="-Dpython.path=${ORACLE_SERVER_DIR}/common/wlst/modules/jython-modules.jar/Lib ${JAVA_PROPS}"
2429
local JAVA_PROPS="-Dpython.console= ${JAVA_PROPS} -Dpython.verbose=debug"
25-
local CP="${ORACLE_SERVER_DIR}/server/lib/weblogic.jar:/u01/wdt/weblogic-deploy/lib/weblogic-deploy-core.jar:/tmpmount/code.jar"
30+
local CP="${ORACLE_SERVER_DIR}/server/lib/weblogic.jar:$WDT_HOME/lib/weblogic-deploy-core.jar"
2631
${JAVA_HOME}/bin/java -cp ${CP} \
2732
${JAVA_PROPS} org.python.util.jython /tmp/model-encryption-util.py $1 $(cat $2) $3 $4 > ${WDT_OUTPUT} 2>&1
2833
rc=$?
@@ -40,3 +45,4 @@ trace() {
4045
}
4146

4247
encrypt_decrypt_model $*
48+

operator/integration-tests/bash/show_merged_model.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright (c) 2019, 2023, Oracle and/or its affiliates.
2+
# Copyright (c) 2019, 2024, Oracle and/or its affiliates.
33
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44

55
# This script show the model in image merged model of the running domain in clear text
@@ -9,6 +9,7 @@ DOMAIN_UID=sample-domain1
99
PASSWORD=my_runtime_password
1010
IMAGE=model-in-image:JRF-v1
1111
IMAGEPULLPOLICY=IfNotPresent
12+
WDT_INSTALLER=$HOME/Downloads/weblogic-deploy.zip
1213
IMAGEPULLSECRETSTAG=''
1314
IMGPS=''
1415
IMGPSN=''
@@ -28,8 +29,7 @@ cat << EOF
2829
-n namespace - Namespace, default is "$NAMESPACE".
2930
-p password - Password, default is "$PASSWORD".
3031
-d domain uid - Domain UID, default is "${DOMAIN_UID}"
31-
32-
You can specify -f, -m, and -s more than once.
32+
-w wdt installer - WDT Installer location, default is "${WDT_INSTALLER} - $HOME/Downloads/weblogic-deploy.zip"
3333
3434
Sample usage:
3535
@@ -40,7 +40,7 @@ EOF
4040
exit 1
4141
}
4242

43-
while getopts i:n:p:l:s:d:h OPT
43+
while getopts i:n:p:l:s:w:d:h OPT
4444
do
4545
case $OPT in
4646
i) IMAGE=$OPTARG
@@ -58,6 +58,8 @@ do
5858
;;
5959
d) DOMAIN_UID=$OPTARG
6060
;;
61+
w) WDT_INSTALLER=$OPTARG
62+
;;
6163
h) usage_exit
6264
;;
6365
*) usage_exit
@@ -101,6 +103,11 @@ ${KUBERNETES_CLI} -n ${DOMAIN_NAMESPACE} get configmap ${DOMAIN_UID}-weblogic-do
101103
${KUBERNETES_CLI} cp encrypted_model.json ${DOMAIN_NAMESPACE}/decryptmodel:/tmp
102104
${KUBERNETES_CLI} cp decrypt_model.sh ${DOMAIN_NAMESPACE}/decryptmodel:/tmp
103105
${KUBERNETES_CLI} cp model-encryption-util.py ${DOMAIN_NAMESPACE}/decryptmodel:/tmp
106+
if [ -f ${WDT_INSTALLER} ] ; then
107+
${KUBERNETES_CLI} cp ${WDT_INSTALLER} ${DOMAIN_NAMESPACE}/decryptmodel:/tmp
108+
INSTALLER=$(basename ${WDT_INSTALLER})
109+
${KUBERNETES_CLI} -n ${DOMAIN_NAMESPACE} exec decryptmodel -- bash -c "cd /tmp && unzip ${INSTALLER}"
110+
fi
104111
${KUBERNETES_CLI} -n ${DOMAIN_NAMESPACE} exec decryptmodel -- bash -c "/tmp/decrypt_model.sh decrypt /tmp/encrypted_model.json ${PASSWORD} /tmp/decrypted_model.json && base64 -d /tmp/decrypted_model.json | gunzip "
105112
${KUBERNETES_CLI} -n ${DOMAIN_NAMESPACE} delete -f decrypt_model.yaml
106113

0 commit comments

Comments
 (0)