Skip to content

Commit 8d44683

Browse files
authored
Merge branch 'develop' into OWLS-70638
2 parents 4803c8f + f5b1e52 commit 8d44683

40 files changed

+619
-241
lines changed

integration-tests/pom.xml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,12 @@
7171
<artifactId>client-java</artifactId>
7272
<scope>test</scope>
7373
</dependency>
74-
</dependencies>
74+
<dependency>
75+
<groupId>javax.jms</groupId>
76+
<artifactId>javax.jms-api</artifactId>
77+
<version>2.0</version>
78+
</dependency>
79+
</dependencies>
7580

7681

7782
<profiles>
@@ -156,6 +161,9 @@
156161
<!--<TAGS>${env.TAGS}</TAGS> -->
157162
<maxThreads>3</maxThreads>
158163
</systemPropertyVariables>
164+
<additionalClasspathElements>
165+
<additionalClasspathElement>${project.basedir}/src/test/resources/wlthint3client.jar</additionalClasspathElement>
166+
</additionalClasspathElements>
159167
</configuration>
160168

161169
<executions>

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
import java.util.logging.FileHandler;
1212
import java.util.logging.Logger;
1313
import java.util.logging.SimpleFormatter;
14+
import javax.jms.Connection;
15+
import javax.jms.ConnectionFactory;
1416
import oracle.kubernetes.operator.utils.Domain;
1517
import oracle.kubernetes.operator.utils.ExecCommand;
1618
import oracle.kubernetes.operator.utils.ExecResult;
@@ -179,6 +181,23 @@ public void testAdminT3Channel(Domain domain) throws Exception {
179181
logger.info("Done - testAdminT3Channel");
180182
}
181183

184+
/**
185+
* Verify t3channel port by a JMS connection.
186+
*
187+
* @throws Exception
188+
*/
189+
public void testAdminT3ChannelWithJMS(Domain domain) throws Exception {
190+
logger.info("Inside testAdminT3ChannelWithJMS");
191+
ConnectionFactory cf = domain.createJMSConnectionFactory();
192+
Connection c = cf.createConnection();
193+
logger.info("Connection created successfully before cycle.");
194+
domain.shutdownUsingServerStartPolicy();
195+
domain.restartUsingServerStartPolicy();
196+
c = cf.createConnection();
197+
logger.info("Connection created successfully after cycle");
198+
c.close();
199+
logger.info("Done - testAdminT3ChannelWithJMS");
200+
}
182201
/**
183202
* Restarting the domain should not have any impact on Operator managing the domain, web app load
184203
* balancing and node port service

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,7 @@ public void testAutoSitConfigOverrides() throws Exception {
568568
domain11 = testDomainCreation(domain11YamlFile);
569569
domain11.verifyDomainCreated();
570570
testBasicUseCases(domain11);
571+
testAdminT3ChannelWithJMS(domain11);
571572
// testAdvancedUseCasesForADomain(operator1, domain11);
572573
testCompletedSuccessfully = true;
573574

@@ -638,6 +639,7 @@ public void testCustomSitConfigOverrides() throws Exception {
638639
domain12 = testDomainCreation(domain12YamlFile);
639640
domain12.verifyDomainCreated();
640641
testBasicUseCases(domain12);
642+
testAdminT3ChannelWithJMS(domain12);
641643
// testAdvancedUseCasesForADomain(operator1, domain11);
642644
testCompletedSuccessfully = true;
643645

integration-tests/src/test/java/oracle/kubernetes/operator/utils/Domain.java

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,15 @@
1212
import java.nio.file.Paths;
1313
import java.nio.file.StandardOpenOption;
1414
import java.util.HashMap;
15+
import java.util.Hashtable;
1516
import java.util.Map;
1617
import java.util.Objects;
1718
import java.util.logging.Logger;
19+
import javax.jms.ConnectionFactory;
20+
import javax.jms.QueueConnection;
21+
import javax.jms.QueueConnectionFactory;
22+
import javax.naming.Context;
23+
import javax.naming.InitialContext;
1824
import oracle.kubernetes.operator.BaseTest;
1925
import org.yaml.snakeyaml.Yaml;
2026

@@ -306,6 +312,26 @@ public void deployWebAppViaWLST(
306312
callShellScriptByExecToPod(username, password, webappName);
307313
}
308314

315+
/**
316+
* Creates a Connection Factory using JMS.
317+
*
318+
* @return connection facotry.
319+
* @throws Exception
320+
*/
321+
public ConnectionFactory createJMSConnectionFactory() throws Exception {
322+
Hashtable<String, String> env = new Hashtable<>();
323+
env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
324+
env.put(Context.PROVIDER_URL, "t3://" + TestUtils.getHostName() + ":" + t3ChannelPort);
325+
logger.info("Creating JNDI context with URL " + env.get(Context.PROVIDER_URL));
326+
InitialContext ctx = new InitialContext(env);
327+
QueueConnection qcc = null;
328+
logger.info("Getting JMS Connection Factory");
329+
QueueConnectionFactory cf =
330+
(QueueConnectionFactory) ctx.lookup("weblogic.jms.ConnectionFactory");
331+
logger.info("Connection Factory created successfully");
332+
return cf;
333+
}
334+
309335
/**
310336
* Test http load balancing using loadBalancerWebPort
311337
*
@@ -457,6 +483,28 @@ public void shutdownUsingServerStartPolicy() throws Exception {
457483
verifyServerPodsDeleted(replicas);
458484
}
459485

486+
/**
487+
* restart domain by setting serverStartPolicy to IF_NEEDED
488+
*
489+
* @throws Exception
490+
*/
491+
public void restartUsingServerStartPolicy() throws Exception {
492+
String cmd =
493+
"kubectl patch domain "
494+
+ domainUid
495+
+ " -n "
496+
+ domainNS
497+
+ " -p '{\"spec\":{\"serverStartPolicy\":\"IF_NEEDED\"}}' --type merge";
498+
ExecResult result = ExecCommand.exec(cmd);
499+
if (result.exitValue() != 0) {
500+
throw new RuntimeException(
501+
"FAILURE: command " + cmd + " failed, returned " + result.stderr());
502+
}
503+
String output = result.stdout().trim();
504+
logger.info("command to restart domain " + cmd + " \n returned " + output);
505+
verifyPodsCreated();
506+
verifyServersReady();
507+
}
460508
/**
461509
* verify domain is deleted
462510
*

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ function create_image_pull_secret_jenkins {
9494
fi
9595
}
9696

97+
function get_wlthint3client_from_image {
98+
# Get wlthint3client.jar from image
99+
id=$(docker create $IMAGE_NAME_WEBLOGIC:$IMAGE_TAG_WEBLOGIC)
100+
docker cp $id:/u01/oracle/wlserver/server/lib/wlthint3client.jar $SCRIPTPATH
101+
docker rm -v $id
102+
}
97103
export SCRIPTPATH="$( cd "$(dirname "$0")" > /dev/null 2>&1 ; pwd -P )"
98104
export PROJECT_ROOT="$SCRIPTPATH/../../../.."
99105
export RESULT_ROOT=${RESULT_ROOT:-/scratch/$USER/wl_k8s_test_results}
@@ -192,7 +198,8 @@ elif [ "$JENKINS" = "true" ]; then
192198

193199
/usr/local/packages/aime/ias/run_as_root "mkdir -p $PV_ROOT/acceptance_test_pv_archive"
194200
/usr/local/packages/aime/ias/run_as_root "chmod 777 $PV_ROOT/acceptance_test_pv_archive"
195-
201+
202+
get_wlthint3client_from_image
196203
else
197204
pull_tag_images
198205

@@ -203,4 +210,6 @@ else
203210

204211
export JAR_VERSION="`grep -m1 "<version>" pom.xml | cut -f2 -d">" | cut -f1 -d "<"`"
205212
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 .
206-
fi
213+
214+
get_wlthint3client_from_image
215+
fi

kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/common/utility.sh

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2018, Oracle Corporation and/or its affiliates. All rights reserved.
2+
# Copyright 2018, 2019, Oracle Corporation and/or its affiliates. All rights reserved.
33
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
44

55
#
@@ -20,15 +20,6 @@ function createFolder {
2020
fi
2121
}
2222

23-
#
24-
# Check a file exists
25-
# $1 - path of file to check
26-
function checkFileExists {
27-
if [ ! -f $1 ]; then
28-
fail "The file $1 does not exist"
29-
fi
30-
}
31-
3223
function checkCreateDomainScript {
3324
if [ -f $1 ]; then
3425
echo The domain will be created using the script $1

kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/wdt/wdt_model_configured.yaml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,48 +10,35 @@ topology:
1010
'@@PROP:clusterName@@':
1111
Server:
1212
'@@PROP:adminServerName@@':
13-
ListenAddress: '@@PROP:domainUID@@-@@PROP:adminServerName@@'
14-
Log:
15-
FileName: '/shared/logs/@@PROP:domainUID@@/@@PROP:adminServerName@@.log'
1613
NetworkAccessPoint:
1714
T3Channel:
18-
ListenAddress: '@@PROP:domainUID@@-@@PROP:adminServerName@@'
1915
ListenPort: '@@PROP:t3ChannelPort@@'
2016
PublicAddress: '@@PROP:t3PublicAddress@@'
2117
PublicPort: '@@PROP:t3ChannelPort@@'
2218
'@@PROP:managedServerNameBase@@1':
2319
Cluster: '@@PROP:clusterName@@'
24-
ListenAddress: '@@PROP:domainUID@@-@@PROP:managedServerNameBase@@1'
2520
ListenPort: '@@PROP:managedServerPort@@'
2621
NumOfRetriesBeforeMsiMode: 0
2722
RetryIntervalBeforeMsiMode: 1
2823
JTAMigratableTarget:
2924
Cluster: '@@PROP:clusterName@@'
3025
UserPreferredServer: '@@PROP:managedServerNameBase@@1'
31-
Log:
32-
FileName: '/shared/logs/@@PROP:domainUID@@/@@PROP:managedServerNameBase@@1.log'
3326
'@@PROP:managedServerNameBase@@2':
3427
Cluster: '@@PROP:clusterName@@'
35-
ListenAddress: '@@PROP:domainUID@@-@@PROP:managedServerNameBase@@2'
3628
ListenPort: '@@PROP:managedServerPort@@'
3729
NumOfRetriesBeforeMsiMode: 0
3830
RetryIntervalBeforeMsiMode: 1
3931
JTAMigratableTarget:
4032
Cluster: '@@PROP:clusterName@@'
4133
UserPreferredServer: '@@PROP:managedServerNameBase@@2'
42-
Log:
43-
FileName: '/shared/logs/@@PROP:managedServerNameBase@@2.log'
4434
'@@PROP:managedServerNameBase@@3':
4535
Cluster: '@@PROP:clusterName@@'
46-
ListenAddress: '@@PROP:domainUID@@-@@PROP:managedServerNameBase@@3'
4736
ListenPort: '@@PROP:managedServerPort@@'
4837
NumOfRetriesBeforeMsiMode: 0
4938
RetryIntervalBeforeMsiMode: 1
5039
JTAMigratableTarget:
5140
Cluster: '@@PROP:clusterName@@'
5241
UserPreferredServer: '@@PROP:managedServerNameBase@@3'
53-
Log:
54-
FileName: '/shared/logs/@@PROP:domainUID@@/@@PROP:managedServerNameBase@@3.log'
5542
MigratableTarget:
5643
'@@PROP:managedServerNameBase@@1 (migratable)':
5744
Cluster: '@@PROP:clusterName@@'

kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/wdt/wdt_model_dynamic.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,14 @@ topology:
1616
ServerTemplate: '@@PROP:clusterName@@-template'
1717
Server:
1818
'@@PROP:adminServerName@@':
19-
ListenAddress: '@@PROP:domainUID@@-@@PROP:adminServerName@@'
2019
NetworkAccessPoint:
2120
T3Channel:
22-
ListenAddress: '@@PROP:domainUID@@-@@PROP:adminServerName@@'
2321
ListenPort: '@@PROP:t3ChannelPort@@'
2422
PublicAddress: '@@PROP:t3PublicAddress@@'
2523
PublicPort: '@@PROP:t3ChannelPort@@'
2624
ServerTemplate:
2725
'@@PROP:clusterName@@-template':
2826
Cluster: '@@PROP:clusterName@@'
29-
ListenAddress: '@@PROP:domainUID@@-@@PROP:managedServerNameBase@@${id}'
3027
ListenPort: '@@PROP:managedServerPort@@'
3128
JTAMigratableTarget:
3229
Cluster: '@@PROP:clusterName@@'

kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/wlst/create-domain.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2018, Oracle Corporation and/or its affiliates. All rights reserved.
1+
# Copyright 2018, 2019, Oracle Corporation and/or its affiliates. All rights reserved.
22
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
33

44
def getEnvVar(var):
@@ -48,15 +48,13 @@ def getEnvVar(var):
4848
# Configure the Administration Server
4949
# ===================================
5050
cd('/Servers/AdminServer')
51-
set('ListenAddress', '%s-%s' % (domain_uid, admin_server_name_svc))
5251
set('ListenPort', admin_port)
5352
set('Name', admin_server_name)
5453

5554
create('T3Channel', 'NetworkAccessPoint')
5655
cd('/Servers/%s/NetworkAccessPoints/T3Channel' % admin_server_name)
5756
set('PublicPort', t3_channel_port)
5857
set('PublicAddress', t3_public_address)
59-
set('ListenAddress', '%s-%s' % (domain_uid, admin_server_name_svc))
6058
set('ListenPort', t3_channel_port)
6159

6260
# Set the admin user's username and password
@@ -87,7 +85,6 @@ def getEnvVar(var):
8785
create(name, 'Server')
8886
cd('/Servers/%s/' % name )
8987
print('managed server name is %s' % name);
90-
set('ListenAddress', '%s-%s' % (domain_uid, name_svc))
9188
set('ListenPort', server_port)
9289
set('NumOfRetriesBeforeMSIMode', 0)
9390
set('RetryIntervalBeforeMSIMode', 1)
@@ -102,7 +99,6 @@ def getEnvVar(var):
10299
print('Done creating Server Template: %s' % templateName)
103100
cd('/ServerTemplates/%s' % templateName)
104101
cmo.setListenPort(server_port)
105-
cmo.setListenAddress('%s-%s${id}' % (domain_uid, managed_server_name_base_svc))
106102
cmo.setCluster(cl)
107103
print('Done setting attributes for Server Template: %s' % templateName);
108104

kubernetes/samples/scripts/elasticsearch-and-kibana/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ It runs the Elastic Stack on the same host and port that the operator's Helm cha
1515
to, therefore, you only need to set `elkIntegrationEnabled` to `true` in your
1616
`values.yaml` file.
1717

18+
To control Elasticsearch memory parameters (Heap allocation and Enabling/Disabling swapping) please open the file `elasticsearch_and_kibana.yaml`, search for env variables of the elasticsearch container and change the values of the following.
19+
20+
* ES_JAVA_OPTS: value may contain for example -Xms512m -Xmx512m to lower the default memory usage (please be aware that this value is only applicable for demo purpose and it is not the one recommended by Elasticsearch itself)
21+
* bootstrap.memory_lock: value may contain true (enables the usage of mlockall to try to lock the process address space into RAM, preventing any Elasticsearch memory from being swapped out) or false (disables the usage of mlockall to try to lock the process address space into RAM, preventing any Elasticsearch memory from being swapped out).
22+
1823
To install Elasticsearch and Kibana, use:
1924
```
2025
$ kubectl apply -f kubernetes/samples/scripts/elasticsearch-and-kibana/elasticsearch_and_kibana.yaml

0 commit comments

Comments
 (0)