Skip to content

Commit

Permalink
Merge branch 'okeforward' into 'main'
Browse files Browse the repository at this point in the history
Forward recent changes from release/4.2 to main

See merge request weblogic-cloud/weblogic-kubernetes-operator!4849
  • Loading branch information
rjeberhard committed Oct 26, 2024
2 parents 62a1704 + ac27050 commit f963142
Show file tree
Hide file tree
Showing 39 changed files with 518 additions and 211 deletions.
122 changes: 87 additions & 35 deletions Jenkinsfile.armoke

Large diffs are not rendered by default.

23 changes: 13 additions & 10 deletions Jenkinsfile.oke
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
//

CRON_SETTINGS = '''H 3 * * 0-4 % MAVEN_PROFILE_NAME=oke-gate;CLUSTER_NAME=seqone;PARALLEL_RUN=false
H 1 * * 0-4 % MAVEN_PROFILE_NAME=oke-sequential;CLUSTER_NAME=seqtwo;PARALLEL_RUN=false
H 2 * * 0-4 % MAVEN_PROFILE_NAME=oke-parallel;CLUSTER_NAME=parone;PARALLEL_RUN=true'''
CRON_SETTINGS = '''H 3 * * 6 % MAVEN_PROFILE_NAME=oke-weekly-sequential;CLUSTER_NAME=seqweek;PARALLEL_RUN=false
H 18 * * 0-4 % MAVEN_PROFILE_NAME=oke-sequential;CLUSTER_NAME=seqone;PARALLEL_RUN=false
H 12 * * 0-4 % MAVEN_PROFILE_NAME=oke-parallel;CLUSTER_NAME=parone;PARALLEL_RUN=true'''




pipeline {
agent { label 'large' }
Expand Down Expand Up @@ -83,18 +86,18 @@ pipeline {

string(name: 'OKE_KUBE_VERSION',
description: 'kube version for oke cluster',
defaultValue: '1.29.1'
defaultValue: '1.30.1'
)
string(name: 'IMAGE_ID',
description: 'oci image id for node pool, find image OCID for your region from https://docs.oracle.com/iaas/images/',
//defaultValue OKE1.26.2: 'ocid1.image.oc1.phx.aaaaaaaaaizmtmozeudeeuq7o5ir7dkl2bkxbbb3tgomshqbqn6jpomrsjza'
//1.27.2 oke defaultValue: 'ocid1.image.oc1.phx.aaaaaaaaypr5r5drojwytghw6e6mvpjsscrnkuwtmqlmvmix7kjb2zcnc7wa'
defaultValue: 'ocid1.image.oc1.phx.aaaaaaaa22u45gr3ikxnc6rius2qil2kz5k3e7p476c4usr6qnvql4l5dxea'
defaultValue: 'ocid1.image.oc1.phx.aaaaaaaahgrs3zcwrvutjtni557ttrt62uggseijsmqxacr7dym423uaokcq'

)
string(name: 'KUBECTL_VERSION',
description: 'kubectl version',
defaultValue: '1.26.2'
defaultValue: '1.30.0'
)
string(name: 'HELM_VERSION',
description: 'Helm version',
Expand All @@ -115,9 +118,9 @@ pipeline {
)

choice(name: 'MAVEN_PROFILE_NAME',
description: 'Profile to use in mvn command to run the tests. Possible values are oke-gate,oke-parallel, oke-sequential. Refer to weblogic-kubernetes-operator/integration-tests/pom.xml on the branch.',
description: 'Profile to use in mvn command to run the tests. Possible values are oke-weekly-sequential,oke-parallel, oke-sequential. Refer to weblogic-kubernetes-operator/integration-tests/pom.xml on the branch.',
choices: [
'oke-gate',
'oke-weekly-sequential',
'oke-sequential',
'oke-parallel'
]
Expand All @@ -144,7 +147,7 @@ pipeline {
)
string(name: 'NODE_SHAPE',
description: '',
defaultValue: "VM.Standard.E4.Flex"
defaultValue: "VM.Standard.E5.Flex"
)
string(name: 'MOUNT_TARGET_OCID',
description: 'only for debug runs on wko-oke-dev',
Expand Down Expand Up @@ -683,7 +686,7 @@ EOF
${WORKSPACE}/terraform/oke.delete.sh ${OCI_PROP_FILE} ${WORKSPACE}/terraform ${AVAILABILITY_DOMAIN}
fi

if [ "${MAVEN_PROFILE_NAME}" = "oke-gate" ] && [ "${BRANCH}" = "release/4.2" ]; then
if [ "${MAVEN_PROFILE_NAME}" = "oke-sequential" ] && [ "${BRANCH}" = "release/4.2" ]; then
compname="wkt"
wkt_compartment_ocid=$(oci iam compartment list --compartment-id-in-subtree true --all | jq --arg compname "$compname" '.data[] | select(."name"==$compname)' | jq -r ."id")
sec_list_id=$(oci network security-list list --compartment-id="$wkt_compartment_ocid" --display-name=Security-List-wktiso1 | jq -r '.data[] | ."id"')
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -469,10 +469,10 @@
</profile>

<profile>
<id>oke-gate</id>
<id>oke-weekly-sequential</id>
<properties>
<skipITs>false</skipITs>
<groups>oke-gate</groups>
<groups>oke-weekly-sequential</groups>
</properties>
</profile>
<profile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
@DisplayName("Verify the overrideDistributionStrategy applies the overrides accordingly to the value set")
@Tag("kind-parallel")
@Tag("okd-wls-mrg")
@Tag("oke-parallel")
@Tag("oke-weekly-sequential")
@IntegrationTest
@Tag("olcne-mrg")
class ItConfigDistributionStrategy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
*/
@DisplayName("Verify cross domain transaction is successful")
@IntegrationTest
@Tag("oke-sequential")
@Tag("oke-weekly-sequential")
@Tag("kind-parallel")
@Tag("okd-wls-srg")
class ItCrossDomainTransaction {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
@DisplayName("Test to create FMW model in image domain and WebLogic domain using Oracle "
+ "database created using Oracle Database Operator")
@IntegrationTest
@Tag("oke-gate")
@Tag("oke-weekly-sequential")
@Tag("kind-parallel")
class ItDBOperator {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
*/
@DisplayName("Test Operator and WebLogic domain with Dedicated set to true")
@Tag("kind-sequential")
@Tag("oke-gate")
@Tag("oke-weekly-sequential")
@Tag("okd-wls-mrg")
@IntegrationTest
class ItDedicatedMode {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
*/
@DisplayName("Test to creat a FMW domain in persistent volume using WDT")
@IntegrationTest
@Tag("oke-gate")
@Tag("oke-weekly-sequential")
@Tag("kind-sequential")
@Tag("okd-fmw-cert")
class ItFmwDomainInPVUsingWDT {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
@Tag("okd-fmw-cert")
@IntegrationTest
@Tag("olcne-sequential")
@Tag("oke-gate")
@Tag("oke-weekly-sequential")
class ItFmwDomainInPVUsingWLST {

private static String dbNamespace = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
@DisplayName("Test for initializeDomainOnPV when user per-creates RCU")
@IntegrationTest
@Tag("kind-sequential")
@Tag("oke-gate")
@Tag("oke-weekly-sequential")
public class ItFmwDomainInPvUserCreateRcu {

private static String opNamespace = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
@DisplayName("Test to create a FMW domain in persistent volume with new simplified feature")
@IntegrationTest
@Tag("kind-sequential")
@Tag("oke-gate")
@Tag("oke-weekly-sequential")
@Tag("okd-fmw-cert")
@Tag("olcne-sequential")
class ItFmwDomainOnPV {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,20 @@
*/
@DisplayName("Test to creat a FMW dynamic domain in persistent volume using WLST")
@IntegrationTest
@Tag("oke-sequential")
@Tag("oke-weekly-sequential")
@Tag("kind-sequential")
@Tag("okd-fmw-cert")
class ItFmwDynamicDomainInPV {

private static String opNamespace = null;
private static String domainNamespace = null;
private static String dbNamespace = null;

private static String nginxNamespace = null;
private static String oracle_home = null;
private static String java_home = null;

private static final String RCUSCHEMAPREFIX = "fmwdomainpv";
private static final String ORACLEDBURLPREFIX = "oracledb.";
private static String ORACLEDBSUFFIX = null;
private static final String RCUSYSUSERNAME = "sys";
private static final String RCUSYSPASSWORD = "Oradoc_db1";
private static final String RCUSCHEMAUSERNAME = "myrcuuser";
Expand All @@ -105,18 +105,23 @@ class ItFmwDynamicDomainInPV {
private static final String adminServerName = "admin-server";
private static final String managedServerNameBase = "managed-server";
private static final String adminServerPodName = domainUid + "-" + adminServerName;
private static final int managedServerPort = 8001;
private static List<String> ingressHostList = null;
private static final String managedServerPodNamePrefix = domainUid + "-" + managedServerNameBase;
private final int managedServerPort = 8001;
private final String wlSecretName = domainUid + "-weblogic-credentials";
private final String rcuSecretName = domainUid + "-rcu-credentials";
private static final int replicaCount = 1;
private String adminSvcExtHost = null;
private static String hostHeader;
private static int adminPort = 7001;
private static String dbName = domainUid + "my-oracle-db";
private static String nginxNamespace = null;
private static List<String> ingressHostList = null;
private static String ingressIP = null;
private static NginxParams nginxHelmParams = null;




/**
* Assigns unique namespaces for DB, operator and domains.
* Start DB service and create RCU schema.
Expand Down Expand Up @@ -175,13 +180,6 @@ void testFmwDynamicDomainInPV() {
// create FMW dynamic domain and verify
createFmwDomainAndVerify();
verifyDomainReady(domainNamespace, domainUid, replicaCount, "nosuffix");
if (OKE_CLUSTER_PRIVATEIP) {
Map<String, Integer> clusterNameMsPortMap = new HashMap<>();
clusterNameMsPortMap.put(clusterName, managedServerPort);
ingressHostList
= createIngressForDomainAndVerify(domainUid, domainNamespace, 0, clusterNameMsPortMap,
false, nginxHelmParams.getIngressClassName(), true, 7001);
}
// Expose the admin service external node port as a route for OKD
adminSvcExtHost = createRouteForOKD(getExternalServicePodName(adminServerPodName), domainNamespace);
if (OKE_CLUSTER_PRIVATEIP) {
Expand Down Expand Up @@ -363,12 +361,12 @@ private File createWlstPropertyFile(int t3ChannelPort) {

// create a temporary WebLogic domain property file
File domainPropertiesFile = assertDoesNotThrow(() ->
File.createTempFile("domain", ".properties", new File(RESULTS_TEMPFILE)),
File.createTempFile("domain", ".properties", new File(RESULTS_TEMPFILE)),
"Failed to create domain properties file");

// create the property file
assertDoesNotThrow(() ->
p.store(new FileOutputStream(domainPropertiesFile), "FMW wlst properties file"),
p.store(new FileOutputStream(domainPropertiesFile), "FMW wlst properties file"),
"Failed to write domain properties file");

return domainPropertiesFile;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
import static oracle.weblogic.kubernetes.utils.MonitoringUtils.installMonitoringExporter;
import static oracle.weblogic.kubernetes.utils.OperatorUtils.installAndVerifyOperator;
import static oracle.weblogic.kubernetes.utils.PersistentVolumeUtils.createPvAndPvc;
import static oracle.weblogic.kubernetes.utils.PodUtils.checkPodReady;
import static oracle.weblogic.kubernetes.utils.PodUtils.isPodDeleted;
import static oracle.weblogic.kubernetes.utils.SecretUtils.createSecretWithUsernamePassword;
import static oracle.weblogic.kubernetes.utils.ThreadSafeLogger.getLogger;
Expand All @@ -112,7 +113,7 @@
@DisplayName("Test to a create MII domain and test autoscaling using HPA and"
+ "custom metrics provided via use of monitoring exporter and prometheus and prometheus adapter")
@IntegrationTest
@Tag("oke-gate")
@Tag("oke-sequential")
@Tag("kind-parallel")
public class ItHorizontalPodAutoscalerCustomMetrics {
private static final String MONEXP_MODEL_FILE = "model.monexp.custommetrics.yaml";
Expand Down Expand Up @@ -224,6 +225,7 @@ public static void initAll(@Namespaces(4) List<String> namespaces) {
// install and verify NGINX
nginxHelmParams = installAndVerifyNginx(nginxNamespace, IT_HPACUSTOMNGINX_INGRESS_HTTP_NODEPORT,
IT_HPACUSTOMNGINX_INGRESS_HTTPS_NODEPORT, NGINX_CHART_VERSION, (OKE_CLUSTER ? null : "NodePort"));

String nginxServiceName = nginxHelmParams.getHelmParams().getReleaseName() + "-ingress-nginx-controller";
logger.info("NGINX service name: {0}", nginxServiceName);
nodeportshttp = getServiceNodePort(nginxNamespace, nginxServiceName, "http");
Expand Down Expand Up @@ -317,15 +319,46 @@ void testHPAWithCustomMetrics() {
hostPort = host + ":" + nodeportshttp;
}
String curlCmd =
String.format("curl --silent --show-error --noproxy '*' -H 'host: %s' http://%s:%s@%s/" + SESSMIGT_APP_URL,
String.format("curl -g --silent --show-error -v --noproxy '*' -H 'host: %s' http://%s:%s@%s/" + SESSMIGT_APP_URL,
ingressHostList.get(0),
ADMIN_USERNAME_DEFAULT,
ADMIN_PASSWORD_DEFAULT,
hostPort);

logger.info("Executing curl command " + curlCmd);
assertDoesNotThrow(() -> {
ExecResult result = ExecCommand.exec(curlCmd, true);
String response = result.stdout().trim();
getLogger().info("exitCode: {0}, \nstdout: {1}, \nstderr: {2}",
result.exitValue(), response, result.stderr());
if (!response.contains("cluster-1-managed")) {
logger.info("Can't invoke application");

if (OKE_CLUSTER) {
LoggingFacade logger = getLogger();
try {

result = ExecCommand.exec(KUBERNETES_CLI + " get all -A");
logger.info(result.stdout());
//restart core-dns service
result = ExecCommand.exec(KUBERNETES_CLI + " rollout restart deployment coredns -n kube-system");
logger.info(result.stdout());
checkPodReady("coredns", null, "kube-system");

} catch (Exception ex) {
logger.warning(ex.getLocalizedMessage());
}
}
}
});
for (int i = 0; i < 50; i++) {
assertDoesNotThrow(() -> ExecCommand.exec(curlCmd));
assertDoesNotThrow(() -> {
ExecResult result = ExecCommand.exec(curlCmd, true);
String response = result.stdout().trim();
getLogger().info("exitCode: {0}, \nstdout: {1}, \nstderr: {2}",
result.exitValue(), response, result.stderr());
assertTrue(response.contains("cluster-1-managed"), "Can't invoke application");
});
}
//check hpa scaled up to one more server
checkPodReadyAndServiceExists(managedServerPrefix + 3, domainUid, domainNamespace);
Expand Down Expand Up @@ -452,8 +485,8 @@ private boolean verifyCustomMetricsExposed(String namespace, String customMetric
}

private void installPrometheus(String promChartVersion,
String domainNS,
String domainUid
String domainNS,
String domainUid
) throws IOException, ApiException {
final String prometheusRegexValue = String.format("regex: %s;%s", domainNS, domainUid);
if (promHelmParams == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
@DisplayName("Verify cross domain transaction with istio enabled is successful")
@IntegrationTest
@Tag("kind-parallel")
@Tag("oke-arm")
@Tag("oke-parallel")
class ItIstioCrossDomainTransaction {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
@IntegrationTest
@Tag("olcne-mrg")
@Tag("kind-parallel")
@Tag("oke-gate")
@Tag("oke-sequential")
class ItLBTwoDomainsNginx {

private static final int numberOfDomains = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
@IntegrationTest
@Tag("olcne-mrg")
@Tag("kind-parallel")
@Tag("oke-gate")
@Tag("oke-sequential")
class ItLBTwoDomainsTraefik {

private static final int numberOfDomains = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
@Tag("toolkits-srg")
@Tag("okd-wls-mrg")
@Tag("olcne-mrg")
@Tag("oke-gate")
@Tag("oke-sequential")

@IntegrationTest
class ItLiftAndShiftFromOnPremDomain {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
@Tag("kind-parallel")
@Tag("okd-wls-mrg")
@Tag("oke-arm")
@Tag("oke-gate")
@Tag("oke-weekly-sequential")
class ItLivenessProbeCustomization {

// domain constants
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
@Tag("olcne-mrg")
@Tag("kind-parallel")
@Tag("okd-wls-srg")
@Tag("oke-gate")
@Tag("oke-weekly-sequential")
class ItMiiDomain {

private static String opNamespace = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
@Tag("kind-parallel")
@Tag("toolkits-srg")
@Tag("okd-wls-srg")
@Tag("oke-sequential")
@Tag("oke-weekly-sequential")
class ItMiiUpdateDomainConfig {

private static String opNamespace = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
@DisplayName("Verify WebLogic Metric is processed and filtered as expected by MonitoringExporter")
@IntegrationTest
@Tag("olcne-mrg")
@Tag("oke-gate")
@Tag("oke-sequential")
@Tag("kind-sequential")
@Tag("okd-wls-mrg")
class ItMonitoringExporterMetricsFiltering {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
* Verify WebLogic metrics can be accessed via Prometheus
*/
@DisplayName("Verify end to end sample, provided in the Monitoring Exporter github project")
@Tag("oke-gate")
@Tag("oke-weekly-sequential")
@Tag("kind-parallel")
@Tag("okd-wls-mrg")
@IntegrationTest
Expand Down
Loading

0 comments on commit f963142

Please sign in to comment.