Skip to content

Commit 069b691

Browse files
committed
Merge branch 'develop' of https://github.com/oracle/weblogic-kubernetes-operator into feature/java-integration-tests
2 parents 8e07f64 + acb6e08 commit 069b691

File tree

150 files changed

+9592
-3108
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+9592
-3108
lines changed

integration-tests/src/test/java/oracle/kubernetes/operator/ITOperator.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -285,13 +285,9 @@ private Domain testAllUseCasesForADomain(Operator operator, String domainYamlFil
285285
logger.info("Creating Domain & verifing the domain creation");
286286
// create domain1
287287
Domain domain = testDomainCreation(domainYamlFile);
288-
if (System.getenv("QUICKTEST") == null
289-
|| (System.getenv("QUICKTEST") != null
290-
&& !System.getenv("QUICKTEST").equalsIgnoreCase("true"))) {
291-
testDomainLifecyle(operator, domain);
292-
testOperatorLifecycle(operator, domain);
293-
}
294288
testClusterScaling(operator, domain);
289+
testDomainLifecyle(operator, domain);
290+
testOperatorLifecycle(operator, domain);
295291
return domain;
296292
}
297293

integration-tests/src/test/resources/setupenv.sh

Lines changed: 100 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -3,98 +3,95 @@
33
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
44

55
function clean_jenkins {
6-
echo "Cleaning."
7-
/usr/local/packages/aime/ias/run_as_root "${PROJECT_ROOT}/src/integration-tests/bash/clean_docker_k8s.sh -y"
6+
echo "Cleaning."
7+
/usr/local/packages/aime/ias/run_as_root "${PROJECT_ROOT}/src/integration-tests/bash/clean_docker_k8s.sh -y"
88
}
99

1010
function setup_jenkins {
11-
echo "Setting up."
12-
/usr/local/packages/aime/ias/run_as_root "sh ${PROJECT_ROOT}/src/integration-tests/bash/install_docker_k8s.sh -y -u wls -v ${K8S_VERSION}"
13-
set +x
14-
. ~/.dockerk8senv
15-
set -x
16-
id
17-
18-
docker login -u [email protected] -p $docker_pass wlsldi-v2.docker.oraclecorp.com
19-
docker images
20-
21-
pull_tag_images
22-
23-
export JAR_VERSION="`grep -m1 "<version>" pom.xml | cut -f2 -d">" | cut -f1 -d "<"`"
24-
# create a docker image for the operator code being tested
25-
docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$https_proxy --build-arg no_proxy=$no_proxy -t "${IMAGE_NAME_OPERATOR}:${IMAGE_TAG_OPERATOR}" --build-arg VERSION=$JAR_VERSION --no-cache=true .
26-
docker tag "${IMAGE_NAME_OPERATOR}:${IMAGE_TAG_OPERATOR}" wlsldi-v2.docker.oraclecorp.com/weblogic-operator:latest
27-
28-
docker images
11+
echo "Setting up."
12+
/usr/local/packages/aime/ias/run_as_root "sh ${PROJECT_ROOT}/src/integration-tests/bash/install_docker_k8s.sh -y -u wls -v ${K8S_VERSION}"
13+
set +x
14+
. ~/.dockerk8senv
15+
set -x
16+
id
17+
18+
docker login -u [email protected] -p $docker_pass wlsldi-v2.docker.oraclecorp.com
19+
docker images
20+
21+
pull_tag_images
22+
23+
export JAR_VERSION="`grep -m1 "<version>" pom.xml | cut -f2 -d">" | cut -f1 -d "<"`"
24+
# create a docker image for the operator code being tested
25+
docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$https_proxy --build-arg no_proxy=$no_proxy -t "${IMAGE_NAME_OPERATOR}:${IMAGE_TAG_OPERATOR}" --build-arg VERSION=$JAR_VERSION --no-cache=true .
26+
docker tag "${IMAGE_NAME_OPERATOR}:${IMAGE_TAG_OPERATOR}" wlsldi-v2.docker.oraclecorp.com/weblogic-operator:latest
27+
28+
docker images
2929

30-
echo "Helm installation starts"
31-
wget -q -O /tmp/helm-v2.8.2-linux-amd64.tar.gz https://kubernetes-helm.storage.googleapis.com/helm-v2.8.2-linux-amd64.tar.gz
32-
mkdir /tmp/helm
33-
tar xzf /tmp/helm-v2.8.2-linux-amd64.tar.gz -C /tmp/helm
34-
chmod +x /tmp/helm/linux-amd64/helm
35-
/usr/local/packages/aime/ias/run_as_root "cp /tmp/helm/linux-amd64/helm /usr/bin/"
36-
rm -rf /tmp/helm
37-
helm init
38-
echo "Helm is configured."
30+
echo "Helm installation starts"
31+
wget -q -O /tmp/helm-v2.8.2-linux-amd64.tar.gz https://kubernetes-helm.storage.googleapis.com/helm-v2.8.2-linux-amd64.tar.gz
32+
mkdir /tmp/helm
33+
tar xzf /tmp/helm-v2.8.2-linux-amd64.tar.gz -C /tmp/helm
34+
chmod +x /tmp/helm/linux-amd64/helm
35+
/usr/local/packages/aime/ias/run_as_root "cp /tmp/helm/linux-amd64/helm /usr/bin/"
36+
rm -rf /tmp/helm
37+
helm init
38+
echo "Helm is configured."
3939
}
4040

4141
function setup_wercker {
42-
echo "Perform setup for running in wercker"
43-
echo "Install tiller"
44-
kubectl create serviceaccount --namespace kube-system tiller
45-
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
46-
47-
# Note: helm init --wait would wait until tiller is ready, and requires helm 2.8.2 or above
48-
helm init --service-account=tiller --wait
49-
50-
helm version
51-
52-
kubectl get po -n kube-system
53-
54-
echo "Existing helm charts "
55-
helm ls
56-
echo "Deleting installed helm charts"
57-
helm list --short | xargs -L1 helm delete --purge
58-
echo "After helm delete, list of installed helm charts is: "
59-
helm ls
60-
61-
echo "Completed setup_wercker"
42+
echo "Perform setup for running in wercker"
43+
echo "Install tiller"
44+
kubectl create serviceaccount --namespace kube-system tiller
45+
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
46+
47+
# Note: helm init --wait would wait until tiller is ready, and requires helm 2.8.2 or above
48+
helm init --service-account=tiller --wait
49+
50+
helm version
51+
52+
kubectl get po -n kube-system
53+
54+
echo "Existing helm charts "
55+
helm ls
56+
echo "Deleting installed helm charts"
57+
helm list --short | xargs -L1 helm delete --purge
58+
echo "After helm delete, list of installed helm charts is: "
59+
helm ls
60+
61+
echo "Completed setup_wercker"
6262
}
6363

6464
function pull_tag_images {
65+
echo "Pull and tag the images we need"
6566

66-
echo "Pull and tag the images we need"
67-
docker pull wlsldi-v2.docker.oraclecorp.com/store-weblogic-12.2.1.3:latest
68-
docker tag wlsldi-v2.docker.oraclecorp.com/store-weblogic-12.2.1.3:latest store/oracle/weblogic:12.2.1.3
69-
70-
docker pull wlsldi-v2.docker.oraclecorp.com/weblogic:19.1.0.0
71-
docker tag wlsldi-v2.docker.oraclecorp.com/weblogic:19.1.0.0 store/oracle/weblogic:19.1.0.0
67+
docker pull wlsldi-v2.docker.oraclecorp.com/store-weblogic-12.2.1.3:latest
68+
docker tag wlsldi-v2.docker.oraclecorp.com/store-weblogic-12.2.1.3:latest store/oracle/weblogic:12.2.1.3
7269

73-
docker pull wlsldi-v2.docker.oraclecorp.com/store-serverjre-8:latest
74-
docker tag wlsldi-v2.docker.oraclecorp.com/store-serverjre-8:latest store/oracle/serverjre:8
70+
docker pull wlsldi-v2.docker.oraclecorp.com/weblogic:19.1.0.0
71+
docker tag wlsldi-v2.docker.oraclecorp.com/weblogic:19.1.0.0 store/oracle/weblogic:19.1.0.0
7572

76-
docker pull wlsldi-v2.docker.oraclecorp.com/weblogic-webtier-apache-12.2.1.3.0:latest
77-
docker tag wlsldi-v2.docker.oraclecorp.com/weblogic-webtier-apache-12.2.1.3.0:latest store/oracle/apache:12.2.1.3
73+
docker pull wlsldi-v2.docker.oraclecorp.com/store-serverjre-8:latest
74+
docker tag wlsldi-v2.docker.oraclecorp.com/store-serverjre-8:latest store/oracle/serverjre:8
7875

76+
docker pull wlsldi-v2.docker.oraclecorp.com/weblogic-webtier-apache-12.2.1.3.0:latest
77+
docker tag wlsldi-v2.docker.oraclecorp.com/weblogic-webtier-apache-12.2.1.3.0:latest store/oracle/apache:12.2.1.3
7978
}
8079

8180

8281
function create_image_pull_secret_jenkins {
83-
84-
echo "Creating Secret"
85-
kubectl create secret docker-registry wlsldi-secret \
82+
echo "Creating Secret"
83+
kubectl create secret docker-registry wlsldi-secret \
8684
--docker-server=wlsldi-v2.docker.oraclecorp.com \
8785
8886
--docker-password=$docker_pass \
8987
9088

91-
echo "Checking Secret"
92-
local SECRET="`kubectl get secret wlsldi-secret | grep wlsldi | wc | awk ' { print $1; }'`"
93-
if [ "$SECRET" != "1" ]; then
94-
echo 'secret wlsldi-secret was not created successfully'
95-
exit 1
96-
fi
97-
89+
echo "Checking Secret"
90+
local SECRET="`kubectl get secret wlsldi-secret | grep wlsldi | wc | awk ' { print $1; }'`"
91+
if [ "$SECRET" != "1" ]; then
92+
echo 'secret wlsldi-secret was not created successfully'
93+
exit 1
94+
fi
9895
}
9996

10097
export SCRIPTPATH="$( cd "$(dirname "$0")" > /dev/null 2>&1 ; pwd -P )"
@@ -103,21 +100,23 @@ export RESULT_ROOT=${RESULT_ROOT:-/scratch/$USER/wl_k8s_test_results}
103100
export PV_ROOT=${PV_ROOT:-$RESULT_ROOT}
104101
echo "RESULT_ROOT$RESULT_ROOT PV_ROOT$PV_ROOT"
105102
export BRANCH_NAME="${BRANCH_NAME:-$WERCKER_GIT_BRANCH}"
103+
export IMAGE_NAME_WEBLOGIC="${IMAGE_NAME_WEBLOGIC:-store/oracle/weblogic}"
104+
export IMAGE_TAG_WEBLOGIC="${IMAGE_TAG_WEBLOGIC:-19.1.0.0}"
106105

107106
if [ -z "$BRANCH_NAME" ]; then
108107
export BRANCH_NAME="`git branch | grep \* | cut -d ' ' -f2-`"
109108
if [ ! "$?" = "0" ] ; then
110-
echo "Error: Could not determine branch. Run script from within a git repo".
111-
exit 1
109+
echo "Error: Could not determine branch. Run script from within a git repo".
110+
exit 1
112111
fi
113112
fi
114113
export IMAGE_TAG_OPERATOR=${IMAGE_TAG_OPERATOR:-`echo "test_${BRANCH_NAME}" | sed "s#/#_#g"`}
115114
export IMAGE_NAME_OPERATOR=${IMAGE_NAME_OPERATOR:-wlsldi-v2.docker.oraclecorp.com/weblogic-operator}
116115

117116
cd $PROJECT_ROOT
118117
if [ $? -ne 0 ]; then
119-
echo "Couldn't change to $PROJECT_ROOT dir"
120-
exit 1
118+
echo "Couldn't change to $PROJECT_ROOT dir"
119+
exit 1
121120
fi
122121

123122
export JAR_VERSION="`grep -m1 "<version>" pom.xml | cut -f2 -d">" | cut -f1 -d "<"`"
@@ -126,40 +125,40 @@ echo IMAGE_NAME_OPERATOR $IMAGE_NAME_OPERATOR IMAGE_TAG_OPERATOR $IMAGE_TAG_OPER
126125

127126
if [ "$WERCKER" = "true" ]; then
128127

129-
echo "Test Suite is running locally on Wercker and k8s is running on remote nodes."
128+
echo "Test Suite is running locally on Wercker and k8s is running on remote nodes."
130129

131-
export IMAGE_PULL_SECRET_OPERATOR=$IMAGE_PULL_SECRET_OPERATOR
132-
export IMAGE_PULL_SECRET_WEBLOGIC=$IMAGE_PULL_SECRET_WEBLOGIC
130+
export IMAGE_PULL_SECRET_OPERATOR=$IMAGE_PULL_SECRET_OPERATOR
131+
export IMAGE_PULL_SECRET_WEBLOGIC=$IMAGE_PULL_SECRET_WEBLOGIC
133132

134-
echo "Creating Docker Secret"
135-
kubectl create secret docker-registry $IMAGE_PULL_SECRET_WEBLOGIC \
133+
echo "Creating Docker Secret"
134+
kubectl create secret docker-registry $IMAGE_PULL_SECRET_WEBLOGIC \
136135
--docker-server=index.docker.io/v1/ \
137136
--docker-username=$DOCKER_USERNAME \
138137
--docker-password=$DOCKER_PASSWORD \
139138
--docker-email=$DOCKER_EMAIL
140139

141-
echo "Checking Secret"
142-
SECRET="`kubectl get secret $IMAGE_PULL_SECRET_WEBLOGIC | grep $IMAGE_PULL_SECRET_WEBLOGIC | wc | awk ' { print $1; }'`"
143-
if [ "$SECRET" != "1" ]; then
144-
echo "secret $IMAGE_PULL_SECRET_WEBLOGIC was not created successfully"
145-
exit 1
146-
fi
140+
echo "Checking Secret"
141+
SECRET="`kubectl get secret $IMAGE_PULL_SECRET_WEBLOGIC | grep $IMAGE_PULL_SECRET_WEBLOGIC | wc | awk ' { print $1; }'`"
142+
if [ "$SECRET" != "1" ]; then
143+
echo "secret $IMAGE_PULL_SECRET_WEBLOGIC was not created successfully"
144+
exit 1
145+
fi
147146

148-
echo "Creating Registry Secret"
149-
kubectl create secret docker-registry $IMAGE_PULL_SECRET_OPERATOR \
147+
echo "Creating Registry Secret"
148+
kubectl create secret docker-registry $IMAGE_PULL_SECRET_OPERATOR \
150149
--docker-server=$REPO_REGISTRY \
151150
--docker-username=$REPO_USERNAME \
152151
--docker-password=$REPO_PASSWORD \
153152
--docker-email=$REPO_EMAIL
154153

155-
echo "Checking Secret"
156-
SECRET="`kubectl get secret $IMAGE_PULL_SECRET_OPERATOR | grep $IMAGE_PULL_SECRET_OPERATOR | wc | awk ' { print $1; }'`"
157-
if [ "$SECRET" != "1" ]; then
158-
echo "secret $IMAGE_PULL_SECRET_OPERATOR was not created successfully"
159-
exit 1
160-
fi
161-
162-
setup_wercker
154+
echo "Checking Secret"
155+
SECRET="`kubectl get secret $IMAGE_PULL_SECRET_OPERATOR | grep $IMAGE_PULL_SECRET_OPERATOR | wc | awk ' { print $1; }'`"
156+
if [ "$SECRET" != "1" ]; then
157+
echo "secret $IMAGE_PULL_SECRET_OPERATOR was not created successfully"
158+
exit 1
159+
fi
160+
161+
setup_wercker
163162

164163
elif [ "$JENKINS" = "true" ]; then
165164

@@ -194,18 +193,14 @@ elif [ "$JENKINS" = "true" ]; then
194193
/usr/local/packages/aime/ias/run_as_root "mkdir -p $PV_ROOT/acceptance_test_pv_archive"
195194
/usr/local/packages/aime/ias/run_as_root "chmod 777 $PV_ROOT/acceptance_test_pv_archive"
196195

197-
198-
199196
else
200-
pull_tag_images
201-
202-
#docker rmi -f $(docker images -q -f dangling=true)
203-
docker images --quiet --filter=dangling=true | xargs --no-run-if-empty docker rmi -f
204-
205-
docker images
197+
pull_tag_images
198+
199+
#docker rmi -f $(docker images -q -f dangling=true)
200+
docker images --quiet --filter=dangling=true | xargs --no-run-if-empty docker rmi -f
201+
202+
docker images
206203

207204
export JAR_VERSION="`grep -m1 "<version>" pom.xml | cut -f2 -d">" | cut -f1 -d "<"`"
208-
docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$https_proxy --build-arg no_proxy=$no_proxy -t "${IMAGE_NAME_OPERATOR}:${IMAGE_TAG_OPERATOR}" --build-arg VERSION=$JAR_VERSION --no-cache=true .
209-
205+
docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$https_proxy --build-arg no_proxy=$no_proxy -t "${IMAGE_NAME_OPERATOR}:${IMAGE_TAG_OPERATOR}" --build-arg VERSION=$JAR_VERSION --no-cache=true .
210206
fi
211-

integration-tests/src/test/resources/wldf/wldf.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from java.io import File
44
import sys, socket
55
import os
6+
import time as systime
67
hostname = socket.gethostname()
78

89
k8s_master_host=os.environ.get('KUBERNETES_SERVICE_HOST')
@@ -63,4 +64,22 @@
6364
wh1.addNotification(scriptAct)
6465

6566
save()
66-
activate()
67+
activate(block='true')
68+
69+
print "wait for harvester watch to become active"
70+
71+
domainRuntime()
72+
73+
cd('ServerRuntimes/admin-server/WLDFRuntime/WLDFRuntime/WLDFWatchNotificationRuntime/WatchNotification')
74+
75+
numWatchEval=cmo.getTotalHarvesterWatchEvaluations()
76+
maxwait=300
77+
78+
while(numWatchEval < 1) and (maxwait > 0):
79+
print numWatchEval
80+
maxwait -= 1
81+
systime.sleep(1)
82+
numWatchEval=cmo.getTotalHarvesterWatchEvaluations()
83+
84+
print "wldf.py done numWatchEval is ", numWatchEval, " maxwait is ", maxwait
85+

kubernetes/charts/weblogic-operator/templates/_operator-dep.tpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ spec:
4343
volumeMounts:
4444
- name: "weblogic-operator-cm-volume"
4545
mountPath: "/operator/config"
46+
- name: "weblogic-operator-debug-cm-volume"
47+
mountPath: "/operator/debug-config"
4648
- name: "weblogic-operator-secrets-volume"
4749
mountPath: "/operator/secrets"
4850
readOnly: true
@@ -79,6 +81,10 @@ spec:
7981
- name: "weblogic-operator-cm-volume"
8082
configMap:
8183
name: "weblogic-operator-cm"
84+
- name: "weblogic-operator-debug-cm-volume"
85+
configMap:
86+
name: "weblogic-operator-debug-cm"
87+
optional: true
8288
- name: "weblogic-operator-secrets-volume"
8389
secret:
8490
secretName: "weblogic-operator-secrets"

kubernetes/samples/charts/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Weblogic operator supports three types load balancers: TRAEFIK, VOYAGER, APACHE. We provide samples for each type to demostrate how to install and configure load balancer. Samples are located in following folders:
2+
traefik
3+
voyager
4+
ingress-per-domain
5+
apache-samples
6+
Note: apache-webtier is helm chart. It is used in apache-samples.

0 commit comments

Comments
 (0)